KReport

KReportScriptLabel.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 KRSCRIPTLABEL_H
19#define KRSCRIPTLABEL_H
20
21#include <QObject>
22
23#include "KReportItemLabel.h"
24
25/**
26 @brief Label item script interface
27
28 The user facing interface for scripting report label items
29 */
30namespace Scripting
31{
32class Label : public QObject
33{
35public:
36 explicit Label(KReportItemLabel *);
37
38 ~Label() override;
39
40public Q_SLOTS:
41 //!Return the label caption
42 QString caption() const;
43 //!Sets the label caption
44 void setCaption(const QString&);
45
46 //! @return the horizontal alignment as an integer
47 //! Valid values are left: -1, center: 0, right; 1
48 int horizontalAlignment() const;
49
50 //! Sets the horizontal alignment
51 //! Valid values for alignment are left: -1, center: 0, right; 1
52 void setHorizonalAlignment(int);
53
54 //! @return the vertical alignment
55 //! Valid values are top: -1, middle: 0, bottom: 1
56 int verticalAlignment() const;
57
58 //! Sets the vertical alignment
59 //! Valid values for aligmnt are top: -1, middle: 0, bottom: 1
60 void setVerticalAlignment(int);
61
62 //! @return the background color of the lable
63 QColor backgroundColor() const;
64
65 //! Set the background color of the label to the given color
66 void setBackgroundColor(const QColor&);
67
68 //! @return the foreground (text) color of the label
69 QColor foregroundColor() const;
70
71 //! Sets the foreground (text) color of the label to the given color
72 void setForegroundColor(const QColor&);
73
74 //! @return the opacity of the label
75 int backgroundOpacity() const;
76
77 //! Sets the background opacity of the label
78 //! Valid values are in the range 0-100
79 void setBackgroundOpacity(int);
80
81 //! @return the border line color of the label
82 QColor lineColor() const;
83
84 //! Sets the border line color of the label to the given color
85 void setLineColor(const QColor&);
86
87 //! @return the border line weight (thickness) of the label
88 int lineWeight() const;
89
90 //! Sets the border line weight (thickness) of the label
91 void setLineWeight(int);
92
93 //! @return the border line style of the label. Values are from Qt::Penstyle range 0-5
94 int lineStyle() const;
95
96 //! Sets the border line style of the label to the given style in the range 0-5
97 void setLineStyle(int);
98
99 //! @returns the position of the label in points
100 QPointF position() const;
101
102 //! Sets the position of the label to the given point coordinates
103 void setPosition(const QPointF&);
104
105 //! @returns the size of the label in points
106 QSizeF size() const;
107
108 //! Sets the size of the label to the given size in points
109 void setSize(const QSizeF&);
110
111private:
112 KReportItemLabel *m_label;
113};
114}
115
116#endif
Field item script interface.
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.