Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportItemBase.h
Show All 16 Lines | |||||
17 | 17 | | |||
18 | #ifndef KREPORTITEMBASE_H | 18 | #ifndef KREPORTITEMBASE_H | ||
19 | #define KREPORTITEMBASE_H | 19 | #define KREPORTITEMBASE_H | ||
20 | 20 | | |||
21 | #include "config-kreport.h" | 21 | #include "config-kreport.h" | ||
22 | #include "kreport_export.h" | 22 | #include "kreport_export.h" | ||
23 | #include "KReportPosition.h" | 23 | #include "KReportPosition.h" | ||
24 | #include "KReportSize.h" | 24 | #include "KReportSize.h" | ||
25 | #include "KReportDpi.h" | ||||
25 | 26 | | |||
26 | #include <QObject> | 27 | #include <QObject> | ||
27 | #include <QFont> | 28 | #include <QFont> | ||
28 | #include <QColor> | 29 | #include <QColor> | ||
29 | 30 | | |||
30 | class OROPage; | 31 | class OROPage; | ||
31 | class OROSection; | 32 | class OROSection; | ||
32 | class KReportSize; | 33 | class KReportSize; | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 74 | public: | |||
100 | virtual QString itemDataSource() const; | 101 | virtual QString itemDataSource() const; | ||
101 | 102 | | |||
102 | /** | 103 | /** | ||
103 | @brief Override if the item uses a sub query and linked fields, such as a chart or sub-report | 104 | @brief Override if the item uses a sub query and linked fields, such as a chart or sub-report | ||
104 | @return True if uses a sub query | 105 | @return True if uses a sub query | ||
105 | */ | 106 | */ | ||
106 | virtual bool supportsSubQuery() const; | 107 | virtual bool supportsSubQuery() const; | ||
107 | 108 | | |||
108 | KPropertySet* propertySet() const; | 109 | KPropertySet* propertySet(); | ||
110 | const KPropertySet* propertySet() const; | ||||
109 | 111 | | |||
110 | void setEntityName(const QString& n); | 112 | void setEntityName(const QString& n); | ||
111 | QString entityName() const; | 113 | QString entityName() const; | ||
112 | 114 | | |||
113 | virtual void setUnit(const KReportUnit& u); | 115 | virtual void setUnit(const KReportUnit& u); | ||
114 | 116 | | |||
115 | KReportPosition position() const; | 117 | /** | ||
116 | KReportSize size() const; | 118 | * @brief Return the size in points | ||
119 | */ | ||||
120 | QSizeF size() const; | ||||
117 | 121 | | |||
118 | qreal Z; | 122 | /** | ||
119 | protected: | 123 | * @brief Return the position in points | ||
120 | KPropertySet *m_set; | 124 | */ | ||
121 | KProperty *m_name; | 125 | QPointF position() const; | ||
122 | KReportPosition m_pos; | | |||
123 | KReportSize m_size; | | |||
124 | 126 | | |||
125 | QString m_oldName; | 127 | void setPosition(const QPointF &pos); | ||
128 | void setSize(const QSizeF &siz); | ||||
126 | 129 | | |||
127 | void addDefaultProperties(); | 130 | qreal z() const; | ||
131 | void setZ(qreal z); | ||||
128 | 132 | | |||
129 | virtual void createProperties() = 0; | 133 | //Helper function to map between size/position units | ||
134 | static QPointF scenePosition(const QPointF &pos); | ||||
135 | static QSizeF sceneSize(const QSizeF &size); | ||||
136 | static QPointF positionFromScene(const QPointF &pos); | ||||
137 | static QSizeF sizeFromScene(const QSizeF &size); | ||||
130 | 138 | | |||
131 | static bool parseReportRect(const QDomElement &, KReportPosition *pos, KReportSize *size); | 139 | protected: | ||
140 | virtual void createProperties() = 0; | ||||
141 | bool parseReportRect(const QDomElement &elem); | ||||
132 | static bool parseReportTextStyleData(const QDomElement &, KRTextStyleData*); | 142 | static bool parseReportTextStyleData(const QDomElement &, KRTextStyleData*); | ||
133 | static bool parseReportLineStyleData(const QDomElement &, KReportLineStyle*); | 143 | static bool parseReportLineStyleData(const QDomElement &, KReportLineStyle*); | ||
134 | 144 | | |||
135 | 145 | KProperty *nameProperty(); | |||
146 | QString oldName() const; | ||||
147 | void setOldName(const QString &old); | ||||
148 | | ||||
149 | Q_SLOT virtual void propertyChanged(KPropertySet &s, KProperty &p); | ||||
150 | | ||||
151 | private: | ||||
152 | class Private; | ||||
153 | Private * const d; | ||||
136 | }; | 154 | }; | ||
137 | 155 | | |||
138 | #endif | 156 | #endif |