QCAD
Open Source 2D CAD
RAttributeDefinitionEntity.h
Go to the documentation of this file.
1 
20 #ifndef RATTRIBUTEDEFINITIONENTITY_H
21 #define RATTRIBUTEDEFINITIONENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "RTextBasedEntity.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40  Q_DECLARE_TR_FUNCTIONS(RAttributeDefinitionEntity)
41 
42 public:
55 
72 
73 public:
75  virtual ~RAttributeDefinitionEntity();
76 
77  static void init();
78 
79  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
81  }
82 
83  virtual RAttributeDefinitionEntity* clone() const {
84  return new RAttributeDefinitionEntity(*this);
85  }
86 
88  return data;
89  }
90 
91  virtual const RAttributeDefinitionData& getData() const {
92  return data;
93  }
94 
96  data = d;
97  }
98 
99  virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
100  RTransaction* transaction=NULL);
101  virtual QPair<QVariant, RPropertyAttributes> getProperty(
102  RPropertyTypeId& propertyTypeId,
103  bool humanReadable = false, bool noAttributes = false, bool showOnRequest = false);
104 
105  // void exportEntity(RExporter& e, bool preview) const;
106 
107  QString getTag() const {
108  return data.getTag();
109  }
110 
111  void setTag(const QString& t) {
112  data.setTag(t);
113  }
114 
115  QString getPrompt() const {
116  return data.getPrompt();
117  }
118 
119  void setPrompt(const QString& p) {
120  data.setPrompt(p);
121  }
122 
123 protected:
124  virtual void print(QDebug dbg) const;
125 
126 protected:
128 };
129 
133 
134 #endif
static RPropertyTypeId PropertyTag
Definition: RAttributeDefinitionEntity.h:68
static RPropertyTypeId PropertyColor
Definition: RAttributeDefinitionEntity.h:52
static RPropertyTypeId PropertyVAlign
Definition: RAttributeDefinitionEntity.h:71
static void init()
Definition: RTextBasedEntity.cpp:58
static RPropertyTypeId PropertyDrawOrder
Definition: RAttributeDefinitionEntity.h:54
static RPropertyTypeId PropertyPrompt
Definition: RAttributeDefinitionEntity.h:67
void setData(RAttributeDefinitionData &d)
Definition: RAttributeDefinitionEntity.h:95
Block attribute definition entity.
Definition: RAttributeDefinitionEntity.h:38
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyPositionX
Definition: RAttributeDefinitionEntity.h:64
static RPropertyTypeId PropertyHAlign
Definition: RAttributeDefinitionEntity.h:60
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RTextBasedEntity.cpp:172
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static RPropertyTypeId PropertyItalic
Definition: RAttributeDefinitionEntity.h:62
static RPropertyTypeId PropertyProtected
Definition: RAttributeDefinitionEntity.h:45
static RPropertyTypeId PropertyBlock
Definition: RAttributeDefinitionEntity.h:47
Transaction implementation.
Definition: RTransaction.h:74
void setPrompt(const QString &p)
Definition: RAttributeDefinitionEntity.h:119
QString getPrompt() const
Definition: RAttributeDefinitionEntity.h:115
RAttributeDefinitionData data
Definition: RAttributeDefinitionEntity.h:127
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RAttributeDefinitionData.h:39
static RPropertyTypeId PropertyFontName
Definition: RAttributeDefinitionEntity.h:59
virtual const RAttributeDefinitionData & getData() const
Definition: RAttributeDefinitionEntity.h:91
Text entity.
Definition: RTextBasedEntity.h:38
static QSet< RPropertyTypeId > getPropertyTypeIds(const std::type_info &classInfo)
Gets all property type IDs that where registered for the given class.
Definition: RPropertyTypeId.cpp:229
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RTextBasedEntity.cpp:88
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyPlainText
Definition: RAttributeDefinitionEntity.h:70
static RPropertyTypeId PropertyText
Definition: RAttributeDefinitionEntity.h:69
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
Definition: RTextBasedEntity.cpp:118
static RPropertyTypeId PropertyLayer
Definition: RAttributeDefinitionEntity.h:48
static RPropertyTypeId PropertyBold
Definition: RAttributeDefinitionEntity.h:58
static RPropertyTypeId PropertyPositionZ
Definition: RAttributeDefinitionEntity.h:66
static RPropertyTypeId PropertyLinetypeScale
Definition: RAttributeDefinitionEntity.h:50
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RAttributeDefinitionEntity.h:43
static RPropertyTypeId PropertyLineweight
Definition: RAttributeDefinitionEntity.h:51
static RPropertyTypeId PropertyLineSpacingFactor
Definition: RAttributeDefinitionEntity.h:63
static RPropertyTypeId PropertyDisplayedColor
Definition: RAttributeDefinitionEntity.h:53
virtual RAttributeDefinitionData & getData()
Definition: RAttributeDefinitionEntity.h:87
void setTag(const QString &t)
Definition: RAttributeDefinitionEntity.h:111
static RPropertyTypeId PropertyHandle
Definition: RAttributeDefinitionEntity.h:44
virtual RAttributeDefinitionEntity * clone() const
Definition: RAttributeDefinitionEntity.h:83
static RPropertyTypeId PropertyType
Definition: RAttributeDefinitionEntity.h:46
static RPropertyTypeId PropertyAngle
Definition: RAttributeDefinitionEntity.h:56
static RPropertyTypeId PropertyPositionY
Definition: RAttributeDefinitionEntity.h:65
Abstract base class for exporters.
Definition: RExporter.h:71
static RPropertyTypeId PropertyXScale
Definition: RAttributeDefinitionEntity.h:57
static RPropertyTypeId PropertyLinetype
Definition: RAttributeDefinitionEntity.h:49
static RPropertyTypeId PropertyHeight
Definition: RAttributeDefinitionEntity.h:61
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RAttributeDefinitionEntity.h:79
QString getTag() const
Definition: RAttributeDefinitionEntity.h:107