Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportRenderObjects.h
Show All 36 Lines | |||||
37 | class ORODocument; | 37 | class ORODocument; | ||
38 | class OROPage; | 38 | class OROPage; | ||
39 | class OROPrimitive; | 39 | class OROPrimitive; | ||
40 | class OROTextBox; | 40 | class OROTextBox; | ||
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 | /*! | ||
47 | // This object is a single document containing one or more OROPage elements | 47 | * @brief Represents 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 | public: | 53 | public: | ||
54 | explicit ORODocument(const QString &title = QString()); | 54 | explicit ORODocument(const QString &title = QString()); | ||
55 | ~ORODocument() override; | 55 | ~ORODocument() override; | ||
56 | 56 | | |||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | |||||
137 | * | 137 | * | ||
138 | * @param section OROSection* to remove and delete | 138 | * @param section OROSection* to remove and delete | ||
139 | */ | 139 | */ | ||
140 | void removeSection(OROSection *section); | 140 | void removeSection(OROSection *section); | ||
141 | 141 | | |||
142 | /** | 142 | /** | ||
143 | * @brief Takes the section from the document but does not delete it | 143 | * @brief Takes the section from the document but does not delete it | ||
144 | * | 144 | * | ||
145 | * @param page OROSection* to take from the document | 145 | * @param section OROSection* to take from the document | ||
146 | */ | 146 | */ | ||
147 | void takeSection(OROSection *section); | 147 | void takeSection(OROSection *section); | ||
148 | 148 | | |||
149 | void setPageLayout(const QPageLayout &layout); | 149 | void setPageLayout(const QPageLayout &layout); | ||
150 | QPageLayout pageLayout() const; | 150 | QPageLayout pageLayout() const; | ||
151 | 151 | | |||
152 | void notifyChange(int pageNo); | 152 | void notifyChange(int pageNo); | ||
153 | 153 | | |||
154 | Q_SIGNALS: | 154 | Q_SIGNALS: | ||
155 | void updated(int pageNo); | 155 | void updated(int pageNo); | ||
156 | 156 | | |||
157 | private: | 157 | private: | ||
158 | class Private; | 158 | class Private; | ||
159 | Private * const d; | 159 | Private * const d; | ||
160 | }; | 160 | }; | ||
161 | 161 | | |||
162 | // | 162 | /*! | ||
163 | // OROPage | 163 | * @brief Represents a single page in a document and may contain zero or more | ||
164 | // This object is a single page in a document and may contain zero or more | 164 | * OROPrimitive objects all of which represent some form of mark to be made on | ||
165 | // OROPrimitive objects all of which represent some form of mark to made on | 165 | * a page. | ||
166 | // a page. | 166 | */ | ||
167 | // | | |||
168 | class KREPORT_EXPORT OROPage | 167 | class KREPORT_EXPORT OROPage | ||
169 | { | 168 | { | ||
170 | public: | 169 | public: | ||
171 | explicit OROPage(ORODocument * doc = nullptr); | 170 | explicit OROPage(ORODocument * doc = nullptr); | ||
172 | ~OROPage(); | 171 | ~OROPage(); | ||
173 | 172 | | |||
174 | ORODocument* document(); | 173 | ORODocument* document(); | ||
175 | const ORODocument* document() const; | 174 | const ORODocument* document() const; | ||
Show All 9 Lines | |||||
185 | void insertPrimitive(OROPrimitive* primitive, int index = -1); | 184 | void insertPrimitive(OROPrimitive* primitive, int index = -1); | ||
186 | void removePrimitive(OROPrimitive *primitive); | 185 | void removePrimitive(OROPrimitive *primitive); | ||
187 | void takePrimitive(OROPrimitive *primitive); | 186 | void takePrimitive(OROPrimitive *primitive); | ||
188 | 187 | | |||
189 | private: | 188 | private: | ||
190 | class Private; | 189 | class Private; | ||
191 | Private * const d; | 190 | Private * const d; | ||
192 | }; | 191 | }; | ||
193 | // | 192 | | ||
194 | // OROSection | 193 | /*! | ||
195 | // This object is a single row in a document and may contain zero or more | 194 | * @brief Represents a single a single row in a document and may contain zero or more | ||
196 | // OROPrimitives | 195 | * OROPrimitives | ||
197 | // | 196 | */ | ||
198 | class KREPORT_EXPORT OROSection | 197 | class KREPORT_EXPORT OROSection | ||
199 | { | 198 | { | ||
200 | public: | 199 | public: | ||
201 | explicit OROSection(ORODocument* doc = nullptr); | 200 | explicit OROSection(ORODocument* doc = nullptr); | ||
202 | ~OROSection(); | 201 | ~OROSection(); | ||
203 | 202 | | |||
204 | void setHeight(int); | 203 | void setHeight(int); | ||
205 | int height() const; | 204 | int height() const; | ||
Show All 15 Lines | |||||
221 | void sortPrimitives(Qt::Orientation orientation); | 220 | void sortPrimitives(Qt::Orientation orientation); | ||
222 | 221 | | |||
223 | private: | 222 | private: | ||
224 | class Private; | 223 | class Private; | ||
225 | Private * const d; | 224 | Private * const d; | ||
226 | }; | 225 | }; | ||
227 | 226 | | |||
228 | 227 | | |||
229 | // | 228 | /*! | ||
230 | // OROPrimitive | 229 | * @brief Represents the basic primitive with a position and type. | ||
231 | // This object represents the basic primitive with a position and type. | 230 | * Other primitives are subclasses with a defined type and any additional | ||
232 | // Other primitives are subclasses with a defined type and any additional | 231 | * information they require to define that primitive. | ||
233 | // information they require to define that primitive. | 232 | */ | ||
234 | // | | |||
235 | class KREPORT_EXPORT OROPrimitive | 233 | class KREPORT_EXPORT OROPrimitive | ||
236 | { | 234 | { | ||
237 | public: | 235 | public: | ||
238 | virtual ~OROPrimitive(); | 236 | virtual ~OROPrimitive(); | ||
239 | 237 | | |||
240 | OROPage* page(); | 238 | OROPage* page(); | ||
241 | const OROPage* page() const; | 239 | const OROPage* page() const; | ||
242 | void setPage(OROPage *page); | 240 | void setPage(OROPage *page); | ||
Show All 9 Lines | |||||
252 | protected: | 250 | protected: | ||
253 | OROPrimitive(); | 251 | OROPrimitive(); | ||
254 | 252 | | |||
255 | private: | 253 | private: | ||
256 | class Private; | 254 | class Private; | ||
257 | Private * const d; | 255 | Private * const d; | ||
258 | }; | 256 | }; | ||
259 | 257 | | |||
260 | // | 258 | /*! | ||
261 | // OROTextBox | 259 | * @brief A text box primitive it defines a box region and text that will | ||
262 | // This is a text box primitive it defines a box region and text that will | 260 | * be rendered inside that region, it also contains information for font | ||
263 | // be rendered inside that region. It also contains information for font | 261 | * and positioning of the text. | ||
264 | // and positioning of the text. | 262 | */ | ||
265 | // | | |||
266 | class KREPORT_EXPORT OROTextBox : public OROPrimitive | 263 | class KREPORT_EXPORT OROTextBox : public OROPrimitive | ||
267 | { | 264 | { | ||
268 | public: | 265 | public: | ||
269 | OROTextBox(); | 266 | OROTextBox(); | ||
270 | ~OROTextBox() override; | 267 | ~OROTextBox() override; | ||
271 | 268 | | |||
272 | QString text() const; | 269 | QString text() const; | ||
273 | void setText(const QString &text); | 270 | void setText(const QString &text); | ||
Show All 20 Lines | |||||
294 | bool canGrow() const; | 291 | bool canGrow() const; | ||
295 | void setCanGrow(bool grow); | 292 | void setCanGrow(bool grow); | ||
296 | 293 | | |||
297 | private: | 294 | private: | ||
298 | class Private; | 295 | class Private; | ||
299 | Private * const d; | 296 | Private * const d; | ||
300 | }; | 297 | }; | ||
301 | 298 | | |||
302 | // | 299 | /*! | ||
303 | // OROLine | 300 | * @brief Defines a line with a width/weight. | ||
304 | // This primitive defines a line with a width/weight. | 301 | */ | ||
305 | // | | |||
306 | class KREPORT_EXPORT OROLine : public OROPrimitive | 302 | class KREPORT_EXPORT OROLine : public OROPrimitive | ||
307 | { | 303 | { | ||
308 | public: | 304 | public: | ||
309 | OROLine(); | 305 | OROLine(); | ||
310 | ~OROLine() override; | 306 | ~OROLine() override; | ||
311 | 307 | | |||
312 | QPointF startPoint() const { | 308 | QPointF startPoint() const { | ||
313 | return position(); | 309 | return position(); | ||
314 | }; | 310 | }; | ||
315 | void setStartPoint(const QPointF &start); | 311 | void setStartPoint(const QPointF &start); | ||
316 | 312 | | |||
317 | QPointF endPoint() const; | 313 | QPointF endPoint() const; | ||
318 | void setEndPoint(const QPointF &end); | 314 | void setEndPoint(const QPointF &end); | ||
319 | 315 | | |||
320 | KReportLineStyle lineStyle() const; | 316 | KReportLineStyle lineStyle() const; | ||
321 | void setLineStyle(const KReportLineStyle& style); | 317 | void setLineStyle(const KReportLineStyle& style); | ||
322 | 318 | | |||
323 | OROPrimitive* clone() const override; | 319 | OROPrimitive* clone() const override; | ||
324 | 320 | | |||
325 | private: | 321 | private: | ||
326 | class Private; | 322 | class Private; | ||
327 | Private * const d; | 323 | Private * const d; | ||
328 | }; | 324 | }; | ||
329 | 325 | | |||
330 | // | 326 | /*! | ||
331 | // OROImage | 327 | * @brief Defines an image. | ||
332 | // This primitive defines an image | 328 | * An image is a bitmap. | ||
333 | // | 329 | */ | ||
334 | class KREPORT_EXPORT OROImage: public OROPrimitive | 330 | class KREPORT_EXPORT OROImage: public OROPrimitive | ||
335 | { | 331 | { | ||
336 | public: | 332 | public: | ||
337 | OROImage(); | 333 | OROImage(); | ||
338 | ~OROImage() override; | 334 | ~OROImage() override; | ||
339 | 335 | | |||
340 | QImage image() const; | 336 | QImage image() const; | ||
341 | void setImage(const QImage &img); | 337 | void setImage(const QImage &img); | ||
Show All 9 Lines | |||||
351 | 347 | | |||
352 | OROPrimitive* clone() const override; | 348 | OROPrimitive* clone() const override; | ||
353 | 349 | | |||
354 | private: | 350 | private: | ||
355 | class Private; | 351 | class Private; | ||
356 | Private * const d; | 352 | Private * const d; | ||
357 | }; | 353 | }; | ||
358 | 354 | | |||
359 | // | 355 | /*! | ||
360 | // OROPicture | 356 | * @brief Defines a picture. | ||
361 | // This primitive defines a picture | 357 | * A picture is different to an image, in that it is drawn using commands. | ||
362 | // | 358 | */ | ||
363 | class KREPORT_EXPORT OROPicture: public OROPrimitive | 359 | class KREPORT_EXPORT OROPicture: public OROPrimitive | ||
364 | { | 360 | { | ||
365 | public: | 361 | public: | ||
366 | OROPicture(); | 362 | OROPicture(); | ||
367 | ~OROPicture() override; | 363 | ~OROPicture() override; | ||
368 | 364 | | |||
369 | void setPicture(const QPicture& pic); | 365 | void setPicture(const QPicture& pic); | ||
370 | QPicture* picture(); | 366 | QPicture* picture(); | ||
371 | 367 | | |||
372 | OROPrimitive* clone() const override; | 368 | OROPrimitive* clone() const override; | ||
373 | 369 | | |||
374 | private: | 370 | private: | ||
375 | class Private; | 371 | class Private; | ||
376 | Private * const d; | 372 | Private * const d; | ||
377 | 373 | | |||
378 | }; | 374 | }; | ||
379 | // | 375 | | ||
380 | // ORORect | 376 | /*! | ||
381 | // This primitive defines a drawn rectangle | 377 | * @brief Defines a rectangle. | ||
382 | // | 378 | */ | ||
383 | class KREPORT_EXPORT ORORect: public OROPrimitive | 379 | class KREPORT_EXPORT ORORect: public OROPrimitive | ||
384 | { | 380 | { | ||
385 | public: | 381 | public: | ||
386 | ORORect(); | 382 | ORORect(); | ||
387 | ~ORORect() override; | 383 | ~ORORect() override; | ||
388 | 384 | | |||
389 | QRectF rect() const; | 385 | QRectF rect() const; | ||
390 | void setRect(const QRectF &rectangle); | 386 | void setRect(const QRectF &rectangle); | ||
391 | 387 | | |||
392 | QPen pen() const; | 388 | QPen pen() const; | ||
393 | void setPen(const QPen &pen); | 389 | void setPen(const QPen &pen); | ||
394 | 390 | | |||
395 | QBrush brush() const; | 391 | QBrush brush() const; | ||
396 | void setBrush(const QBrush &brush); | 392 | void setBrush(const QBrush &brush); | ||
397 | 393 | | |||
398 | OROPrimitive* clone() const override; | 394 | OROPrimitive* clone() const override; | ||
399 | 395 | | |||
400 | private: | 396 | private: | ||
401 | class Private; | 397 | class Private; | ||
402 | Private * const d; | 398 | Private * const d; | ||
403 | }; | 399 | }; | ||
404 | 400 | | |||
405 | // | 401 | /*! | ||
406 | // ORORect | 402 | * @brief Defines an ellipse. | ||
407 | // This primitive defines a drawn rectangle | 403 | */ | ||
408 | // | | |||
409 | class KREPORT_EXPORT OROEllipse: public OROPrimitive | 404 | class KREPORT_EXPORT OROEllipse: public OROPrimitive | ||
410 | { | 405 | { | ||
411 | public: | 406 | public: | ||
412 | OROEllipse(); | 407 | OROEllipse(); | ||
413 | ~OROEllipse() override; | 408 | ~OROEllipse() override; | ||
414 | 409 | | |||
415 | QRectF rect() const; | 410 | QRectF rect() const; | ||
416 | void setRect(const QRectF &rectangle); | 411 | void setRect(const QRectF &rectangle); | ||
417 | 412 | | |||
418 | QPen pen() const; | 413 | QPen pen() const; | ||
419 | void setPen(const QPen &pen); | 414 | void setPen(const QPen &pen); | ||
420 | 415 | | |||
421 | QBrush brush() const; | 416 | QBrush brush() const; | ||
422 | void setBrush(const QBrush &brush); | 417 | void setBrush(const QBrush &brush); | ||
423 | 418 | | |||
424 | OROPrimitive* clone() const override; | 419 | OROPrimitive* clone() const override; | ||
425 | 420 | | |||
426 | private: | 421 | private: | ||
427 | class Private; | 422 | class Private; | ||
428 | Private * const d; | 423 | Private * const d; | ||
429 | }; | 424 | }; | ||
430 | 425 | | |||
426 | /*! | ||||
427 | * @brief Defines checkbox. | ||||
428 | */ | ||||
431 | class KREPORT_EXPORT OROCheckBox : public OROPrimitive | 429 | class KREPORT_EXPORT OROCheckBox : public OROPrimitive | ||
432 | { | 430 | { | ||
433 | public: | 431 | public: | ||
434 | enum class Type { | 432 | enum class Type { | ||
435 | Cross, | 433 | Cross, | ||
436 | Tick, | 434 | Tick, | ||
437 | Dot | 435 | Dot | ||
438 | }; | 436 | }; | ||
Show All 24 Lines |