QCAD Application Framework
CAD Application Development and Automation.
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
RTextEntity.h
Go to the documentation of this file.
1
#ifndef RTEXTENTITY_H
2
#define RTEXTENTITY_H
3
4
#include "
REntity.h
"
5
#include "
RTextData.h
"
6
7
class
RDocument
;
8
class
RExporter
;
9
17
class
RTextEntity
:
public
REntity
{
18
19
Q_DECLARE_TR_FUNCTIONS(
RTextEntity
)
20
21
public
:
22
static
RPropertyTypeId
PropertyCustom
;
23
static
RPropertyTypeId
PropertyHandle
;
24
static
RPropertyTypeId
PropertyType
;
25
static
RPropertyTypeId
PropertyBlock
;
26
static
RPropertyTypeId
PropertyLayer
;
27
static
RPropertyTypeId
PropertyLinetype
;
28
static
RPropertyTypeId
PropertyLineweight
;
29
static
RPropertyTypeId
PropertyColor
;
30
static
RPropertyTypeId
PropertyDrawOrder
;
31
32
static
RPropertyTypeId
PropertySimple
;
33
static
RPropertyTypeId
PropertyPositionX
;
34
static
RPropertyTypeId
PropertyPositionY
;
35
static
RPropertyTypeId
PropertyPositionZ
;
36
static
RPropertyTypeId
PropertyText
;
37
static
RPropertyTypeId
PropertyFontName
;
38
static
RPropertyTypeId
PropertyHeight
;
39
static
RPropertyTypeId
PropertyAngle
;
40
static
RPropertyTypeId
PropertyBold
;
41
static
RPropertyTypeId
PropertyItalic
;
42
static
RPropertyTypeId
PropertyLineSpacingFactor
;
43
static
RPropertyTypeId
PropertyHAlign
;
44
static
RPropertyTypeId
PropertyVAlign
;
45
46
public
:
47
RTextEntity
(
RDocument
*
document
,
const
RTextData
&
data
,
48
RObject::Id
objectId
=
RObject::INVALID_ID
);
49
virtual
~RTextEntity
();
50
51
static
void
init
();
52
53
virtual
RTextEntity
*
clone
()
const
{
54
return
new
RTextEntity
(*
this
);
55
}
56
57
virtual
RS::EntityType
getType
()
const
{
58
return
RS::EntityText
;
59
}
60
61
bool
setProperty
(
RPropertyTypeId
propertyTypeId,
const
QVariant& value);
62
QPair<QVariant, RPropertyAttributes>
getProperty
(
63
RPropertyTypeId
propertyTypeId,
64
bool
humanReadable =
false
,
bool
noAttributes =
false
);
65
66
virtual
void
exportEntity
(
RExporter
& e,
bool
preview=
false
)
const
;
67
68
QList<RPainterPath>
getPainterPaths
(
bool
draft =
false
)
const
{
69
return
data
.
getPainterPaths
(draft);
70
}
71
72
virtual
QList<QSharedPointer<RShape> >
getShapes
(
const
RBox
& queryBox =
RDEFAULT_RBOX
)
const
{
73
return
data
.
getShapes
(queryBox);
74
}
75
76
virtual
QList<QSharedPointer<RShape> >
getExploded
()
const
{
77
return
data
.
getExploded
();
78
}
79
80
virtual
RTextData
&
getTextData
() {
81
return
data
;
82
}
83
84
virtual
RTextData
&
getData
() {
85
return
data
;
86
}
87
88
void
setData
(
RTextData
& d) {
89
data
= d;
90
}
91
92
virtual
const
RTextData
&
getData
()
const
{
93
return
data
;
94
}
95
96
RVector
getPosition
()
const
{
97
return
data
.
getPosition
();
98
}
99
100
RVector
getAlignmentPoint
()
const
{
101
return
data
.
getAlignmentPoint
();
102
}
103
104
double
getTextHeight
()
const
{
105
return
data
.
getTextHeight
();
106
}
107
108
double
getTextWidth
()
const
{
109
return
data
.
getTextWidth
();
110
}
111
112
double
getWidth
()
const
{
113
return
data
.
getWidth
();
114
}
115
double
getHeight
()
const
{
116
return
data
.
getHeight
();
117
}
118
119
RS::VAlign
getVAlign
()
const
{
120
return
data
.
getVAlign
();
121
}
122
123
RS::HAlign
getHAlign
()
const
{
124
return
data
.
getHAlign
();
125
}
126
127
QString
getFontName
()
const
{
128
return
data
.
getFontName
();
129
}
130
131
void
setFontName
(
const
QString& fontName) {
132
data
.
setFontName
(fontName);
133
}
134
135
QString
getEscapedText
()
const
{
136
return
data
.
getEscapedText
();
137
}
138
139
//QString getHtmlText() const {
140
// return data.getHtmlText();
141
//}
142
143
QString
getPlainText
()
const
{
144
return
data
.
getPlainText
();
145
}
146
147
void
setText
(
const
QString& text) {
148
data
.
setText
(text);
149
}
150
151
bool
isSimple
()
const
{
152
return
data
.
isSimple
();
153
}
154
155
protected
:
156
virtual
void
print
(QDebug dbg)
const
;
157
158
protected
:
159
RTextData
data
;
160
};
161
162
Q_DECLARE_METATYPE
(
RTextEntity
*)
163
Q_DECLARE_METATYPE
(QSharedPointer<
RTextEntity
>)
164
Q_DECLARE_METATYPE
(QSharedPointer<
RTextEntity
>*)
165
166
#endif
src
entity
RTextEntity.h
Generated on Tue Jun 26 2012 18:41:08 for QCAD Application Framework by
1.8.1.1