KReport

KReportScriptField.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 KRSCRIPTFIELD_H
19#define KRSCRIPTFIELD_H
20
21#include <QObject>
22
23#include "KReportItemField.h"
24
25/**
26 @brief Field item script interface
27
28 The user facing interface for scripting report field items
29 */
30namespace Scripting
31{
32/**
33 @brief Field script interface
34
35 The user facing interface for scripting report fields
36*/
37class Field : public QObject
38{
40public:
41 explicit Field(KReportItemField*);
42
43 ~Field() override;
44
45public Q_SLOTS:
46
47 //! @return the data source for the field element
48 //! The source can be a column name or a valid script expression if prefixed with a '='.
49 QString source() const;
50
51 //! Sets the data source for the field element.
52 //! @see source()
53 void setSource(const QString &s);
54
55 //! @return the horizontal alignment as an integer
56 //! Valid values are left: -1, center: 0, right; 1
57 int horizontalAlignment() const;
58
59 //! Sets the horizontal alignment
60 //! Valid values for alignment are left: -1, center: 0, right; 1
61 void setHorizonalAlignment(int);
62
63 //! @return the vertical alignment
64 //! Valid values are top: -1, middle: 0, bottom: 1
65 int verticalAlignment() const;
66
67 //! Sets the vertical alignment
68 //! Valid values for aligmnt are top: -1, middle: 0, bottom: 1
69 void setVerticalAlignment(int);
70
71 //! @return the background color of the lable
72 QColor backgroundColor() const;
73
74 //! Set the background color of the field to the given color
75 void setBackgroundColor(const QColor&);
76
77 //! @return the foreground (text) color of the field
78 QColor foregroundColor() const;
79
80 //! Sets the foreground (text) color of the field to the given color
81 void setForegroundColor(const QColor&);
82
83 //! @return the opacity of the field
84 int backgroundOpacity() const;
85
86 //! Sets the background opacity of the field
87 //! Valid values are in the range 0-100
88 void setBackgroundOpacity(int);
89
90 //! @return the border line color of the field
91 QColor lineColor() const;
92
93 //! Sets the border line color of the field to the given color
94 void setLineColor(const QColor&);
95
96 //! @return the border line weight (thickness) of the field
97 int lineWeight() const;
98
99 //! Sets the border line weight (thickness) of the field
100 void setLineWeight(int);
101
102 //! @return the border line style of the field. Values are from Qt::Penstyle range 0-5
103 int lineStyle() const;
104
105 //! Sets the border line style of the field to the given style in the range 0-5
106 void setLineStyle(int);
107
108 //! @returns the position of the field in points
109 QPointF position() const;
110
111 //! Sets the position of the field to the given point coordinates
112 void setPosition(const QPointF&);
113
114 //! @returns the size of the field in points
115 QSizeF size() const;
116
117 //! Sets the size of the field to the given size in points
118 void setSize(const QSizeF&);
119
120private:
121 KReportItemField *m_field;
122
123};
124}
125#endif
Field script interface.
int horizontalAlignment() const
void setSize(const QSizeF &)
Sets the size of the field to the given size in points.
void setPosition(const QPointF &)
Sets the position of the field to the given point coordinates.
void setBackgroundOpacity(int)
Sets the background opacity of the field Valid values are in the range 0-100.
void setLineWeight(int)
Sets the border line weight (thickness) of the field.
void setVerticalAlignment(int)
Sets the vertical alignment Valid values for aligmnt are top: -1, middle: 0, bottom: 1.
QColor backgroundColor() const
void setLineColor(const QColor &)
Sets the border line color of the field to the given color.
void setBackgroundColor(const QColor &)
Set the background color of the field to the given color.
void setHorizonalAlignment(int)
Sets the horizontal alignment Valid values for alignment are left: -1, center: 0, right; 1.
int verticalAlignment() const
QString source() const
void setLineStyle(int)
Sets the border line style of the field to the given style in the range 0-5.
void setForegroundColor(const QColor &)
Sets the foreground (text) color of the field to the given color.
QColor foregroundColor() const
void setSource(const QString &s)
Sets the data source for the field element.
QPointF position() const
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.