Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportUtils.h
Show All 28 Lines | |||||
29 | 29 | | |||
30 | class QDomDocument; | 30 | class QDomDocument; | ||
31 | class QDomElement; | 31 | class QDomElement; | ||
32 | class QFont; | 32 | class QFont; | ||
33 | class QPointF; | 33 | class QPointF; | ||
34 | class KProperty; | 34 | class KProperty; | ||
35 | class KReportPosition; | 35 | class KReportPosition; | ||
36 | class KReportSize; | 36 | class KReportSize; | ||
37 | class KRTextStyleData; | 37 | class KReportTextStyleData; | ||
38 | class KReportLineStyle; | 38 | class KReportLineStyle; | ||
39 | 39 | | |||
40 | namespace KReportUtils | 40 | namespace KReportUtils | ||
41 | { | 41 | { | ||
42 | KREPORT_EXPORT QString attr(const QDomElement &el, const char *attrName, | 42 | KREPORT_EXPORT QString attr(const QDomElement &el, const char *attrName, | ||
43 | const QString &defaultValue = QString()); | 43 | const QString &defaultValue = QString()); | ||
44 | 44 | | |||
45 | KREPORT_EXPORT QByteArray attr(const QDomElement &el, const char *attrName, | 45 | KREPORT_EXPORT QByteArray attr(const QDomElement &el, const char *attrName, | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
88 | //! Writes all attributes of font @a font into element @a el. | 88 | //! Writes all attributes of font @a font into element @a el. | ||
89 | //! @todo add unit tests | 89 | //! @todo add unit tests | ||
90 | KREPORT_EXPORT void writeFontAttributes(QDomElement *el, const QFont &font); | 90 | KREPORT_EXPORT void writeFontAttributes(QDomElement *el, const QFont &font); | ||
91 | 91 | | |||
92 | //! Writes attributes for the rect position @p pos, @p siz | 92 | //! Writes attributes for the rect position @p pos, @p siz | ||
93 | KREPORT_EXPORT void buildXMLRect(QDomElement *entity, const QPointF &pos, const QSizeF &size); | 93 | KREPORT_EXPORT void buildXMLRect(QDomElement *entity, const QPointF &pos, const QSizeF &size); | ||
94 | 94 | | |||
95 | //! Writes attributes for text style @p ts | 95 | //! Writes attributes for text style @p ts | ||
96 | KREPORT_EXPORT void buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts); | 96 | KREPORT_EXPORT void buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KReportTextStyleData &ts); | ||
97 | 97 | | |||
98 | //! Writes attributes for line style @p ls | 98 | //! Writes attributes for line style @p ls | ||
99 | KREPORT_EXPORT void buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls); | 99 | KREPORT_EXPORT void buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls); | ||
100 | 100 | | |||
101 | //! Writes attributes for the property @p p | 101 | //! Writes attributes for the property @p p | ||
102 | KREPORT_EXPORT void addPropertyAsAttribute(QDomElement* e, KProperty* p); | 102 | KREPORT_EXPORT void addPropertyAsAttribute(QDomElement* e, KProperty* p); | ||
103 | 103 | | |||
104 | //! Writes @p attribute to element @p e, @p value is stored in points with unit 'pt' | 104 | //! Writes @p attribute to element @p e, @p value is stored in points with unit 'pt' | ||
105 | KREPORT_EXPORT void setAttribute(QDomElement *e, const QString &attribute, double value); | 105 | KREPORT_EXPORT void setAttribute(QDomElement *e, const QString &attribute, double value); | ||
106 | 106 | | |||
107 | //! Writes point @p value as attributes to element @p e | 107 | //! Writes point @p value as attributes to element @p e | ||
108 | KREPORT_EXPORT void setAttribute(QDomElement *e, const QPointF &value); | 108 | KREPORT_EXPORT void setAttribute(QDomElement *e, const QPointF &value); | ||
109 | 109 | | |||
110 | //! Writes size @p value as attributes to element @p e | 110 | //! Writes size @p value as attributes to element @p e | ||
111 | KREPORT_EXPORT void setAttribute(QDomElement *e, const QSizeF &value); | 111 | KREPORT_EXPORT void setAttribute(QDomElement *e, const QSizeF &value); | ||
112 | 112 | | |||
113 | //! Reads attributes from @p elemSource into text style @p ts | 113 | //! Reads attributes from @p elemSource into text style @p ts | ||
114 | KREPORT_EXPORT bool parseReportTextStyleData(const QDomElement & elemSource, KRTextStyleData *ts); | 114 | KREPORT_EXPORT bool parseReportTextStyleData(const QDomElement & elemSource, KReportTextStyleData *ts); | ||
115 | 115 | | |||
116 | //! Reads attributes from @p elemSource into line style @p ls | 116 | //! Reads attributes from @p elemSource into line style @p ls | ||
117 | KREPORT_EXPORT bool parseReportLineStyleData(const QDomElement & elemSource, KReportLineStyle *ls); | 117 | KREPORT_EXPORT bool parseReportLineStyleData(const QDomElement & elemSource, KReportLineStyle *ls); | ||
118 | 118 | | |||
119 | //! Reads attributes from @p elemSource into rect @p pos, @p siz | 119 | //! Reads attributes from @p elemSource into rect @p pos, @p siz | ||
120 | KREPORT_EXPORT bool parseReportRect(const QDomElement & elemSource, KReportPosition *pos, KReportSize *size); | 120 | KREPORT_EXPORT bool parseReportRect(const QDomElement & elemSource, KReportPosition *pos, KReportSize *size); | ||
121 | 121 | | |||
122 | //! @return page size ID for page key (the PPD standard mediaOption keyword, e.g. "A4") | 122 | //! @return page size ID for page key (the PPD standard mediaOption keyword, e.g. "A4") | ||
Show All 9 Lines |