QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsexpression_texts.cpp
Go to the documentation of this file.
1 #include "qgsexpression.h"
2 #include <QCoreApplication>
3 
4 QHash<QString, QString> QgsExpression::gFunctionHelpTexts;
5 
7 {
8  if( !gFunctionHelpTexts.isEmpty() )
9  return;
10 
11  gFunctionHelpTexts.insert( "ramp_color", QCoreApplication::translate( "function_help", "\n"
12 "<h3>ramp_color() function</h3>\n"
13 "Returns a string representing a color from a color ramp. \n"
14 "\n"
15 "<p><h4>Syntax</h4>\n"
16 " ramp_color(<i>ramp_name,value</i>)</p>\n"
17 "\n"
18 "<p><h4>Arguments</h4>\n"
19 "<!-- List args for functions here-->\n"
20 "<i> ramp_name</i> &rarr; the name of the color ramp as a string, for example 'Spectral'.<br>\n"
21 "<i> value</i> &rarr; the position on the ramp to select the color from as a real number between 0 and 1.<br>\n"
22 "\n"
23 "<p><h4>Example</h4>\n"
24 "<!-- Show example of function.-->\n"
25 " ramp_color('Spectral',0.3) &rarr; '#fdbe73'</p>\n"
26 "\n"
27 "<p><h4>Note:</h4>\n"
28 "The color ramps available vary between QGIS installations. This function\n"
29 "may not give the expected results if you move your Quantum project.\n"
30 "</p>\n"
31 "") );
32  gFunctionHelpTexts.insert( "rand", QCoreApplication::translate( "function_help", "<h3>rand() function</h3>\n"
33 "Returns a random integer within the range specified by the minimum and \n"
34 "maximum argument (inclusive).\n"
35 "<br>\n"
36 "This function takes two arguments.\n"
37 "<h4>Syntax</h4>\n"
38 "<code>rand(min, max)</code><br>\n"
39 "\n"
40 "<h4>Arguments</h4>\n"
41 "<code>min</code> - an integer representing the smallest possible random number desired.<br>\n"
42 "<code>max</code> - an integer representing the largest possible random number desired.\n"
43 "<br>\n"
44 "\n"
45 "<h4>Example</h4>\n"
46 "<!-- Show example of function.-->\n"
47 "<code>rand(1, 10) &rarr; 8</code><br>\n"
48 "") );
49  gFunctionHelpTexts.insert( "within", QCoreApplication::translate( "function_help", "<h3>within function</h3>\n"
50 "Returns 1 if the geometry a is completely inside geometry b\n"
51 "\n"
52 "<h4>Syntax</h4>\n"
53 "<pre>within( geometry a , geometry b)</pre>\n"
54 "\n"
55 "<h4>Arguments</h4>\n"
56 "geometry &rarr; geometry\n"
57 "geometry &rarr; geometry\n"
58 "\n"
59 "<h4>Example</h4>\n"
60 "<pre> within( geomFromWKT( 'POINT( 0.5 0.5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) &rarr; returns 1</pre>\n"
61 "<pre> within( geomFromWKT( 'POINT( 5 5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) &rarr; returns 0</pre>\n"
62 "") );
63  gFunctionHelpTexts.insert( "disjoint", QCoreApplication::translate( "function_help", "<h3>disjoint function</h3>\n"
64 "Returns 1 if the geometries do not \"spatially intersect\" - if they do not share any space together. \n"
65 "\n"
66 "<h4>Syntax</h4>\n"
67 "<pre>disjoint( a, b )</pre>\n"
68 "\n"
69 "<h4>Arguments</h4>\n"
70 "a &rarr; geometry\n"
71 "b &rarr; geometry\n"
72 "\n"
73 "<h4>Example</h4>\n"
74 "<pre> disjoint( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
75 "<pre> disjoint( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'POINT(4 4)' )) &rarr; returns 0</pre>\n"
76 "") );
77  gFunctionHelpTexts.insert( "month", QCoreApplication::translate( "function_help", "<h3>month() function</h3>\n"
78 "Extract the month part from a date, or the number of months\n"
79 "from a <code>Interval</code>\n"
80 "\n"
81 "<h4>Syntax</h4>\n"
82 "<code>month(date)</code><br>\n"
83 "<code>month(Interval)</code><br>\n"
84 "\n"
85 "<h4>Arguments</h4>\n"
86 "<code>date</code> - is date or datetime. The date to extract the month from.\n"
87 "<br>\n"
88 "<code>Interval</code> - is Interval. The Interval to return the number of months from.\n"
89 "\n"
90 "<h4>Example</h4>\n"
91 "<!-- Show example of function.-->\n"
92 "<code>month('2012-05-12') &rarr; 05</code><br>\n"
93 "<code>month(tointerval('3 months')) &rarr; 3</code><br>\n"
94 "<code>month(age('2012-01-01','2010-01-01')) &rarr; 4.033...</code><br>\n"
95 "\n"
96 "") );
97  gFunctionHelpTexts.insert( "Field", QCoreApplication::translate( "function_help", "<h3>Field</h3>\n"
98 "Double click to add field name to expression string.\n"
99 "<br><br>\n"
100 "Right-Click on field name to open context menu sample value loading options.\n"
101 "\n"
102 "<p><h4>Note:</h4>\n"
103 "Loading field values from WFS layers isn't supported, before the layer is\n"
104 "actually inserted, ie. when building queries.\n"
105 "</p>\n"
106 "") );
107  gFunctionHelpTexts.insert( "yat", QCoreApplication::translate( "function_help", "<h3>yat() function</h3>\n"
108 "Retrieves a y coordinate of the current feature\n"
109 "\n"
110 "<h4>Syntax</h4>\n"
111 "<code>yat(i)</code>\n"
112 "\n"
113 "<h4>Arguments</h4>\n"
114 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
115 "\n"
116 "<h4>Example</h4>\n"
117 "<pre>yat(1) &rarr; 5</pre>\n"
118 "") );
119  gFunctionHelpTexts.insert( "intersection", QCoreApplication::translate( "function_help", "<h3>intersection function</h3>\n"
120 "Returns a geometry that represents the shared portion of geometry a and geometry b.\n"
121 "\n"
122 "<h4>Syntax</h4>\n"
123 "<pre>intersection( geometry a , geometry b)</pre>\n"
124 "\n"
125 "<h4>Arguments</h4>\n"
126 "geometry &rarr; geometry\n"
127 "geometry &rarr; geometry\n"
128 "\n"
129 "<h4>Example</h4>\n"
130 "<pre> geomToWKT( intersection( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 )' )) ) &rarr; returns LINESTRING(3 3, 4 4)</pre>\n"
131 "") );
132  gFunctionHelpTexts.insert( "centroid", QCoreApplication::translate( "function_help", "<h3>centroid function</h3>\n"
133 "Returns the geometric center of a geometry.\n"
134 "\n"
135 "<h4>Syntax</h4>\n"
136 "<pre>centroid(a)</pre>\n"
137 "\n"
138 "<h4>Arguments</h4>\n"
139 "b &rarr; geometry\n"
140 "\n"
141 "<h4>Example</h4>\n"
142 "<pre> centroid($geometry) &rarr; returns a point geometry</pre>\n"
143 "\n"
144 "") );
145  gFunctionHelpTexts.insert( "cos", QCoreApplication::translate( "function_help", "<h3>cos() function</h3>\n"
146 "Returns cosinus of an angle.\n"
147 "\n"
148 "\n"
149 "<p><h4>Syntax</h4>\n"
150 " cos(<i>real</i>)</p>\n"
151 "\n"
152 "<p><h4>Arguments</h4>\n"
153 "<i>real</i> &rarr; angle in radians.</p>\n"
154 "\n"
155 "<p><h4>Example</h4>\n"
156 " cos(1.571) &rarr; 0.000796326710733263</p>\n"
157 "") );
158  gFunctionHelpTexts.insert( "second", QCoreApplication::translate( "function_help", "<h3>second() function</h3>\n"
159 "Extract the seconds from a datetime or time, or the number of seconds\n"
160 "from a <code>Interval</code>\n"
161 "\n"
162 "<h4>Syntax</h4>\n"
163 "<code>second(datetime)</code><br>\n"
164 "<code>second(Interval)</code><br>\n"
165 "\n"
166 "<h4>Arguments</h4>\n"
167 "<code>date</code> - is datetime or time. The date to extract the second from.\n"
168 "<br>\n"
169 "<code>Interval</code> - is Interval. The Interval to return the number of seconds from.\n"
170 "\n"
171 "<h4>Example</h4>\n"
172 "<!-- Show example of function.-->\n"
173 "<code>second('2012-07-22T13:24:57') &rarr; 57</code><br>\n"
174 "<code>second(tointerval('3 seconds')) &rarr; 3</code><br>\n"
175 "<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 1200</code><br>\n"
176 "<code>second(age('2012-01-01','2010-01-01')) &rarr; 63072000</code><br>\n"
177 "\n"
178 "") );
179  gFunctionHelpTexts.insert( "geomToWKT", QCoreApplication::translate( "function_help", "<h3>geomToWKT function</h3>\n"
180 "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata.\n"
181 "\n"
182 "<h4>Syntax</h4>\n"
183 "<pre>geomToWKT(a)</pre>\n"
184 "\n"
185 "<h4>Arguments</h4>\n"
186 "a &rarr; geometry\n"
187 "\n"
188 "<h4>Example</h4>\n"
189 "<pre> geomToWKT( $geometry ) &rarr; POINT(6 50)</pre>\n"
190 "") );
191  gFunctionHelpTexts.insert( "touches", QCoreApplication::translate( "function_help", "<h3>touches function</h3>\n"
192 "Returns 1 if the geometries have at least one point in common, but their interiors do not intersect.\n"
193 "\n"
194 "<h4>Syntax</h4>\n"
195 "<pre>touches( a, b )</pre>\n"
196 "\n"
197 "<h4>Arguments</h4>\n"
198 "a &rarr; geometry\n"
199 "b &rarr; geometry\n"
200 "\n"
201 "<h4>Example</h4>\n"
202 "<pre> touches( geomFromWKT( 'LINESTRING(5 3 , 4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
203 "<pre> touches( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) &rarr; returns 0</pre>\n"
204 "") );
205  gFunctionHelpTexts.insert( "randf", QCoreApplication::translate( "function_help", "<h3>randf() function</h3>\n"
206 "Returns a random float within the range specified by the minimum and \n"
207 "maximum argument (inclusive).\n"
208 "<br>\n"
209 "This function takes two arguments.\n"
210 "<h4>Syntax</h4>\n"
211 "<code>randf(min, max)</code><br>\n"
212 "\n"
213 "<h4>Arguments</h4>\n"
214 "<code>min</code> - a float representing the smallest possible random number desired.<br>\n"
215 "<code>max</code> - a float representing the largest possible random number desired.\n"
216 "<br>\n"
217 "\n"
218 "<h4>Example</h4>\n"
219 "<!-- Show example of function.-->\n"
220 "<code>randf(1, 10) &rarr; 4.59258286403147</code><br>\n"
221 "") );
222  gFunctionHelpTexts.insert( "abs", QCoreApplication::translate( "function_help", "<h3>abs() function</h3>\n"
223 "Returns the absolute value of a number.<br>\n"
224 "\n"
225 "\n"
226 "<h4>Syntax</h4>\n"
227 "abs(<i>value</i>)<br>\n"
228 "\n"
229 "<h4>Arguments</h4>\n"
230 "<code>value</code> - a number.<br>\n"
231 "\n"
232 "<h4>Example</h4>\n"
233 "<code>abs(-2) &rarr; 2</code><br>\n"
234 "") );
235  gFunctionHelpTexts.insert( "$numfeatures", QCoreApplication::translate( "function_help", "<h3>$numfeatures function</h3>\n"
236 "In atlas generation, returns the total number of features within the coverage layer.\n"
237 "\n"
238 "<h4>Syntax</h4>\n"
239 "<pre>$numfeatures</pre>\n"
240 "\n"
241 "<h4>Arguments</h4>\n"
242 "None\n"
243 "\n"
244 "<h4>Example</h4>\n"
245 "<pre>$numfeatures &rarr; 42</pre>\n"
246 "\n"
247 "") );
248  gFunctionHelpTexts.insert( "union", QCoreApplication::translate( "function_help", "<h3>union function</h3>\n"
249 "Returns a geometry that represents the point set union of the geometries.\n"
250 "\n"
251 "<h4>Syntax</h4>\n"
252 "<pre>union( a, b )</pre>\n"
253 "\n"
254 "<h4>Arguments</h4>\n"
255 "a &rarr; geometry\n"
256 "b &rarr; geometry\n"
257 "\n"
258 "<h4>Example</h4>\n"
259 "<pre> geomToWKT( union( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) ) &rarr; returns MULTIPOINT(4 4, 5 5)</pre>\n"
260 "") );
261  gFunctionHelpTexts.insert( "color_rgb", QCoreApplication::translate( "function_help", "\n"
262 "<h3>color_rgb() function</h3>\n"
263 "Returns a string representation of a color based on its red, green, and blue components\n"
264 "\n"
265 "<p><h4>Syntax</h4>\n"
266 " color_rgb(<i>red, green, blue</i>)</p>\n"
267 "\n"
268 "<p><h4>Arguments</h4>\n"
269 "<!-- List args for functions here-->\n"
270 "<i> red</i> &rarr; the red component as an integer value from 0 to 255.<br>\n"
271 "<i> green</i> &rarr; the green component as an integer value from 0 to 255.<br>\n"
272 "<i> blue</i> &rarr; the blue component as an integer value from 0 to 255.<br>\n"
273 "\n"
274 "<p><h4>Example</h4>\n"
275 "<!-- Show example of function.-->\n"
276 " color_rgb(255,127,0) &rarr; '#ff7f00'</p>\n"
277 "") );
278  gFunctionHelpTexts.insert( "xat", QCoreApplication::translate( "function_help", "<h3>xat() function</h3>\n"
279 "Retrieves a x coordinate of the current feature\n"
280 "\n"
281 "<h4>Syntax</h4>\n"
282 "<code>xat(i)</code>\n"
283 "\n"
284 "<h4>Arguments</h4>\n"
285 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
286 "\n"
287 "<h4>Example</h4>\n"
288 "<pre>xat(1) &rarr; 5</pre>\n"
289 "") );
290  gFunctionHelpTexts.insert( "color_hsva", QCoreApplication::translate( "function_help", "<h3>color_hsva() function</h3>\n"
291 "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes\n"
292 "\n"
293 "<p><h4>Syntax</h4>\n"
294 " color_hsva(<i>hue, saturation, value, alpha</i>)</p>\n"
295 "\n"
296 "<p><h4>Arguments</h4>\n"
297 "<!-- List args for functions here-->\n"
298 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
299 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
300 "<i> value</i> &rarr; the value percentage of the color as an integer from 0 to 100.<br>\n"
301 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
302 "\n"
303 "<p><h4>Example</h4>\n"
304 "<!-- Show example of function.-->\n"
305 " color_hsva(40,100,100,200) &rarr; '255,170,0,200'</p>\n"
306 "") );
307  gFunctionHelpTexts.insert( "$y", QCoreApplication::translate( "function_help", "<h3>$y function</h3>\n"
308 "Returns the y coordinate of the current feature.\n"
309 "\n"
310 "<h4>Syntax</h4>\n"
311 "<pre>$y</pre>\n"
312 "\n"
313 "<h4>Arguments</h4>\n"
314 "None\n"
315 "\n"
316 "<h4>Example</h4>\n"
317 "<pre>$y &rarr; 42</pre>\n"
318 "\n"
319 "") );
320  gFunctionHelpTexts.insert( "strpos", QCoreApplication::translate( "function_help", "<h3>strpos() function</h3>\n"
321 "Return the index of a regular expression in a string.\n"
322 "\n"
323 "<h4>Syntax</h4>\n"
324 " strpos(<i>haystack</i>, <i>needle</i>)\n"
325 "<br><br>\n"
326 "Returns -1 if the expression isn't found.\n"
327 "\n"
328 "<p><h4>Arguments</h4>\n"
329 "<!-- List args for functions here-->\n"
330 "<i> haystack</i> &rarr; is string. The string that is to be searched.<br>\n"
331 "<i> needle</i> &rarr; is string. The regular expression to look for.<br>\n"
332 "\n"
333 "<h4>Example</h4>\n"
334 "<!-- Show example of function.-->\n"
335 " strpos('HELLO WORLD','WORLD') &rarr; 6<br>\n"
336 " strpos('HELLO WORLD','GOODBYE') &rarr; -1<br>\n"
337 "") );
338  gFunctionHelpTexts.insert( "substr", QCoreApplication::translate( "function_help", "<h3>substr() function</h3>\n"
339 "Return a part of a string\n"
340 "\n"
341 "<p><h4>Syntax</h4>\n"
342 " substr(<i>string,startpos,length</i>)</p>\n"
343 "\n"
344 "<p><h4>Arguments</h4>\n"
345 "<!-- List args for functions here-->\n"
346 "<i> string</i> &rarr; is string. The full string.<br>\n"
347 "<i> startpos</i> &rarr; is number. The start position to extract from.<br>\n"
348 "<i> length</i> &rarr; is number. The length of the string to extract.<br></p>\n"
349 "\n"
350 "<p><h4>Example</h4>\n"
351 "<!-- Show example of function.-->\n"
352 " substr('HELLO WORLD',3,5) &rarr; 'LLO W'</p>\n"
353 "") );
354  gFunctionHelpTexts.insert( "right", QCoreApplication::translate( "function_help", "<h3>right() function</h3>\n"
355 "Returns a substring that contains the <i>n</i> rightmost characters of the string.\n"
356 "\n"
357 "<h4>Syntax</h4>\n"
358 "<code>right(string, pos)</code><br>\n"
359 "\n"
360 "<h4>Arguments</h4>\n"
361 "<code>string</code> - is string. The string.\n"
362 "<br>\n"
363 "<code>length</code> - is int. The number of characters from the right to return.\n"
364 "\n"
365 "<h4>Example</h4>\n"
366 "<!-- Show example of function.-->\n"
367 "<code>right('Hello World',5) &rarr; 'World'</code><br>\n"
368 "\n"
369 "") );
370  gFunctionHelpTexts.insert( "bbox", QCoreApplication::translate( "function_help", "<h3>bbox function</h3>\n"
371 "Returns 1 if the geometries spatially intersect the bounding box defined and 0 if they don't.\n"
372 "\n"
373 "<h4>Syntax</h4>\n"
374 "<pre>bbox( a, b )</pre>\n"
375 "\n"
376 "<h4>Arguments</h4>\n"
377 "a &rarr; geometry\n"
378 "b &rarr; geometry\n"
379 "\n"
380 "<h4>Example</h4>\n"
381 "<pre>bbox( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
382 "<pre>bbox( geomFromWKT( 'POINT(6 5)' ) , geomFromWKT( 'POLYGON((3 3 , 4 4 , 5 5, 3 3))' )) &rarr; returns 0</pre>\n"
383 "") );
384  gFunctionHelpTexts.insert( "minute", QCoreApplication::translate( "function_help", "<h3>minute() function</h3>\n"
385 "Extract the minute from a datetime or time, or the number of minutes\n"
386 "from a <code>Interval</code>\n"
387 "\n"
388 "<h4>Syntax</h4>\n"
389 "<code>minute(datetime)</code><br>\n"
390 "<code>minute(Interval)</code><br>\n"
391 "\n"
392 "<h4>Arguments</h4>\n"
393 "<code>date</code> - is datetime or time. The date to extract the minute from.\n"
394 "<br>\n"
395 "<code>Interval</code> - is Interval. The Interval to return the number of minutes from.\n"
396 "\n"
397 "<h4>Example</h4>\n"
398 "<!-- Show example of function.-->\n"
399 "<code>minute('2012-07-22T13:24:57') &rarr; 24</code><br>\n"
400 "<code>minute(tointerval('3 minutes')) &rarr; 3</code><br>\n"
401 "<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 20</code><br>\n"
402 "<code>minute(age('2012-01-01','2010-01-01')) &rarr; 1051200</code><br>\n"
403 "\n"
404 "") );
405  gFunctionHelpTexts.insert( "clamp", QCoreApplication::translate( "function_help", "<h3>clamp() function</h3>\n"
406 "Restricts an input value to a specified range.\n"
407 "\n"
408 "<p><h4>Syntax</h4>\n"
409 " clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>\n"
410 "\n"
411 "<p><h4>Arguments</h4>\n"
412 "<!-- List args for functions here-->\n"
413 "<i> minimum</i> &rarr; The smallest value <i>input</i> is allowed to take.<br>\n"
414 "<i> input</i> &rarr; a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>\n"
415 "<i> maximum</i> &rarr; The largest value <i>input</i> is allowed to take.<br>\n"
416 "\n"
417 "<h4>Example</h4>\n"
418 "<!-- Show example of function.-->\n"
419 " clamp(1,5,10) &rarr; 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>\n"
420 " clamp(1,0,10) &rarr; 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>\n"
421 " clamp(1,11,10) &rarr; 10 (<i>input</i> is greater than maximum value of 10, so function returns 10)<br>\n"
422 " \n"
423 " \n"
424 "") );
425  gFunctionHelpTexts.insert( "scale_exp", QCoreApplication::translate( "function_help", "<h3>scale_exp() function</h3>\n"
426 "Transforms a given value from an input domain to an output range using an exponential curve. This function can be used to ease values in or out \n"
427 "of the specified output range. \n"
428 "\n"
429 "<p><h4>Syntax</h4>\n"
430 " scale_exp(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>,<i>exponent</i>)</p>\n"
431 "\n"
432 "<p><h4>Arguments</h4>\n"
433 "<!-- List args for functions here-->\n"
434 "<i> val</i> &rarr; is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
435 "<i> domain_min, domain_max</i> &rarr; specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
436 "<i> range_min, range_max</i> &rarr; specify the output range, the smallest and largest values which should be output by the function.<br>\n"
437 "<i> exponent</i> &rarr; a positive value (greater than 0), which dictates the way input values are mapped to the output range. Large exponents will cause the output values to 'ease in', starting slowly before\n"
438 "accelerating as the input values approach the domain maximum. Smaller exponents (less than 1) will cause output values to 'ease out', where the mapping starts quickly but slows as it approaches the domain maximum.<br>\n"
439 "\n"
440 "<h4>Example</h4>\n"
441 "<!-- Show example of function.-->\n"
442 "<b>Easing in, using an exponent of 2:</b><br>\n"
443 " scale_exp(5,0,10,0,100,2) &rarr; 25<br>\n"
444 " scale_exp(7.5,0,10,0,100,2) &rarr; 56.25<br>\n"
445 " scale_exp(9.5,0,10,0,100,2) &rarr; 90.25<br> \n"
446 " <br>\n"
447 "<b>Easing out, using an exponent of 0.5:</b><br> \n"
448 " scale_exp(3,0,10,0,100,0.5) &rarr; 54.772<br>\n"
449 " scale_exp(6,0,10,0,100,0.5) &rarr; 77.459<br>\n"
450 " scale_exp(9,0,10,0,100,0.5) &rarr; 94.868<br> \n"
451 " \n"
452 " \n"
453 "") );
454  gFunctionHelpTexts.insert( "crosses", QCoreApplication::translate( "function_help", "<h3>crosses function</h3>\n"
455 "Returns 1 if the supplied geometries have some, but not all, interior points in common.\n"
456 "\n"
457 "<h4>Syntax</h4>\n"
458 "<pre>crosses( $geometry , $geometry)</pre>\n"
459 "\n"
460 "<h4>Arguments</h4>\n"
461 "geometry &rarr; geometry\n"
462 "geometry &rarr; geometry\n"
463 "\n"
464 "<h4>Example</h4>\n"
465 "<pre> crosses( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
466 "<pre> crosses( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>\n"
467 "") );
468  gFunctionHelpTexts.insert( "concat", QCoreApplication::translate( "function_help", "<h3>concat() function</h3>\n"
469 "Concatenates several strings to one.\n"
470 "\n"
471 "<h4>Syntax</h4>\n"
472 " concat(<i>string<i>[,<i>string</i>...])\n"
473 "\n"
474 "<h4>Arguments</h4>\n"
475 "<!-- List args for functions here-->\n"
476 "<i> string</i> &rarr; is string. a string.<br>\n"
477 "\n"
478 "<h4>Example</h4>\n"
479 "<!-- Show example of function.-->\n"
480 " concat('a','b','c','d','e') &rarr; 'abcde'\n"
481 "") );
482  gFunctionHelpTexts.insert( "length", QCoreApplication::translate( "function_help", "<h3>length() function</h3>\n"
483 "Returns the length of a string.\n"
484 "\n"
485 "<p><h4>Syntax</h4>\n"
486 " length(<i>string</i>)</p>\n"
487 "\n"
488 "<p><h4>Arguments</h4>\n"
489 "<!-- List args for functions here-->\n"
490 "<i> string</i> &rarr; is string. The String to count the length of.</p>\n"
491 "\n"
492 "<p><h4>Example</h4>\n"
493 "<!-- Show example of function.-->\n"
494 " length('HELLO') &rarr; 5</p>\n"
495 "") );
496  gFunctionHelpTexts.insert( "distance", QCoreApplication::translate( "function_help", "<h3>distance function</h3>\n"
497 " Returns the minimum distance (based on spatial ref) between two geometries in projected units.\n"
498 "\n"
499 "<h4>Syntax</h4>\n"
500 "<pre>distance( a, b )</pre>\n"
501 "\n"
502 "<h4>Arguments</h4>\n"
503 "a &rarr; geometry\n"
504 "b &rarr; geometry\n"
505 "\n"
506 "<h4>Example</h4>\n"
507 "<pre> distance( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(4 8)' )) &rarr; returns 4</pre>\n"
508 "") );
509  gFunctionHelpTexts.insert( "format", QCoreApplication::translate( "function_help", "<h3>format() function</h3>\n"
510 "Format a string using supplied arguments. \n"
511 "\n"
512 "<h4>Syntax</h4>\n"
513 "<code>format('string', arg, [arg...n])</code><br>\n"
514 "\n"
515 "<h4>Arguments</h4>\n"
516 "<code>string</code> - is string. String with Qt QString place holders. Use %1, %2, etc for placeholders. Placeholders can be repeated. \n"
517 "<br>\n"
518 "<code>arg [arg...n]</code> - any type. Any number of args. \n"
519 "\n"
520 "<h4>Example</h4>\n"
521 "<!-- Show example of function.-->\n"
522 "<code>format('This %1 a %2','is', 'test') &rarr; This is a test</code><br>") );
523  gFunctionHelpTexts.insert( "scale_linear", QCoreApplication::translate( "function_help", "<h3>scale_linear() function</h3>\n"
524 "Transforms a given value from an input domain to an output range using linear interpolation. \n"
525 "\n"
526 "<p><h4>Syntax</h4>\n"
527 " scale_linear(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>)</p>\n"
528 "\n"
529 "<p><h4>Arguments</h4>\n"
530 "<!-- List args for functions here-->\n"
531 "<i> val</i> &rarr; is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
532 "<i> domain_min, domain_max</i> &rarr; specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
533 "<i> range_min, range_max</i> &rarr; specify the output range, the smallest and largest values which should be output by the function.<br>\n"
534 "\n"
535 "<h4>Example</h4>\n"
536 "<!-- Show example of function.-->\n"
537 " scale_linear(5,0,10,0,100) &rarr; 50<br>\n"
538 " scale_linear(0.2,0,1,0,360) &rarr; 72 <i>(eg, scaling a value between 0 and 1 to an angle between 0 and 360)</i><br>\n"
539 " scale_linear(1500,1000,10000,9,20) &rarr; 10.22 <i>(eg, scaling a population which varies between 1000 and 10000 to a font size between 9 and 20)</i><br>\n"
540 " \n"
541 " \n"
542 "") );
543  gFunctionHelpTexts.insert( "symDifference", QCoreApplication::translate( "function_help", "<h3>symDifference function</h3>\n"
544 "Returns a geometry that represents the portions of a and b that do not intersect.\n"
545 "\n"
546 "<h4>Syntax</h4>\n"
547 "<pre>symDifference( geometry a, geometry b)</pre>\n"
548 "\n"
549 "<h4>Arguments</h4>\n"
550 "geometry &rarr; geometry\n"
551 "geometry &rarr; geometry\n"
552 "\n"
553 "<h4>Example</h4>\n"
554 "<pre> geomToWKT( symDifference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 8 8)' )) ) &rarr; returns LINESTRING(5 5, 8 8)</pre>\n"
555 "") );
556  gFunctionHelpTexts.insert( "min", QCoreApplication::translate( "function_help", "<h3>min() function</h3>\n"
557 "Returns the smallest value in a set of values.\n"
558 "\n"
559 "<h4>Syntax</h4>\n"
560 " min(<i>value<i>[,<i>value</i>...])\n"
561 "\n"
562 "<h4>Arguments</h4>\n"
563 "<!-- List args for functions here-->\n"
564 "<i> value</i> &rarr; a number.<br>\n"
565 "\n"
566 "<h4>Example</h4>\n"
567 "<!-- Show example of function.-->\n"
568 " min(20.5,10,6.2) &rarr; 6.2\n"
569 "") );
570  gFunctionHelpTexts.insert( "Conversions", QCoreApplication::translate( "function_help", "<h3>Conversions Group</h3>\n"
571 "This group contains functions to convert on data type to another e.g string to integer, integer to string.\n"
572 "") );
573  gFunctionHelpTexts.insert( "AND", QCoreApplication::translate( "function_help", "<h3>AND logical operator</h3>\n"
574 "Returns 1 when condition a and b are true.\n"
575 "\n"
576 "<h4>Syntax</h4>\n"
577 "<pre> condition a AND condition b </pre>\n"
578 "\n"
579 "<h4>Arguments</h4>\n"
580 "None\n"
581 "\n"
582 "<h4>Example</h4>\n"
583 "<pre> 4 = 2+2 AND 1 = 1 &rarr; returns 1 </pre>\n"
584 "<pre> 4 = 2+2 AND 1 = 2 &rarr; returns 0 </pre>\n"
585 "\n"
586 "") );
587  gFunctionHelpTexts.insert( "lower", QCoreApplication::translate( "function_help", "<h3>lower() function</h3>\n"
588 "Converts a string to lower case letters.\n"
589 "\n"
590 "<p><h4> Syntax</h4>\n"
591 " lower(<i>string</i>)</p>\n"
592 "\n"
593 "<p><h4> Arguments</h4>\n"
594 "<i> string</i> &rarr; is string. The String to convert to lower case.</p>\n"
595 "\n"
596 "<p><h4> Example</h4>\n"
597 " lower('HELLO World') &rarr; 'hello world'</p>\n"
598 "") );
599  gFunctionHelpTexts.insert( "todatetime", QCoreApplication::translate( "function_help", "<h3>todatetime() function</h3>\n"
600 "Convert a string into Qt data time type.\n"
601 "\n"
602 "<h4>Syntax</h4>\n"
603 "<code>todatetime('string')</code><br>\n"
604 "\n"
605 "<h4>Arguments</h4>\n"
606 "<code>string</code> - is string in Qt date time format.\n"
607 "<br>\n"
608 "\n"
609 "<h4>Example</h4>\n"
610 "<!-- Show example of function.-->\n"
611 "<code>todatetime('2012-05-04 12:50:00') &rarr; 2012-05-04T12:50:00</code><br>") );
612  gFunctionHelpTexts.insert( "color_rgba", QCoreApplication::translate( "function_help", "\n"
613 "<h3>color_rgba() function</h3>\n"
614 "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components\n"
615 "\n"
616 "<p><h4>Syntax</h4>\n"
617 " color_rgba(<i>red, green, blue, alpha</i>)</p>\n"
618 "\n"
619 "<p><h4>Arguments</h4>\n"
620 "<!-- List args for functions here-->\n"
621 "<i> red</i> &rarr; the red component as an integer value from 0 to 255.<br>\n"
622 "<i> green</i> &rarr; the green component as an integer value from 0 to 255.<br>\n"
623 "<i> blue</i> &rarr; the blue component as an integer value from 0 to 255.<br>\n"
624 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
625 "\n"
626 "<p><h4>Example</h4>\n"
627 "<!-- Show example of function.-->\n"
628 " color_rgba(255,127,0,200) &rarr; '255,127,0,200'</p>\n"
629 "") );
630  gFunctionHelpTexts.insert( "color_cmyk", QCoreApplication::translate( "function_help", "\n"
631 "<h3>color_cmyk() function</h3>\n"
632 "Returns a string representation of a color based on its cyan, magenta, yellow and black components\n"
633 "\n"
634 "<p><h4>Syntax</h4>\n"
635 " color_cmyk(<i>cyan, magenta, yellow, black</i>)</p>\n"
636 "\n"
637 "<p><h4>Arguments</h4>\n"
638 "<!-- List args for functions here-->\n"
639 "<i> cyan</i> &rarr; the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
640 "<i> magenta</i> &rarr; the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
641 "<i> yellow</i> &rarr; the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
642 "<i> black</i> &rarr; the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
643 "\n"
644 "<p><h4>Example</h4>\n"
645 "<!-- Show example of function.-->\n"
646 " color_cmyk(100,50,0,10) &rarr; '#0073e6'</p>\n"
647 "") );
648  gFunctionHelpTexts.insert( "Conditions", QCoreApplication::translate( "function_help", "<h3>Conditions Group</h3>\n"
649 "This group contains functions that operate on condition.\n"
650 "") );
651  gFunctionHelpTexts.insert( "floor", QCoreApplication::translate( "function_help", "<h3>floor() function</h3>\n"
652 "Rounds a number downwards.\n"
653 "\n"
654 "<h4>Syntax</h4>\n"
655 "<code>floor(value)</code><br>\n"
656 "\n"
657 "<h4>Arguments</h4>\n"
658 "<code>value</code> - a number.\n"
659 "<br>\n"
660 "\n"
661 "<h4>Example</h4>\n"
662 "<!-- Show example of function.-->\n"
663 "<code>floor(4.9) &rarr; 4</code><br>\n"
664 "<code>floor(-4.9) &rarr; -5</code><br>\n"
665 "") );
666  gFunctionHelpTexts.insert( "max", QCoreApplication::translate( "function_help", "<h3>max() function</h3>\n"
667 "Returns the largest value in a set of values.\n"
668 "\n"
669 "<h4>Syntax</h4>\n"
670 " max(<i>value<i>[,<i>value</i>...])\n"
671 "\n"
672 "<h4>Arguments</h4>\n"
673 "<!-- List args for functions here-->\n"
674 "<i> value</i> &rarr; a number.<br>\n"
675 "\n"
676 "<h4>Example</h4>\n"
677 "<!-- Show example of function.-->\n"
678 " max(2,10.2,5.5) &rarr; 10.2\n"
679 "") );
680  gFunctionHelpTexts.insert( "age", QCoreApplication::translate( "function_help", "<h3>age() function</h3>\n"
681 "Returns the difference between two dates.\n"
682 "<br><br>\n"
683 "The difference is returned as a <code>Interval</code> \n"
684 "and needs to be used with one of the following functions\n"
685 "in order to extract useful information:\n"
686 "<ul>\n"
687 "<li><code>year</code>\n"
688 "<li><code>month</code>\n"
689 "<li><code>week</code>\n"
690 "<li><code>day</code>\n"
691 "<li><code>hour</code>\n"
692 "<li><code>minute</code>\n"
693 "<li><code>second</code>\n"
694 "</ul>\n"
695 "<h4>Syntax</h4>\n"
696 "<code>age(string,string)</code><br>\n"
697 "<code>age(datetime,datetime)</code><br>\n"
698 "<code>age(string,datetime)</code><br>\n"
699 "<code>age(datetime,string)</code><br>\n"
700 "\n"
701 "<h4>Arguments</h4>\n"
702 "<code>string</code> - is string. A string in date format.\n"
703 "<br>\n"
704 "<code>datetime</code> - is date or datetime. A date or datetime type.\n"
705 "\n"
706 "<h4>Example</h4>\n"
707 "<!-- Show example of function.-->\n"
708 "<code>age('2012-05-12','2012-05-2') &rarr; Interval</code><br>\n"
709 "use <code>day</code> to extract number of days<br>\n"
710 "<code>day(age('2012-05-12','2012-05-2')) &rarr; 10</code><br>\n"
711 "\n"
712 "") );
713  gFunctionHelpTexts.insert( "color_hsv", QCoreApplication::translate( "function_help", "<h3>color_hsv() function</h3>\n"
714 "Returns a string representation of a color based on its hue, saturation, and value attributes\n"
715 "\n"
716 "<p><h4>Syntax</h4>\n"
717 " color_hsv(<i>hue, saturation, value</i>)</p>\n"
718 "\n"
719 "<p><h4>Arguments</h4>\n"
720 "<!-- List args for functions here-->\n"
721 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
722 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
723 "<i> value</i> &rarr; the value percentage of the color as an integer from 0 to 100.<br>\n"
724 "\n"
725 "<p><h4>Example</h4>\n"
726 "<!-- Show example of function.-->\n"
727 " color_hsv(40,100,100) &rarr; '#ffaa00'</p>\n"
728 "") );
729  gFunctionHelpTexts.insert( "trim", QCoreApplication::translate( "function_help", "<h3>trim() function</h3>\n"
730 "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.\n"
731 "\n"
732 "<p><h4>Syntax</h4>\n"
733 " trim(<i>string</i>)</p>\n"
734 "\n"
735 "<p><h4>Arguments</h4>\n"
736 "<!-- List args for functions here-->\n"
737 "<i> string</i> &rarr; is string. The string to trim.</p>\n"
738 "\n"
739 "<p><h4>Example</h4>\n"
740 "<!-- Show example of function.-->\n"
741 " trim(' hello world ') &rarr; 'hello world'</p>\n"
742 "") );
743  gFunctionHelpTexts.insert( "tostring", QCoreApplication::translate( "function_help", "<h3>tostring() function</h3>\n"
744 "Converts a number to string.\n"
745 "\n"
746 "<p><h4>Syntax</h4>\n"
747 " tostring(<i>number</i>)</p>\n"
748 "\n"
749 "<p><h4>Arguments</h4>\n"
750 "<!-- List args for functions here-->\n"
751 "<i>number</i> &rarr; is integer or real. The number to convert to string.</p>\n"
752 "\n"
753 "<p><h4>Example</h4>\n"
754 "<!-- Show example of function.-->\n"
755 " tostring(123) &rarr; '123'</p>\n"
756 "") );
757  gFunctionHelpTexts.insert( "log", QCoreApplication::translate( "function_help", "<h3>log() function</h3>\n"
758 "Returns the value of the logarithm of the passed value and base.\n"
759 "<br>\n"
760 "This function takes two arguments.\n"
761 "<h4>Syntax</h4>\n"
762 "<code>log(base, value)</code><br>\n"
763 "\n"
764 "<h4>Arguments</h4>\n"
765 "<code>base</code> - any positive number.<br>\n"
766 "<code>value</code> - any positive number.\n"
767 "<br>\n"
768 "\n"
769 "<h4>Example</h4>\n"
770 "<!-- Show example of function.-->\n"
771 "<code>log(2, 32) &rarr; 5</code><br>\n"
772 "<code>log(0.5, 32) &rarr; -5</code><br>\n"
773 "") );
774  gFunctionHelpTexts.insert( "title", QCoreApplication::translate( "function_help", "<h3>title() function</h3>\n"
775 "Converts all words of a string to title case (all words lower case with leading\n"
776 "capital letter).\n"
777 "\n"
778 "<p><h4>Syntax</h4>\n"
779 " title(<i>string</i>)</p>\n"
780 "\n"
781 "<p><h4>Arguments</h4>\n"
782 "<!-- List args for functions here-->\n"
783 "<i> string</i> &rarr; is string. The string to convert to title case.</p>\n"
784 "\n"
785 "<p><h4>Example</h4>\n"
786 "<!-- Show example of function.-->\n"
787 " upper('hello WOrld') &rarr; 'Hello World'</p>\n"
788 "") );
789  gFunctionHelpTexts.insert( "coalesce", QCoreApplication::translate( "function_help", "<h3>coalesce() function</h3>\n"
790 "Returns the first non-NULL value from the expression list.\n"
791 "<br>\n"
792 "This function can take any number of arguments.\n"
793 "<h4>Syntax</h4>\n"
794 "<code>coalesce(expression1, expression2 ...)</code><br>\n"
795 "\n"
796 "<h4>Arguments</h4>\n"
797 "<code>expression</code> - any valid expression or value, irregardless of type.\n"
798 "<br>\n"
799 "\n"
800 "<h4>Example</h4>\n"
801 "<!-- Show example of function.-->\n"
802 "<code>coalesce(NULL, 2) &rarr; 2</code><br>\n"
803 "<code>coalesce(NULL, 2, 3) &rarr; 2</code><br>\n"
804 "<code>coalesce(7, NULL, 3*2) &rarr; 7</code><br><br>\n"
805 "<code>coalesce(\"fieldA\", \"fallbackField\", 'ERROR') &rarr; value of fieldA if it is non-NULL\n"
806 " else the value of \"fallbackField\" or the string 'ERROR' if both are NULL</code><br>\n"
807 "\n"
808 "") );
809  gFunctionHelpTexts.insert( "intersects", QCoreApplication::translate( "function_help", "<h3>intersects function</h3>\n"
810 "Returns 1 if the geometries spatially intersect (share any portion of space) and 0 if they don't.\n"
811 "\n"
812 "<h4>Syntax</h4>\n"
813 "<pre>intersects( a, b )</pre>\n"
814 "\n"
815 "<h4>Arguments</h4>\n"
816 "a &rarr; geometry\n"
817 "b &rarr; geometry\n"
818 "\n"
819 "<h4>Example</h4>\n"
820 "<pre> intersects( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
821 "<pre> intersects( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'POINT(5 5)' )) &rarr; returns 0</pre>\n"
822 "") );
823  gFunctionHelpTexts.insert( "color_hsl", QCoreApplication::translate( "function_help", "<h3>color_hsl() function</h3>\n"
824 "Returns a string representation of a color based on its hue, saturation, and lightness attributes\n"
825 "\n"
826 "<p><h4>Syntax</h4>\n"
827 " color_hsl(<i>hue, saturation, lightness</i>)</p>\n"
828 "\n"
829 "<p><h4>Arguments</h4>\n"
830 "<!-- List args for functions here-->\n"
831 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
832 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
833 "<i> lightness</i> &rarr; the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
834 "\n"
835 "<p><h4>Example</h4>\n"
836 "<!-- Show example of function.-->\n"
837 " color_hsl(100,50,70) &rarr; '#a6d98c'</p>\n"
838 "") );
839  gFunctionHelpTexts.insert( "$numpages", QCoreApplication::translate( "function_help", "<h3>$numpages function</h3>\n"
840 "Returns the total number of pages in the composition.\n"
841 "\n"
842 "<h4>Syntax</h4>\n"
843 "<pre>$numpages</pre>\n"
844 "\n"
845 "<h4>Arguments</h4>\n"
846 "None\n"
847 "\n"
848 "<h4>Example</h4>\n"
849 "<pre>$numpages &rarr; 42</pre>\n"
850 "\n"
851 "") );
852  gFunctionHelpTexts.insert( "$length", QCoreApplication::translate( "function_help", "<h3>$length function</h3>\n"
853 "Returns the length of the current feature.\n"
854 "\n"
855 "<h4>Syntax</h4>\n"
856 "<pre>$length</pre>\n"
857 "\n"
858 "<h4>Arguments</h4>\n"
859 "None\n"
860 "\n"
861 "<h4>Example</h4>\n"
862 "<pre>$length &rarr; 42.4711</pre>\n"
863 "") );
864  gFunctionHelpTexts.insert( "todate", QCoreApplication::translate( "function_help", "<h3>todate() function</h3>\n"
865 "Convert a string into Qt data type.\n"
866 "\n"
867 "<h4>Syntax</h4>\n"
868 "<code>todate('string')</code><br>\n"
869 "\n"
870 "<h4>Arguments</h4>\n"
871 "<code>string</code> - is string in Qt date format.\n"
872 "<br>\n"
873 "\n"
874 "<h4>Example</h4>\n"
875 "<!-- Show example of function.-->\n"
876 "<code>todate('2012-05-04') &rarr; 2012-05-04</code><br>") );
877  gFunctionHelpTexts.insert( "upper", QCoreApplication::translate( "function_help", "<h3>upper() function</h3>\n"
878 "Converts a string to upper case letters.\n"
879 "\n"
880 "<p><h4>Syntax</h4>\n"
881 " upper(<i>string</i>)</p>\n"
882 "\n"
883 "<p><h4>Arguments</h4>\n"
884 "<!-- List args for functions here-->\n"
885 "<i> string</i> &rarr; is string. The String to convert to upper case.</p>\n"
886 "\n"
887 "<p><h4>Example</h4>\n"
888 "<!-- Show example of function.-->\n"
889 " upper('hello WOrld') &rarr; 'HELLO WORLD'</p>\n"
890 "") );
891  gFunctionHelpTexts.insert( "$atlasfeatureid", QCoreApplication::translate( "function_help", "<h3>$atlasfeatureid function</h3>\n"
892 "Returns the feature id of the current row while using atlas.\n"
893 "This enables you to use features of atlas in rules \n"
894 "and for example show or hide features based on their id.\n"
895 "\n"
896 "<h4>Syntax</h4>\n"
897 "<pre>$atlasfeatureid</pre>\n"
898 "\n"
899 "<h4>Arguments</h4>\n"
900 "None\n"
901 "\n"
902 "<h4>Example</h4>\n"
903 "<pre>$atlasfeatureid = $id</pre>\n"
904 "\n"
905 "") );
906  gFunctionHelpTexts.insert( "overlaps", QCoreApplication::translate( "function_help", "<h3>overlaps function</h3>\n"
907 "Returns 1 if the geometries share space, are of the same dimension, but are not completely contained by each other.\n"
908 "\n"
909 "<h4>Syntax</h4>\n"
910 "<pre>overlaps( a, b )</pre>\n"
911 "\n"
912 "<h4>Arguments</h4>\n"
913 "a &rarr; geometry\n"
914 "b &rarr; geometry\n"
915 "\n"
916 "<h4>Example</h4>\n"
917 "<pre> overlaps( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 5 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
918 "<pre> overlaps( geomFromWKT( 'LINESTRING(0 0 , 1 1)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>\n"
919 "") );
920  gFunctionHelpTexts.insert( "toint", QCoreApplication::translate( "function_help", "<h3>toint() function</h3>\n"
921 "Converts a string to integer number. Nothing changed if a value cannot be converted to integer (e.g '123asd' is invalid).\n"
922 "\n"
923 "<p><h4>Syntax</h4>\n"
924 " toint(<i>string</i>)</p>\n"
925 "\n"
926 "<p><h4>Arguments</h4>\n"
927 "<!-- List args for functions here-->\n"
928 "<i> string</i> &rarr; is string. The String to convert to integer number.</p>\n"
929 "\n"
930 "<p><h4>Example</h4>\n"
931 "<!-- Show example of function.-->\n"
932 " toint('123') &rarr; 123</p>\n"
933 "") );
934  gFunctionHelpTexts.insert( "CASE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
935 "A conditional expression that can be used to evaluate multiple expressions and\n"
936 "return a result.\n"
937 "\n"
938 "<h4>Syntax</h4>\n"
939 "<pre>\n"
940 " CASE\n"
941 " WHEN <i>condition</i> THEN <i>result</i>\n"
942 " [ ...n ]\n"
943 " [ ELSE <i>result</i> ]\n"
944 " END\n"
945 "</pre>\n"
946 "[ ] marks optional components\n"
947 "\n"
948 "<h4>Arguments</h4>\n"
949 "<!-- List args for functions here-->\n"
950 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
951 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
952 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
953 "\n"
954 "<h4>Example</h4>\n"
955 "<!-- Show example of function.-->\n"
956 "<pre>\n"
957 " CASE\n"
958 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
959 " END\n"
960 "</pre>\n"
961 "") );
962  gFunctionHelpTexts.insert( "year", QCoreApplication::translate( "function_help", "<h3>year() function</h3>\n"
963 "Extract the year part from a date, or the number of years\n"
964 "from a <code>Interval</code>\n"
965 "\n"
966 "<h4>Syntax</h4>\n"
967 "<code>year(date)</code><br>\n"
968 "<code>year(Interval)</code><br>\n"
969 "\n"
970 "<h4>Arguments</h4>\n"
971 "<code>date</code> - is date or datetime. The date to extract the year from.\n"
972 "<br>\n"
973 "<code>Interval</code> - is Interval. The Interval to return the number of years from.\n"
974 "\n"
975 "<h4>Example</h4>\n"
976 "<!-- Show example of function.-->\n"
977 "<code>year('2012-05-12') &rarr; 2012</code><br>\n"
978 "<code>year(tointerval('3 Years')) &rarr; 3</code><br>\n"
979 "<code>year(age('2012-01-01','2010-01-01')) &rarr; 1.9986..</code><br>\n"
980 "\n"
981 "") );
982  gFunctionHelpTexts.insert( "Conditionals", QCoreApplication::translate( "function_help", "<h3>Conditionals Group</h3>\n"
983 "This group contains functions to handle conditional checks in expressions.\n"
984 "") );
985  gFunctionHelpTexts.insert( "log10", QCoreApplication::translate( "function_help", "<h3>log10() function</h3>\n"
986 "Returns the value of the base 10 logarithm of the passed expression.\n"
987 "<br>\n"
988 "This function takes one argument.\n"
989 "<h4>Syntax</h4>\n"
990 "<code>log10(value)</code><br>\n"
991 "\n"
992 "<h4>Arguments</h4>\n"
993 "<code>value</code> - any positive number.\n"
994 "<br>\n"
995 "\n"
996 "<h4>Example</h4>\n"
997 "<!-- Show example of function.-->\n"
998 "<code>log10(1) &rarr; 0</code><br>\n"
999 "<code>log10(100) &rarr; 2</code><br>\n"
1000 "") );
1001  gFunctionHelpTexts.insert( "ln", QCoreApplication::translate( "function_help", "<h3>ln() function</h3>\n"
1002 "Returns the value of the natural logarithm of the passed expression.\n"
1003 "<br>\n"
1004 "This function takes one argument.\n"
1005 "<h4>Syntax</h4>\n"
1006 "<code>ln(value)</code><br>\n"
1007 "\n"
1008 "<h4>Arguments</h4>\n"
1009 "<code>value</code> - any positive number.\n"
1010 "<br>\n"
1011 "\n"
1012 "<h4>Example</h4>\n"
1013 "<!-- Show example of function.-->\n"
1014 "<code>ln(1) &rarr; 0</code><br>\n"
1015 "<code>ln(2.7182818284590452354) &rarr; 1</code><br>\n"
1016 "") );
1017  gFunctionHelpTexts.insert( "$pi", QCoreApplication::translate( "function_help", "<h3>$pi constant</h3>\n"
1018 "Returns pi as value for calculations\n"
1019 "\n"
1020 "<h4>Syntax</h4>\n"
1021 "<pre>$pi</pre>\n"
1022 "\n"
1023 "<h4>Arguments</h4>\n"
1024 "None\n"
1025 "\n"
1026 "<h4>Example</h4>\n"
1027 "<pre>$pi &rarr; 3.14159265358979</pre>\n"
1028 "") );
1029  gFunctionHelpTexts.insert( "wordwrap", QCoreApplication::translate( "function_help", "<h3>wordwrap() function</h3>\n"
1030 "Returns a string wrapped to a maximum/minimum number of characters.\n"
1031 "\n"
1032 "<p><h4>Syntax</h4>\n"
1033 " wordwrap(<i>string,wrap_length[,delimiter_string]</i>)</p>\n"
1034 "\n"
1035 "<p><h4>Arguments</h4>\n"
1036 "<!-- List args for functions here-->\n"
1037 "<i> string</i> &rarr; is string. The string to be wrapped.<br>\n"
1038 "<i> wrap_length</i> &rarr; is number. If positive, the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap.<br>\n"
1039 "<i> delimiter_string</i> &rarr; is string. The delimiter string to wrap to a new line (<u>optional</u>).<br></p>\n"
1040 "\n"
1041 "<p><h4>Example</h4>\n"
1042 "<!-- Show example of function.-->\n"
1043 " wordwrap('UNIVERSITY OF QGIS',13) &rarr; 'UNIVERSITY OF&#92;nQGIS'<br>\n"
1044 " wordwrap('UNIVERSITY OF QGIS',-3) &rarr; 'UNIVERSITY&#92;nOF QGIS'</p>\n"
1045 "") );
1046  gFunctionHelpTexts.insert( "atan", QCoreApplication::translate( "function_help", "<h3>atan() function</h3>\n"
1047 "Returns arcustanget of a value in radians.\n"
1048 "\n"
1049 "\n"
1050 "<p><h4>Syntax</h4>\n"
1051 " atan(<i>real</i>)</p>\n"
1052 "\n"
1053 "<p><h4>Arguments</h4>\n"
1054 "<i>real</i> &rarr; tan of an angle.</p>\n"
1055 "\n"
1056 "<p><h4>Example</h4>\n"
1057 " atan(0.5) &rarr; 0.463647609000806</p>\n"
1058 "") );
1059  gFunctionHelpTexts.insert( "Geometry", QCoreApplication::translate( "function_help", "<h3>Geometry Group</h3>\n"
1060 "This group contains functions that operate on geometry objects e.g length, area.\n"
1061 "") );
1062  gFunctionHelpTexts.insert( "$x", QCoreApplication::translate( "function_help", "<h3>$x function</h3>\n"
1063 "Returns the x coordinate of the current feature.\n"
1064 "\n"
1065 "<h4>Syntax</h4>\n"
1066 "<pre>$x</pre>\n"
1067 "\n"
1068 "<h4>Arguments</h4>\n"
1069 "None\n"
1070 "\n"
1071 "<h4>Example</h4>\n"
1072 "<pre>$x &rarr; 42</pre>\n"
1073 "\n"
1074 "") );
1075  gFunctionHelpTexts.insert( "LIKE", QCoreApplication::translate( "function_help", "<h3>LIKE expression</h3>\n"
1076 "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also.\n"
1077 "\n"
1078 "<h4>Syntax</h4>\n"
1079 "<pre>string/number LIKE pattern</pre>\n"
1080 "\n"
1081 "<h4>Arguments</h4>\n"
1082 "None\n"
1083 "\n"
1084 "<h4>Example</h4>\n"
1085 "<pre> 'A' LIKE 'A' &rarr; returns 1 </pre>\n"
1086 "<pre> 'A' LIKE 'a' &rarr; returns 0 </pre>\n"
1087 "<pre> 'A' LIKE 'B' &rarr; returns 0 </pre>\n"
1088 "") );
1089  gFunctionHelpTexts.insert( "sqrt", QCoreApplication::translate( "function_help", "<h3>sqrt() function</h3>\n"
1090 "Returns square root of a value\n"
1091 "\n"
1092 "\n"
1093 "<p><h4>Syntax</h4>\n"
1094 " sqrt(<i>real</i>)</p>\n"
1095 "\n"
1096 "<p><h4>Arguments</h4>\n"
1097 "<i>real</i> &rarr; number.</p>\n"
1098 "\n"
1099 "<p><h4>Example</h4>\n"
1100 " sqrt(9) &rarr; 3</p>\n"
1101 "") );
1102  gFunctionHelpTexts.insert( "tan", QCoreApplication::translate( "function_help", "<h3>tan() function</h3>\n"
1103 "Returns tangent of an angle.\n"
1104 "\n"
1105 "\n"
1106 "<p><h4>Syntax</h4>\n"
1107 " tan(<i>real</i>)</p>\n"
1108 "\n"
1109 "<p><h4>Arguments</h4>\n"
1110 "<i>real</i> &rarr; angle in radians.</p>\n"
1111 "\n"
1112 "<p><h4>Example</h4>\n"
1113 " tan(1.0) &rarr; 1.5574077246549</p>\n"
1114 "") );
1115  gFunctionHelpTexts.insert( "format_number", QCoreApplication::translate( "function_help", "<h3>format_number() function</h3>\n"
1116 "Returns a number formatted with the locale separator for thousands. \n"
1117 "Also truncates the number to the number of supplied places. \n"
1118 "<h4>Syntax</h4>\n"
1119 "<code>format_number(number,places)</code><br>\n"
1120 "\n"
1121 "<h4>Arguments</h4>\n"
1122 "<code>number</code> - is number. The number to be formatted.\n"
1123 "<br>\n"
1124 "<code>places</code> - is int. The number of decimal places to truncate the string\n"
1125 "to.\n"
1126 "\n"
1127 "<h4>Example</h4>\n"
1128 "<!-- Show example of function.-->\n"
1129 "<code>format_number(10000000.332,2) &rarr; 10,000,000.33</code>\n"
1130 "\n"
1131 "") );
1132  gFunctionHelpTexts.insert( "round", QCoreApplication::translate( "function_help", "<h3>round() function</h3>\n"
1133 "Rounds a number to number of decimal places.\n"
1134 "<br>\n"
1135 "This function can take one or two arguments depending on what is needed.\n"
1136 "<h4>Syntax</h4>\n"
1137 "<code>round(decimal,places)</code><br>\n"
1138 "<code>round(decimal)</code><br>\n"
1139 "\n"
1140 "<h4>Arguments</h4>\n"
1141 "<code>decimal</code> - is decimal. The decimal number to be rounded.\n"
1142 "<br>\n"
1143 "<code>places</code> - is int. The number of places to round decimal too. Can be negative.\n"
1144 "\n"
1145 "<h4>Example</h4>\n"
1146 "<!-- Show example of function.-->\n"
1147 "<code>round(1234.567, 2 ) &rarr; 1234.57</code><br>\n"
1148 "use <code>round(decimal)</code> to round to the nearest integer<br>\n"
1149 "<code>round(1234.567) &rarr; 1235</code><br>\n"
1150 "\n"
1151 "\n"
1152 "") );
1153  gFunctionHelpTexts.insert( "regexp_replace", QCoreApplication::translate( "function_help", "<h3>regexp_replace() function</h3>\n"
1154 "Returns a string with the supplied regular expression replaced.\n"
1155 "\n"
1156 "<p><h4>Syntax</h4>\n"
1157 " regexp_replace(<i>string,regex,after</i>)</p>\n"
1158 "\n"
1159 "<p><h4>Arguments</h4>\n"
1160 "<!-- List args for functions here-->\n"
1161 "<i> string</i> &rarr; is string. The start string.<br>\n"
1162 "<i> regex</i> &rarr; is string. The regular expression to replace. Backslash characters must be double escaped (eg \"&#92;&#92;s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
1163 "<i> after</i> &rarr; is string. The string that will replace any matching occurences of the supplied regular expression. Captured groups can be inserted into the replacement string using &#92;&#92;1, &#92;&#92;2, etc. <br></p>\n"
1164 "\n"
1165 "<p><h4>Example</h4>\n"
1166 "<!-- Show example of function.-->\n"
1167 " regexp_replace('QGIS SHOULD ROCK','&#92;&#92;sSHOULD&#92;&#92;s',' DOES ') &rarr; 'QGIS DOES ROCK'</p>\n"
1168 "") );
1169  gFunctionHelpTexts.insert( "Record", QCoreApplication::translate( "function_help", "<h3>Record Group</h3>\n"
1170 "This group contains functions that operate on record identifiers.\n"
1171 "") );
1172  gFunctionHelpTexts.insert( "contains", QCoreApplication::translate( "function_help", "<h3>contains function</h3>\n"
1173 " Returns true if and only if no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a. \n"
1174 "\n"
1175 "<h4>Syntax</h4>\n"
1176 "<pre>contains( geometry a , geometry a)</pre>\n"
1177 "\n"
1178 "<h4>Arguments</h4>\n"
1179 "geometry &rarr; geometry\n"
1180 "geometry &rarr; geometry\n"
1181 "\n"
1182 "<h4>Example</h4>\n"
1183 "<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'POINT( 0.5 0.5 )' )) &rarr; returns 1</pre>\n"
1184 "<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>\n"
1185 "") );
1186  gFunctionHelpTexts.insert( "$id", QCoreApplication::translate( "function_help", "<h3>$id function</h3>\n"
1187 "Returns the feature id of the current row.\n"
1188 "\n"
1189 "<h4>Syntax</h4>\n"
1190 "<pre>$id</pre>\n"
1191 "\n"
1192 "<h4>Arguments</h4>\n"
1193 "None\n"
1194 "\n"
1195 "<h4>Example</h4>\n"
1196 "<pre>$id &rarr; 42</pre>\n"
1197 "\n"
1198 "") );
1199  gFunctionHelpTexts.insert( "format_date", QCoreApplication::translate( "function_help", "<h3>format_date() function</h3>\n"
1200 "Format a date type or string into a custom string format. Uses Qt data time format strings. See <a href='http://qt-project.org/doc/qt-4.8/qdatetime.html#toString'>QDateTime::toString</a>\n"
1201 "\n"
1202 "<h4>Syntax</h4>\n"
1203 "<code>format_date('string', 'format_string')</code><br>\n"
1204 "\n"
1205 "<h4>Arguments</h4>\n"
1206 "<code>string</code> - is string. Date/Time/DateTime string.\n"
1207 "<br>\n"
1208 "<code>format_string</code> - is string. String template used to format the string.\n"
1209 "\n"
1210 " <table>\n"
1211 " <thead>\n"
1212 " <tr>\n"
1213 " <th>Expression</th>\n"
1214 "\n"
1215 " <th>Output</th>\n"
1216 " </tr>\n"
1217 " </thead>\n"
1218 "\n"
1219 " <tr valign=\"top\">\n"
1220 " <td>d</td>\n"
1221 "\n"
1222 " <td>the day as number without a leading zero (1 to 31)</td>\n"
1223 " </tr>\n"
1224 "\n"
1225 " <tr valign=\"top\">\n"
1226 " <td>dd</td>\n"
1227 "\n"
1228 " <td>the day as number with a leading zero (01 to 31)</td>\n"
1229 " </tr>\n"
1230 "\n"
1231 " <tr valign=\"top\">\n"
1232 " <td>ddd</td>\n"
1233 "\n"
1234 " <td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses <a href=\n"
1235 " \"qdate.html#shortDayName\">QDate::shortDayName</a>().</td>\n"
1236 " </tr>\n"
1237 "\n"
1238 " <tr valign=\"top\">\n"
1239 " <td>dddd</td>\n"
1240 "\n"
1241 " <td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses <a href=\n"
1242 " \"qdate.html#longDayName\">QDate::longDayName</a>().</td>\n"
1243 " </tr>\n"
1244 "\n"
1245 " <tr valign=\"top\">\n"
1246 " <td>M</td>\n"
1247 "\n"
1248 " <td>the month as number without a leading zero (1-12)</td>\n"
1249 " </tr>\n"
1250 "\n"
1251 " <tr valign=\"top\">\n"
1252 " <td>MM</td>\n"
1253 "\n"
1254 " <td>the month as number with a leading zero (01-12)</td>\n"
1255 " </tr>\n"
1256 "\n"
1257 " <tr valign=\"top\">\n"
1258 " <td>MMM</td>\n"
1259 "\n"
1260 " <td>the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses <a href=\n"
1261 " \"qdate.html#shortMonthName\">QDate::shortMonthName</a>().</td>\n"
1262 " </tr>\n"
1263 "\n"
1264 " <tr valign=\"top\">\n"
1265 " <td>MMMM</td>\n"
1266 "\n"
1267 " <td>the long localized month name (e.g. 'January' to 'December'). Uses <a href=\n"
1268 " \"qdate.html#longMonthName\">QDate::longMonthName</a>().</td>\n"
1269 " </tr>\n"
1270 "\n"
1271 " <tr valign=\"top\">\n"
1272 " <td>yy</td>\n"
1273 "\n"
1274 " <td>the year as two digit number (00-99)</td>\n"
1275 " </tr>\n"
1276 "\n"
1277 " <tr valign=\"top\">\n"
1278 " <td>yyyy</td>\n"
1279 "\n"
1280 " <td>the year as four digit number</td>\n"
1281 " </tr>\n"
1282 " </table>\n"
1283 "\n"
1284 " <p>These expressions may be used for the time part of the format string:</p>\n"
1285 "\n"
1286 " <table>\n"
1287 " <thead>\n"
1288 " <tr>\n"
1289 " <th>Expression</th>\n"
1290 "\n"
1291 " <th>Output</th>\n"
1292 " </tr>\n"
1293 " </thead>\n"
1294 "\n"
1295 " <tr valign=\"top\">\n"
1296 " <td>h</td>\n"
1297 "\n"
1298 " <td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td>\n"
1299 " </tr>\n"
1300 "\n"
1301 " <tr valign=\"top\">\n"
1302 " <td>hh</td>\n"
1303 "\n"
1304 " <td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td>\n"
1305 " </tr>\n"
1306 "\n"
1307 " <tr valign=\"top\">\n"
1308 " <td>H</td>\n"
1309 "\n"
1310 " <td>the hour without a leading zero (0 to 23, even with AM/PM display)</td>\n"
1311 " </tr>\n"
1312 "\n"
1313 " <tr valign=\"top\">\n"
1314 " <td>HH</td>\n"
1315 "\n"
1316 " <td>the hour with a leading zero (00 to 23, even with AM/PM display)</td>\n"
1317 " </tr>\n"
1318 "\n"
1319 " <tr valign=\"top\">\n"
1320 " <td>m</td>\n"
1321 "\n"
1322 " <td>the minute without a leading zero (0 to 59)</td>\n"
1323 " </tr>\n"
1324 "\n"
1325 " <tr valign=\"top\">\n"
1326 " <td>mm</td>\n"
1327 "\n"
1328 " <td>the minute with a leading zero (00 to 59)</td>\n"
1329 " </tr>\n"
1330 "\n"
1331 " <tr valign=\"top\">\n"
1332 " <td>s</td>\n"
1333 "\n"
1334 " <td>the second without a leading zero (0 to 59)</td>\n"
1335 " </tr>\n"
1336 "\n"
1337 " <tr valign=\"top\">\n"
1338 " <td>ss</td>\n"
1339 "\n"
1340 " <td>the second with a leading zero (00 to 59)</td>\n"
1341 " </tr>\n"
1342 "\n"
1343 " <tr valign=\"top\">\n"
1344 " <td>z</td>\n"
1345 "\n"
1346 " <td>the milliseconds without leading zeroes (0 to 999)</td>\n"
1347 " </tr>\n"
1348 "\n"
1349 " <tr valign=\"top\">\n"
1350 " <td>zzz</td>\n"
1351 "\n"
1352 " <td>the milliseconds with leading zeroes (000 to 999)</td>\n"
1353 " </tr>\n"
1354 "\n"
1355 " <tr valign=\"top\">\n"
1356 " <td>AP or A</td>\n"
1357 "\n"
1358 " <td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td>\n"
1359 " </tr>\n"
1360 "\n"
1361 " <tr valign=\"top\">\n"
1362 " <td>ap or a</td>\n"
1363 "\n"
1364 " <td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td>\n"
1365 " </tr>\n"
1366 " </table>\n"
1367 "\n"
1368 "<br>\n"
1369 "\n"
1370 "<h4>Example</h4>\n"
1371 "<!-- Show example of function.-->\n"
1372 "<code>format_date('2012-05-15','dd.mm.yyyy') &rarr; 15.05.2012</code><br>\n"
1373 "") );
1374  gFunctionHelpTexts.insert( "exp", QCoreApplication::translate( "function_help", "<h3>exp() function</h3>\n"
1375 "Returns exponential of an value.\n"
1376 "\n"
1377 "\n"
1378 "<p><h4>Syntax</h4>\n"
1379 " exp(<i>real</i>)</p>\n"
1380 "\n"
1381 "<p><h4>Arguments</h4>\n"
1382 "<i>real</i> &rarr; number.</p>\n"
1383 "\n"
1384 "<p><h4>Example</h4>\n"
1385 " exp(1.0) &rarr; 2.71828182845905</p>\n"
1386 "") );
1387  gFunctionHelpTexts.insert( "$now", QCoreApplication::translate( "function_help", "<h3>$now function</h3>\n"
1388 "Returns the current date and time\n"
1389 "\n"
1390 "<h4>Syntax</h4>\n"
1391 "<pre>$now</pre>\n"
1392 "\n"
1393 "<h4>Arguments</h4>\n"
1394 "None\n"
1395 "\n"
1396 "<h4>Example</h4>\n"
1397 "<pre>$now &rarr; 2012-07-22T13:24:57</pre>\n"
1398 "\n"
1399 "") );
1400  gFunctionHelpTexts.insert( "$rownum", QCoreApplication::translate( "function_help", "<h3>$rownum function</h3>\n"
1401 "Returns the number of the current row.\n"
1402 "\n"
1403 "<h4>Syntax</h4>\n"
1404 "<pre>$rownum</pre>\n"
1405 "\n"
1406 "<h4>Arguments</h4>\n"
1407 "None\n"
1408 "\n"
1409 "<h4>Example</h4>\n"
1410 "<pre>$rownum &rarr; 4711</pre>\n"
1411 "\n"
1412 "") );
1413  gFunctionHelpTexts.insert( "replace", QCoreApplication::translate( "function_help", "<h3>replace() function</h3>\n"
1414 "Returns a string with the the supplied string replaced.\n"
1415 "\n"
1416 "<p><h4>Syntax</h4>\n"
1417 " replace(<i>string,before,after</i>)</p>\n"
1418 "\n"
1419 "<p><h4>Arguments</h4>\n"
1420 "<!-- List args for functions here-->\n"
1421 "<i> string</i> &rarr; is string. The start string.<br>\n"
1422 "<i> before</i> &rarr; is string. The string to replace.<br>\n"
1423 "<i> after</i> &rarr; is string. The string that will replace <i>before</i><br></p>\n"
1424 "\n"
1425 "<p><h4>Example</h4>\n"
1426 "<!-- Show example of function.-->\n"
1427 " replace('QGIS SHOULD ROCK','SHOULD','DOES') &rarr; 'QGIS DOES ROCK'</p>\n"
1428 "") );
1429  gFunctionHelpTexts.insert( "lpad", QCoreApplication::translate( "function_help", "<h3>lpad() function</h3>\n"
1430 "Returns a string with supplied width padded\n"
1431 "using the fill character.\n"
1432 "\n"
1433 "<h4>Syntax</h4>\n"
1434 "<code>lpad(string, length, fill)</code><br>\n"
1435 "\n"
1436 "<h4>Arguments</h4>\n"
1437 "<code>string</code> - is string. The string.\n"
1438 "<br>\n"
1439 "<code>length</code> - is int. The length of the new string.\n"
1440 "<br>\n"
1441 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1442 "\n"
1443 "<h4>Example</h4>\n"
1444 "<!-- Show example of function.-->\n"
1445 "<code>lpad('Hello', 10, 'x') &rarr; 'Helloxxxxx'</code><br>\n"
1446 "") );
1447  gFunctionHelpTexts.insert( "$map", QCoreApplication::translate( "function_help", "<h3>$map function</h3>\n"
1448 "Returns the id of the current map item if the map is being drawn in a composition, or \"canvas\" if the map is being\n"
1449 "drawn within the main QGIS window.\n"
1450 "\n"
1451 "<h4>Syntax</h4>\n"
1452 "<pre>$map</pre>\n"
1453 "\n"
1454 "<h4>Arguments</h4>\n"
1455 "None\n"
1456 "\n"
1457 "<h4>Example</h4>\n"
1458 "<!-- Show example of function.-->\n"
1459 "<pre>$map &rarr; \"overview_map\" (within a composer item)<br />\n"
1460 "$map &rarr; \"canvas\" (within the main QGIS main canvas)</pre>\n"
1461 "\n"
1462 "\n"
1463 "") );
1464  gFunctionHelpTexts.insert( "NOT", QCoreApplication::translate( "function_help", "<h3>NOT</h3>\n"
1465 "Returns 1 if a is not the same as b.\n"
1466 "\n"
1467 "<h4>Syntax</h4>\n"
1468 "<pre> a NOT b </pre>\n"
1469 "\n"
1470 "<h4>Arguments</h4>\n"
1471 "None\n"
1472 "\n"
1473 "<h4>Example</h4>\n"
1474 "<pre> 'a' IS NOT 'b' &rarr; returns 1 </pre>\n"
1475 "<pre> 'a' IS NOT 'a' &rarr; returns 0 </pre>\n"
1476 "<pre> 4 IS NOT 2+2 &rarr; returns 0 </pre>\n"
1477 "\n"
1478 "") );
1479  gFunctionHelpTexts.insert( "ceil", QCoreApplication::translate( "function_help", "<h3>ceil() function</h3>\n"
1480 "Rounds a number upwards.\n"
1481 "\n"
1482 "<h4>Syntax</h4>\n"
1483 "<code>ceil(value)</code><br>\n"
1484 "\n"
1485 "<h4>Arguments</h4>\n"
1486 "<code>value</code> - a number.\n"
1487 "<br>\n"
1488 "\n"
1489 "<h4>Example</h4>\n"
1490 "<!-- Show example of function.-->\n"
1491 "<code>ceil(4.9) &rarr; 5</code><br>\n"
1492 "<code>ceil(-4.9) &rarr; -4</code><br>\n"
1493 "") );
1494  gFunctionHelpTexts.insert( "$area", QCoreApplication::translate( "function_help", "<h3>$area function</h3>\n"
1495 "Returns the area size of the current feature.\n"
1496 "\n"
1497 "<h4>Syntax</h4>\n"
1498 "<pre>$area</pre>\n"
1499 "\n"
1500 "<h4>Arguments</h4>\n"
1501 "None\n"
1502 "\n"
1503 "<h4>Example</h4>\n"
1504 "<pre>$area &rarr; 42</pre>\n"
1505 "\n"
1506 "") );
1507  gFunctionHelpTexts.insert( "sin", QCoreApplication::translate( "function_help", "<h3>sin() function</h3>\n"
1508 "Returns sinus of an angle.\n"
1509 "\n"
1510 "\n"
1511 "<p><h4>Syntax</h4>\n"
1512 " sin(<i>real</i>)</p>\n"
1513 "\n"
1514 "<p><h4>Arguments</h4>\n"
1515 "<i>real</i> &rarr; angle in radians.</p>\n"
1516 "\n"
1517 "<p><h4>Example</h4>\n"
1518 " sin(1.571) &rarr; 0.999999682931835</p>\n"
1519 "") );
1520  gFunctionHelpTexts.insert( "week", QCoreApplication::translate( "function_help", "<h3>week() function</h3>\n"
1521 "Extract the week number from a date, or the number of weeks\n"
1522 "from a <code>Interval</code>\n"
1523 "\n"
1524 "<h4>Syntax</h4>\n"
1525 "<code>week(date)</code><br>\n"
1526 "<code>week(Interval)</code><br>\n"
1527 "\n"
1528 "<h4>Arguments</h4>\n"
1529 "<code>date</code> - is date or datetime. The date to extract the week from.\n"
1530 "<br>\n"
1531 "<code>Interval</code> - is Interval. The Interval to return the number of weeks from.\n"
1532 "\n"
1533 "<h4>Example</h4>\n"
1534 "<!-- Show example of function.-->\n"
1535 "<code>week('2012-05-12') &rarr; 19</code><br>\n"
1536 "<code>week(tointerval('3 weeks')) &rarr; 3</code><br>\n"
1537 "<code>week(age('2012-01-01','2010-01-01')) &rarr; 104.285...</code><br>\n"
1538 "\n"
1539 "") );
1540  gFunctionHelpTexts.insert( "rpad", QCoreApplication::translate( "function_help", "<h3>rpad() function</h3>\n"
1541 "Returns a string with supplied width padded\n"
1542 "using the fill character.\n"
1543 "\n"
1544 "<h4>Syntax</h4>\n"
1545 "<code>rpad(string, width, fill)</code><br>\n"
1546 "\n"
1547 "<h4>Arguments</h4>\n"
1548 "<code>string</code> - is string. The string.\n"
1549 "<br>\n"
1550 "<code>width</code> - is int. The length of the new string.\n"
1551 "<br>\n"
1552 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1553 "\n"
1554 "<h4>Example</h4>\n"
1555 "<!-- Show example of function.-->\n"
1556 "<code>rpad('Hello', 10, 'x') &rarr; 'xxxxxHello'</code><br>\n"
1557 "\n"
1558 "") );
1559  gFunctionHelpTexts.insert( "day", QCoreApplication::translate( "function_help", "<h3>day() function</h3>\n"
1560 "Extract the day from a date, or the number of days\n"
1561 "from a <code>Interval</code>\n"
1562 "\n"
1563 "<h4>Syntax</h4>\n"
1564 "<code>day(date)</code><br>\n"
1565 "<code>day(Interval)</code><br>\n"
1566 "\n"
1567 "<h4>Arguments</h4>\n"
1568 "<code>date</code> - is date or datetime. The date to extract the day from.\n"
1569 "<br>\n"
1570 "<code>Interval</code> - is Interval. The Interval to return the number of days from.\n"
1571 "\n"
1572 "<h4>Example</h4>\n"
1573 "<!-- Show example of function.-->\n"
1574 "<code>day('2012-05-12') &rarr; 12</code><br>\n"
1575 "<code>day(tointerval('3 days')) &rarr; 3</code><br>\n"
1576 "<code>day(age('2012-01-01','2010-01-01')) &rarr; 730</code><br>\n"
1577 "\n"
1578 "") );
1579  gFunctionHelpTexts.insert( "geomFromWKT", QCoreApplication::translate( "function_help", "<h3>geomFromWKT function</h3>\n"
1580 "Returns a geometry created from a Well-Known Text (WKT) representation.\n"
1581 "\n"
1582 "<h4>Syntax</h4>\n"
1583 "<pre>geomFromWKT(text)</pre>\n"
1584 "\n"
1585 "<h4>Arguments</h4>\n"
1586 "text &rarr; Well-Known Text (WKT) representation of a geometry\n"
1587 "\n"
1588 "<h4>Example</h4>\n"
1589 "<pre> geomFromWKT( 'POINT(4 5)' ) &rarr; returns a geometry</pre>\n"
1590 "\n"
1591 "") );
1592  gFunctionHelpTexts.insert( "combine", QCoreApplication::translate( "function_help", "<h3>combine function</h3>\n"
1593 "Returns the combination of geometry a and geometry b.\n"
1594 "\n"
1595 "<h4>Syntax</h4>\n"
1596 "<pre>combine( geometry a , geometry b)</pre>\n"
1597 "\n"
1598 "<h4>Arguments</h4>\n"
1599 "geometry &rarr; geometry\n"
1600 "geometry &rarr; geometry\n"
1601 "\n"
1602 "<h4>Example</h4>\n"
1603 "<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5 )' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4, 2 1 )' )) ) &rarr; returns MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5)) </pre>\n"
1604 "<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 )' ) , geomFromWKT( 'LINESTRING(3 3 , 6 6, 2 1 )' )) ) &rarr; returns LINESTRING(3 3, 4 4, 6 6, 2 1) </pre>\n"
1605 "") );
1606  gFunctionHelpTexts.insert( "Color", QCoreApplication::translate( "function_help", "\n"
1607 "<h3>Color Group</h3>\n"
1608 "This group contains functions for manipulating colors\n"
1609 "") );
1610  gFunctionHelpTexts.insert( "buffer", QCoreApplication::translate( "function_help", "<h3>buffer function</h3>\n"
1611 "Returns a geometry that represents all points whose distance from this geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry. \n"
1612 "\n"
1613 "<h4>Syntax</h4>\n"
1614 "<pre>buffer(a, b)</pre>\n"
1615 "\n"
1616 "<h4>Arguments</h4>\n"
1617 "a &rarr; geometry\n"
1618 "b &rarr; distance for the buffer\n"
1619 "\n"
1620 "<h4>Example</h4>\n"
1621 "<pre> buffer($geometry, 10.5 ) &rarr; returns a polygon</pre>\n"
1622 "\n"
1623 "") );
1624  gFunctionHelpTexts.insert( "acos", QCoreApplication::translate( "function_help", "<h3>acos() function</h3>\n"
1625 "Returns arcuscosinus of a value in radians.\n"
1626 "\n"
1627 "\n"
1628 "<p><h4>Syntax</h4>\n"
1629 " acos(<i>real</i>)</p>\n"
1630 "\n"
1631 "<p><h4>Arguments</h4>\n"
1632 "<i>real</i> &rarr; cos of an angle.</p>\n"
1633 "\n"
1634 "<p><h4>Example</h4>\n"
1635 " acos(0.5) &rarr; 1.0471975511966</p>\n"
1636 "") );
1637  gFunctionHelpTexts.insert( "Math", QCoreApplication::translate( "function_help", "<h3>Math Group</h3>\n"
1638 "This group contains math functions e.g square root, sin and cos\n"
1639 "") );
1640  gFunctionHelpTexts.insert( "$feature", QCoreApplication::translate( "function_help", "<h3>$feature function</h3>\n"
1641 "In atlas generation, returns the current feature number that is iterated over on the coverage layer.\n"
1642 "\n"
1643 "<h4>Syntax</h4>\n"
1644 "<pre>$feature</pre>\n"
1645 "\n"
1646 "<h4>Arguments</h4>\n"
1647 "None\n"
1648 "\n"
1649 "<h4>Example</h4>\n"
1650 "<pre>$feature &rarr; 2</pre>\n"
1651 "\n"
1652 "") );
1653  gFunctionHelpTexts.insert( "atan2", QCoreApplication::translate( "function_help", "<h3>atan2() function</h3>\n"
1654 "Returns arcustangens of y/x using the signs of the two \n"
1655 "arguments to determine the quadrant of the result\n"
1656 "\n"
1657 "\n"
1658 "\n"
1659 "<p><h4>Syntax</h4>\n"
1660 " atan2(<i>real</i>, <i>real</i>)</p>\n"
1661 "\n"
1662 "<p><h4>Arguments</h4>\n"
1663 "<i>real</i> &rarr; y coordinate difference<br>\n"
1664 "<i>real</i> &rarr; x coordinate difference</p>\n"
1665 "\n"
1666 "<p><h4>Example</h4>\n"
1667 " atan2(1.0, 1.732) &rarr; 0.523611477769969</p>\n"
1668 "") );
1669  gFunctionHelpTexts.insert( "regexp_match", QCoreApplication::translate( "function_help", "<h3>regexp_match() function</h3>\n"
1670 "Returns true if any part of a string matches the supplied regular expression.\n"
1671 "\n"
1672 "<p><h4>Syntax</h4>\n"
1673 " regexp_match(<i>string,regex</i>)</p>\n"
1674 "\n"
1675 "<p><h4>Arguments</h4>\n"
1676 "<!-- List args for functions here-->\n"
1677 "<i> string</i> &rarr; is string. The string to test against the regular expression.<br>\n"
1678 "<i> regex</i> &rarr; is string. The regular expression to test against. Backslash characters must be double escaped (eg \"&#92;&#92;s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
1679 "\n"
1680 "<p><h4>Example</h4>\n"
1681 "<!-- Show example of function.-->\n"
1682 " regexp_match('QGIS ROCKS','&#92;&#92;sROCKS') &rarr; 1</p>\n"
1683 "") );
1684  gFunctionHelpTexts.insert( "hour", QCoreApplication::translate( "function_help", "<h3>hour() function</h3>\n"
1685 "Extract the hour from a datetime or time, or the number of hours\n"
1686 "from a <code>Interval</code>\n"
1687 "\n"
1688 "<h4>Syntax</h4>\n"
1689 "<code>hour(datetime)</code><br>\n"
1690 "<code>hour(Interval)</code><br>\n"
1691 "\n"
1692 "<h4>Arguments</h4>\n"
1693 "<code>date</code> - is datetime or time. The date to extract the hour from.\n"
1694 "<br>\n"
1695 "<code>Interval</code> - is Interval. The Interval to return the number of hours from.\n"
1696 "\n"
1697 "<h4>Example</h4>\n"
1698 "<!-- Show example of function.-->\n"
1699 "<code>hour('2012-07-22T13:24:57') &rarr; 13</code><br>\n"
1700 "<code>hour(tointerval('3 hours')) &rarr; 3</code><br>\n"
1701 "<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) &rarr; 3</code><br>\n"
1702 "<code>hour(age('2012-01-01','2010-01-01')) &rarr; 17520</code><br>\n"
1703 "\n"
1704 "") );
1705  gFunctionHelpTexts.insert( "Date and Time", QCoreApplication::translate( "function_help", "<h3>Date and Time Group</h3>\n"
1706 "This group contains functions for handling date and time data.\n"
1707 "") );
1708  gFunctionHelpTexts.insert( "ILIKE", QCoreApplication::translate( "function_help", "<h3>ILIKE expression</h3>\n"
1709 "Returns 1 if the first parameter matches case-insensitive the supplied pattern. LIKE can be used instead of ILIKE to make the match case-sensitive. Works with numbers also.\n"
1710 "\n"
1711 "<h4>Syntax</h4>\n"
1712 "<pre>string/number ILIKE pattern</pre>\n"
1713 "\n"
1714 "<h4>Arguments</h4>\n"
1715 "None\n"
1716 "\n"
1717 "<h4>Example</h4>\n"
1718 "<pre> 'A' ILIKE 'A' &rarr; returns 1 </pre>\n"
1719 "<pre> 'A' ILIKE 'a' &rarr; returns 1 </pre>\n"
1720 "<pre> 'A' ILIKE 'B' &rarr; returns 0 </pre>\n"
1721 "") );
1722  gFunctionHelpTexts.insert( "$page", QCoreApplication::translate( "function_help", "<h3>$page function</h3>\n"
1723 "Returns the current page number within a composition.\n"
1724 "\n"
1725 "<h4>Syntax</h4>\n"
1726 "<pre>$page</pre>\n"
1727 "\n"
1728 "<h4>Arguments</h4>\n"
1729 "None\n"
1730 "\n"
1731 "<h4>Example</h4>\n"
1732 "<pre>$page &rarr; 2</pre>\n"
1733 "\n"
1734 "") );
1735  gFunctionHelpTexts.insert( "tointerval", QCoreApplication::translate( "function_help", "<h3>tointerval() function</h3>\n"
1736 "Converts a string to a interval type. Can be used to take days, hours, month, etc off a date. \n"
1737 "\n"
1738 "<h4>Syntax</h4>\n"
1739 "<code>tointerval('string')</code><br>\n"
1740 "\n"
1741 "<h4>Arguments</h4>\n"
1742 "<code>string</code> - is string. Format {n} days {n} hours {n} months\n"
1743 "<br>\n"
1744 "\n"
1745 "<h4>Example</h4>\n"
1746 "<!-- Show example of function.-->\n"
1747 "<code>todatetime('2012-05-05 12:00:00') - tointerval('1 day 2 hours') &rarr; 2012-05-04T10:00:00</code><br>") );
1748  gFunctionHelpTexts.insert( "convexHull", QCoreApplication::translate( "function_help", "<h3>convexHull function</h3>\n"
1749 "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.\n"
1750 "\n"
1751 "<h4>Syntax</h4>\n"
1752 "<pre>convexHull( a, b )</pre>\n"
1753 "\n"
1754 "<h4>Arguments</h4>\n"
1755 "a &rarr; geometry\n"
1756 "a &rarr; geometry\n"
1757 "\n"
1758 "<h4>Example</h4>\n"
1759 "<pre> geomToWKT( convexHull( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 4 10)' )) ) &rarr; returns POLYGON((3 3,4 10,4 4,3 3)) </pre>\n"
1760 "") );
1761  gFunctionHelpTexts.insert( "asin", QCoreApplication::translate( "function_help", "<h3>asin() function</h3>\n"
1762 "Returns arcussinus of a value in radians.\n"
1763 "\n"
1764 "\n"
1765 "<p><h4>Syntax</h4>\n"
1766 " asin(<i>real</i>)</p>\n"
1767 "\n"
1768 "<p><h4>Arguments</h4>\n"
1769 "<i>real</i> &rarr; sin of an angle.</p>\n"
1770 "\n"
1771 "<p><h4>Example</h4>\n"
1772 " asin(1.0) &rarr; 1.5707963267949</p>\n"
1773 "") );
1774  gFunctionHelpTexts.insert( "$geometry", QCoreApplication::translate( "function_help", "<h3>$geometry function</h3>\n"
1775 "Returns the geometry of the current feature. Can be used for processing with other functions.\n"
1776 "\n"
1777 "<h4>Syntax</h4>\n"
1778 "<pre>$geometry</pre>\n"
1779 "\n"
1780 "<h4>Arguments</h4>\n"
1781 "None\n"
1782 "\n"
1783 "<h4>Example</h4>\n"
1784 "<pre> geomToWKT( $geometry ) &rarr; POINT(6 50)</pre>\n"
1785 "\n"
1786 "") );
1787  gFunctionHelpTexts.insert( "Operators", QCoreApplication::translate( "function_help", "<h3>Operators Group</h3>\n"
1788 "This group contains operators e.g + - * \n"
1789 "") );
1790  gFunctionHelpTexts.insert( "difference", QCoreApplication::translate( "function_help", "<h3>difference function</h3>\n"
1791 "Returns a geometry that represents that part of geometry a that does not intersect with geometry b.\n"
1792 "\n"
1793 "<h4>Syntax</h4>\n"
1794 "<pre>difference( a, b )</pre>\n"
1795 "\n"
1796 "<h4>Arguments</h4>\n"
1797 "geometry &rarr; geometry\n"
1798 "geometry &rarr; geometry\n"
1799 "\n"
1800 "<h4>Example</h4>\n"
1801 "<pre> geomToWKT( difference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4)' )) ) &rarr; returns LINESTRING(4 4, 5 5)</pre>\n"
1802 "") );
1803  gFunctionHelpTexts.insert( "IS", QCoreApplication::translate( "function_help", "<h3>IS expression</h3>\n"
1804 "Returns 1 if a is the same as b.\n"
1805 "\n"
1806 "<h4>Syntax</h4>\n"
1807 "<pre>a is b</pre>\n"
1808 "\n"
1809 "<h4>Arguments</h4>\n"
1810 "None\n"
1811 "\n"
1812 "<h4>Example</h4>\n"
1813 "<pre> 'A' IS 'A' &rarr; returns 1 </pre>\n"
1814 "<pre> 'A' IS 'a' &rarr; returns 0 </pre>\n"
1815 "<pre> 4 IS 4 &rarr; returns 1 </pre>\n"
1816 "<pre> 4 IS 2+2 &rarr; returns 1 </pre>\n"
1817 "<pre> 4 IS 2 &rarr; returns 0 </pre>\n"
1818 "<pre> 4 IS 2 &rarr; returns 0 </pre>\n"
1819 "<pre> $geometry IS NULL &rarr; returns 0, if your geometry is not NULL</pre>\n"
1820 "\n"
1821 "") );
1822  gFunctionHelpTexts.insert( "color_hsla", QCoreApplication::translate( "function_help", "<h3>color_hsla() function</h3>\n"
1823 "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes\n"
1824 "\n"
1825 "<p><h4>Syntax</h4>\n"
1826 " color_hsla(<i>hue, saturation, lightness, alpha</i>)</p>\n"
1827 "\n"
1828 "<p><h4>Arguments</h4>\n"
1829 "<!-- List args for functions here-->\n"
1830 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
1831 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1832 "<i> lightness</i> &rarr; the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
1833 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1834 "\n"
1835 "<p><h4>Example</h4>\n"
1836 "<!-- Show example of function.-->\n"
1837 " color_hsla(100,50,70,200) &rarr; '166,217,140,200'</p>\n"
1838 "") );
1839  gFunctionHelpTexts.insert( "Fields and Values", QCoreApplication::translate( "function_help", "<h3>Fields and Values</h3>\n"
1840 "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\n"
1841 "<br><br>\n"
1842 "Select the field name from the list then right-click to access context menu with options to load sample values from the selected field.\n"
1843 "\n"
1844 "<p><h4>Note:</h4>\n"
1845 "Loading field values from WFS layers isn't supported, before the layer is\n"
1846 "actually inserted, ie. when building queries.\n"
1847 "</p>\n"
1848 "") );
1849  gFunctionHelpTexts.insert( "$atlasgeometry", QCoreApplication::translate( "function_help", "<h3>$atlasgeometry function</h3>\n"
1850 "Returns the geometry of the current feature iterated in atlas.\n"
1851 "Can be used for rule based display of geometry when using atlas.\n"
1852 "For example to only show geometries of other layers when their geometry \n"
1853 "intersects the iterated geometry of features using atlas.\n"
1854 "\n"
1855 "<h4>Syntax</h4>\n"
1856 "<pre>$atlasgeometry</pre>\n"
1857 "\n"
1858 "<h4>Arguments</h4>\n"
1859 "None\n"
1860 "\n"
1861 "<h4>Example</h4>\n"
1862 "<pre> intersects( $atlasgeometry, $geometry ) </pre>\n"
1863 "\n"
1864 "") );
1865  gFunctionHelpTexts.insert( "$perimeter", QCoreApplication::translate( "function_help", "<h3>$perimeter function</h3>\n"
1866 "Returns the perimeter length of the current feature.\n"
1867 "\n"
1868 "<h4>Syntax</h4>\n"
1869 "<pre>$perimeter</pre>\n"
1870 "\n"
1871 "<h4>Arguments</h4>\n"
1872 "None\n"
1873 "\n"
1874 "<h4>Example</h4>\n"
1875 "<pre>$perimeter &rarr; 42</pre>\n"
1876 "\n"
1877 "") );
1878  gFunctionHelpTexts.insert( "totime", QCoreApplication::translate( "function_help", "<h3>totime() function</h3>\n"
1879 "Convert a string into Qt time type.\n"
1880 "\n"
1881 "<h4>Syntax</h4>\n"
1882 "<code>totime('string')</code><br>\n"
1883 "\n"
1884 "<h4>Arguments</h4>\n"
1885 "<code>string</code> - is string in Qt time format.\n"
1886 "<br>\n"
1887 "\n"
1888 "<h4>Example</h4>\n"
1889 "<!-- Show example of function.-->\n"
1890 "<code>totime('12:30:01') &rarr; 12:30:01</code><br>") );
1891  gFunctionHelpTexts.insert( "String", QCoreApplication::translate( "function_help", "<h3>String Group</h3>\n"
1892 "This group contains functions that operate on strings e.g replace, convert to upper case.\n"
1893 "") );
1894  gFunctionHelpTexts.insert( "CASE ELSE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
1895 "A conditional expression that can be used to evaluate multiple expressions and\n"
1896 "return a result.\n"
1897 "\n"
1898 "<h4>Syntax</h4>\n"
1899 "<pre>\n"
1900 " CASE\n"
1901 " WHEN <i>condition</i> THEN <i>result</i>\n"
1902 " [ ...n ]\n"
1903 " [ ELSE <i>result</i> ]\n"
1904 " END\n"
1905 "</pre>\n"
1906 "[ ] marks optional components\n"
1907 "\n"
1908 "<h4>Arguments</h4>\n"
1909 "<!-- List args for functions here-->\n"
1910 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
1911 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
1912 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
1913 "\n"
1914 "<h4>Example</h4>\n"
1915 "<!-- Show example of function.-->\n"
1916 "<pre>\n"
1917 " CASE\n"
1918 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
1919 " ELSE <i>\"column\"</i>\n"
1920 " END\n"
1921 "</pre>\n"
1922 "") );
1923  gFunctionHelpTexts.insert( "toreal", QCoreApplication::translate( "function_help", "<h3>toreal() function</h3>\n"
1924 "Converts a string to real number. Nothing changed if a value cannot be converted to real (e.g '123.56asd' is invalid). Numbers are rounded after saving changes if the precision is smaller than the result of the conversion.\n"
1925 "\n"
1926 "<p><h4>Syntax</h4>\n"
1927 " toreal(<i>string</i>)</p>\n"
1928 "\n"
1929 "<p><h4>Arguments</h4>\n"
1930 "<!-- List args for functions here-->\n"
1931 "<i> string</i> &rarr; is string. The String to convert to real number.</p>\n"
1932 "\n"
1933 "<p><h4>Example</h4>\n"
1934 "<!-- Show example of function.-->\n"
1935 " toreal('123.45') &rarr; 123.45</p>\n"
1936 "") );
1937  gFunctionHelpTexts.insert( "regexp_substr", QCoreApplication::translate( "function_help", "<h3>regexp_substr() function</h3>\n"
1938 "Returns the portion of a string which matches a supplied regular expression.\n"
1939 "\n"
1940 "<p><h4>Syntax</h4>\n"
1941 " regexp_substr(<i>string,regex</i>)</p>\n"
1942 "\n"
1943 "<p><h4>Arguments</h4>\n"
1944 "<!-- List args for functions here-->\n"
1945 "<i> string</i> &rarr; is string. The input string.<br>\n"
1946 "<i> regex</i> &rarr; is string. The regular expression to match against. Backslash characters must be double escaped (eg \"&#92;&#92;s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
1947 "\n"
1948 "<p><h4>Example</h4>\n"
1949 "<!-- Show example of function.-->\n"
1950 " regexp_substr('abc123','(&#92;&#92;d+)') &rarr; '123'</p>\n"
1951 "") );
1952  gFunctionHelpTexts.insert( "geomFromGML", QCoreApplication::translate( "function_help", "<h3>geomFromGML function</h3>\n"
1953 "Returns a geometry from a GML representation of geometry\n"
1954 "\n"
1955 "<h4>Syntax</h4>\n"
1956 "<pre>geomFromGML(text)</pre>\n"
1957 "\n"
1958 "<h4>Arguments</h4>\n"
1959 "text &rarr; GML representation of a geometry\n"
1960 "\n"
1961 "<h4>Example</h4>\n"
1962 "<pre> geomFromGML( '<gml:LineString srsName=\"EPSG:4326\"><gml:coordinates>4,4 5,5 6,6</gml:coordinates></gml:LineString>') &rarr; returns a geometry</pre>\n"
1963 "\n"
1964 "") );
1965  gFunctionHelpTexts.insert( "$scale", QCoreApplication::translate( "function_help", "<h3>$scale function</h3>\n"
1966 "Returns the current scale of the map canvas.\n"
1967 "<br>\n"
1968 "Note: This function is only available in some contexts and will be 0 otherwise. \n"
1969 "<h4>Syntax</h4>\n"
1970 "<code>$scale</code><br>\n"
1971 "\n"
1972 "<h4>Example</h4>\n"
1973 "<!-- Show example of function.-->\n"
1974 "<code>$scale &rarr; 10000</code><br>\n"
1975 "\n"
1976 "\n"
1977 "") );
1978  gFunctionHelpTexts.insert( "OR", QCoreApplication::translate( "function_help", "<h3>OR logical operator</h3>\n"
1979 "Returns 1 when condition a or b is true.\n"
1980 "\n"
1981 "<h4>Syntax</h4>\n"
1982 "<pre> condition a OR condition b </pre>\n"
1983 "\n"
1984 "<h4>Arguments</h4>\n"
1985 "None\n"
1986 "\n"
1987 "<h4>Example</h4>\n"
1988 "<pre> 4 = 2+2 OR 1 = 1 &rarr; returns 1 </pre>\n"
1989 "<pre> 4 = 2+2 OR 1 = 2 &rarr; returns 1 </pre>\n"
1990 "<pre> 4 = 2 OR 1 = 2 &rarr; returns 0 </pre>\n"
1991 "") );
1992  gFunctionHelpTexts.insert( "left", QCoreApplication::translate( "function_help", "<h3>left() function</h3>\n"
1993 "Returns a substring that contains the <i>n</i> leftmost characters of the string.\n"
1994 "\n"
1995 "<h4>Syntax</h4>\n"
1996 "<code>left(string, length)</code><br>\n"
1997 "\n"
1998 "<h4>Arguments</h4>\n"
1999 "<code>string</code> - is string. The string.\n"
2000 "<br>\n"
2001 "<code>length</code> - is int. The number of characters from the left to return.\n"
2002 "\n"
2003 "<h4>Example</h4>\n"
2004 "<!-- Show example of function.-->\n"
2005 "<code>left('Hello World',5) &rarr; 'Hello'</code><br>\n"
2006 "\n"
2007 "") );
2008  gFunctionHelpTexts.insert( "color_cmyka", QCoreApplication::translate( "function_help", "\n"
2009 "<h3>color_cmyka() function</h3>\n"
2010 "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components\n"
2011 "\n"
2012 "<p><h4>Syntax</h4>\n"
2013 " color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p>\n"
2014 "\n"
2015 "<p><h4>Arguments</h4>\n"
2016 "<!-- List args for functions here-->\n"
2017 "<i> cyan</i> &rarr; the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
2018 "<i> magenta</i> &rarr; the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
2019 "<i> yellow</i> &rarr; the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
2020 "<i> black</i> &rarr; the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
2021 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
2022 "\n"
2023 "<p><h4>Example</h4>\n"
2024 "<!-- Show example of function.-->\n"
2025 " color_cmyka(100,50,0,10,200) &rarr; '0,115,230,200'</p>\n"
2026 "") );
2027 }
static QHash< QString, QString > gFunctionHelpTexts
static void initFunctionHelp()