|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/qgsconditionalstyle.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
1 | 12 | typedef QList<QgsConditionalStyle> QgsConditionalStyles;
|
2 | 13 |
|
3 | 14 |
|
4 |
| -/** |
5 |
| - * @brief The QgsConditionalLayerStyles class holds conditional style information |
6 |
| - * for a layer. This includes field styles and full row styles. |
7 |
| - */ |
8 | 15 | class QgsConditionalLayerStyles
|
9 | 16 | {
|
| 17 | +%Docstring |
| 18 | + The QgsConditionalLayerStyles class holds conditional style information |
| 19 | + for a layer. This includes field styles and full row styles. |
| 20 | +%End |
| 21 | + |
10 | 22 | %TypeHeaderCode
|
11 |
| -#include <qgsconditionalstyle.h> |
| 23 | +#include "qgsconditionalstyle.h" |
12 | 24 | %End
|
13 | 25 | public:
|
14 | 26 | QgsConditionalLayerStyles();
|
15 | 27 |
|
16 | 28 | QList<QgsConditionalStyle> rowStyles();
|
17 | 29 |
|
18 |
| - /** |
19 |
| - * @brief Set the conditional styles that apply to full rows of data in the attribute table. |
20 |
| - * Each row will check be checked against each rule. |
21 |
| - * @param styles The styles to assign to all the rows |
22 |
| - * @note added in QGIS 2.12 |
23 |
| - */ |
24 |
| - void setRowStyles( const QList<QgsConditionalStyle>& styles ); |
25 |
| - |
26 |
| - /** |
27 |
| - * @brief Set the conditional styles for the field UI properties. |
28 |
| - * @param fieldName name of field |
29 |
| - * @param styles |
30 |
| - */ |
31 |
| - void setFieldStyles( const QString& fieldName, const QList<QgsConditionalStyle>& styles ); |
32 |
| - |
33 |
| - /** |
34 |
| - * @brief Returns the conditional styles set for the field UI properties |
35 |
| - * @return A list of conditional styles that have been set. |
36 |
| - */ |
37 |
| - QList<QgsConditionalStyle> fieldStyles( const QString& fieldName ); |
38 |
| - |
39 |
| - /** Reads field ui properties specific state from Dom node. |
40 |
| - */ |
41 |
| - bool readXml( const QDomNode& node ); |
42 |
| - |
43 |
| - /** Write field ui properties specific state from Dom node. |
44 |
| - */ |
45 |
| - bool writeXml( QDomNode & node, QDomDocument & doc ) const; |
| 30 | + void setRowStyles( const QList<QgsConditionalStyle> &styles ); |
| 31 | +%Docstring |
| 32 | + Set the conditional styles that apply to full rows of data in the attribute table. |
| 33 | + Each row will check be checked against each rule. |
| 34 | + @param styles The styles to assign to all the rows |
| 35 | +.. versionadded:: 2.12 |
| 36 | +%End |
| 37 | + |
| 38 | + void setFieldStyles( const QString &fieldName, const QList<QgsConditionalStyle> &styles ); |
| 39 | +%Docstring |
| 40 | + Set the conditional styles for the field UI properties. |
| 41 | + @param fieldName name of field |
| 42 | + @param styles |
| 43 | +%End |
| 44 | + |
| 45 | + QList<QgsConditionalStyle> fieldStyles( const QString &fieldName ); |
| 46 | +%Docstring |
| 47 | + Returns the conditional styles set for the field UI properties |
| 48 | + @return A list of conditional styles that have been set. |
| 49 | +%End |
| 50 | + |
| 51 | + bool readXml( const QDomNode &node ); |
| 52 | +%Docstring |
| 53 | + Reads field ui properties specific state from Dom node. |
| 54 | +%End |
| 55 | + |
| 56 | + bool writeXml( QDomNode &node, QDomDocument &doc ) const; |
| 57 | +%Docstring |
| 58 | + Write field ui properties specific state from Dom node. |
| 59 | +%End |
| 60 | + |
46 | 61 | };
|
47 | 62 |
|
48 |
| -/** \class QgsConditionalStyle |
49 |
| - * \ingroup core |
50 |
| - * Conditional styling for a rule. |
51 |
| - */ |
52 | 63 | class QgsConditionalStyle
|
53 | 64 | {
|
| 65 | +%Docstring |
| 66 | + Conditional styling for a rule. |
| 67 | +%End |
| 68 | + |
54 | 69 | %TypeHeaderCode
|
55 |
| -#include <qgsconditionalstyle.h> |
| 70 | +#include "qgsconditionalstyle.h" |
56 | 71 | %End
|
57 | 72 | public:
|
58 | 73 | QgsConditionalStyle();
|
59 |
| - QgsConditionalStyle( const QgsConditionalStyle& other ); |
60 |
| - QgsConditionalStyle( const QString& rule ); |
61 |
| - ~QgsConditionalStyle(); |
62 |
| - |
63 |
| - /** |
64 |
| - * @brief Check if the rule matches using the given value and feature |
65 |
| - * @param value The current value being checked. The "value" variable from the context is replaced with this value. |
66 |
| - * @param context Expression context for evaluating rule expression |
67 |
| - * @return True of the rule matches against the given feature |
68 |
| - */ |
69 |
| - bool matches( const QVariant& value, QgsExpressionContext& context ) const; |
70 |
| - |
71 |
| - /** |
72 |
| - * @brief Render a preview icon of the rule. |
73 |
| - * @return QPixmap preview of the style |
74 |
| - */ |
| 74 | + QgsConditionalStyle( const QgsConditionalStyle &other ); |
| 75 | + QgsConditionalStyle( const QString &rule ); |
| 76 | + |
| 77 | +// QgsConditionalStyle &operator=( const QgsConditionalStyle &other ); |
| 78 | + |
| 79 | + bool matches( const QVariant &value, QgsExpressionContext &context ) const; |
| 80 | +%Docstring |
| 81 | + Check if the rule matches using the given value and feature |
| 82 | + @param value The current value being checked. The "value" variable from the context is replaced with this value. |
| 83 | + @param context Expression context for evaluating rule expression |
| 84 | + @return True of the rule matches against the given feature |
| 85 | +%End |
| 86 | + |
75 | 87 | QPixmap renderPreview() const;
|
| 88 | +%Docstring |
| 89 | + Render a preview icon of the rule. |
| 90 | + @return QPixmap preview of the style |
| 91 | +%End |
| 92 | + |
| 93 | + void setName( const QString &value ); |
| 94 | +%Docstring |
| 95 | + Set the name of the style. Names are optional but handy for display |
| 96 | + @param value The name given to the style |
| 97 | +%End |
| 98 | + |
| 99 | + void setRule( const QString &value ); |
| 100 | +%Docstring |
| 101 | + Set the rule for the style. Rules should be of QgsExpression syntax. |
| 102 | + Special value of \@value is replaced at run time with the check value |
| 103 | + @param value The QgsExpression style rule to use for this style |
| 104 | +%End |
| 105 | + |
| 106 | + void setBackgroundColor( const QColor &value ); |
| 107 | +%Docstring |
| 108 | + Set the background color for the style |
| 109 | + @param value QColor for background color |
| 110 | +%End |
| 111 | + |
| 112 | + void setTextColor( const QColor &value ); |
| 113 | +%Docstring |
| 114 | + Set the text color for the style |
| 115 | + @param value QColor for text color |
| 116 | +%End |
| 117 | + |
| 118 | + void setFont( const QFont &value ); |
| 119 | +%Docstring |
| 120 | + Set the font for the the style |
| 121 | + @param value QFont to be used for text |
| 122 | +%End |
| 123 | + |
| 124 | + void setSymbol( QgsSymbol *value ); |
| 125 | +%Docstring |
| 126 | + Set the icon for the style. Icons are generated from symbols |
| 127 | + @param value QgsSymbol to be used when generating the icon |
| 128 | +%End |
76 | 129 |
|
77 |
| - /** |
78 |
| - * @brief Set the name of the style. Names are optional but handy for display |
79 |
| - * @param value The name given to the style |
80 |
| - */ |
81 |
| - void setName( const QString& value ); |
82 |
| - |
83 |
| - /** |
84 |
| - * @brief Set the rule for the style. Rules should be of QgsExpression syntax. |
85 |
| - * Special value of \@value is replaced at run time with the check value |
86 |
| - * @param value The QgsExpression style rule to use for this style |
87 |
| - */ |
88 |
| - void setRule( const QString& value ); |
89 |
| - |
90 |
| - /** |
91 |
| - * @brief Set the background color for the style |
92 |
| - * @param value QColor for background color |
93 |
| - */ |
94 |
| - void setBackgroundColor( const QColor& value ); |
95 |
| - |
96 |
| - /** |
97 |
| - * @brief Set the text color for the style |
98 |
| - * @param value QColor for text color |
99 |
| - */ |
100 |
| - void setTextColor( const QColor& value ); |
101 |
| - |
102 |
| - /** |
103 |
| - * @brief Set the font for the the style |
104 |
| - * @param value QFont to be used for text |
105 |
| - */ |
106 |
| - void setFont( const QFont& value ); |
107 |
| - |
108 |
| - /** |
109 |
| - * @brief Set the icon for the style. Icons are generated from symbols |
110 |
| - * @param value QgsSymbol to be used when generating the icon |
111 |
| - */ |
112 |
| - void setSymbol( QgsSymbol* value ); |
113 |
| - |
114 |
| - /** |
115 |
| - * @brief The name of the style. |
116 |
| - * @return The name of the style. Names are optional so might be empty. |
117 |
| - */ |
118 | 130 | QString displayText() const;
|
| 131 | +%Docstring |
| 132 | + The name of the style. |
| 133 | + @return The name of the style. Names are optional so might be empty. |
| 134 | +%End |
119 | 135 |
|
120 |
| - /** |
121 |
| - * @brief The name of the style. |
122 |
| - * @return The name of the style. Names are optional so might be empty. |
123 |
| - */ |
124 | 136 | QString name() const;
|
| 137 | +%Docstring |
| 138 | + The name of the style. |
| 139 | + @return The name of the style. Names are optional so might be empty. |
| 140 | +%End |
125 | 141 |
|
126 |
| - /** |
127 |
| - * @brief The icon set for style generated from the set symbol |
128 |
| - * @return A QPixmap that was set for the icon using the symbol |
129 |
| - */ |
130 | 142 | QPixmap icon() const;
|
| 143 | +%Docstring |
| 144 | + The icon set for style generated from the set symbol |
| 145 | + @return A QPixmap that was set for the icon using the symbol |
| 146 | +%End |
131 | 147 |
|
132 |
| - /** |
133 |
| - * @brief The symbol used to generate the icon for the style |
134 |
| - * @return The QgsSymbol used for the icon |
135 |
| - */ |
136 |
| - QgsSymbol* symbol() const; |
| 148 | + QgsSymbol *symbol() const; |
| 149 | +%Docstring |
| 150 | + The symbol used to generate the icon for the style |
| 151 | + @return The QgsSymbol used for the icon |
| 152 | +%End |
137 | 153 |
|
138 |
| - /** |
139 |
| - * @brief The text color set for style |
140 |
| - * @return QColor for text color |
141 |
| - */ |
142 | 154 | QColor textColor() const;
|
| 155 | +%Docstring |
| 156 | + The text color set for style |
| 157 | + @return QColor for text color |
| 158 | +%End |
143 | 159 |
|
144 |
| - /** |
145 |
| - * @brief Check if the text color is valid for render. |
146 |
| - * Valid colors are non invalid QColors and a color with a > 0 alpha |
147 |
| - * @return True of the color set for text is valid. |
148 |
| - */ |
149 | 160 | bool validTextColor() const;
|
| 161 | +%Docstring |
| 162 | + Check if the text color is valid for render. |
| 163 | + Valid colors are non invalid QColors and a color with a > 0 alpha |
| 164 | + @return True of the color set for text is valid. |
| 165 | +%End |
150 | 166 |
|
151 |
| - /** |
152 |
| - * @brief The background color for style |
153 |
| - * @return QColor for background color |
154 |
| - */ |
155 | 167 | QColor backgroundColor() const;
|
| 168 | +%Docstring |
| 169 | + The background color for style |
| 170 | + @return QColor for background color |
| 171 | +%End |
156 | 172 |
|
157 |
| - /** |
158 |
| - * @brief Check if the background color is valid for render. |
159 |
| - * Valid colors are non invalid QColors and a color with a > 0 alpha |
160 |
| - * @return True of the color set for background is valid. |
161 |
| - */ |
162 | 173 | bool validBackgroundColor() const;
|
163 |
| - /** |
164 |
| - * @brief The font for the style |
165 |
| - * @return QFont for the style |
166 |
| - */ |
| 174 | +%Docstring |
| 175 | + Check if the background color is valid for render. |
| 176 | + Valid colors are non invalid QColors and a color with a > 0 alpha |
| 177 | + @return True of the color set for background is valid. |
| 178 | +%End |
| 179 | + |
167 | 180 | QFont font() const;
|
| 181 | +%Docstring |
| 182 | + The font for the style |
| 183 | + @return QFont for the style |
| 184 | +%End |
168 | 185 |
|
169 |
| - /** |
170 |
| - * @brief The condition rule set for the style. Rule may contain variable \@value |
171 |
| - * to represent the current value |
172 |
| - * @return QString of the current set rule |
173 |
| - */ |
174 | 186 | QString rule() const;
|
| 187 | +%Docstring |
| 188 | + The condition rule set for the style. Rule may contain variable \@value |
| 189 | + to represent the current value |
| 190 | + @return QString of the current set rule |
| 191 | +%End |
175 | 192 |
|
176 |
| - /** |
177 |
| - * @brief isValid Check if this rule is valid. A valid rule has one or more properties |
178 |
| - * set. |
179 |
| - * @return True if the rule is valid. |
180 |
| - */ |
181 | 193 | bool isValid() const;
|
| 194 | +%Docstring |
| 195 | + isValid Check if this rule is valid. A valid rule has one or more properties |
| 196 | + set. |
| 197 | + @return True if the rule is valid. |
| 198 | +%End |
| 199 | + |
| 200 | + static QList<QgsConditionalStyle> matchingConditionalStyles( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context ); |
| 201 | +%Docstring |
| 202 | + Find and return the matching styles for the value and feature. |
| 203 | + If no match is found a invalid QgsConditionalStyle is return. |
| 204 | + |
| 205 | + @return A condtional style that matches the value and feature. |
| 206 | + Check with QgsConditionalStyle::isValid() |
| 207 | +%End |
| 208 | + |
| 209 | + static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context ); |
| 210 | +%Docstring |
| 211 | + Find and return the matching style for the value and feature. |
| 212 | + If no match is found a invalid QgsConditionalStyle is return. |
| 213 | + |
| 214 | + @return A condtional style that matches the value and feature. |
| 215 | + Check with QgsConditionalStyle::isValid() |
| 216 | +%End |
| 217 | + |
| 218 | + static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle> &styles ); |
| 219 | +%Docstring |
| 220 | + Compress a list of styles into a single style. This can be used to stack the elements of the |
| 221 | + styles. The font of the last style is used in the output. |
| 222 | + @param styles The list of styles to compress down |
| 223 | + @return A single style generated from joining each style property. |
| 224 | +%End |
| 225 | + |
| 226 | + bool readXml( const QDomNode &node ); |
| 227 | +%Docstring |
| 228 | + Reads vector conditional style specific state from layer Dom node. |
| 229 | +%End |
| 230 | + |
| 231 | + bool writeXml( QDomNode &node, QDomDocument &doc ) const; |
| 232 | +%Docstring |
| 233 | + Write vector conditional style specific state from layer Dom node. |
| 234 | +%End |
| 235 | + |
182 | 236 |
|
183 |
| - /** |
184 |
| - * @brief Find and return the matching styles for the value and feature. |
185 |
| - * If no match is found a invalid QgsConditionalStyle is return. |
186 |
| - * |
187 |
| - * @return A condtional style that matches the value and feature. |
188 |
| - * Check with QgsConditionalStyle::isValid() |
189 |
| - */ |
190 |
| - static QList<QgsConditionalStyle> matchingConditionalStyles( const QList<QgsConditionalStyle>& styles, const QVariant& value, QgsExpressionContext& context ); |
191 |
| - |
192 |
| - /** |
193 |
| - * @brief Find and return the matching style for the value and feature. |
194 |
| - * If no match is found a invalid QgsConditionalStyle is return. |
195 |
| - * |
196 |
| - * @return A condtional style that matches the value and feature. |
197 |
| - * Check with QgsConditionalStyle::isValid() |
198 |
| - */ |
199 |
| - static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle>& styles, const QVariant& value, QgsExpressionContext& context ); |
200 |
| - |
201 |
| - /** |
202 |
| - * @brief Compress a list of styles into a single style. This can be used to stack the elements of the |
203 |
| - * styles. The font of the last style is used in the output. |
204 |
| - * @param styles The list of styles to compress down |
205 |
| - * @return A single style generated from joining each style property. |
206 |
| - */ |
207 |
| - static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle>& styles ); |
208 |
| - |
209 |
| - /** Reads vector conditional style specific state from layer Dom node. |
210 |
| - */ |
211 |
| - bool readXml( const QDomNode& node ); |
212 |
| - |
213 |
| - /** Write vector conditional style specific state from layer Dom node. |
214 |
| - */ |
215 |
| - bool writeXml( QDomNode & node, QDomDocument & doc ) const; |
216 | 237 | };
|
| 238 | + |
| 239 | +/************************************************************************ |
| 240 | + * This file has been generated automatically from * |
| 241 | + * * |
| 242 | + * src/core/qgsconditionalstyle.h * |
| 243 | + * * |
| 244 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 245 | + ************************************************************************/ |
0 commit comments