Changeset View
Changeset View
Standalone View
Standalone View
core/annotations.cpp
Show First 20 Lines • Show All 1022 Lines • ▼ Show 20 Line(s) | 1011 | public: | |||
---|---|---|---|---|---|
1023 | bool openDialogAfterCreation() const override; | 1023 | bool openDialogAfterCreation() const override; | ||
1024 | void setAnnotationProperties( const QDomNode& node ) override; | 1024 | void setAnnotationProperties( const QDomNode& node ) override; | ||
1025 | bool canBeResized() const override; | 1025 | bool canBeResized() const override; | ||
1026 | AnnotationPrivate* getNewAnnotationPrivate() override; | 1026 | AnnotationPrivate* getNewAnnotationPrivate() override; | ||
1027 | 1027 | | |||
1028 | TextAnnotation::TextType m_textType; | 1028 | TextAnnotation::TextType m_textType; | ||
1029 | QString m_textIcon; | 1029 | QString m_textIcon; | ||
1030 | QFont m_textFont; | 1030 | QFont m_textFont; | ||
1031 | QColor m_textColor; | ||||
1031 | int m_inplaceAlign; | 1032 | int m_inplaceAlign; | ||
1032 | NormalizedPoint m_inplaceCallout[3]; | 1033 | NormalizedPoint m_inplaceCallout[3]; | ||
1033 | NormalizedPoint m_transformedInplaceCallout[3]; | 1034 | NormalizedPoint m_transformedInplaceCallout[3]; | ||
1034 | TextAnnotation::InplaceIntent m_inplaceIntent; | 1035 | TextAnnotation::InplaceIntent m_inplaceIntent; | ||
1035 | }; | 1036 | }; | ||
1036 | 1037 | | |||
1037 | /* | 1038 | /* | ||
1038 | The default textIcon for text annotation is Note as the PDF Reference says | 1039 | The default textIcon for text annotation is Note as the PDF Reference says | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
1082 | } | 1083 | } | ||
1083 | 1084 | | |||
1084 | QFont TextAnnotation::textFont() const | 1085 | QFont TextAnnotation::textFont() const | ||
1085 | { | 1086 | { | ||
1086 | Q_D( const TextAnnotation ); | 1087 | Q_D( const TextAnnotation ); | ||
1087 | return d->m_textFont; | 1088 | return d->m_textFont; | ||
1088 | } | 1089 | } | ||
1089 | 1090 | | |||
1091 | void TextAnnotation::setTextColor( const QColor &color ) | ||||
1092 | { | ||||
1093 | Q_D( TextAnnotation ); | ||||
1094 | d->m_textColor = color; | ||||
1095 | } | ||||
1096 | | ||||
1097 | QColor TextAnnotation::textColor() const | ||||
1098 | { | ||||
1099 | Q_D( const TextAnnotation ); | ||||
1100 | return d->m_textColor; | ||||
1101 | } | ||||
1102 | | ||||
1090 | void TextAnnotation::setInplaceAlignment( int alignment ) | 1103 | void TextAnnotation::setInplaceAlignment( int alignment ) | ||
1091 | { | 1104 | { | ||
1092 | Q_D( TextAnnotation ); | 1105 | Q_D( TextAnnotation ); | ||
1093 | d->m_inplaceAlign = alignment; | 1106 | d->m_inplaceAlign = alignment; | ||
1094 | } | 1107 | } | ||
1095 | 1108 | | |||
1096 | int TextAnnotation::inplaceAlignment() const | 1109 | int TextAnnotation::inplaceAlignment() const | ||
1097 | { | 1110 | { | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 1160 | { | |||
1155 | 1168 | | |||
1156 | // store the optional attributes | 1169 | // store the optional attributes | ||
1157 | if ( d->m_textType != Linked ) | 1170 | if ( d->m_textType != Linked ) | ||
1158 | textElement.setAttribute( QStringLiteral("type"), (int)d->m_textType ); | 1171 | textElement.setAttribute( QStringLiteral("type"), (int)d->m_textType ); | ||
1159 | if ( !d->m_textIcon.isEmpty() ) | 1172 | if ( !d->m_textIcon.isEmpty() ) | ||
1160 | textElement.setAttribute( QStringLiteral("icon"), d->m_textIcon ); | 1173 | textElement.setAttribute( QStringLiteral("icon"), d->m_textIcon ); | ||
1161 | if ( d->m_textFont != QApplication::font() ) | 1174 | if ( d->m_textFont != QApplication::font() ) | ||
1162 | textElement.setAttribute( QStringLiteral("font"), d->m_textFont.toString() ); | 1175 | textElement.setAttribute( QStringLiteral("font"), d->m_textFont.toString() ); | ||
1176 | if ( d->m_textColor.isValid() ) | ||||
1177 | textElement.setAttribute( QStringLiteral("fontColor"), d->m_textColor.name() ); | ||||
1163 | if ( d->m_inplaceAlign ) | 1178 | if ( d->m_inplaceAlign ) | ||
1164 | textElement.setAttribute( QStringLiteral("align"), d->m_inplaceAlign ); | 1179 | textElement.setAttribute( QStringLiteral("align"), d->m_inplaceAlign ); | ||
1165 | if ( d->m_inplaceIntent != Unknown ) | 1180 | if ( d->m_inplaceIntent != Unknown ) | ||
1166 | textElement.setAttribute( QStringLiteral("intent"), (int)d->m_inplaceIntent ); | 1181 | textElement.setAttribute( QStringLiteral("intent"), (int)d->m_inplaceIntent ); | ||
1167 | 1182 | | |||
1168 | // Sub-Node - callout | 1183 | // Sub-Node - callout | ||
1169 | if ( d->m_inplaceCallout[0].x != 0.0 ) | 1184 | if ( d->m_inplaceCallout[0].x != 0.0 ) | ||
1170 | { | 1185 | { | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 1251 | { | |||
1241 | 1256 | | |||
1242 | // parse the attributes | 1257 | // parse the attributes | ||
1243 | if ( e.hasAttribute( QStringLiteral("type") ) ) | 1258 | if ( e.hasAttribute( QStringLiteral("type") ) ) | ||
1244 | m_textType = (TextAnnotation::TextType)e.attribute( QStringLiteral("type") ).toInt(); | 1259 | m_textType = (TextAnnotation::TextType)e.attribute( QStringLiteral("type") ).toInt(); | ||
1245 | if ( e.hasAttribute( QStringLiteral("icon") ) ) | 1260 | if ( e.hasAttribute( QStringLiteral("icon") ) ) | ||
1246 | m_textIcon = e.attribute( QStringLiteral("icon") ); | 1261 | m_textIcon = e.attribute( QStringLiteral("icon") ); | ||
1247 | if ( e.hasAttribute( QStringLiteral("font") ) ) | 1262 | if ( e.hasAttribute( QStringLiteral("font") ) ) | ||
1248 | m_textFont.fromString( e.attribute( QStringLiteral("font") ) ); | 1263 | m_textFont.fromString( e.attribute( QStringLiteral("font") ) ); | ||
1264 | if ( e.hasAttribute( QStringLiteral("fontColor") ) ) | ||||
1265 | m_textColor = QColor( e.attribute( QStringLiteral("fontColor") ) ); | ||||
1249 | if ( e.hasAttribute( QStringLiteral("align") ) ) | 1266 | if ( e.hasAttribute( QStringLiteral("align") ) ) | ||
1250 | m_inplaceAlign = e.attribute( QStringLiteral("align") ).toInt(); | 1267 | m_inplaceAlign = e.attribute( QStringLiteral("align") ).toInt(); | ||
1251 | if ( e.hasAttribute( QStringLiteral("intent") ) ) | 1268 | if ( e.hasAttribute( QStringLiteral("intent") ) ) | ||
1252 | m_inplaceIntent = (TextAnnotation::InplaceIntent)e.attribute( QStringLiteral("intent") ).toInt(); | 1269 | m_inplaceIntent = (TextAnnotation::InplaceIntent)e.attribute( QStringLiteral("intent") ).toInt(); | ||
1253 | 1270 | | |||
1254 | // parse the subnodes | 1271 | // parse the subnodes | ||
1255 | QDomNode eSubNode = e.firstChild(); | 1272 | QDomNode eSubNode = e.firstChild(); | ||
1256 | while ( eSubNode.isElement() ) | 1273 | while ( eSubNode.isElement() ) | ||
▲ Show 20 Lines • Show All 1845 Lines • Show Last 20 Lines |