Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportSectionData.h
Show All 39 Lines | |||||
40 | // A section has a name and optionally extra data. `name' | 40 | // A section has a name and optionally extra data. `name' | ||
41 | // reportheader, reportfooter, pageheader, pagefooter, groupheader, groupfooter or detail. | 41 | // reportheader, reportfooter, pageheader, pagefooter, groupheader, groupfooter or detail. | ||
42 | // In the case of pghead and pgfoot extra would contain the page | 42 | // In the case of pghead and pgfoot extra would contain the page | ||
43 | // designation (firstpage, odd, even or lastpage). | 43 | // designation (firstpage, odd, even or lastpage). | ||
44 | class KReportSectionData : public QObject | 44 | class KReportSectionData : public QObject | ||
45 | { | 45 | { | ||
46 | Q_OBJECT | 46 | Q_OBJECT | ||
47 | public: | 47 | public: | ||
48 | enum Section { | 48 | enum class Type { | ||
49 | None = 0, | 49 | None, | ||
50 | PageHeaderFirst = 1, | 50 | PageHeaderFirst, | ||
51 | PageHeaderOdd, | 51 | PageHeaderOdd, | ||
52 | PageHeaderEven, | 52 | PageHeaderEven, | ||
53 | PageHeaderLast, | 53 | PageHeaderLast, | ||
54 | PageHeaderAny, | 54 | PageHeaderAny, | ||
55 | ReportHeader, | 55 | ReportHeader, | ||
56 | ReportFooter, | 56 | ReportFooter, | ||
57 | PageFooterFirst, | 57 | PageFooterFirst, | ||
58 | PageFooterOdd, | 58 | PageFooterOdd, | ||
Show All 25 Lines | |||||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | QString name() const; | 86 | QString name() const; | ||
87 | 87 | | |||
88 | QColor backgroundColor() const { | 88 | QColor backgroundColor() const { | ||
89 | return m_backgroundColor->value().value<QColor>(); | 89 | return m_backgroundColor->value().value<QColor>(); | ||
90 | } | 90 | } | ||
91 | 91 | | |||
92 | Section type() const { | 92 | Type type() const { | ||
93 | return m_type; | 93 | return m_type; | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | static KReportSectionData::Section sectionTypeFromString(const QString& s); | 96 | static KReportSectionData::Type sectionTypeFromString(const QString& s); | ||
97 | static QString sectionTypeString(KReportSectionData::Section s); | 97 | static QString sectionTypeString(KReportSectionData::Type type); | ||
98 | protected: | 98 | protected: | ||
99 | KPropertySet *m_set; | 99 | KPropertySet *m_set; | ||
100 | KProperty *m_height; | 100 | KProperty *m_height; | ||
101 | KProperty *m_backgroundColor; | 101 | KProperty *m_backgroundColor; | ||
102 | 102 | | |||
103 | private: | 103 | private: | ||
104 | void createProperties(const QDomElement & elemSource); | 104 | void createProperties(const QDomElement & elemSource); | ||
105 | 105 | | |||
106 | QList<KReportItemBase*> m_objects; | 106 | QList<KReportItemBase*> m_objects; | ||
107 | 107 | | |||
108 | Section m_type; | 108 | Type m_type; | ||
109 | 109 | | |||
110 | static bool zLessThan(KReportItemBase* s1, KReportItemBase* s2); | 110 | static bool zLessThan(KReportItemBase* s1, KReportItemBase* s2); | ||
111 | static bool xLessThan(KReportItemBase* s1, KReportItemBase* s2); | 111 | static bool xLessThan(KReportItemBase* s1, KReportItemBase* s2); | ||
112 | 112 | | |||
113 | bool m_valid; | 113 | bool m_valid; | ||
114 | 114 | | |||
115 | friend class Scripting::Section; | 115 | friend class Scripting::Section; | ||
116 | friend class KReportDesignerSection; | 116 | friend class KReportDesignerSection; | ||
117 | }; | 117 | }; | ||
118 | 118 | | |||
119 | #endif | 119 | #endif |