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