Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportRenderObjects.h
Show All 40 Lines | |||||
41 | class OROLine; | 41 | class OROLine; | ||
42 | class OROImage; | 42 | class OROImage; | ||
43 | class OROSection; | 43 | class OROSection; | ||
44 | 44 | | |||
45 | // | 45 | // | ||
46 | // ORODocument | 46 | // ORODocument | ||
47 | // This object is a single document containing one or more OROPage elements | 47 | // This object is a single document containing one or more OROPage elements | ||
48 | // | 48 | // | ||
49 | class KREPORT_EXPORT ORODocument : public QObject | 49 | class ORODocument : public QObject | ||
50 | { | 50 | { | ||
51 | Q_OBJECT | 51 | Q_OBJECT | ||
52 | 52 | | |||
53 | friend class OROPage; | | |||
54 | friend class OROSection; | | |||
55 | | ||||
56 | public: | 53 | public: | ||
57 | explicit ORODocument(const QString & = QString()); | 54 | explicit ORODocument(const QString &title = QString()); | ||
staniek: +title param. | |||||
58 | ~ORODocument(); | 55 | ~ORODocument(); | ||
59 | 56 | | |||
60 | QString title() const { | 57 | QString title() const; | ||
61 | return m_title; | | |||
62 | }; | | |||
63 | void setTitle(const QString &); | 58 | void setTitle(const QString &); | ||
staniek: +title param. | |||||
staniek: TODO | |||||
64 | 59 | | |||
65 | int pages() const { | 60 | int pageCount() const; | ||
staniek: +index | |||||
staniek: + const OROPage* page(int index) const; overload | |||||
staniek: +const overload | |||||
staniek: +param name here and everywhere :) | |||||
66 | return m_pages.count(); | 61 | OROPage* page(int index); | ||
67 | }; | 62 | const OROPage* page(int index) const; | ||
68 | OROPage* page(int); | 63 | void addPage(OROPage* page); | ||
staniek: While we're looking here. Add docs informing that ownership is transferred. | |||||
69 | void addPage(OROPage*); | 64 | int pageIndex(const OROPage* page) const; | ||
65 | void removePage(OROPage* page); | ||||
staniek: Add docs informing that the page object will be removed and deleted. | |||||
66 | | ||||
67 | int sectionCount() const; | ||||
68 | OROSection* section(int index); | ||||
69 | const OROSection* section(int index) const; | ||||
70 | void addSection(OROSection* section); | ||||
staniek: Add docs informing that ownership is transferred. | |||||
71 | void removeSetion(OROSection *section); | ||||
staniek: Setion -> Section | |||||
staniek: TODO | |||||
staniek: Add docs informing that the section object will be removed and deleted.
| |||||
70 | 72 | | |||
71 | int sections() const { | 73 | void setPageLayout(const QPageLayout &layout); | ||
72 | return m_sections.count(); | 74 | QPageLayout pageLayout() const; | ||
73 | }; | | |||
74 | OROSection* section(int); | | |||
75 | void addSection(OROSection*); | | |||
76 | | ||||
77 | void setPageLayout(const QPageLayout &); | | |||
78 | QPageLayout pageLayout() const { | | |||
79 | return m_pageLayout; | | |||
80 | }; | | |||
81 | 75 | | |||
82 | void notifyChange(int pageNo); | 76 | void notifyChange(int pageNo); | ||
83 | 77 | | |||
84 | protected: | | |||
85 | QString m_title; | | |||
86 | QList<OROPage*> m_pages; | | |||
87 | QList<OROSection*> m_sections; | | |||
88 | QPageLayout m_pageLayout; | | |||
89 | | ||||
90 | Q_SIGNALS: | 78 | Q_SIGNALS: | ||
91 | void updated(int pageNo); | 79 | void updated(int pageNo); | ||
80 | | ||||
81 | private: | ||||
82 | class Private; | ||||
83 | Private * const d; | ||||
92 | }; | 84 | }; | ||
93 | 85 | | |||
94 | // | 86 | // | ||
95 | // OROPage | 87 | // OROPage | ||
96 | // This object is a single page in a document and may contain zero or more | 88 | // This object is a single page in a document and may contain zero or more | ||
97 | // OROPrimitive objects all of which represent some form of mark to made on | 89 | // OROPrimitive objects all of which represent some form of mark to made on | ||
98 | // a page. | 90 | // a page. | ||
99 | // | 91 | // | ||
100 | class KREPORT_EXPORT OROPage | 92 | class OROPage | ||
101 | { | 93 | { | ||
102 | friend class ORODocument; | | |||
103 | friend class OROPrimitive; | | |||
104 | | ||||
105 | public: | 94 | public: | ||
106 | explicit OROPage(ORODocument * = 0); | 95 | explicit OROPage(ORODocument * doc = 0); | ||
107 | ~OROPage(); | 96 | ~OROPage(); | ||
108 | 97 | | |||
109 | ORODocument* document() const { | 98 | ORODocument* document(); | ||
staniek: remove const, add const overload | |||||
110 | return m_document; | 99 | const ORODocument* document() const; | ||
111 | }; | 100 | void setDocument(ORODocument *doc); | ||
112 | int page() const; // returns this pages current page number | | |||
113 | 101 | | |||
114 | int primitives() const { | 102 | int pageNumber() const; // returns this pages current page number | ||
staniek: -> pageNumber
| |||||
115 | return m_primitives.count(); | | |||
116 | }; | | |||
117 | OROPrimitive* primitive(int); | | |||
118 | void addPrimitive(OROPrimitive*, bool atBeginning = false, bool notify = false); | | |||
119 | 103 | | |||
120 | protected: | 104 | int primitiveCount() const; | ||
121 | ORODocument * m_document; | 105 | | ||
staniek: remove const, add const overload | |||||
122 | QList<OROPrimitive*> m_primitives; | 106 | OROPrimitive* primitive(int index); | ||
107 | const OROPrimitive* primitive(int index) const; | ||||
108 | | ||||
109 | void insertPrimitive(OROPrimitive* primitive, int index = -1); | ||||
110 | void removePrimitive(OROPrimitive *primitive); | ||||
replace with void insertPrimitive(OROPrimitive*, int index = -1)
staniek: replace with void insertPrimitive(OROPrimitive*, int index = -1)
- removes atBeginning… | |||||
111 | | ||||
112 | private: | ||||
113 | class Private; | ||||
114 | Private * const d; | ||||
123 | }; | 115 | }; | ||
124 | // | 116 | // | ||
125 | // OROSection | 117 | // OROSection | ||
126 | // This object is a single row in a document and may contain zero or more | 118 | // This object is a single row in a document and may contain zero or more | ||
127 | // OROPrimitives | 119 | // OROPrimitives | ||
128 | // | 120 | // | ||
129 | class KREPORT_EXPORT OROSection | 121 | class OROSection | ||
130 | { | 122 | { | ||
131 | friend class ORODocument; | | |||
132 | friend class OROPrimitive; | | |||
133 | | ||||
134 | public: | 123 | public: | ||
135 | enum Sort { | 124 | enum Sort { | ||
staniek: mostly unused, what to do with it? | |||||
I noticed it is mostly unused, only SortX. I imagine there could be use cases for sorting in other directions (probably not Z though). remove Z and keep Y ? piggz: I noticed it is mostly unused, only SortX. I imagine there could be use cases for sorting in… | |||||
staniek: How about keeping X and Y by using Qt::Orientation and removing Sort? | |||||
136 | SortX = 1, | 125 | SortX = 1, | ||
137 | SortY, | 126 | SortY | ||
138 | SortZ | | |||
139 | }; | 127 | }; | ||
140 | 128 | | |||
141 | explicit OROSection(ORODocument * = 0); | 129 | explicit OROSection(ORODocument* doc = 0); | ||
142 | ~OROSection(); | 130 | ~OROSection(); | ||
143 | 131 | | |||
144 | void setHeight(int); | 132 | void setHeight(int); | ||
145 | int height(); | 133 | int height(); | ||
staniek: +const | |||||
146 | 134 | | |||
147 | void setBackgroundColor(const QColor&L); | 135 | void setBackgroundColor(const QColor& color); | ||
staniek: fix par. name | |||||
148 | QColor backgroundColor(); | 136 | QColor backgroundColor() const; | ||
staniek: +const | |||||
149 | | ||||
150 | ORODocument* document() const { | | |||
151 | return m_document; | | |||
152 | }; | | |||
153 | 137 | | |||
154 | void setType(KReportSectionData::Section t) { | 138 | ORODocument* document(); | ||
155 | m_type = t; | 139 | const ORODocument* document() const; | ||
156 | } | 140 | void setDocument(ORODocument *doc); | ||
157 | KReportSectionData::Section type() { | 141 | | ||
158 | return m_type; | 142 | void setType(KReportSectionData::Section t); | ||
159 | } | 143 | KReportSectionData::Section type() const; | ||
staniek: +const | |||||
160 | 144 | | |||
161 | int primitives() const { | 145 | int primitiveCount() const; | ||
162 | return m_primitives.count(); | 146 | OROPrimitive* primitive(int index); | ||
163 | }; | 147 | const OROPrimitive* primitive(int index) const; | ||
staniek: +const overload | |||||
164 | OROPrimitive* primitive(int); | | |||
165 | void addPrimitive(OROPrimitive*); | 148 | void addPrimitive(OROPrimitive*); | ||
166 | 149 | void sortPrimitives(Sort s); | |||
staniek: +param name | |||||
staniek: The param is only checked against SortX | |||||
staniek: typo "primatives" | |||||
staniek: +param name | |||||
167 | void sortPrimatives(Sort); | | |||
168 | protected: | | |||
169 | ORODocument * m_document; | | |||
170 | QList<OROPrimitive*> m_primitives; | | |||
171 | long m_row; | | |||
172 | int m_height; | | |||
173 | KReportSectionData::Section m_type; | | |||
174 | QColor m_backgroundColor; | | |||
175 | 150 | | |||
176 | private: | 151 | private: | ||
177 | static bool xLessThan(OROPrimitive* s1, OROPrimitive* s2); | 152 | static bool xLessThan(OROPrimitive* s1, OROPrimitive* s2); | ||
153 | | ||||
154 | class Private; | ||||
155 | Private * const d; | ||||
staniek: private so move to .cpp only? | |||||
staniek: I mean xLessThan | |||||
178 | }; | 156 | }; | ||
179 | 157 | | |||
180 | 158 | | |||
181 | // | 159 | // | ||
182 | // OROPrimitive | 160 | // OROPrimitive | ||
183 | // This object represents the basic primitive with a position and type. | 161 | // This object represents the basic primitive with a position and type. | ||
184 | // Other primitives are subclasses with a defined type and any additional | 162 | // Other primitives are subclasses with a defined type and any additional | ||
185 | // information they require to define that primitive. | 163 | // information they require to define that primitive. | ||
186 | // | 164 | // | ||
187 | class KREPORT_EXPORT OROPrimitive | 165 | class OROPrimitive | ||
188 | { | 166 | { | ||
189 | friend class OROPage; | | |||
190 | | ||||
191 | public: | 167 | public: | ||
192 | virtual ~OROPrimitive(); | 168 | virtual ~OROPrimitive(); | ||
193 | 169 | | |||
194 | // Returns the type of the primitive which should be | 170 | OROPage* page(); | ||
195 | // set by the subclass | 171 | const OROPage* page() const; | ||
196 | int type() const { | 172 | void setPage(OROPage *page); | ||
staniek: remove const,
add const overload | |||||
197 | return m_type; | | |||
198 | }; | | |||
199 | OROPage * page() const { | | |||
200 | return m_page; | | |||
201 | }; | | |||
202 | 173 | | |||
203 | QPointF position() const { | 174 | QPointF position() const; | ||
staniek: +arg name | |||||
204 | return m_position; | 175 | void setPosition(const QPointF &pos); | ||
205 | }; | 176 | | ||
206 | void setPosition(const QPointF &); | 177 | QSizeF size() const; | ||
207 | QSizeF size() const { return m_size; } | | |||
208 | void setSize(const QSizeF &s); | 178 | void setSize(const QSizeF &s); | ||
209 | 179 | | |||
210 | virtual OROPrimitive* clone() = 0; | 180 | virtual OROPrimitive* clone() = 0; | ||
211 | 181 | | |||
212 | protected: | 182 | protected: | ||
213 | OROPrimitive(int); | 183 | OROPrimitive(); | ||
staniek: +arg name | |||||
214 | 184 | | |||
215 | OROPage * m_page; | 185 | private: | ||
216 | int m_type; | 186 | class Private; | ||
217 | QPointF m_position; | 187 | Private * const d; | ||
218 | QSizeF m_size; | | |||
219 | }; | 188 | }; | ||
220 | 189 | | |||
221 | // | 190 | // | ||
222 | // OROTextBox | 191 | // OROTextBox | ||
223 | // This is a text box primitive it defines a box region and text that will | 192 | // This is a text box primitive it defines a box region and text that will | ||
224 | // be rendered inside that region. It also contains information for font | 193 | // be rendered inside that region. It also contains information for font | ||
225 | // and positioning of the text. | 194 | // and positioning of the text. | ||
226 | // | 195 | // | ||
227 | class KREPORT_EXPORT OROTextBox : public OROPrimitive | 196 | class OROTextBox : public OROPrimitive | ||
228 | { | 197 | { | ||
229 | public: | 198 | public: | ||
230 | OROTextBox(); | 199 | OROTextBox(); | ||
231 | virtual ~OROTextBox(); | 200 | virtual ~OROTextBox(); | ||
232 | 201 | | |||
233 | QString text() const { | 202 | QString text() const; | ||
234 | return m_text; | | |||
235 | }; | | |||
236 | void setText(const QString &); | 203 | void setText(const QString &); | ||
staniek: +arg name here and everywhere | |||||
staniek: Not done... | |||||
staniek: TODO | |||||
237 | 204 | | |||
238 | KRTextStyleData textStyle() const { | 205 | KRTextStyleData textStyle() const; | ||
239 | return m_textStyle; | | |||
240 | } | | |||
241 | void setTextStyle(const KRTextStyleData&); | 206 | void setTextStyle(const KRTextStyleData&); | ||
242 | 207 | | |||
243 | KReportLineStyle lineStyle() const { | 208 | KReportLineStyle lineStyle() const; | ||
244 | return m_lineStyle; | | |||
245 | } | | |||
246 | void setLineStyle(const KReportLineStyle&); | 209 | void setLineStyle(const KReportLineStyle&); | ||
247 | 210 | | |||
248 | void setFont(const QFont &); | 211 | void setFont(const QFont &); | ||
249 | 212 | | |||
250 | int flags() const { | 213 | int flags() const; | ||
251 | return m_flags; | | |||
252 | }; | | |||
253 | void setFlags(int); | 214 | void setFlags(int); | ||
254 | 215 | | |||
255 | static const int TextBox; | | |||
256 | | ||||
257 | virtual OROPrimitive* clone(); | 216 | virtual OROPrimitive* clone(); | ||
Hmm, in most cases dynamic_cast<> is ok for checking types. This construction feels like written for pre-C++ without dynamic cast and polymorphism... If we even need type IDs it would be possible to have a single enum with them. staniek: Hmm, in most cases dynamic_cast<> is ok for checking types.
I propose to remove this line and… | |||||
258 | 217 | | |||
259 | bool requiresPostProcessing(){return m_requiresPostProcessing;} | 218 | bool requiresPostProcessing() const; | ||
260 | void setRequiresPostProcessing(bool pp = true){m_requiresPostProcessing = pp;} | 219 | void setRequiresPostProcessing(bool pp); | ||
staniek: remove = true | |||||
261 | 220 | | |||
262 | bool wordWrap() const {return m_wordWrap;} | 221 | bool wordWrap() const; | ||
263 | void setWordWrap(bool ww){m_wordWrap = ww;} | 222 | void setWordWrap(bool ww); | ||
264 | 223 | | |||
265 | bool canGrow() const {return m_canGrow;} | 224 | bool canGrow() const; | ||
266 | void setCanGrow(bool cg){m_canGrow = cg;} | 225 | void setCanGrow(bool grow); | ||
267 | 226 | | |||
268 | protected: | 227 | private: | ||
269 | QString m_text; | 228 | class Private; | ||
270 | KRTextStyleData m_textStyle; | 229 | Private * const d; | ||
271 | KReportLineStyle m_lineStyle; | | |||
272 | Qt::Alignment m_alignment; | | |||
273 | int m_flags; // Qt::AlignmentFlag and Qt::TextFlag OR'd | | |||
274 | bool m_wordWrap; | | |||
275 | bool m_canGrow; | | |||
276 | bool m_requiresPostProcessing; | | |||
277 | }; | 230 | }; | ||
278 | 231 | | |||
279 | // | 232 | // | ||
280 | // OROLine | 233 | // OROLine | ||
281 | // This primitive defines a line with a width/weight. | 234 | // This primitive defines a line with a width/weight. | ||
282 | // | 235 | // | ||
283 | class KREPORT_EXPORT OROLine : public OROPrimitive | 236 | class OROLine : public OROPrimitive | ||
284 | { | 237 | { | ||
285 | public: | 238 | public: | ||
286 | OROLine(); | 239 | OROLine(); | ||
287 | virtual ~OROLine(); | 240 | virtual ~OROLine(); | ||
288 | 241 | | |||
289 | QPointF startPoint() const { | 242 | QPointF startPoint() const { | ||
290 | return position(); | 243 | return position(); | ||
291 | }; | 244 | }; | ||
292 | void setStartPoint(const QPointF &); | 245 | void setStartPoint(const QPointF &); | ||
staniek: let's add arg name | |||||
293 | 246 | | |||
294 | QPointF endPoint() const { | 247 | QPointF endPoint() const; | ||
295 | return m_endPoint; | | |||
296 | }; | | |||
297 | void setEndPoint(const QPointF &); | 248 | void setEndPoint(const QPointF &); | ||
staniek: let's add arg name | |||||
298 | 249 | | |||
299 | KReportLineStyle lineStyle() const { | 250 | KReportLineStyle lineStyle() const; | ||
300 | return m_lineStyle; | | |||
301 | }; | | |||
302 | void setLineStyle(const KReportLineStyle&); | 251 | void setLineStyle(const KReportLineStyle&); | ||
staniek: let's add arg name | |||||
303 | 252 | | |||
304 | static const int Line; | | |||
305 | virtual OROPrimitive* clone(); | 253 | virtual OROPrimitive* clone(); | ||
staniek: remove? | |||||
306 | protected: | 254 | | ||
307 | QPointF m_endPoint; | 255 | private: | ||
308 | KReportLineStyle m_lineStyle; | 256 | class Private; | ||
257 | Private * const d; | ||||
309 | }; | 258 | }; | ||
310 | 259 | | |||
311 | // | 260 | // | ||
312 | // OROImage | 261 | // OROImage | ||
313 | // This primitive defines an image | 262 | // This primitive defines an image | ||
314 | // | 263 | // | ||
315 | class KREPORT_EXPORT OROImage: public OROPrimitive | 264 | class OROImage: public OROPrimitive | ||
316 | { | 265 | { | ||
317 | public: | 266 | public: | ||
318 | OROImage(); | 267 | OROImage(); | ||
319 | virtual ~OROImage(); | 268 | virtual ~OROImage(); | ||
320 | 269 | | |||
321 | QImage image() const { | 270 | QImage image() const; | ||
322 | return m_image; | | |||
323 | }; | | |||
324 | void setImage(const QImage &); | 271 | void setImage(const QImage &); | ||
staniek: let's add arg name | |||||
325 | 272 | | |||
326 | bool scaled() const { | 273 | bool isScaled() const; | ||
staniek: -> isScaled | |||||
327 | return m_scaled; | | |||
328 | }; | | |||
329 | void setScaled(bool); | 274 | void setScaled(bool); | ||
staniek: let's add arg name | |||||
330 | 275 | | |||
331 | int transformationMode() const { | 276 | Qt::TransformationMode transformationMode() const; | ||
staniek: int -> Qt::TransformationMode | |||||
332 | return m_transformFlags; | 277 | void setTransformationMode(Qt::TransformationMode transformation); | ||
staniek: int -> Qt::TransformationMode | |||||
333 | }; | | |||
334 | void setTransformationMode(int); | | |||
335 | 278 | | |||
336 | int aspectRatioMode() const { | 279 | Qt::AspectRatioMode aspectRatioMode() const; | ||
staniek: int -> Qt::AspectRatioMode ? | |||||
337 | return m_aspectFlags; | 280 | void setAspectRatioMode(Qt::AspectRatioMode aspect); | ||
staniek: int -> Qt::AspectRatioMode ? | |||||
338 | }; | | |||
339 | void setAspectRatioMode(int); | | |||
340 | 281 | | |||
341 | static const int Image; | | |||
342 | virtual OROPrimitive* clone(); | 282 | virtual OROPrimitive* clone(); | ||
343 | 283 | | |||
344 | protected: | 284 | private: | ||
345 | QImage m_image; | 285 | class Private; | ||
346 | bool m_scaled; | 286 | Private * const d; | ||
347 | int m_transformFlags; | | |||
348 | int m_aspectFlags; | | |||
349 | }; | 287 | }; | ||
350 | 288 | | |||
351 | class KREPORT_EXPORT OROPicture: public OROPrimitive | 289 | // | ||
290 | // OROPicture | ||||
291 | // This primitive defines a picture | ||||
292 | // | ||||
293 | class OROPicture: public OROPrimitive | ||||
352 | { | 294 | { | ||
353 | public: | 295 | public: | ||
354 | OROPicture(); | 296 | OROPicture(); | ||
355 | virtual ~OROPicture(); | 297 | virtual ~OROPicture(); | ||
356 | 298 | | |||
357 | void setPicture(const QPicture& p) { | 299 | void setPicture(const QPicture& p); | ||
358 | m_picture = p; | 300 | QPicture* picture(); | ||
359 | } | | |||
360 | QPicture* picture() { | | |||
361 | return &m_picture; | | |||
362 | }; | | |||
363 | 301 | | |||
364 | static const int Picture; | | |||
365 | virtual OROPrimitive* clone(); | 302 | virtual OROPrimitive* clone(); | ||
staniek: remove? | |||||
366 | protected: | 303 | | ||
367 | QPicture m_picture; | 304 | private: | ||
305 | class Private; | ||||
306 | Private * const d; | ||||
368 | 307 | | |||
369 | }; | 308 | }; | ||
370 | // | 309 | // | ||
371 | // ORORect | 310 | // ORORect | ||
372 | // This primitive defines a drawn rectangle | 311 | // This primitive defines a drawn rectangle | ||
373 | // | 312 | // | ||
374 | class KREPORT_EXPORT ORORect: public OROPrimitive | 313 | class ORORect: public OROPrimitive | ||
375 | { | 314 | { | ||
376 | public: | 315 | public: | ||
377 | ORORect(); | 316 | ORORect(); | ||
378 | virtual ~ORORect(); | 317 | virtual ~ORORect(); | ||
379 | 318 | | |||
380 | QRectF rect() const { | 319 | QRectF rect() const; | ||
381 | return QRectF(m_position, m_size); | | |||
382 | }; | | |||
383 | void setRect(const QRectF &); | 320 | void setRect(const QRectF &); | ||
384 | 321 | | |||
385 | QPen pen() const { | 322 | QPen pen() const; | ||
386 | return m_pen; | | |||
387 | }; | | |||
388 | void setPen(const QPen &); | 323 | void setPen(const QPen &); | ||
389 | 324 | | |||
390 | QBrush brush() const { | 325 | QBrush brush() const; | ||
391 | return m_brush; | | |||
392 | }; | | |||
393 | void setBrush(const QBrush &); | 326 | void setBrush(const QBrush &); | ||
staniek: let's add arg name | |||||
394 | 327 | | |||
395 | static const int Rect; | | |||
396 | virtual OROPrimitive* clone(); | 328 | virtual OROPrimitive* clone(); | ||
staniek: remove? | |||||
397 | protected: | 329 | | ||
398 | QPen m_pen; | 330 | private: | ||
399 | QBrush m_brush; | 331 | class Private; | ||
332 | Private * const d; | ||||
400 | }; | 333 | }; | ||
401 | 334 | | |||
402 | // | 335 | // | ||
403 | // ORORect | 336 | // ORORect | ||
404 | // This primitive defines a drawn rectangle | 337 | // This primitive defines a drawn rectangle | ||
405 | // | 338 | // | ||
406 | class KREPORT_EXPORT OROEllipse: public OROPrimitive | 339 | class OROEllipse: public OROPrimitive | ||
407 | { | 340 | { | ||
408 | public: | 341 | public: | ||
409 | OROEllipse(); | 342 | OROEllipse(); | ||
410 | virtual ~OROEllipse(); | 343 | virtual ~OROEllipse(); | ||
411 | 344 | | |||
412 | QRectF rect() const { | 345 | QRectF rect() const; | ||
413 | return QRectF(m_position, m_size); | | |||
414 | }; | | |||
415 | void setRect(const QRectF &); | 346 | void setRect(const QRectF &); | ||
staniek: let's add arg name | |||||
416 | 347 | | |||
417 | QPen pen() const { | 348 | QPen pen() const; | ||
418 | return m_pen; | | |||
419 | }; | | |||
420 | void setPen(const QPen &); | 349 | void setPen(const QPen &); | ||
staniek: let's add arg name | |||||
421 | 350 | | |||
422 | QBrush brush() const { | 351 | QBrush brush() const; | ||
423 | return m_brush; | | |||
424 | }; | | |||
425 | void setBrush(const QBrush &); | 352 | void setBrush(const QBrush &); | ||
staniek: let's add arg name | |||||
426 | 353 | | |||
427 | static const int Ellipse; | | |||
428 | virtual OROPrimitive* clone(); | 354 | virtual OROPrimitive* clone(); | ||
staniek: remove? | |||||
429 | 355 | | |||
430 | protected: | 356 | private: | ||
431 | QSizeF m_size; | 357 | class Private; | ||
432 | QPen m_pen; | 358 | Private * const d; | ||
433 | QBrush m_brush; | | |||
434 | }; | 359 | }; | ||
435 | 360 | | |||
436 | class KREPORT_EXPORT OROCheck : public OROPrimitive | 361 | class OROCheckBox : public OROPrimitive | ||
staniek: OROCheckBox? | |||||
437 | { | 362 | { | ||
438 | public: | 363 | public: | ||
439 | OROCheck(); | 364 | OROCheckBox(); | ||
440 | virtual ~OROCheck(); | 365 | virtual ~OROCheckBox(); | ||
441 | virtual OROPrimitive* clone(); | 366 | virtual OROPrimitive* clone(); | ||
442 | static const int Check; | | |||
443 | 367 | | |||
staniek: Remove? | |||||
staniek: TODO: enum types? | |||||
444 | void setCheckType(const QString& t) { | 368 | void setCheckType(const QString& t); | ||
445 | if (t == QLatin1String("Cross") || t == QLatin1String("Tick") || t == QLatin1String("Dot")) { | 369 | QString checkType() const; | ||
446 | m_checkType = t; | | |||
447 | } else { | | |||
448 | m_checkType = QLatin1String("Cross"); | | |||
449 | } | | |||
450 | } | | |||
451 | | ||||
452 | QString checkType() const { | | |||
453 | return m_checkType; | | |||
454 | }; | | |||
455 | | ||||
456 | void setValue(bool v) { | | |||
457 | m_value = v; | | |||
458 | } | | |||
459 | bool value() const { | | |||
460 | return m_value; | | |||
461 | } | | |||
462 | | ||||
463 | void setLineStyle(const KReportLineStyle& ls) { | | |||
464 | m_lineStyle = ls; | | |||
465 | } | | |||
466 | | ||||
467 | KReportLineStyle lineStyle() const { | | |||
468 | return m_lineStyle; | | |||
469 | } | | |||
470 | void setForegroundColor(const QColor& fg) { | | |||
471 | m_fgColor = fg; | | |||
472 | } | | |||
473 | QColor foregroundColor() const { | | |||
474 | return m_fgColor; | | |||
475 | } | | |||
476 | 370 | | |||
477 | protected: | 371 | void setValue(bool v); | ||
478 | QSizeF m_size; | 372 | bool value() const; | ||
479 | QString m_checkType; | 373 | | ||
480 | bool m_value; | 374 | void setLineStyle(const KReportLineStyle& ls); | ||
481 | KReportLineStyle m_lineStyle; | 375 | KReportLineStyle lineStyle() const; | ||
482 | QColor m_fgColor; | | |||
483 | 376 | | |||
377 | void setForegroundColor(const QColor& fg); | ||||
378 | QColor foregroundColor() const; | ||||
379 | | ||||
380 | private: | ||||
381 | class Private; | ||||
382 | Private * const d; | ||||
484 | 383 | | |||
485 | }; | 384 | }; | ||
486 | 385 | | |||
487 | #endif // __RENDEROBJECTS_H__ | 386 | #endif // __RENDEROBJECTS_H__ |
+title param.