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