KReport

KReportScriptText.h
1 /* This file is part of the KDE project
2  * Copyright (C) 2007-2008 by Adam Pigg ([email protected])
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 #ifndef SCRIPTINGKRSCRIPTTEXT_H
18 #define SCRIPTINGKRSCRIPTTEXT_H
19 
20 #include <QObject>
21 
22 #include "KReportItemText.h"
23 
24 namespace Scripting
25 {
26 
27 /**
28 @brief Text item script interface
29 
30 The user facing interface for scripting report text items
31 */
32 class Text : public QObject
33 {
34  Q_OBJECT
35 public:
36  explicit Text(KReportItemText*);
37 
38  ~Text() override;
39 public Q_SLOTS:
40 
41  //! @return the data source for the text element
42  //! The source can be a column name or a valid script expression if prefixed with a '='.
43  QString source() const;
44 
45  //! Sets the data source for the text element.
46  //! @see source()
47  void setSource(const QString &s);
48 
49  //! @return the horizontal alignment as an integer
50  //! Valid values are left: -1, center: 0, right; 1
51  int horizontalAlignment() const;
52 
53  //! Sets the horizontal alignment
54  //! Valid values for alignment are left: -1, center: 0, right; 1
55  void setHorizonalAlignment(int);
56 
57  //! @return the vertical alignment
58  //! Valid values are top: -1, middle: 0, bottom: 1
59  int verticalAlignment() const;
60 
61  //! Sets the vertical alignment
62  //! Valid values for aligmnt are top: -1, middle: 0, bottom: 1
63  void setVerticalAlignment(int);
64 
65  //! @return the background color of the lable
66  QColor backgroundColor() const;
67 
68  //! Set the background color of the text-item to the given color
69  void setBackgroundColor(const QColor&);
70 
71  //! @return the foreground (text) color of the text-item
72  QColor foregroundColor() const;
73 
74  //! Sets the foreground (text) color of the text-item to the given color
75  void setForegroundColor(const QColor&);
76 
77  //! @return the opacity of the text-item
78  int backgroundOpacity() const;
79 
80  //! Sets the background opacity of the text-item
81  //! Valid values are in the range 0-100
82  void setBackgroundOpacity(int);
83 
84  //! @return the border line color of the text-item
85  QColor lineColor() const;
86 
87  //! Sets the border line color of the text-item to the given color
88  void setLineColor(const QColor&);
89 
90  //! @return the border line weight (thickness) of the text-item
91  int lineWeight() const;
92 
93  //! Sets the border line weight (thickness) of the text-item
94  void setLineWeight(int);
95 
96  //! @return the border line style of the text-item. Values are from Qt::Penstyle range 0-5
97  int lineStyle() const;
98 
99  //! Sets the border line style of the text-item to the given style in the range 0-5
100  void setLineStyle(int);
101 
102  //! @returns the position of the text-item in points
103  QPointF position() const;
104 
105  //! Sets the position of the text-item to the given point coordinates
106  void setPosition(const QPointF&);
107 
108  //! @returns the size of the text-item in points
109  QSizeF size() const;
110 
111  //! Sets the size of the text-item to the given size in points
112  void setSize(const QSizeF&);
113 
114  //!Load the contents for the text item from the given file
115  bool loadFromFile(const QString& fileName);
116 private:
117  KReportItemText *m_text;
118 };
119 
120 }
121 
122 #endif
Q_OBJECTQ_OBJECT
int verticalAlignment() const
Q_SLOTSQ_SLOTS
void setSize(const QSizeF &)
Sets the size of the text-item to the given size in points.
void setSource(const QString &s)
Sets the data source for the text element.
void setBackgroundOpacity(int)
Sets the background opacity of the text-item Valid values are in the range 0-100.
void setHorizonalAlignment(int)
Sets the horizontal alignment Valid values for alignment are left: -1, center: 0, right; 1.
QString source() const
void setPosition(const QPointF &)
Sets the position of the text-item to the given point coordinates.
QColor backgroundColor() const
void setLineStyle(int)
Sets the border line style of the text-item to the given style in the range 0-5.
void setForegroundColor(const QColor &)
Sets the foreground (text) color of the text-item to the given color.
QPointF position() const
void setLineColor(const QColor &)
Sets the border line color of the text-item to the given color.
void setVerticalAlignment(int)
Sets the vertical alignment Valid values for aligmnt are top: -1, middle: 0, bottom: 1.
bool loadFromFile(const QString &fileName)
Load the contents for the text item from the given file.
void setLineWeight(int)
Sets the border line weight (thickness) of the text-item.
QColor foregroundColor() const
Text item script interface.
int horizontalAlignment() const
Field item script interface.
int backgroundOpacity() const
QSizeF size() const
QColor lineColor() const
void setBackgroundColor(const QColor &)
Set the background color of the text-item to the given color.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:17:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.