KReport

KReportScriptDraw.h
1/* This file is part of the KDE project
2 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef KRSCRIPTDRAW_H
19#define KRSCRIPTDRAW_H
20
21#include <QObject>
22#include <QPointF>
23
24class OROPage;
25
26/**
27 @brief Helper giving access to drawing functions
28
29 Contains methods for drawing shapes on a report page
30*/
32{
34public:
35 explicit KReportScriptDraw(QObject *parent = nullptr);
36
37 ~KReportScriptDraw() override;
38 void setPage(OROPage*);
39 void setOffset(QPointF);
40public Q_SLOTS:
41 /**
42 @brief Draw a rectangle
43 \param x X posistion
44 \param y Y position
45 \param w Width
46 \param h Height
47 \param lc Line Color
48 \param fc Fill Color
49 \param lw Line Width
50 \param o Opacity (0=transparent, 100=opaque)
51 */
52 void rectangle(qreal, qreal, qreal, qreal, const QString&, const QString&, qreal, int);
53
54 /**
55 @brief Draw an ellipse
56 \param x X posistion
57 \param y Y position
58 \param w Width
59 \param h Height
60 \param lc Line Color
61 \param fc Fill Color
62 \param lw Line Width
63 \param o Opacity (0=transparent, 100=opaque)
64 */
65 void ellipse(qreal, qreal, qreal, qreal, const QString&, const QString&, qreal, int);
66
67 /**
68 @brief Draw a line
69 \param x1 Start X position
70 \param y1 Start Y Position
71 \param x2 End X position
72 \param y2 End Y position
73 \param lc Line Color
74 */
75 void line(qreal, qreal, qreal, qreal, const QString&);
76
77 /**
78 @brief Draw some text
79 \param x X Position
80 \param y Y Position
81 \param txt The text
82 \param fnt The font
83 \param pt Point size
84 \param fc Foreground color
85 \param bc Background color
86 \param lc Line color
87 \param lw Line width
88 \param o Opacity (0=transparent, 100=opaque)
89 */
90 void text(qreal, qreal, const QString &, const QString &fnt = QLatin1String("Helvetica"),
91 int pt = 12, const QString &fc = QLatin1String("#000000"), const QString &bc = QLatin1String("#ffffff"),
92 const QString &lc = QLatin1String("#ffffff"), qreal lw = 0, int o = 0);
93private:
94 OROPage *m_curPage;
95 QPointF m_curOffset;
96
97};
98
99#endif
Helper giving access to drawing functions.
void rectangle(qreal, qreal, qreal, qreal, const QString &, const QString &, qreal, int)
Draw a rectangle.
void ellipse(qreal, qreal, qreal, qreal, const QString &, const QString &, qreal, int)
Draw an ellipse.
void text(qreal, qreal, const QString &, const QString &fnt=QLatin1String("Helvetica"), int pt=12, const QString &fc=QLatin1String("#000000"), const QString &bc=QLatin1String("#ffffff"), const QString &lc=QLatin1String("#ffffff"), qreal lw=0, int o=0)
Draw some text.
void line(qreal, qreal, qreal, qreal, const QString &)
Draw a line.
Represents a single page in a document and may contain zero or more OROPrimitive objects all of which...
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:50:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.