Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportItemBase.h
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 71 | public: | |||
---|---|---|---|---|---|
104 | virtual bool supportsSubQuery() const; | 104 | virtual bool supportsSubQuery() const; | ||
105 | 105 | | |||
106 | KPropertySet* propertySet(); | 106 | KPropertySet* propertySet(); | ||
107 | const KPropertySet* propertySet() const; | 107 | const KPropertySet* propertySet() const; | ||
108 | 108 | | |||
109 | void setEntityName(const QString& n); | 109 | void setEntityName(const QString& n); | ||
110 | QString entityName() const; | 110 | QString entityName() const; | ||
111 | 111 | | |||
112 | KReportUnit unit() const; | ||||
113 | | ||||
114 | //! Sets unit to @a a and converts values of position and size property from the old | ||||
115 | //! unit to new if needed. | ||||
112 | virtual void setUnit(const KReportUnit& u); | 116 | virtual void setUnit(const KReportUnit &u); | ||
113 | 117 | | |||
114 | /** | 118 | /** | ||
115 | * @brief Return the size in points | 119 | * @brief Return the size in points | ||
116 | */ | 120 | */ | ||
117 | QSizeF size() const; | 121 | QSizeF size() const; | ||
118 | 122 | | |||
119 | /** | 123 | /** | ||
120 | * @brief Return the position in points | 124 | * @brief Return the position in points | ||
121 | */ | 125 | */ | ||
122 | QPointF position() const; | 126 | QPointF position() const; | ||
123 | 127 | | |||
124 | void setPosition(const QPointF &pos); | 128 | /** | ||
125 | void setSize(const QSizeF &siz); | 129 | * @brief Sets position for the element | ||
130 | * @param ptPos Position in points | ||||
131 | */ | ||||
132 | void setPosition(const QPointF &ptPos); | ||||
133 | | ||||
134 | /** | ||||
135 | * @brief Sets size for the element | ||||
136 | * @param ptSize Size in points | ||||
137 | */ | ||||
138 | void setSize(const QSizeF &ptSize); | ||||
126 | 139 | | |||
140 | /** | ||||
141 | * @brief Return the z-value in points | ||||
142 | */ | ||||
127 | qreal z() const; | 143 | qreal z() const; | ||
144 | | ||||
145 | /** | ||||
146 | * @brief Sets the z-value for the element | ||||
147 | * @param z Z-value in points | ||||
148 | */ | ||||
128 | void setZ(qreal z); | 149 | void setZ(qreal z); | ||
129 | 150 | | |||
130 | //Helper function to map between size/position units | 151 | //! Helper function mapping to screen units (pixels), @a ptPos is in points | ||
131 | static QPointF scenePosition(const QPointF &pos); | 152 | static QPointF scenePosition(const QPointF &ptPos); | ||
132 | static QSizeF sceneSize(const QSizeF &size); | 153 | | ||
154 | //! Helper function mapping to screen units (pixels), @a ptSize is in points | ||||
155 | static QSizeF sceneSize(const QSizeF &ptSize); | ||||
156 | | ||||
157 | //! Helper function mapping from screen units to points, @a pos is in pixels | ||||
133 | static QPointF positionFromScene(const QPointF &pos); | 158 | static QPointF positionFromScene(const QPointF &pos); | ||
159 | | ||||
160 | //! Helper function mapping from screen units to points, @a size is in pixels | ||||
134 | static QSizeF sizeFromScene(const QSizeF &size); | 161 | static QSizeF sizeFromScene(const QSizeF &size); | ||
135 | 162 | | |||
136 | protected: | 163 | protected: | ||
137 | virtual void createProperties() = 0; | 164 | virtual void createProperties() = 0; | ||
138 | bool parseReportRect(const QDomElement &elem); | 165 | bool parseReportRect(const QDomElement &elem); | ||
139 | static bool parseReportTextStyleData(const QDomElement &, KReportTextStyleData*); | 166 | static bool parseReportTextStyleData(const QDomElement &, KReportTextStyleData*); | ||
140 | static bool parseReportLineStyleData(const QDomElement &, KReportLineStyle*); | 167 | static bool parseReportLineStyleData(const QDomElement &, KReportLineStyle*); | ||
141 | 168 | | |||
142 | KProperty *nameProperty(); | 169 | KProperty *nameProperty(); | ||
143 | QString oldName() const; | 170 | QString oldName() const; | ||
144 | void setOldName(const QString &old); | 171 | void setOldName(const QString &old); | ||
145 | 172 | | |||
146 | Q_SLOT virtual void propertyChanged(KPropertySet &s, KProperty &p); | 173 | Q_SLOT virtual void propertyChanged(KPropertySet &s, KProperty &p); | ||
147 | 174 | | |||
148 | private: | 175 | private: | ||
149 | Q_DISABLE_COPY(KReportItemBase) | 176 | Q_DISABLE_COPY(KReportItemBase) | ||
150 | class Private; | 177 | class Private; | ||
151 | Private * const d; | 178 | Private * const d; | ||
179 | Q_SLOT void aboutToDeleteProperty(KPropertySet& set, KProperty& property); | ||||
180 | | ||||
152 | }; | 181 | }; | ||
153 | 182 | | |||
154 | #endif | 183 | #endif |