QGIS API Documentation  2.2.0-Valmiera
 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( "overlaps", QCoreApplication::translate( "function_help", "<h3>overlaps function</h3>\n"
892 "Returns 1 if the geometries share space, are of the same dimension, but are not completely contained by each other.\n"
893 "\n"
894 "<h4>Syntax</h4>\n"
895 "<pre>overlaps( a, b )</pre>\n"
896 "\n"
897 "<h4>Arguments</h4>\n"
898 "a &rarr; geometry\n"
899 "b &rarr; geometry\n"
900 "\n"
901 "<h4>Example</h4>\n"
902 "<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"
903 "<pre> overlaps( geomFromWKT( 'LINESTRING(0 0 , 1 1)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>\n"
904 "") );
905  gFunctionHelpTexts.insert( "toint", QCoreApplication::translate( "function_help", "<h3>toint() function</h3>\n"
906 "Converts a string to integer number. Nothing changed if a value cannot be converted to integer (e.g '123asd' is invalid).\n"
907 "\n"
908 "<p><h4>Syntax</h4>\n"
909 " toint(<i>string</i>)</p>\n"
910 "\n"
911 "<p><h4>Arguments</h4>\n"
912 "<!-- List args for functions here-->\n"
913 "<i> string</i> &rarr; is string. The String to convert to integer number.</p>\n"
914 "\n"
915 "<p><h4>Example</h4>\n"
916 "<!-- Show example of function.-->\n"
917 " toint('123') &rarr; 123</p>\n"
918 "") );
919  gFunctionHelpTexts.insert( "CASE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
920 "A conditional expression that can be used to evaluate multiple expressions and\n"
921 "return a result.\n"
922 "\n"
923 "<h4>Syntax</h4>\n"
924 "<pre>\n"
925 " CASE\n"
926 " WHEN <i>condition</i> THEN <i>result</i>\n"
927 " [ ...n ]\n"
928 " [ ELSE <i>result</i> ]\n"
929 " END\n"
930 "</pre>\n"
931 "[ ] marks optional components\n"
932 "\n"
933 "<h4>Arguments</h4>\n"
934 "<!-- List args for functions here-->\n"
935 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
936 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
937 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
938 "\n"
939 "<h4>Example</h4>\n"
940 "<!-- Show example of function.-->\n"
941 "<pre>\n"
942 " CASE\n"
943 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
944 " END\n"
945 "</pre>\n"
946 "") );
947  gFunctionHelpTexts.insert( "year", QCoreApplication::translate( "function_help", "<h3>year() function</h3>\n"
948 "Extract the year part from a date, or the number of years\n"
949 "from a <code>Interval</code>\n"
950 "\n"
951 "<h4>Syntax</h4>\n"
952 "<code>year(date)</code><br>\n"
953 "<code>year(Interval)</code><br>\n"
954 "\n"
955 "<h4>Arguments</h4>\n"
956 "<code>date</code> - is date or datetime. The date to extract the year from.\n"
957 "<br>\n"
958 "<code>Interval</code> - is Interval. The Interval to return the number of years from.\n"
959 "\n"
960 "<h4>Example</h4>\n"
961 "<!-- Show example of function.-->\n"
962 "<code>year('2012-05-12') &rarr; 2012</code><br>\n"
963 "<code>year(tointerval('3 Years')) &rarr; 3</code><br>\n"
964 "<code>year(age('2012-01-01','2010-01-01')) &rarr; 1.9986..</code><br>\n"
965 "\n"
966 "") );
967  gFunctionHelpTexts.insert( "Conditionals", QCoreApplication::translate( "function_help", "<h3>Conditionals Group</h3>\n"
968 "This group contains functions to handle conditional checks in expressions.\n"
969 "") );
970  gFunctionHelpTexts.insert( "log10", QCoreApplication::translate( "function_help", "<h3>log10() function</h3>\n"
971 "Returns the value of the base 10 logarithm of the passed expression.\n"
972 "<br>\n"
973 "This function takes one argument.\n"
974 "<h4>Syntax</h4>\n"
975 "<code>log10(value)</code><br>\n"
976 "\n"
977 "<h4>Arguments</h4>\n"
978 "<code>value</code> - any positive number.\n"
979 "<br>\n"
980 "\n"
981 "<h4>Example</h4>\n"
982 "<!-- Show example of function.-->\n"
983 "<code>log10(1) &rarr; 0</code><br>\n"
984 "<code>log10(100) &rarr; 2</code><br>\n"
985 "") );
986  gFunctionHelpTexts.insert( "ln", QCoreApplication::translate( "function_help", "<h3>ln() function</h3>\n"
987 "Returns the value of the natural logarithm of the passed expression.\n"
988 "<br>\n"
989 "This function takes one argument.\n"
990 "<h4>Syntax</h4>\n"
991 "<code>ln(value)</code><br>\n"
992 "\n"
993 "<h4>Arguments</h4>\n"
994 "<code>value</code> - any positive number.\n"
995 "<br>\n"
996 "\n"
997 "<h4>Example</h4>\n"
998 "<!-- Show example of function.-->\n"
999 "<code>ln(1) &rarr; 0</code><br>\n"
1000 "<code>ln(2.7182818284590452354) &rarr; 1</code><br>\n"
1001 "") );
1002  gFunctionHelpTexts.insert( "$pi", QCoreApplication::translate( "function_help", "<h3>$pi constant</h3>\n"
1003 "Returns pi as value for calculations\n"
1004 "\n"
1005 "<h4>Syntax</h4>\n"
1006 "<pre>$pi</pre>\n"
1007 "\n"
1008 "<h4>Arguments</h4>\n"
1009 "None\n"
1010 "\n"
1011 "<h4>Example</h4>\n"
1012 "<pre>$pi &rarr; 3.14159265358979</pre>\n"
1013 "") );
1014  gFunctionHelpTexts.insert( "atan", QCoreApplication::translate( "function_help", "<h3>atan() function</h3>\n"
1015 "Returns arcustanget of a value in radians.\n"
1016 "\n"
1017 "\n"
1018 "<p><h4>Syntax</h4>\n"
1019 " atan(<i>real</i>)</p>\n"
1020 "\n"
1021 "<p><h4>Arguments</h4>\n"
1022 "<i>real</i> &rarr; tan of an angle.</p>\n"
1023 "\n"
1024 "<p><h4>Example</h4>\n"
1025 " atan(0.5) &rarr; 0.463647609000806</p>\n"
1026 "") );
1027  gFunctionHelpTexts.insert( "Geometry", QCoreApplication::translate( "function_help", "<h3>Geometry Group</h3>\n"
1028 "This group contains functions that operate on geometry objects e.g length, area.\n"
1029 "") );
1030  gFunctionHelpTexts.insert( "$x", QCoreApplication::translate( "function_help", "<h3>$x function</h3>\n"
1031 "Returns the x coordinate of the current feature.\n"
1032 "\n"
1033 "<h4>Syntax</h4>\n"
1034 "<pre>$x</pre>\n"
1035 "\n"
1036 "<h4>Arguments</h4>\n"
1037 "None\n"
1038 "\n"
1039 "<h4>Example</h4>\n"
1040 "<pre>$x &rarr; 42</pre>\n"
1041 "\n"
1042 "") );
1043  gFunctionHelpTexts.insert( "LIKE", QCoreApplication::translate( "function_help", "<h3>LIKE expression</h3>\n"
1044 "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also.\n"
1045 "\n"
1046 "<h4>Syntax</h4>\n"
1047 "<pre>string/number LIKE pattern</pre>\n"
1048 "\n"
1049 "<h4>Arguments</h4>\n"
1050 "None\n"
1051 "\n"
1052 "<h4>Example</h4>\n"
1053 "<pre> 'A' LIKE 'A' &rarr; returns 1 </pre>\n"
1054 "<pre> 'A' LIKE 'a' &rarr; returns 0 </pre>\n"
1055 "<pre> 'A' LIKE 'B' &rarr; returns 0 </pre>\n"
1056 "") );
1057  gFunctionHelpTexts.insert( "sqrt", QCoreApplication::translate( "function_help", "<h3>sqrt() function</h3>\n"
1058 "Returns square root of a value\n"
1059 "\n"
1060 "\n"
1061 "<p><h4>Syntax</h4>\n"
1062 " sqrt(<i>real</i>)</p>\n"
1063 "\n"
1064 "<p><h4>Arguments</h4>\n"
1065 "<i>real</i> &rarr; number.</p>\n"
1066 "\n"
1067 "<p><h4>Example</h4>\n"
1068 " sqrt(9) &rarr; 3</p>\n"
1069 "") );
1070  gFunctionHelpTexts.insert( "tan", QCoreApplication::translate( "function_help", "<h3>tan() function</h3>\n"
1071 "Returns tangent of an angle.\n"
1072 "\n"
1073 "\n"
1074 "<p><h4>Syntax</h4>\n"
1075 " tan(<i>real</i>)</p>\n"
1076 "\n"
1077 "<p><h4>Arguments</h4>\n"
1078 "<i>real</i> &rarr; angle in radians.</p>\n"
1079 "\n"
1080 "<p><h4>Example</h4>\n"
1081 " tan(1.0) &rarr; 1.5574077246549</p>\n"
1082 "") );
1083  gFunctionHelpTexts.insert( "format_number", QCoreApplication::translate( "function_help", "<h3>format_number() function</h3>\n"
1084 "Returns a number formatted with the locale separator for thousands. \n"
1085 "Also truncates the number to the number of supplied places. \n"
1086 "<h4>Syntax</h4>\n"
1087 "<code>format_number(number,places)</code><br>\n"
1088 "\n"
1089 "<h4>Arguments</h4>\n"
1090 "<code>number</code> - is number. The number to be formatted.\n"
1091 "<br>\n"
1092 "<code>places</code> - is int. The number of decimal places to truncate the string\n"
1093 "to.\n"
1094 "\n"
1095 "<h4>Example</h4>\n"
1096 "<!-- Show example of function.-->\n"
1097 "<code>format_number(10000000.332,2) &rarr; 10,000,000.33</code>\n"
1098 "\n"
1099 "") );
1100  gFunctionHelpTexts.insert( "round", QCoreApplication::translate( "function_help", "<h3>round() function</h3>\n"
1101 "Rounds a number to number of decimal places.\n"
1102 "<br>\n"
1103 "This function can take one or two arguments depending on what is needed.\n"
1104 "<h4>Syntax</h4>\n"
1105 "<code>round(decimal,places)</code><br>\n"
1106 "<code>round(decimal)</code><br>\n"
1107 "\n"
1108 "<h4>Arguments</h4>\n"
1109 "<code>decimal</code> - is decimal. The decimal number to be rounded.\n"
1110 "<br>\n"
1111 "<code>places</code> - is int. The number of places to round decimal too. Can be negative.\n"
1112 "\n"
1113 "<h4>Example</h4>\n"
1114 "<!-- Show example of function.-->\n"
1115 "<code>round(1234.567, 2 ) &rarr; 1234.57</code><br>\n"
1116 "use <code>round(decimal)</code> to round to the nearest integer<br>\n"
1117 "<code>round(1234.567) &rarr; 1235</code><br>\n"
1118 "\n"
1119 "\n"
1120 "") );
1121  gFunctionHelpTexts.insert( "regexp_replace", QCoreApplication::translate( "function_help", "<h3>regexp_replace() function</h3>\n"
1122 "Returns a string with the supplied regular expression replaced.\n"
1123 "\n"
1124 "<p><h4>Syntax</h4>\n"
1125 " regexp_replace(<i>string,regex,after</i>)</p>\n"
1126 "\n"
1127 "<p><h4>Arguments</h4>\n"
1128 "<!-- List args for functions here-->\n"
1129 "<i> string</i> &rarr; is string. The start string.<br>\n"
1130 "<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"
1131 "<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"
1132 "\n"
1133 "<p><h4>Example</h4>\n"
1134 "<!-- Show example of function.-->\n"
1135 " regexp_replace('QGIS SHOULD ROCK','&#92;&#92;sSHOULD&#92;&#92;s',' DOES ') &rarr; 'QGIS DOES ROCK'</p>\n"
1136 "") );
1137  gFunctionHelpTexts.insert( "Record", QCoreApplication::translate( "function_help", "<h3>Record Group</h3>\n"
1138 "This group contains functions that operate on record identifiers.\n"
1139 "") );
1140  gFunctionHelpTexts.insert( "contains", QCoreApplication::translate( "function_help", "<h3>contains function</h3>\n"
1141 " 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"
1142 "\n"
1143 "<h4>Syntax</h4>\n"
1144 "<pre>contains( geometry a , geometry a)</pre>\n"
1145 "\n"
1146 "<h4>Arguments</h4>\n"
1147 "geometry &rarr; geometry\n"
1148 "geometry &rarr; geometry\n"
1149 "\n"
1150 "<h4>Example</h4>\n"
1151 "<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"
1152 "<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"
1153 "") );
1154  gFunctionHelpTexts.insert( "$id", QCoreApplication::translate( "function_help", "<h3>$id function</h3>\n"
1155 "Returns the feature id of the current row.\n"
1156 "\n"
1157 "<h4>Syntax</h4>\n"
1158 "<pre>$id</pre>\n"
1159 "\n"
1160 "<h4>Arguments</h4>\n"
1161 "None\n"
1162 "\n"
1163 "<h4>Example</h4>\n"
1164 "<pre>$id &rarr; 42</pre>\n"
1165 "\n"
1166 "") );
1167  gFunctionHelpTexts.insert( "format_date", QCoreApplication::translate( "function_help", "<h3>format_date() function</h3>\n"
1168 "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"
1169 "\n"
1170 "<h4>Syntax</h4>\n"
1171 "<code>format_date('string', 'format_string')</code><br>\n"
1172 "\n"
1173 "<h4>Arguments</h4>\n"
1174 "<code>string</code> - is string. Date/Time/DateTime string.\n"
1175 "<br>\n"
1176 "<code>format_string</code> - is string. String template used to format the string.\n"
1177 "\n"
1178 " <table>\n"
1179 " <thead>\n"
1180 " <tr>\n"
1181 " <th>Expression</th>\n"
1182 "\n"
1183 " <th>Output</th>\n"
1184 " </tr>\n"
1185 " </thead>\n"
1186 "\n"
1187 " <tr valign=\"top\">\n"
1188 " <td>d</td>\n"
1189 "\n"
1190 " <td>the day as number without a leading zero (1 to 31)</td>\n"
1191 " </tr>\n"
1192 "\n"
1193 " <tr valign=\"top\">\n"
1194 " <td>dd</td>\n"
1195 "\n"
1196 " <td>the day as number with a leading zero (01 to 31)</td>\n"
1197 " </tr>\n"
1198 "\n"
1199 " <tr valign=\"top\">\n"
1200 " <td>ddd</td>\n"
1201 "\n"
1202 " <td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses <a href=\n"
1203 " \"qdate.html#shortDayName\">QDate::shortDayName</a>().</td>\n"
1204 " </tr>\n"
1205 "\n"
1206 " <tr valign=\"top\">\n"
1207 " <td>dddd</td>\n"
1208 "\n"
1209 " <td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses <a href=\n"
1210 " \"qdate.html#longDayName\">QDate::longDayName</a>().</td>\n"
1211 " </tr>\n"
1212 "\n"
1213 " <tr valign=\"top\">\n"
1214 " <td>M</td>\n"
1215 "\n"
1216 " <td>the month as number without a leading zero (1-12)</td>\n"
1217 " </tr>\n"
1218 "\n"
1219 " <tr valign=\"top\">\n"
1220 " <td>MM</td>\n"
1221 "\n"
1222 " <td>the month as number with a leading zero (01-12)</td>\n"
1223 " </tr>\n"
1224 "\n"
1225 " <tr valign=\"top\">\n"
1226 " <td>MMM</td>\n"
1227 "\n"
1228 " <td>the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses <a href=\n"
1229 " \"qdate.html#shortMonthName\">QDate::shortMonthName</a>().</td>\n"
1230 " </tr>\n"
1231 "\n"
1232 " <tr valign=\"top\">\n"
1233 " <td>MMMM</td>\n"
1234 "\n"
1235 " <td>the long localized month name (e.g. 'January' to 'December'). Uses <a href=\n"
1236 " \"qdate.html#longMonthName\">QDate::longMonthName</a>().</td>\n"
1237 " </tr>\n"
1238 "\n"
1239 " <tr valign=\"top\">\n"
1240 " <td>yy</td>\n"
1241 "\n"
1242 " <td>the year as two digit number (00-99)</td>\n"
1243 " </tr>\n"
1244 "\n"
1245 " <tr valign=\"top\">\n"
1246 " <td>yyyy</td>\n"
1247 "\n"
1248 " <td>the year as four digit number</td>\n"
1249 " </tr>\n"
1250 " </table>\n"
1251 "\n"
1252 " <p>These expressions may be used for the time part of the format string:</p>\n"
1253 "\n"
1254 " <table>\n"
1255 " <thead>\n"
1256 " <tr>\n"
1257 " <th>Expression</th>\n"
1258 "\n"
1259 " <th>Output</th>\n"
1260 " </tr>\n"
1261 " </thead>\n"
1262 "\n"
1263 " <tr valign=\"top\">\n"
1264 " <td>h</td>\n"
1265 "\n"
1266 " <td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td>\n"
1267 " </tr>\n"
1268 "\n"
1269 " <tr valign=\"top\">\n"
1270 " <td>hh</td>\n"
1271 "\n"
1272 " <td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td>\n"
1273 " </tr>\n"
1274 "\n"
1275 " <tr valign=\"top\">\n"
1276 " <td>H</td>\n"
1277 "\n"
1278 " <td>the hour without a leading zero (0 to 23, even with AM/PM display)</td>\n"
1279 " </tr>\n"
1280 "\n"
1281 " <tr valign=\"top\">\n"
1282 " <td>HH</td>\n"
1283 "\n"
1284 " <td>the hour with a leading zero (00 to 23, even with AM/PM display)</td>\n"
1285 " </tr>\n"
1286 "\n"
1287 " <tr valign=\"top\">\n"
1288 " <td>m</td>\n"
1289 "\n"
1290 " <td>the minute without a leading zero (0 to 59)</td>\n"
1291 " </tr>\n"
1292 "\n"
1293 " <tr valign=\"top\">\n"
1294 " <td>mm</td>\n"
1295 "\n"
1296 " <td>the minute with a leading zero (00 to 59)</td>\n"
1297 " </tr>\n"
1298 "\n"
1299 " <tr valign=\"top\">\n"
1300 " <td>s</td>\n"
1301 "\n"
1302 " <td>the second without a leading zero (0 to 59)</td>\n"
1303 " </tr>\n"
1304 "\n"
1305 " <tr valign=\"top\">\n"
1306 " <td>ss</td>\n"
1307 "\n"
1308 " <td>the second with a leading zero (00 to 59)</td>\n"
1309 " </tr>\n"
1310 "\n"
1311 " <tr valign=\"top\">\n"
1312 " <td>z</td>\n"
1313 "\n"
1314 " <td>the milliseconds without leading zeroes (0 to 999)</td>\n"
1315 " </tr>\n"
1316 "\n"
1317 " <tr valign=\"top\">\n"
1318 " <td>zzz</td>\n"
1319 "\n"
1320 " <td>the milliseconds with leading zeroes (000 to 999)</td>\n"
1321 " </tr>\n"
1322 "\n"
1323 " <tr valign=\"top\">\n"
1324 " <td>AP or A</td>\n"
1325 "\n"
1326 " <td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td>\n"
1327 " </tr>\n"
1328 "\n"
1329 " <tr valign=\"top\">\n"
1330 " <td>ap or a</td>\n"
1331 "\n"
1332 " <td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td>\n"
1333 " </tr>\n"
1334 " </table>\n"
1335 "\n"
1336 "<br>\n"
1337 "\n"
1338 "<h4>Example</h4>\n"
1339 "<!-- Show example of function.-->\n"
1340 "<code>format_date('2012-05-15','dd.mm.yyyy') &rarr; 15.05.2012</code><br>\n"
1341 "") );
1342  gFunctionHelpTexts.insert( "exp", QCoreApplication::translate( "function_help", "<h3>exp() function</h3>\n"
1343 "Returns exponential of an value.\n"
1344 "\n"
1345 "\n"
1346 "<p><h4>Syntax</h4>\n"
1347 " exp(<i>real</i>)</p>\n"
1348 "\n"
1349 "<p><h4>Arguments</h4>\n"
1350 "<i>real</i> &rarr; number.</p>\n"
1351 "\n"
1352 "<p><h4>Example</h4>\n"
1353 " exp(1.0) &rarr; 2.71828182845905</p>\n"
1354 "") );
1355  gFunctionHelpTexts.insert( "$now", QCoreApplication::translate( "function_help", "<h3>$now function</h3>\n"
1356 "Returns the current date and time\n"
1357 "\n"
1358 "<h4>Syntax</h4>\n"
1359 "<pre>$now</pre>\n"
1360 "\n"
1361 "<h4>Arguments</h4>\n"
1362 "None\n"
1363 "\n"
1364 "<h4>Example</h4>\n"
1365 "<pre>$now &rarr; 2012-07-22T13:24:57</pre>\n"
1366 "\n"
1367 "") );
1368  gFunctionHelpTexts.insert( "$rownum", QCoreApplication::translate( "function_help", "<h3>$rownum function</h3>\n"
1369 "Returns the number of the current row.\n"
1370 "\n"
1371 "<h4>Syntax</h4>\n"
1372 "<pre>$rownum</pre>\n"
1373 "\n"
1374 "<h4>Arguments</h4>\n"
1375 "None\n"
1376 "\n"
1377 "<h4>Example</h4>\n"
1378 "<pre>$rownum &rarr; 4711</pre>\n"
1379 "\n"
1380 "") );
1381  gFunctionHelpTexts.insert( "replace", QCoreApplication::translate( "function_help", "<h3>replace() function</h3>\n"
1382 "Returns a string with the the supplied string replaced.\n"
1383 "\n"
1384 "<p><h4>Syntax</h4>\n"
1385 " replace(<i>string,before,after</i>)</p>\n"
1386 "\n"
1387 "<p><h4>Arguments</h4>\n"
1388 "<!-- List args for functions here-->\n"
1389 "<i> string</i> &rarr; is string. The start string.<br>\n"
1390 "<i> before</i> &rarr; is string. The string to replace.<br>\n"
1391 "<i> after</i> &rarr; is string. The string that will replace <i>before</i><br></p>\n"
1392 "\n"
1393 "<p><h4>Example</h4>\n"
1394 "<!-- Show example of function.-->\n"
1395 " replace('QGIS SHOULD ROCK','SHOULD','DOES') &rarr; 'QGIS DOES ROCK'</p>\n"
1396 "") );
1397  gFunctionHelpTexts.insert( "lpad", QCoreApplication::translate( "function_help", "<h3>lpad() function</h3>\n"
1398 "Returns a string with supplied width padded\n"
1399 "using the fill character.\n"
1400 "\n"
1401 "<h4>Syntax</h4>\n"
1402 "<code>lpad(string, length, fill)</code><br>\n"
1403 "\n"
1404 "<h4>Arguments</h4>\n"
1405 "<code>string</code> - is string. The string.\n"
1406 "<br>\n"
1407 "<code>length</code> - is int. The length of the new string.\n"
1408 "<br>\n"
1409 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1410 "\n"
1411 "<h4>Example</h4>\n"
1412 "<!-- Show example of function.-->\n"
1413 "<code>lpad('Hello', 10, 'x') &rarr; 'Helloxxxxx'</code><br>\n"
1414 "") );
1415  gFunctionHelpTexts.insert( "$map", QCoreApplication::translate( "function_help", "<h3>$map function</h3>\n"
1416 "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"
1417 "drawn within the main QGIS window.\n"
1418 "\n"
1419 "<h4>Syntax</h4>\n"
1420 "<pre>$map</pre>\n"
1421 "\n"
1422 "<h4>Arguments</h4>\n"
1423 "None\n"
1424 "\n"
1425 "<h4>Example</h4>\n"
1426 "<!-- Show example of function.-->\n"
1427 "<pre>$map &rarr; \"overview_map\" (within a composer item)<br />\n"
1428 "$map &rarr; \"canvas\" (within the main QGIS main canvas)</pre>\n"
1429 "\n"
1430 "\n"
1431 "") );
1432  gFunctionHelpTexts.insert( "NOT", QCoreApplication::translate( "function_help", "<h3>NOT</h3>\n"
1433 "Returns 1 if a is not the same as b.\n"
1434 "\n"
1435 "<h4>Syntax</h4>\n"
1436 "<pre> a NOT b </pre>\n"
1437 "\n"
1438 "<h4>Arguments</h4>\n"
1439 "None\n"
1440 "\n"
1441 "<h4>Example</h4>\n"
1442 "<pre> 'a' IS NOT 'b' &rarr; returns 1 </pre>\n"
1443 "<pre> 'a' IS NOT 'a' &rarr; returns 0 </pre>\n"
1444 "<pre> 4 IS NOT 2+2 &rarr; returns 0 </pre>\n"
1445 "\n"
1446 "") );
1447  gFunctionHelpTexts.insert( "ceil", QCoreApplication::translate( "function_help", "<h3>ceil() function</h3>\n"
1448 "Rounds a number upwards.\n"
1449 "\n"
1450 "<h4>Syntax</h4>\n"
1451 "<code>ceil(value)</code><br>\n"
1452 "\n"
1453 "<h4>Arguments</h4>\n"
1454 "<code>value</code> - a number.\n"
1455 "<br>\n"
1456 "\n"
1457 "<h4>Example</h4>\n"
1458 "<!-- Show example of function.-->\n"
1459 "<code>ceil(4.9) &rarr; 5</code><br>\n"
1460 "<code>ceil(-4.9) &rarr; -4</code><br>\n"
1461 "") );
1462  gFunctionHelpTexts.insert( "$area", QCoreApplication::translate( "function_help", "<h3>$area function</h3>\n"
1463 "Returns the area size of the current feature.\n"
1464 "\n"
1465 "<h4>Syntax</h4>\n"
1466 "<pre>$area</pre>\n"
1467 "\n"
1468 "<h4>Arguments</h4>\n"
1469 "None\n"
1470 "\n"
1471 "<h4>Example</h4>\n"
1472 "<pre>$area &rarr; 42</pre>\n"
1473 "\n"
1474 "") );
1475  gFunctionHelpTexts.insert( "sin", QCoreApplication::translate( "function_help", "<h3>sin() function</h3>\n"
1476 "Returns sinus of an angle.\n"
1477 "\n"
1478 "\n"
1479 "<p><h4>Syntax</h4>\n"
1480 " sin(<i>real</i>)</p>\n"
1481 "\n"
1482 "<p><h4>Arguments</h4>\n"
1483 "<i>real</i> &rarr; angle in radians.</p>\n"
1484 "\n"
1485 "<p><h4>Example</h4>\n"
1486 " sin(1.571) &rarr; 0.999999682931835</p>\n"
1487 "") );
1488  gFunctionHelpTexts.insert( "week", QCoreApplication::translate( "function_help", "<h3>week() function</h3>\n"
1489 "Extract the week number from a date, or the number of weeks\n"
1490 "from a <code>Interval</code>\n"
1491 "\n"
1492 "<h4>Syntax</h4>\n"
1493 "<code>week(date)</code><br>\n"
1494 "<code>week(Interval)</code><br>\n"
1495 "\n"
1496 "<h4>Arguments</h4>\n"
1497 "<code>date</code> - is date or datetime. The date to extract the week from.\n"
1498 "<br>\n"
1499 "<code>Interval</code> - is Interval. The Interval to return the number of weeks from.\n"
1500 "\n"
1501 "<h4>Example</h4>\n"
1502 "<!-- Show example of function.-->\n"
1503 "<code>week('2012-05-12') &rarr; 19</code><br>\n"
1504 "<code>week(tointerval('3 weeks')) &rarr; 3</code><br>\n"
1505 "<code>week(age('2012-01-01','2010-01-01')) &rarr; 104.285...</code><br>\n"
1506 "\n"
1507 "") );
1508  gFunctionHelpTexts.insert( "rpad", QCoreApplication::translate( "function_help", "<h3>rpad() function</h3>\n"
1509 "Returns a string with supplied width padded\n"
1510 "using the fill character.\n"
1511 "\n"
1512 "<h4>Syntax</h4>\n"
1513 "<code>rpad(string, width, fill)</code><br>\n"
1514 "\n"
1515 "<h4>Arguments</h4>\n"
1516 "<code>string</code> - is string. The string.\n"
1517 "<br>\n"
1518 "<code>width</code> - is int. The length of the new string.\n"
1519 "<br>\n"
1520 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1521 "\n"
1522 "<h4>Example</h4>\n"
1523 "<!-- Show example of function.-->\n"
1524 "<code>rpad('Hello', 10, 'x') &rarr; 'xxxxxHello'</code><br>\n"
1525 "\n"
1526 "") );
1527  gFunctionHelpTexts.insert( "day", QCoreApplication::translate( "function_help", "<h3>day() function</h3>\n"
1528 "Extract the day from a date, or the number of days\n"
1529 "from a <code>Interval</code>\n"
1530 "\n"
1531 "<h4>Syntax</h4>\n"
1532 "<code>day(date)</code><br>\n"
1533 "<code>day(Interval)</code><br>\n"
1534 "\n"
1535 "<h4>Arguments</h4>\n"
1536 "<code>date</code> - is date or datetime. The date to extract the day from.\n"
1537 "<br>\n"
1538 "<code>Interval</code> - is Interval. The Interval to return the number of days from.\n"
1539 "\n"
1540 "<h4>Example</h4>\n"
1541 "<!-- Show example of function.-->\n"
1542 "<code>day('2012-05-12') &rarr; 12</code><br>\n"
1543 "<code>day(tointerval('3 days')) &rarr; 3</code><br>\n"
1544 "<code>day(age('2012-01-01','2010-01-01')) &rarr; 730</code><br>\n"
1545 "\n"
1546 "") );
1547  gFunctionHelpTexts.insert( "geomFromWKT", QCoreApplication::translate( "function_help", "<h3>geomFromWKT function</h3>\n"
1548 "Returns a geometry created from a Well-Known Text (WKT) representation.\n"
1549 "\n"
1550 "<h4>Syntax</h4>\n"
1551 "<pre>geomFromWKT(text)</pre>\n"
1552 "\n"
1553 "<h4>Arguments</h4>\n"
1554 "text &rarr; Well-Known Text (WKT) representation of a geometry\n"
1555 "\n"
1556 "<h4>Example</h4>\n"
1557 "<pre> geomFromWKT( 'POINT(4 5)' ) &rarr; returns a geometry</pre>\n"
1558 "\n"
1559 "") );
1560  gFunctionHelpTexts.insert( "combine", QCoreApplication::translate( "function_help", "<h3>combine function</h3>\n"
1561 "Returns the combination of geometry a and geometry b.\n"
1562 "\n"
1563 "<h4>Syntax</h4>\n"
1564 "<pre>combine( geometry a , geometry b)</pre>\n"
1565 "\n"
1566 "<h4>Arguments</h4>\n"
1567 "geometry &rarr; geometry\n"
1568 "geometry &rarr; geometry\n"
1569 "\n"
1570 "<h4>Example</h4>\n"
1571 "<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"
1572 "<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"
1573 "") );
1574  gFunctionHelpTexts.insert( "Color", QCoreApplication::translate( "function_help", "\n"
1575 "<h3>Color Group</h3>\n"
1576 "This group contains functions for manipulating colors\n"
1577 "") );
1578  gFunctionHelpTexts.insert( "buffer", QCoreApplication::translate( "function_help", "<h3>buffer function</h3>\n"
1579 "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"
1580 "\n"
1581 "<h4>Syntax</h4>\n"
1582 "<pre>buffer(a, b)</pre>\n"
1583 "\n"
1584 "<h4>Arguments</h4>\n"
1585 "a &rarr; geometry\n"
1586 "b &rarr; distance for the buffer\n"
1587 "\n"
1588 "<h4>Example</h4>\n"
1589 "<pre> buffer($geometry, 10.5 ) &rarr; returns a polygon</pre>\n"
1590 "\n"
1591 "") );
1592  gFunctionHelpTexts.insert( "acos", QCoreApplication::translate( "function_help", "<h3>acos() function</h3>\n"
1593 "Returns arcuscosinus of a value in radians.\n"
1594 "\n"
1595 "\n"
1596 "<p><h4>Syntax</h4>\n"
1597 " acos(<i>real</i>)</p>\n"
1598 "\n"
1599 "<p><h4>Arguments</h4>\n"
1600 "<i>real</i> &rarr; cos of an angle.</p>\n"
1601 "\n"
1602 "<p><h4>Example</h4>\n"
1603 " acos(0.5) &rarr; 1.0471975511966</p>\n"
1604 "") );
1605  gFunctionHelpTexts.insert( "Math", QCoreApplication::translate( "function_help", "<h3>Math Group</h3>\n"
1606 "This group contains math functions e.g square root, sin and cos\n"
1607 "") );
1608  gFunctionHelpTexts.insert( "$feature", QCoreApplication::translate( "function_help", "<h3>$feature function</h3>\n"
1609 "In atlas generation, returns the current feature number that is iterated over on the coverage layer.\n"
1610 "\n"
1611 "<h4>Syntax</h4>\n"
1612 "<pre>$feature</pre>\n"
1613 "\n"
1614 "<h4>Arguments</h4>\n"
1615 "None\n"
1616 "\n"
1617 "<h4>Example</h4>\n"
1618 "<pre>$feature &rarr; 2</pre>\n"
1619 "\n"
1620 "") );
1621  gFunctionHelpTexts.insert( "atan2", QCoreApplication::translate( "function_help", "<h3>atan2() function</h3>\n"
1622 "Returns arcustangens of y/x using the signs of the two \n"
1623 "arguments to determine the quadrant of the result\n"
1624 "\n"
1625 "\n"
1626 "\n"
1627 "<p><h4>Syntax</h4>\n"
1628 " atan2(<i>real</i>, <i>real</i>)</p>\n"
1629 "\n"
1630 "<p><h4>Arguments</h4>\n"
1631 "<i>real</i> &rarr; y coordinate difference<br>\n"
1632 "<i>real</i> &rarr; x coordinate difference</p>\n"
1633 "\n"
1634 "<p><h4>Example</h4>\n"
1635 " atan2(1.0, 1.732) &rarr; 0.523611477769969</p>\n"
1636 "") );
1637  gFunctionHelpTexts.insert( "regexp_match", QCoreApplication::translate( "function_help", "<h3>regexp_match() function</h3>\n"
1638 "Returns true if any part of a string matches the supplied regular expression.\n"
1639 "\n"
1640 "<p><h4>Syntax</h4>\n"
1641 " regexp_match(<i>string,regex</i>)</p>\n"
1642 "\n"
1643 "<p><h4>Arguments</h4>\n"
1644 "<!-- List args for functions here-->\n"
1645 "<i> string</i> &rarr; is string. The string to test against the regular expression.<br>\n"
1646 "<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"
1647 "\n"
1648 "<p><h4>Example</h4>\n"
1649 "<!-- Show example of function.-->\n"
1650 " regexp_match('QGIS ROCKS','&#92;&#92;sROCKS') &rarr; 1</p>\n"
1651 "") );
1652  gFunctionHelpTexts.insert( "hour", QCoreApplication::translate( "function_help", "<h3>hour() function</h3>\n"
1653 "Extract the hour from a datetime or time, or the number of hours\n"
1654 "from a <code>Interval</code>\n"
1655 "\n"
1656 "<h4>Syntax</h4>\n"
1657 "<code>hour(datetime)</code><br>\n"
1658 "<code>hour(Interval)</code><br>\n"
1659 "\n"
1660 "<h4>Arguments</h4>\n"
1661 "<code>date</code> - is datetime or time. The date to extract the hour from.\n"
1662 "<br>\n"
1663 "<code>Interval</code> - is Interval. The Interval to return the number of hours from.\n"
1664 "\n"
1665 "<h4>Example</h4>\n"
1666 "<!-- Show example of function.-->\n"
1667 "<code>hour('2012-07-22T13:24:57') &rarr; 13</code><br>\n"
1668 "<code>hour(tointerval('3 hours')) &rarr; 3</code><br>\n"
1669 "<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) &rarr; 3</code><br>\n"
1670 "<code>hour(age('2012-01-01','2010-01-01')) &rarr; 17520</code><br>\n"
1671 "\n"
1672 "") );
1673  gFunctionHelpTexts.insert( "Date and Time", QCoreApplication::translate( "function_help", "<h3>Date and Time Group</h3>\n"
1674 "This group contains functions for handling date and time data.\n"
1675 "") );
1676  gFunctionHelpTexts.insert( "ILIKE", QCoreApplication::translate( "function_help", "<h3>ILIKE expression</h3>\n"
1677 "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"
1678 "\n"
1679 "<h4>Syntax</h4>\n"
1680 "<pre>string/number ILIKE pattern</pre>\n"
1681 "\n"
1682 "<h4>Arguments</h4>\n"
1683 "None\n"
1684 "\n"
1685 "<h4>Example</h4>\n"
1686 "<pre> 'A' ILIKE 'A' &rarr; returns 1 </pre>\n"
1687 "<pre> 'A' ILIKE 'a' &rarr; returns 1 </pre>\n"
1688 "<pre> 'A' ILIKE 'B' &rarr; returns 0 </pre>\n"
1689 "") );
1690  gFunctionHelpTexts.insert( "$page", QCoreApplication::translate( "function_help", "<h3>$page function</h3>\n"
1691 "Returns the current page number within a composition.\n"
1692 "\n"
1693 "<h4>Syntax</h4>\n"
1694 "<pre>$page</pre>\n"
1695 "\n"
1696 "<h4>Arguments</h4>\n"
1697 "None\n"
1698 "\n"
1699 "<h4>Example</h4>\n"
1700 "<pre>$page &rarr; 2</pre>\n"
1701 "\n"
1702 "") );
1703  gFunctionHelpTexts.insert( "tointerval", QCoreApplication::translate( "function_help", "<h3>tointerval() function</h3>\n"
1704 "Converts a string to a interval type. Can be used to take days, hours, month, etc off a date. \n"
1705 "\n"
1706 "<h4>Syntax</h4>\n"
1707 "<code>tointerval('string')</code><br>\n"
1708 "\n"
1709 "<h4>Arguments</h4>\n"
1710 "<code>string</code> - is string. Format {n} days {n} hours {n} months\n"
1711 "<br>\n"
1712 "\n"
1713 "<h4>Example</h4>\n"
1714 "<!-- Show example of function.-->\n"
1715 "<code>todatetime('2012-05-05 12:00:00') - tointerval('1 day 2 hours') &rarr; 2012-05-04T10:00:00</code><br>") );
1716  gFunctionHelpTexts.insert( "convexHull", QCoreApplication::translate( "function_help", "<h3>convexHull function</h3>\n"
1717 "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.\n"
1718 "\n"
1719 "<h4>Syntax</h4>\n"
1720 "<pre>convexHull( a, b )</pre>\n"
1721 "\n"
1722 "<h4>Arguments</h4>\n"
1723 "a &rarr; geometry\n"
1724 "a &rarr; geometry\n"
1725 "\n"
1726 "<h4>Example</h4>\n"
1727 "<pre> geomToWKT( convexHull( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 4 10)' )) ) &rarr; returns POLYGON((3 3,4 10,4 4,3 3)) </pre>\n"
1728 "") );
1729  gFunctionHelpTexts.insert( "asin", QCoreApplication::translate( "function_help", "<h3>asin() function</h3>\n"
1730 "Returns arcussinus of a value in radians.\n"
1731 "\n"
1732 "\n"
1733 "<p><h4>Syntax</h4>\n"
1734 " asin(<i>real</i>)</p>\n"
1735 "\n"
1736 "<p><h4>Arguments</h4>\n"
1737 "<i>real</i> &rarr; sin of an angle.</p>\n"
1738 "\n"
1739 "<p><h4>Example</h4>\n"
1740 " asin(1.0) &rarr; 1.5707963267949</p>\n"
1741 "") );
1742  gFunctionHelpTexts.insert( "$geometry", QCoreApplication::translate( "function_help", "<h3>$geometry function</h3>\n"
1743 "Returns the geometry of the current feature. Can be used for processing with other functions.\n"
1744 "\n"
1745 "<h4>Syntax</h4>\n"
1746 "<pre>$geometry</pre>\n"
1747 "\n"
1748 "<h4>Arguments</h4>\n"
1749 "None\n"
1750 "\n"
1751 "<h4>Example</h4>\n"
1752 "<pre> geomToWKT( $geometry ) &rarr; POINT(6 50)</pre>\n"
1753 "\n"
1754 "") );
1755  gFunctionHelpTexts.insert( "Operators", QCoreApplication::translate( "function_help", "<h3>Operators Group</h3>\n"
1756 "This group contains operators e.g + - * \n"
1757 "") );
1758  gFunctionHelpTexts.insert( "difference", QCoreApplication::translate( "function_help", "<h3>difference function</h3>\n"
1759 "Returns a geometry that represents that part of geometry a that does not intersect with geometry b.\n"
1760 "\n"
1761 "<h4>Syntax</h4>\n"
1762 "<pre>difference( a, b )</pre>\n"
1763 "\n"
1764 "<h4>Arguments</h4>\n"
1765 "geometry &rarr; geometry\n"
1766 "geometry &rarr; geometry\n"
1767 "\n"
1768 "<h4>Example</h4>\n"
1769 "<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"
1770 "") );
1771  gFunctionHelpTexts.insert( "IS", QCoreApplication::translate( "function_help", "<h3>IS expression</h3>\n"
1772 "Returns 1 if a is the same as b.\n"
1773 "\n"
1774 "<h4>Syntax</h4>\n"
1775 "<pre>a is b</pre>\n"
1776 "\n"
1777 "<h4>Arguments</h4>\n"
1778 "None\n"
1779 "\n"
1780 "<h4>Example</h4>\n"
1781 "<pre> 'A' IS 'A' &rarr; returns 1 </pre>\n"
1782 "<pre> 'A' IS 'a' &rarr; returns 0 </pre>\n"
1783 "<pre> 4 IS 4 &rarr; returns 1 </pre>\n"
1784 "<pre> 4 IS 2+2 &rarr; returns 1 </pre>\n"
1785 "<pre> 4 IS 2 &rarr; returns 0 </pre>\n"
1786 "<pre> 4 IS 2 &rarr; returns 0 </pre>\n"
1787 "<pre> $geometry IS NULL &rarr; returns 0, if your geometry is not NULL</pre>\n"
1788 "\n"
1789 "") );
1790  gFunctionHelpTexts.insert( "color_hsla", QCoreApplication::translate( "function_help", "<h3>color_hsla() function</h3>\n"
1791 "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes\n"
1792 "\n"
1793 "<p><h4>Syntax</h4>\n"
1794 " color_hsla(<i>hue, saturation, lightness, alpha</i>)</p>\n"
1795 "\n"
1796 "<p><h4>Arguments</h4>\n"
1797 "<!-- List args for functions here-->\n"
1798 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
1799 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1800 "<i> lightness</i> &rarr; the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
1801 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1802 "\n"
1803 "<p><h4>Example</h4>\n"
1804 "<!-- Show example of function.-->\n"
1805 " color_hsla(100,50,70,200) &rarr; '166,217,140,200'</p>\n"
1806 "") );
1807  gFunctionHelpTexts.insert( "Fields and Values", QCoreApplication::translate( "function_help", "<h3>Fields and Values</h3>\n"
1808 "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\n"
1809 "<br><br>\n"
1810 "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"
1811 "\n"
1812 "<p><h4>Note:</h4>\n"
1813 "Loading field values from WFS layers isn't supported, before the layer is\n"
1814 "actually inserted, ie. when building queries.\n"
1815 "</p>\n"
1816 "") );
1817  gFunctionHelpTexts.insert( "$perimeter", QCoreApplication::translate( "function_help", "<h3>$perimeter function</h3>\n"
1818 "Returns the perimeter length of the current feature.\n"
1819 "\n"
1820 "<h4>Syntax</h4>\n"
1821 "<pre>$perimeter</pre>\n"
1822 "\n"
1823 "<h4>Arguments</h4>\n"
1824 "None\n"
1825 "\n"
1826 "<h4>Example</h4>\n"
1827 "<pre>$perimeter &rarr; 42</pre>\n"
1828 "\n"
1829 "") );
1830  gFunctionHelpTexts.insert( "totime", QCoreApplication::translate( "function_help", "<h3>totime() function</h3>\n"
1831 "Convert a string into Qt time type.\n"
1832 "\n"
1833 "<h4>Syntax</h4>\n"
1834 "<code>totime('string')</code><br>\n"
1835 "\n"
1836 "<h4>Arguments</h4>\n"
1837 "<code>string</code> - is string in Qt time format.\n"
1838 "<br>\n"
1839 "\n"
1840 "<h4>Example</h4>\n"
1841 "<!-- Show example of function.-->\n"
1842 "<code>totime('12:30:01') &rarr; 12:30:01</code><br>") );
1843  gFunctionHelpTexts.insert( "String", QCoreApplication::translate( "function_help", "<h3>String Group</h3>\n"
1844 "This group contains functions that operate on strings e.g replace, convert to upper case.\n"
1845 "") );
1846  gFunctionHelpTexts.insert( "CASE ELSE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
1847 "A conditional expression that can be used to evaluate multiple expressions and\n"
1848 "return a result.\n"
1849 "\n"
1850 "<h4>Syntax</h4>\n"
1851 "<pre>\n"
1852 " CASE\n"
1853 " WHEN <i>condition</i> THEN <i>result</i>\n"
1854 " [ ...n ]\n"
1855 " [ ELSE <i>result</i> ]\n"
1856 " END\n"
1857 "</pre>\n"
1858 "[ ] marks optional components\n"
1859 "\n"
1860 "<h4>Arguments</h4>\n"
1861 "<!-- List args for functions here-->\n"
1862 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
1863 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
1864 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
1865 "\n"
1866 "<h4>Example</h4>\n"
1867 "<!-- Show example of function.-->\n"
1868 "<pre>\n"
1869 " CASE\n"
1870 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
1871 " ELSE <i>\"column\"</i>\n"
1872 " END\n"
1873 "</pre>\n"
1874 "") );
1875  gFunctionHelpTexts.insert( "toreal", QCoreApplication::translate( "function_help", "<h3>toreal() function</h3>\n"
1876 "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"
1877 "\n"
1878 "<p><h4>Syntax</h4>\n"
1879 " toreal(<i>string</i>)</p>\n"
1880 "\n"
1881 "<p><h4>Arguments</h4>\n"
1882 "<!-- List args for functions here-->\n"
1883 "<i> string</i> &rarr; is string. The String to convert to real number.</p>\n"
1884 "\n"
1885 "<p><h4>Example</h4>\n"
1886 "<!-- Show example of function.-->\n"
1887 " toreal('123.45') &rarr; 123.45</p>\n"
1888 "") );
1889  gFunctionHelpTexts.insert( "regexp_substr", QCoreApplication::translate( "function_help", "<h3>regexp_substr() function</h3>\n"
1890 "Returns the portion of a string which matches a supplied regular expression.\n"
1891 "\n"
1892 "<p><h4>Syntax</h4>\n"
1893 " regexp_substr(<i>string,regex</i>)</p>\n"
1894 "\n"
1895 "<p><h4>Arguments</h4>\n"
1896 "<!-- List args for functions here-->\n"
1897 "<i> string</i> &rarr; is string. The input string.<br>\n"
1898 "<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"
1899 "\n"
1900 "<p><h4>Example</h4>\n"
1901 "<!-- Show example of function.-->\n"
1902 " regexp_substr('abc123','(&#92;&#92;d+)') &rarr; '123'</p>\n"
1903 "") );
1904  gFunctionHelpTexts.insert( "geomFromGML", QCoreApplication::translate( "function_help", "<h3>geomFromGML function</h3>\n"
1905 "Returns a geometry from a GML representation of geometry\n"
1906 "\n"
1907 "<h4>Syntax</h4>\n"
1908 "<pre>geomFromGML(text)</pre>\n"
1909 "\n"
1910 "<h4>Arguments</h4>\n"
1911 "text &rarr; GML representation of a geometry\n"
1912 "\n"
1913 "<h4>Example</h4>\n"
1914 "<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"
1915 "\n"
1916 "") );
1917  gFunctionHelpTexts.insert( "$scale", QCoreApplication::translate( "function_help", "<h3>$scale function</h3>\n"
1918 "Returns the current scale of the map canvas.\n"
1919 "<br>\n"
1920 "Note: This function is only available in some contexts and will be 0 otherwise. \n"
1921 "<h4>Syntax</h4>\n"
1922 "<code>$scale</code><br>\n"
1923 "\n"
1924 "<h4>Example</h4>\n"
1925 "<!-- Show example of function.-->\n"
1926 "<code>$scale &rarr; 10000</code><br>\n"
1927 "\n"
1928 "\n"
1929 "") );
1930  gFunctionHelpTexts.insert( "OR", QCoreApplication::translate( "function_help", "<h3>OR logical operator</h3>\n"
1931 "Returns 1 when condition a or b is true.\n"
1932 "\n"
1933 "<h4>Syntax</h4>\n"
1934 "<pre> condition a OR condition b </pre>\n"
1935 "\n"
1936 "<h4>Arguments</h4>\n"
1937 "None\n"
1938 "\n"
1939 "<h4>Example</h4>\n"
1940 "<pre> 4 = 2+2 OR 1 = 1 &rarr; returns 1 </pre>\n"
1941 "<pre> 4 = 2+2 OR 1 = 2 &rarr; returns 1 </pre>\n"
1942 "<pre> 4 = 2 OR 1 = 2 &rarr; returns 0 </pre>\n"
1943 "") );
1944  gFunctionHelpTexts.insert( "left", QCoreApplication::translate( "function_help", "<h3>left() function</h3>\n"
1945 "Returns a substring that contains the <i>n</i> leftmost characters of the string.\n"
1946 "\n"
1947 "<h4>Syntax</h4>\n"
1948 "<code>left(string, length)</code><br>\n"
1949 "\n"
1950 "<h4>Arguments</h4>\n"
1951 "<code>string</code> - is string. The string.\n"
1952 "<br>\n"
1953 "<code>length</code> - is int. The number of characters from the left to return.\n"
1954 "\n"
1955 "<h4>Example</h4>\n"
1956 "<!-- Show example of function.-->\n"
1957 "<code>left('Hello World',5) &rarr; 'Hello'</code><br>\n"
1958 "\n"
1959 "") );
1960  gFunctionHelpTexts.insert( "color_cmyka", QCoreApplication::translate( "function_help", "\n"
1961 "<h3>color_cmyka() function</h3>\n"
1962 "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components\n"
1963 "\n"
1964 "<p><h4>Syntax</h4>\n"
1965 " color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p>\n"
1966 "\n"
1967 "<p><h4>Arguments</h4>\n"
1968 "<!-- List args for functions here-->\n"
1969 "<i> cyan</i> &rarr; the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
1970 "<i> magenta</i> &rarr; the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
1971 "<i> yellow</i> &rarr; the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
1972 "<i> black</i> &rarr; the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
1973 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1974 "\n"
1975 "<p><h4>Example</h4>\n"
1976 "<!-- Show example of function.-->\n"
1977 " color_cmyka(100,50,0,10,200) &rarr; '0,115,230,200'</p>\n"
1978 "") );
1979 }