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