QGIS API Documentation  2.0.1-Dufour
 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( "yat", QCoreApplication::translate( "function_help", "<h3>yat() function</h3>\n"
12 "Retrieves a y coordinate of the current feature\n"
13 "\n"
14 "<h4>Syntax</h4>\n"
15 "<code>yat(i)</code>\n"
16 "\n"
17 "<h4>Arguments</h4>\n"
18 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
19 "\n"
20 "<h4>Example</h4>\n"
21 "<pre>yat(1) &rarr; 5</pre>\n"
22 "") );
23  gFunctionHelpTexts.insert( "regexp_match", QCoreApplication::translate( "function_help", "<h3>regexp_match() function</h3>\n"
24 "Returns true if any part of a string matches the supplied regular expression.\n"
25 "\n"
26 "<p><h4>Syntax</h4>\n"
27 " regexp_match(<i>string,regex</i>)</p>\n"
28 "\n"
29 "<p><h4>Arguments</h4>\n"
30 "<!-- List args for functions here-->\n"
31 "<i> string</i> &rarr; is string. The string to test against the regular expression.<br>\n"
32 "<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"
33 "\n"
34 "<p><h4>Example</h4>\n"
35 "<!-- Show example of function.-->\n"
36 " regexp_match('QGIS ROCKS','&#92;&#92;sROCKS') &rarr; 1</p>\n"
37 "") );
38  gFunctionHelpTexts.insert( "format_number", QCoreApplication::translate( "function_help", "<h3>format_number() function</h3>\n"
39 "Returns a number formatted with the locale separator for thousands. \n"
40 "Also truncates the number to the number of supplied places. \n"
41 "<h4>Syntax</h4>\n"
42 "<code>format_number(number,places)</code><br>\n"
43 "\n"
44 "<h4>Arguments</h4>\n"
45 "<code>number</code> - is number. The number to be formatted.\n"
46 "<br>\n"
47 "<code>places</code> - is int. The number of decimal places to truncate the string\n"
48 "to.\n"
49 "\n"
50 "<h4>Example</h4>\n"
51 "<!-- Show example of function.-->\n"
52 "<code>format_number(10000000.332,2) &rarr; 10,000,000.33</code>\n"
53 "\n"
54 "") );
55  gFunctionHelpTexts.insert( "$scale", QCoreApplication::translate( "function_help", "<h3>$scale function</h3>\n"
56 "Returns the current scale of the map canvas.\n"
57 "<br>\n"
58 "Note: This function is only available in some contexts and will be 0 otherwise. \n"
59 "<h4>Syntax</h4>\n"
60 "<code>$scale</code><br>\n"
61 "\n"
62 "<h4>Example</h4>\n"
63 "<!-- Show example of function.-->\n"
64 "<code>$scale &rarr; 10000</code><br>\n"
65 "\n"
66 "\n"
67 "") );
68  gFunctionHelpTexts.insert( "age", QCoreApplication::translate( "function_help", "<h3>age() function</h3>\n"
69 "Returns the difference between two dates.\n"
70 "<br><br>\n"
71 "The difference is returned as a <code>Interval</code> \n"
72 "and needs to be used with one of the following functions\n"
73 "in order to extract useful information:\n"
74 "<ul>\n"
75 "<li><code>year</code>\n"
76 "<li><code>month</code>\n"
77 "<li><code>week</code>\n"
78 "<li><code>day</code>\n"
79 "<li><code>hour</code>\n"
80 "<li><code>minute</code>\n"
81 "<li><code>second</code>\n"
82 "</ul>\n"
83 "<h4>Syntax</h4>\n"
84 "<code>age(string,string)</code><br>\n"
85 "<code>age(datetime,datetime)</code><br>\n"
86 "<code>age(string,datetime)</code><br>\n"
87 "<code>age(datetime,string)</code><br>\n"
88 "\n"
89 "<h4>Arguments</h4>\n"
90 "<code>string</code> - is string. A string in date format.\n"
91 "<br>\n"
92 "<code>datetime</code> - is date or datetime. A date or datetime type.\n"
93 "\n"
94 "<h4>Example</h4>\n"
95 "<!-- Show example of function.-->\n"
96 "<code>age('2012-05-12','2012-05-2') &rarr; Interval</code><br>\n"
97 "use <code>day</code> to extract number of days<br>\n"
98 "<code>day(age('2012-05-12','2012-05-2')) &rarr; 10</code><br>\n"
99 "\n"
100 "") );
101  gFunctionHelpTexts.insert( "$length", QCoreApplication::translate( "function_help", "<h3>$length function</h3>\n"
102 "Returns the length of the current feature.\n"
103 "\n"
104 "<h4>Syntax</h4>\n"
105 "<pre>$length</pre>\n"
106 "\n"
107 "<h4>Arguments</h4>\n"
108 "None\n"
109 "\n"
110 "<h4>Example</h4>\n"
111 "<pre>$length &rarr; 42.4711</pre>\n"
112 "") );
113  gFunctionHelpTexts.insert( "$pi", QCoreApplication::translate( "function_help", "<h3>$pi constant</h3>\n"
114 "Returns pi as value for calculations\n"
115 "\n"
116 "<h4>Syntax</h4>\n"
117 "<pre>$pi</pre>\n"
118 "\n"
119 "<h4>Arguments</h4>\n"
120 "None\n"
121 "\n"
122 "<h4>Example</h4>\n"
123 "<pre>$pi &rarr; 3.14159265358979</pre>\n"
124 "") );
125  gFunctionHelpTexts.insert( "abs", QCoreApplication::translate( "function_help", "<h3>abs() function</h3>\n"
126 "Returns the absolute value of a number.<br>\n"
127 "\n"
128 "\n"
129 "<h4>Syntax</h4>\n"
130 "abs(<i>value</i>)<br>\n"
131 "\n"
132 "<h4>Arguments</h4>\n"
133 "<code>value</code> - a number.<br>\n"
134 "\n"
135 "<h4>Example</h4>\n"
136 "<code>abs(-2) &rarr; 2</code><br>\n"
137 "") );
138  gFunctionHelpTexts.insert( "color_hsva", QCoreApplication::translate( "function_help", "<h3>color_hsva() function</h3>\n"
139 "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes\n"
140 "\n"
141 "<p><h4>Syntax</h4>\n"
142 " color_hsva(<i>hue, saturation, value, alpha</i>)</p>\n"
143 "\n"
144 "<p><h4>Arguments</h4>\n"
145 "<!-- List args for functions here-->\n"
146 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
147 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
148 "<i> value</i> &rarr; the value percentage of the color as an integer from 0 to 100.<br>\n"
149 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
150 "\n"
151 "<p><h4>Example</h4>\n"
152 "<!-- Show example of function.-->\n"
153 " color_hsva(40,100,100,200) &rarr; '255,170,0,200'</p>\n"
154 "") );
155  gFunctionHelpTexts.insert( "format", QCoreApplication::translate( "function_help", "<h3>format() function</h3>\n"
156 "Format a string using supplied arguments. \n"
157 "\n"
158 "<h4>Syntax</h4>\n"
159 "<code>format('string', arg, [arg...n])</code><br>\n"
160 "\n"
161 "<h4>Arguments</h4>\n"
162 "<code>string</code> - is string. String with Qt QString place holders. Use %1, %2, etc for placeholders. Placeholders can be repeated. \n"
163 "<br>\n"
164 "<code>arg [arg...n]</code> - any type. Any number of args. \n"
165 "\n"
166 "<h4>Example</h4>\n"
167 "<!-- Show example of function.-->\n"
168 "<code>format('This %1 a %2','is', 'test') &rarr; This is a test</code><br>") );
169  gFunctionHelpTexts.insert( "ramp_color", QCoreApplication::translate( "function_help", "\n"
170 "<h3>ramp_color() function</h3>\n"
171 "Returns a string representing a color from a color ramp. \n"
172 "\n"
173 "<p><h4>Syntax</h4>\n"
174 " ramp_color(<i>ramp_name,value</i>)</p>\n"
175 "\n"
176 "<p><h4>Arguments</h4>\n"
177 "<!-- List args for functions here-->\n"
178 "<i> ramp_name</i> &rarr; the name of the color ramp as a string, for example 'Spectral'.<br>\n"
179 "<i> value</i> &rarr; the position on the ramp to select the color from as a real number between 0 and 1.<br>\n"
180 "\n"
181 "<p><h4>Example</h4>\n"
182 "<!-- Show example of function.-->\n"
183 " ramp_color('Spectral',0.3) &rarr; '#fdbe73'</p>\n"
184 "\n"
185 "<p><h4>Note:</h4>\n"
186 "The color ramps available vary between QGIS installations. This function\n"
187 "may not give the expected results if you move your Quantum project.\n"
188 "</p>\n"
189 "") );
190  gFunctionHelpTexts.insert( "trim", QCoreApplication::translate( "function_help", "<h3>trim() function</h3>\n"
191 "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.\n"
192 "\n"
193 "<p><h4>Syntax</h4>\n"
194 " trim(<i>string</i>)</p>\n"
195 "\n"
196 "<p><h4>Arguments</h4>\n"
197 "<!-- List args for functions here-->\n"
198 "<i> string</i> &rarr; is string. The string to trim.</p>\n"
199 "\n"
200 "<p><h4>Example</h4>\n"
201 "<!-- Show example of function.-->\n"
202 " trim(' hello world ') &rarr; 'hello world'</p>\n"
203 "") );
204  gFunctionHelpTexts.insert( "cos", QCoreApplication::translate( "function_help", "<h3>cos() function</h3>\n"
205 "Returns cosinus of an angle.\n"
206 "\n"
207 "\n"
208 "<p><h4>Syntax</h4>\n"
209 " cos(<i>real</i>)</p>\n"
210 "\n"
211 "<p><h4>Arguments</h4>\n"
212 "<i>real</i> &rarr; angle in radians.</p>\n"
213 "\n"
214 "<p><h4>Example</h4>\n"
215 " cos(1.571) &rarr; 0.000796326710733263</p>\n"
216 "") );
217  gFunctionHelpTexts.insert( "Record", QCoreApplication::translate( "function_help", "<h3>Record Group</h3>\n"
218 "This group contains functions that operate on record identifiers.\n"
219 "") );
220  gFunctionHelpTexts.insert( "color_hsv", QCoreApplication::translate( "function_help", "<h3>color_hsv() function</h3>\n"
221 "Returns a string representation of a color based on its hue, saturation, and value attributes\n"
222 "\n"
223 "<p><h4>Syntax</h4>\n"
224 " color_hsv(<i>hue, saturation, value</i>)</p>\n"
225 "\n"
226 "<p><h4>Arguments</h4>\n"
227 "<!-- List args for functions here-->\n"
228 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
229 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
230 "<i> value</i> &rarr; the value percentage of the color as an integer from 0 to 100.<br>\n"
231 "\n"
232 "<p><h4>Example</h4>\n"
233 "<!-- Show example of function.-->\n"
234 " color_hsv(40,100,100) &rarr; '#ffaa00'</p>\n"
235 "") );
236  gFunctionHelpTexts.insert( "asin", QCoreApplication::translate( "function_help", "<h3>asin() function</h3>\n"
237 "Returns arcussinus of a value in radians.\n"
238 "\n"
239 "\n"
240 "<p><h4>Syntax</h4>\n"
241 " asin(<i>real</i>)</p>\n"
242 "\n"
243 "<p><h4>Arguments</h4>\n"
244 "<i>real</i> &rarr; sin of an angle.</p>\n"
245 "\n"
246 "<p><h4>Example</h4>\n"
247 " asin(1.0) &rarr; 1.5707963267949</p>\n"
248 "") );
249  gFunctionHelpTexts.insert( "$id", QCoreApplication::translate( "function_help", "<h3>$id function</h3>\n"
250 "Returns the feature id of the current row.\n"
251 "\n"
252 "<h4>Syntax</h4>\n"
253 "<pre>$id</pre>\n"
254 "\n"
255 "<h4>Arguments</h4>\n"
256 "None\n"
257 "\n"
258 "<h4>Example</h4>\n"
259 "<pre>$id &rarr; 42</pre>\n"
260 "\n"
261 "") );
262  gFunctionHelpTexts.insert( "$area", QCoreApplication::translate( "function_help", "<h3>$area function</h3>\n"
263 "Returns the area size of the current feature.\n"
264 "\n"
265 "<h4>Syntax</h4>\n"
266 "<pre>$area</pre>\n"
267 "\n"
268 "<h4>Arguments</h4>\n"
269 "None\n"
270 "\n"
271 "<h4>Example</h4>\n"
272 "<pre>$area &rarr; 42</pre>\n"
273 "\n"
274 "") );
275  gFunctionHelpTexts.insert( "scale_exp", QCoreApplication::translate( "function_help", "<h3>scale_exp() function</h3>\n"
276 "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"
277 "of the specified output range. \n"
278 "\n"
279 "<p><h4>Syntax</h4>\n"
280 " 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"
281 "\n"
282 "<p><h4>Arguments</h4>\n"
283 "<!-- List args for functions here-->\n"
284 "<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"
285 "<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"
286 "<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"
287 "<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"
288 "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"
289 "\n"
290 "<h4>Example</h4>\n"
291 "<!-- Show example of function.-->\n"
292 "<b>Easing in, using an exponent of 2:</b><br>\n"
293 " scale_exp(5,0,10,0,100,2) &rarr; 25<br>\n"
294 " scale_exp(7.5,0,10,0,100,2) &rarr; 56.25<br>\n"
295 " scale_exp(9.5,0,10,0,100,2) &rarr; 90.25<br> \n"
296 " <br>\n"
297 "<b>Easing out, using an exponent of 0.5:</b><br> \n"
298 " scale_exp(3,0,10,0,100,0.5) &rarr; 54.772<br>\n"
299 " scale_exp(6,0,10,0,100,0.5) &rarr; 77.459<br>\n"
300 " scale_exp(9,0,10,0,100,0.5) &rarr; 94.868<br> \n"
301 " \n"
302 " \n"
303 "") );
304  gFunctionHelpTexts.insert( "lpad", QCoreApplication::translate( "function_help", "<h3>lpad() function</h3>\n"
305 "Returns a string with supplied width padded\n"
306 "using the fill character.\n"
307 "\n"
308 "<h4>Syntax</h4>\n"
309 "<code>lpad(string, length, fill)</code><br>\n"
310 "\n"
311 "<h4>Arguments</h4>\n"
312 "<code>string</code> - is string. The string.\n"
313 "<br>\n"
314 "<code>length</code> - is int. The length of the new string.\n"
315 "<br>\n"
316 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
317 "\n"
318 "<h4>Example</h4>\n"
319 "<!-- Show example of function.-->\n"
320 "<code>lpad('Hello', 10, 'x') &rarr; 'Helloxxxxx'</code><br>\n"
321 "") );
322  gFunctionHelpTexts.insert( "randf", QCoreApplication::translate( "function_help", "<h3>randf() function</h3>\n"
323 "Returns a random float within the range specified by the minimum and \n"
324 "maximum argument (inclusive).\n"
325 "<br>\n"
326 "This function takes two arguments.\n"
327 "<h4>Syntax</h4>\n"
328 "<code>randf(min, max)</code><br>\n"
329 "\n"
330 "<h4>Arguments</h4>\n"
331 "<code>min</code> - a float representing the smallest possible random number desired.<br>\n"
332 "<code>max</code> - a float representing the largest possible random number desired.\n"
333 "<br>\n"
334 "\n"
335 "<h4>Example</h4>\n"
336 "<!-- Show example of function.-->\n"
337 "<code>randf(1, 10) &rarr; 4.59258286403147</code><br>\n"
338 "") );
339  gFunctionHelpTexts.insert( "Date and Time", QCoreApplication::translate( "function_help", "<h3>Date and Time Group</h3>\n"
340 "This group contains functions for handling date and time data.\n"
341 "") );
342  gFunctionHelpTexts.insert( "strpos", QCoreApplication::translate( "function_help", "<h3>strpos() function</h3>\n"
343 "Return the index of a regular expression in a string.\n"
344 "\n"
345 "<h4>Syntax</h4>\n"
346 " strpos(<i>haystack</i>, <i>needle</i>)\n"
347 "<br><br>\n"
348 "Returns -1 if the expression isn't found.\n"
349 "\n"
350 "<p><h4>Arguments</h4>\n"
351 "<!-- List args for functions here-->\n"
352 "<i> haystack</i> &rarr; is string. The string that is to be searched.<br>\n"
353 "<i> needle</i> &rarr; is number. The regular expression to look for.<br>\n"
354 "\n"
355 "<h4>Example</h4>\n"
356 "<!-- Show example of function.-->\n"
357 " strpos('HELLO WORLD','WORLD') &rarr; 6<br>\n"
358 " strpos('HELLO WORLD','GOODBYE') &rarr; -1<br>\n"
359 "") );
360  gFunctionHelpTexts.insert( "Field", QCoreApplication::translate( "function_help", "<h3>Field</h3>\n"
361 "Double click to add field name to expression string.\n"
362 "<br><br>\n"
363 "Right-Click on field name to open context menu sample value loading options.\n"
364 "\n"
365 "<p><h4>Note:</h4>\n"
366 "Loading field values from WFS layers isn't supported, before the layer is\n"
367 "actually inserted, ie. when building queries.\n"
368 "</p>\n"
369 "") );
370  gFunctionHelpTexts.insert( "title", QCoreApplication::translate( "function_help", "<h3>title() function</h3>\n"
371 "Converts all words of a string to title case (all words lower case with leading\n"
372 "capital letter).\n"
373 "\n"
374 "<p><h4>Syntax</h4>\n"
375 " title(<i>string</i>)</p>\n"
376 "\n"
377 "<p><h4>Arguments</h4>\n"
378 "<!-- List args for functions here-->\n"
379 "<i> string</i> &rarr; is string. The string to convert to title case.</p>\n"
380 "\n"
381 "<p><h4>Example</h4>\n"
382 "<!-- Show example of function.-->\n"
383 " upper('hello WOrld') &rarr; 'Hello World'</p>\n"
384 "") );
385  gFunctionHelpTexts.insert( "min", QCoreApplication::translate( "function_help", "<h3>min() function</h3>\n"
386 "Returns the smallest value in a set of values.\n"
387 "\n"
388 "<h4>Syntax</h4>\n"
389 " min(<i>value<i>[,<i>value</i>...])\n"
390 "\n"
391 "<h4>Arguments</h4>\n"
392 "<!-- List args for functions here-->\n"
393 "<i> value</i> &rarr; a number.<br>\n"
394 "\n"
395 "<h4>Example</h4>\n"
396 "<!-- Show example of function.-->\n"
397 " min(20.5,10,6.2) &rarr; 6.2\n"
398 "") );
399  gFunctionHelpTexts.insert( "hour", QCoreApplication::translate( "function_help", "<h3>hour() function</h3>\n"
400 "Extract the hour from a datetime or time, or the number of hours\n"
401 "from a <code>Interval</code>\n"
402 "\n"
403 "<h4>Syntax</h4>\n"
404 "<code>hour(datetime)</code><br>\n"
405 "<code>hour(Interval)</code><br>\n"
406 "\n"
407 "<h4>Arguments</h4>\n"
408 "<code>date</code> - is datetime or time. The date to extract the hour from.\n"
409 "<br>\n"
410 "<code>Interval</code> - is Interval. The Interval to return the number of hours from.\n"
411 "\n"
412 "<h4>Example</h4>\n"
413 "<!-- Show example of function.-->\n"
414 "<code>hour('2012-07-22T13:24:57') &rarr; 13</code><br>\n"
415 "<code>hour(tointerval('3 hours')) &rarr; 3</code><br>\n"
416 "<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) &rarr; 3</code><br>\n"
417 "<code>hour(age('2012-01-01','2010-01-01')) &rarr; 17520</code><br>\n"
418 "\n"
419 "") );
420  gFunctionHelpTexts.insert( "scale_linear", QCoreApplication::translate( "function_help", "<h3>scale_linear() function</h3>\n"
421 "Transforms a given value from an input domain to an output range using linear interpolation. \n"
422 "\n"
423 "<p><h4>Syntax</h4>\n"
424 " scale_linear(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>)</p>\n"
425 "\n"
426 "<p><h4>Arguments</h4>\n"
427 "<!-- List args for functions here-->\n"
428 "<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"
429 "<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"
430 "<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"
431 "\n"
432 "<h4>Example</h4>\n"
433 "<!-- Show example of function.-->\n"
434 " scale_linear(5,0,10,0,100) &rarr; 50<br>\n"
435 " 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"
436 " 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"
437 " \n"
438 " \n"
439 "") );
440  gFunctionHelpTexts.insert( "coalesce", QCoreApplication::translate( "function_help", "<h3>coalesce() function</h3>\n"
441 "Returns the first non-NULL value from the expression list.\n"
442 "<br>\n"
443 "This function can take any number of arguments.\n"
444 "<h4>Syntax</h4>\n"
445 "<code>coalesce(expression1, expression2 ...)</code><br>\n"
446 "\n"
447 "<h4>Arguments</h4>\n"
448 "<code>expression</code> - any valid expression or value, irregardless of type.\n"
449 "<br>\n"
450 "\n"
451 "<h4>Example</h4>\n"
452 "<!-- Show example of function.-->\n"
453 "<code>coalesce(NULL, 2) &rarr; 2</code><br>\n"
454 "<code>coalesce(NULL, 2, 3) &rarr; 2</code><br>\n"
455 "<code>coalesce(7, NULL, 3*2) &rarr; 7</code><br><br>\n"
456 "<code>coalesce(\"fieldA\", \"fallbackField\", 'ERROR') &rarr; value of fieldA if it is non-NULL\n"
457 " else the value of \"fallbackField\" or the string 'ERROR' if both are NULL</code><br>\n"
458 "\n"
459 "") );
460  gFunctionHelpTexts.insert( "Conditionals", QCoreApplication::translate( "function_help", "<h3>Conditionals Group</h3>\n"
461 "This group contains functions to handle conditional checks in expressions.\n"
462 "") );
463  gFunctionHelpTexts.insert( "rpad", QCoreApplication::translate( "function_help", "<h3>rpad() function</h3>\n"
464 "Returns a string with supplied width padded\n"
465 "using the fill character.\n"
466 "\n"
467 "<h4>Syntax</h4>\n"
468 "<code>rpad(string, width, fill)</code><br>\n"
469 "\n"
470 "<h4>Arguments</h4>\n"
471 "<code>string</code> - is string. The string.\n"
472 "<br>\n"
473 "<code>width</code> - is int. The length of the new string.\n"
474 "<br>\n"
475 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
476 "\n"
477 "<h4>Example</h4>\n"
478 "<!-- Show example of function.-->\n"
479 "<code>rpad('Hello', 10, 'x') &rarr; 'xxxxxHello'</code><br>\n"
480 "\n"
481 "") );
482  gFunctionHelpTexts.insert( "acos", QCoreApplication::translate( "function_help", "<h3>acos() function</h3>\n"
483 "Returns arcuscosinus of a value in radians.\n"
484 "\n"
485 "\n"
486 "<p><h4>Syntax</h4>\n"
487 " acos(<i>real</i>)</p>\n"
488 "\n"
489 "<p><h4>Arguments</h4>\n"
490 "<i>real</i> &rarr; cos of an angle.</p>\n"
491 "\n"
492 "<p><h4>Example</h4>\n"
493 " acos(0.5) &rarr; 1.0471975511966</p>\n"
494 "") );
495  gFunctionHelpTexts.insert( "$now", QCoreApplication::translate( "function_help", "<h3>$now function</h3>\n"
496 "Returns the current date and time\n"
497 "\n"
498 "<h4>Syntax</h4>\n"
499 "<pre>$now</pre>\n"
500 "\n"
501 "<h4>Arguments</h4>\n"
502 "None\n"
503 "\n"
504 "<h4>Example</h4>\n"
505 "<pre>$now &rarr; 2012-07-22T13:24:57</pre>\n"
506 "\n"
507 "") );
508  gFunctionHelpTexts.insert( "color_hsla", QCoreApplication::translate( "function_help", "<h3>color_hsla() function</h3>\n"
509 "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes\n"
510 "\n"
511 "<p><h4>Syntax</h4>\n"
512 " color_hsla(<i>hue, saturation, lightness, alpha</i>)</p>\n"
513 "\n"
514 "<p><h4>Arguments</h4>\n"
515 "<!-- List args for functions here-->\n"
516 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
517 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
518 "<i> lightness</i> &rarr; the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
519 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
520 "\n"
521 "<p><h4>Example</h4>\n"
522 "<!-- Show example of function.-->\n"
523 " color_hsla(100,50,70,200) &rarr; '166,217,140,200'</p>\n"
524 "") );
525  gFunctionHelpTexts.insert( "ln", QCoreApplication::translate( "function_help", "<h3>ln() function</h3>\n"
526 "Returns the value of the natural logarithm of the passed expression.\n"
527 "<br>\n"
528 "This function takes one argument.\n"
529 "<h4>Syntax</h4>\n"
530 "<code>ln(value)</code><br>\n"
531 "\n"
532 "<h4>Arguments</h4>\n"
533 "<code>value</code> - any positive number.\n"
534 "<br>\n"
535 "\n"
536 "<h4>Example</h4>\n"
537 "<!-- Show example of function.-->\n"
538 "<code>ln(1) &rarr; 0</code><br>\n"
539 "<code>ln(2.7182818284590452354) &rarr; 1</code><br>\n"
540 "") );
541  gFunctionHelpTexts.insert( "Color", QCoreApplication::translate( "function_help", "\n"
542 "<h3>Color Group</h3>\n"
543 "This group contains functions for manipulating colors\n"
544 "") );
545  gFunctionHelpTexts.insert( "color_rgba", QCoreApplication::translate( "function_help", "\n"
546 "<h3>color_rgba() function</h3>\n"
547 "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components\n"
548 "\n"
549 "<p><h4>Syntax</h4>\n"
550 " color_rgba(<i>red, green, blue, alpha</i>)</p>\n"
551 "\n"
552 "<p><h4>Arguments</h4>\n"
553 "<!-- List args for functions here-->\n"
554 "<i> red</i> &rarr; the red component as an integer value from 0 to 255.<br>\n"
555 "<i> green</i> &rarr; the green component as an integer value from 0 to 255.<br>\n"
556 "<i> blue</i> &rarr; the blue component as an integer value from 0 to 255.<br>\n"
557 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
558 "\n"
559 "<p><h4>Example</h4>\n"
560 "<!-- Show example of function.-->\n"
561 " color_rgba(255,127,0,200) &rarr; '255,127,0,200'</p>\n"
562 "") );
563  gFunctionHelpTexts.insert( "toint", QCoreApplication::translate( "function_help", "<h3>toint() function</h3>\n"
564 "Converts a string to integer number. Nothing changed if a value cannot be converted to integer (e.g '123asd' is invalid).\n"
565 "\n"
566 "<p><h4>Syntax</h4>\n"
567 " toint(<i>string</i>)</p>\n"
568 "\n"
569 "<p><h4>Arguments</h4>\n"
570 "<!-- List args for functions here-->\n"
571 "<i> string</i> &rarr; is string. The String to convert to integer number.</p>\n"
572 "\n"
573 "<p><h4>Example</h4>\n"
574 "<!-- Show example of function.-->\n"
575 " toint('123') &rarr; 123</p>\n"
576 "") );
577  gFunctionHelpTexts.insert( "atan2", QCoreApplication::translate( "function_help", "<h3>atan2() function</h3>\n"
578 "Returns arcustangens of y/x using the signs of the two \n"
579 "arguments to determine the quadrant of the result\n"
580 "\n"
581 "\n"
582 "\n"
583 "<p><h4>Syntax</h4>\n"
584 " atan2(<i>real</i>, <i>real</i>)</p>\n"
585 "\n"
586 "<p><h4>Arguments</h4>\n"
587 "<i>real</i> &rarr; y coordinate difference<br>\n"
588 "<i>real</i> &rarr; x coordinate difference</p>\n"
589 "\n"
590 "<p><h4>Example</h4>\n"
591 " atan2(1.0, 1.732) &rarr; 0.523611477769969</p>\n"
592 "") );
593  gFunctionHelpTexts.insert( "rand", QCoreApplication::translate( "function_help", "<h3>rand() function</h3>\n"
594 "Returns a random integer within the range specified by the minimum and \n"
595 "maximum argument (inclusive).\n"
596 "<br>\n"
597 "This function takes two arguments.\n"
598 "<h4>Syntax</h4>\n"
599 "<code>rand(min, max)</code><br>\n"
600 "\n"
601 "<h4>Arguments</h4>\n"
602 "<code>min</code> - an integer representing the smallest possible random number desired.<br>\n"
603 "<code>max</code> - an integer representing the largest possible random number desired.\n"
604 "<br>\n"
605 "\n"
606 "<h4>Example</h4>\n"
607 "<!-- Show example of function.-->\n"
608 "<code>rand(1, 10) &rarr; 8</code><br>\n"
609 "") );
610  gFunctionHelpTexts.insert( "replace", QCoreApplication::translate( "function_help", "<h3>replace() function</h3>\n"
611 "Returns a string with the the supplied string replaced.\n"
612 "\n"
613 "<p><h4>Syntax</h4>\n"
614 " replace(<i>string,before,after</i>)</p>\n"
615 "\n"
616 "<p><h4>Arguments</h4>\n"
617 "<!-- List args for functions here-->\n"
618 "<i> string</i> &rarr; is string. The start string.<br>\n"
619 "<i> before</i> &rarr; is string. The string to replace.<br>\n"
620 "<i> after</i> &rarr; is string. The string that will replace <i>before</i><br></p>\n"
621 "\n"
622 "<p><h4>Example</h4>\n"
623 "<!-- Show example of function.-->\n"
624 " replace('QGIS SHOULD ROCK','SHOULD','DOES') &rarr; 'QGIS DOES ROCK'</p>\n"
625 "") );
626  gFunctionHelpTexts.insert( "CASE ELSE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
627 "A conditional expression that can be used to evaluate multiple expressions and\n"
628 "return a result.\n"
629 "\n"
630 "<h4>Syntax</h4>\n"
631 "<pre>\n"
632 " CASE\n"
633 " WHEN <i>condition</i> THEN <i>result</i>\n"
634 " [ ...n ]\n"
635 " [ ELSE <i>result</i> ]\n"
636 " END\n"
637 "</pre>\n"
638 "[ ] marks optional components\n"
639 "\n"
640 "<h4>Arguments</h4>\n"
641 "<!-- List args for functions here-->\n"
642 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
643 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
644 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
645 "\n"
646 "<h4>Example</h4>\n"
647 "<!-- Show example of function.-->\n"
648 "<pre>\n"
649 " CASE\n"
650 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
651 " ELSE <i>\"column\"</i>\n"
652 " END\n"
653 "</pre>\n"
654 "") );
655  gFunctionHelpTexts.insert( "sqrt", QCoreApplication::translate( "function_help", "<h3>sqrt() function</h3>\n"
656 "Returns square root of a value\n"
657 "\n"
658 "\n"
659 "<p><h4>Syntax</h4>\n"
660 " sqrt(<i>real</i>)</p>\n"
661 "\n"
662 "<p><h4>Arguments</h4>\n"
663 "<i>real</i> &rarr; number.</p>\n"
664 "\n"
665 "<p><h4>Example</h4>\n"
666 " sqrt(9) &rarr; 3</p>\n"
667 "") );
668  gFunctionHelpTexts.insert( "lower", QCoreApplication::translate( "function_help", "<h3>lower() function</h3>\n"
669 "Converts a string to lower case letters.\n"
670 "\n"
671 "<p><h4> Syntax</h4>\n"
672 " lower(<i>string</i>)</p>\n"
673 "\n"
674 "<p><h4> Arguments</h4>\n"
675 "<i> string</i> &rarr; is string. The String to convert to lower case.</p>\n"
676 "\n"
677 "<p><h4> Example</h4>\n"
678 " lower('HELLO World') &rarr; 'hello world'</p>\n"
679 "") );
680  gFunctionHelpTexts.insert( "$feature", QCoreApplication::translate( "function_help", "<h3>$feature function</h3>\n"
681 "In atlas generation, returns the current feature number that is iterated over on the coverage layer.\n"
682 "\n"
683 "<h4>Syntax</h4>\n"
684 "<pre>$feature</pre>\n"
685 "\n"
686 "<h4>Arguments</h4>\n"
687 "None\n"
688 "\n"
689 "<h4>Example</h4>\n"
690 "<pre>$feature &rarr; 2</pre>\n"
691 "\n"
692 "") );
693  gFunctionHelpTexts.insert( "$page", QCoreApplication::translate( "function_help", "<h3>$page function</h3>\n"
694 "Returns the current page number within a composition.\n"
695 "\n"
696 "<h4>Syntax</h4>\n"
697 "<pre>$page</pre>\n"
698 "\n"
699 "<h4>Arguments</h4>\n"
700 "None\n"
701 "\n"
702 "<h4>Example</h4>\n"
703 "<pre>$page &rarr; 2</pre>\n"
704 "\n"
705 "") );
706  gFunctionHelpTexts.insert( "color_cmyk", QCoreApplication::translate( "function_help", "\n"
707 "<h3>color_cmyk() function</h3>\n"
708 "Returns a string representation of a color based on its cyan, magenta, yellow and black components\n"
709 "\n"
710 "<p><h4>Syntax</h4>\n"
711 " color_cmyk(<i>cyan, magenta, yellow, black</i>)</p>\n"
712 "\n"
713 "<p><h4>Arguments</h4>\n"
714 "<!-- List args for functions here-->\n"
715 "<i> cyan</i> &rarr; the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
716 "<i> magenta</i> &rarr; the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
717 "<i> yellow</i> &rarr; the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
718 "<i> black</i> &rarr; the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
719 "\n"
720 "<p><h4>Example</h4>\n"
721 "<!-- Show example of function.-->\n"
722 " color_cmyk(100,50,0,10) &rarr; '#0073e6'</p>\n"
723 "") );
724  gFunctionHelpTexts.insert( "log10", QCoreApplication::translate( "function_help", "<h3>log10() function</h3>\n"
725 "Returns the value of the base 10 logarithm of the passed expression.\n"
726 "<br>\n"
727 "This function takes one argument.\n"
728 "<h4>Syntax</h4>\n"
729 "<code>log10(value)</code><br>\n"
730 "\n"
731 "<h4>Arguments</h4>\n"
732 "<code>value</code> - any positive number.\n"
733 "<br>\n"
734 "\n"
735 "<h4>Example</h4>\n"
736 "<!-- Show example of function.-->\n"
737 "<code>log10(1) &rarr; 0</code><br>\n"
738 "<code>log10(100) &rarr; 2</code><br>\n"
739 "") );
740  gFunctionHelpTexts.insert( "tostring", QCoreApplication::translate( "function_help", "<h3>tostring() function</h3>\n"
741 "Converts a number to string.\n"
742 "\n"
743 "<p><h4>Syntax</h4>\n"
744 " tostring(<i>number</i>)</p>\n"
745 "\n"
746 "<p><h4>Arguments</h4>\n"
747 "<!-- List args for functions here-->\n"
748 "<i>number</i> &rarr; is integer or real. The number to convert to string.</p>\n"
749 "\n"
750 "<p><h4>Example</h4>\n"
751 "<!-- Show example of function.-->\n"
752 " tostring(123) &rarr; '123'</p>\n"
753 "") );
754  gFunctionHelpTexts.insert( "todatetime", QCoreApplication::translate( "function_help", "<h3>todatetime() function</h3>\n"
755 "Convert a string into Qt data time type.\n"
756 "\n"
757 "<h4>Syntax</h4>\n"
758 "<code>todatetime('string')</code><br>\n"
759 "\n"
760 "<h4>Arguments</h4>\n"
761 "<code>string</code> - is string in Qt date time format.\n"
762 "<br>\n"
763 "\n"
764 "<h4>Example</h4>\n"
765 "<!-- Show example of function.-->\n"
766 "<code>todatetime('2012-05-04 12:50:00') &rarr; 2012-05-04T12:50:00</code><br>") );
767  gFunctionHelpTexts.insert( "day", QCoreApplication::translate( "function_help", "<h3>day() function</h3>\n"
768 "Extract the day from a date, or the number of days\n"
769 "from a <code>Interval</code>\n"
770 "\n"
771 "<h4>Syntax</h4>\n"
772 "<code>day(date)</code><br>\n"
773 "<code>day(Interval)</code><br>\n"
774 "\n"
775 "<h4>Arguments</h4>\n"
776 "<code>date</code> - is date or datetime. The date to extract the day from.\n"
777 "<br>\n"
778 "<code>Interval</code> - is Interval. The Interval to return the number of days from.\n"
779 "\n"
780 "<h4>Example</h4>\n"
781 "<!-- Show example of function.-->\n"
782 "<code>day('2012-05-12') &rarr; 12</code><br>\n"
783 "<code>day(tointerval('3 days')) &rarr; 3</code><br>\n"
784 "<code>day(age('2012-01-01','2010-01-01')) &rarr; 730</code><br>\n"
785 "\n"
786 "") );
787  gFunctionHelpTexts.insert( "Conversions", QCoreApplication::translate( "function_help", "<h3>Conversions Group</h3>\n"
788 "This group contains functions to convert on data type to another e.g string to integer, integer to string.\n"
789 "") );
790  gFunctionHelpTexts.insert( "format_date", QCoreApplication::translate( "function_help", "<h3>format_date() function</h3>\n"
791 "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"
792 "\n"
793 "<h4>Syntax</h4>\n"
794 "<code>format_date('string', 'format_string')</code><br>\n"
795 "\n"
796 "<h4>Arguments</h4>\n"
797 "<code>string</code> - is string. Date/Time/DateTime string.\n"
798 "<br>\n"
799 "<code>format_string</code> - is string. String template used to format the string.\n"
800 "\n"
801 " <table>\n"
802 " <thead>\n"
803 " <tr>\n"
804 " <th>Expression</th>\n"
805 "\n"
806 " <th>Output</th>\n"
807 " </tr>\n"
808 " </thead>\n"
809 "\n"
810 " <tr valign=\"top\">\n"
811 " <td>d</td>\n"
812 "\n"
813 " <td>the day as number without a leading zero (1 to 31)</td>\n"
814 " </tr>\n"
815 "\n"
816 " <tr valign=\"top\">\n"
817 " <td>dd</td>\n"
818 "\n"
819 " <td>the day as number with a leading zero (01 to 31)</td>\n"
820 " </tr>\n"
821 "\n"
822 " <tr valign=\"top\">\n"
823 " <td>ddd</td>\n"
824 "\n"
825 " <td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses <a href=\n"
826 " \"qdate.html#shortDayName\">QDate::shortDayName</a>().</td>\n"
827 " </tr>\n"
828 "\n"
829 " <tr valign=\"top\">\n"
830 " <td>dddd</td>\n"
831 "\n"
832 " <td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses <a href=\n"
833 " \"qdate.html#longDayName\">QDate::longDayName</a>().</td>\n"
834 " </tr>\n"
835 "\n"
836 " <tr valign=\"top\">\n"
837 " <td>M</td>\n"
838 "\n"
839 " <td>the month as number without a leading zero (1-12)</td>\n"
840 " </tr>\n"
841 "\n"
842 " <tr valign=\"top\">\n"
843 " <td>MM</td>\n"
844 "\n"
845 " <td>the month as number with a leading zero (01-12)</td>\n"
846 " </tr>\n"
847 "\n"
848 " <tr valign=\"top\">\n"
849 " <td>MMM</td>\n"
850 "\n"
851 " <td>the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses <a href=\n"
852 " \"qdate.html#shortMonthName\">QDate::shortMonthName</a>().</td>\n"
853 " </tr>\n"
854 "\n"
855 " <tr valign=\"top\">\n"
856 " <td>MMMM</td>\n"
857 "\n"
858 " <td>the long localized month name (e.g. 'January' to 'December'). Uses <a href=\n"
859 " \"qdate.html#longMonthName\">QDate::longMonthName</a>().</td>\n"
860 " </tr>\n"
861 "\n"
862 " <tr valign=\"top\">\n"
863 " <td>yy</td>\n"
864 "\n"
865 " <td>the year as two digit number (00-99)</td>\n"
866 " </tr>\n"
867 "\n"
868 " <tr valign=\"top\">\n"
869 " <td>yyyy</td>\n"
870 "\n"
871 " <td>the year as four digit number</td>\n"
872 " </tr>\n"
873 " </table>\n"
874 "\n"
875 " <p>These expressions may be used for the time part of the format string:</p>\n"
876 "\n"
877 " <table>\n"
878 " <thead>\n"
879 " <tr>\n"
880 " <th>Expression</th>\n"
881 "\n"
882 " <th>Output</th>\n"
883 " </tr>\n"
884 " </thead>\n"
885 "\n"
886 " <tr valign=\"top\">\n"
887 " <td>h</td>\n"
888 "\n"
889 " <td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td>\n"
890 " </tr>\n"
891 "\n"
892 " <tr valign=\"top\">\n"
893 " <td>hh</td>\n"
894 "\n"
895 " <td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td>\n"
896 " </tr>\n"
897 "\n"
898 " <tr valign=\"top\">\n"
899 " <td>H</td>\n"
900 "\n"
901 " <td>the hour without a leading zero (0 to 23, even with AM/PM display)</td>\n"
902 " </tr>\n"
903 "\n"
904 " <tr valign=\"top\">\n"
905 " <td>HH</td>\n"
906 "\n"
907 " <td>the hour with a leading zero (00 to 23, even with AM/PM display)</td>\n"
908 " </tr>\n"
909 "\n"
910 " <tr valign=\"top\">\n"
911 " <td>m</td>\n"
912 "\n"
913 " <td>the minute without a leading zero (0 to 59)</td>\n"
914 " </tr>\n"
915 "\n"
916 " <tr valign=\"top\">\n"
917 " <td>mm</td>\n"
918 "\n"
919 " <td>the minute with a leading zero (00 to 59)</td>\n"
920 " </tr>\n"
921 "\n"
922 " <tr valign=\"top\">\n"
923 " <td>s</td>\n"
924 "\n"
925 " <td>the second without a leading zero (0 to 59)</td>\n"
926 " </tr>\n"
927 "\n"
928 " <tr valign=\"top\">\n"
929 " <td>ss</td>\n"
930 "\n"
931 " <td>the second with a leading zero (00 to 59)</td>\n"
932 " </tr>\n"
933 "\n"
934 " <tr valign=\"top\">\n"
935 " <td>z</td>\n"
936 "\n"
937 " <td>the milliseconds without leading zeroes (0 to 999)</td>\n"
938 " </tr>\n"
939 "\n"
940 " <tr valign=\"top\">\n"
941 " <td>zzz</td>\n"
942 "\n"
943 " <td>the milliseconds with leading zeroes (000 to 999)</td>\n"
944 " </tr>\n"
945 "\n"
946 " <tr valign=\"top\">\n"
947 " <td>AP or A</td>\n"
948 "\n"
949 " <td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td>\n"
950 " </tr>\n"
951 "\n"
952 " <tr valign=\"top\">\n"
953 " <td>ap or a</td>\n"
954 "\n"
955 " <td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td>\n"
956 " </tr>\n"
957 " </table>\n"
958 "\n"
959 "<br>\n"
960 "\n"
961 "<h4>Example</h4>\n"
962 "<!-- Show example of function.-->\n"
963 "<code>format_date('2012-05-15','dd.mm.yyyy') &rarr; 15.05.2012</code><br>\n"
964 "") );
965  gFunctionHelpTexts.insert( "tan", QCoreApplication::translate( "function_help", "<h3>tan() function</h3>\n"
966 "Returns tangent of an angle.\n"
967 "\n"
968 "\n"
969 "<p><h4>Syntax</h4>\n"
970 " tan(<i>real</i>)</p>\n"
971 "\n"
972 "<p><h4>Arguments</h4>\n"
973 "<i>real</i> &rarr; angle in radians.</p>\n"
974 "\n"
975 "<p><h4>Example</h4>\n"
976 " tan(1.0) &rarr; 1.5574077246549</p>\n"
977 "") );
978  gFunctionHelpTexts.insert( "todate", QCoreApplication::translate( "function_help", "<h3>todate() function</h3>\n"
979 "Convert a string into Qt data type.\n"
980 "\n"
981 "<h4>Syntax</h4>\n"
982 "<code>todate('string')</code><br>\n"
983 "\n"
984 "<h4>Arguments</h4>\n"
985 "<code>string</code> - is string in Qt date format.\n"
986 "<br>\n"
987 "\n"
988 "<h4>Example</h4>\n"
989 "<!-- Show example of function.-->\n"
990 "<code>todate('2012-05-04') &rarr; 2012-05-04</code><br>") );
991  gFunctionHelpTexts.insert( "Geometry", QCoreApplication::translate( "function_help", "<h3>Geometry Group</h3>\n"
992 "This group contains functions that operate on geometry objects e.g length, area.\n"
993 "") );
994  gFunctionHelpTexts.insert( "String", QCoreApplication::translate( "function_help", "<h3>String Group</h3>\n"
995 "This group contains functions that operate on strings e.g replace, convert to upper case.\n"
996 "") );
997  gFunctionHelpTexts.insert( "right", QCoreApplication::translate( "function_help", "<h3>right() function</h3>\n"
998 "Returns a substring that contains the <i>n</i> rightmost characters of the string.\n"
999 "\n"
1000 "<h4>Syntax</h4>\n"
1001 "<code>right(string, pos)</code><br>\n"
1002 "\n"
1003 "<h4>Arguments</h4>\n"
1004 "<code>string</code> - is string. The string.\n"
1005 "<br>\n"
1006 "<code>length</code> - is int. The number of characters from the right to return.\n"
1007 "\n"
1008 "<h4>Example</h4>\n"
1009 "<!-- Show example of function.-->\n"
1010 "<code>right('Hello World',5) &rarr; 'World'</code><br>\n"
1011 "\n"
1012 "") );
1013  gFunctionHelpTexts.insert( "toreal", QCoreApplication::translate( "function_help", "<h3>toreal() function</h3>\n"
1014 "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"
1015 "\n"
1016 "<p><h4>Syntax</h4>\n"
1017 " toreal(<i>string</i>)</p>\n"
1018 "\n"
1019 "<p><h4>Arguments</h4>\n"
1020 "<!-- List args for functions here-->\n"
1021 "<i> string</i> &rarr; is string. The String to convert to real number.</p>\n"
1022 "\n"
1023 "<p><h4>Example</h4>\n"
1024 "<!-- Show example of function.-->\n"
1025 " toreal('123.45') &rarr; 123.45</p>\n"
1026 "") );
1027  gFunctionHelpTexts.insert( "Conditions", QCoreApplication::translate( "function_help", "<h3>Conditions Group</h3>\n"
1028 "This group contains functions that operate on condition.\n"
1029 "") );
1030  gFunctionHelpTexts.insert( "month", QCoreApplication::translate( "function_help", "<h3>month() function</h3>\n"
1031 "Extract the month part from a date, or the number of months\n"
1032 "from a <code>Interval</code>\n"
1033 "\n"
1034 "<h4>Syntax</h4>\n"
1035 "<code>month(date)</code><br>\n"
1036 "<code>month(Interval)</code><br>\n"
1037 "\n"
1038 "<h4>Arguments</h4>\n"
1039 "<code>date</code> - is date or datetime. The date to extract the month from.\n"
1040 "<br>\n"
1041 "<code>Interval</code> - is Interval. The Interval to return the number of months from.\n"
1042 "\n"
1043 "<h4>Example</h4>\n"
1044 "<!-- Show example of function.-->\n"
1045 "<code>month('2012-05-12') &rarr; 05</code><br>\n"
1046 "<code>month(tointerval('3 months')) &rarr; 3</code><br>\n"
1047 "<code>month(age('2012-01-01','2010-01-01')) &rarr; 4.033...</code><br>\n"
1048 "\n"
1049 "") );
1050  gFunctionHelpTexts.insert( "$numpages", QCoreApplication::translate( "function_help", "<h3>$numpages function</h3>\n"
1051 "Returns the total number of pages in the composition.\n"
1052 "\n"
1053 "<h4>Syntax</h4>\n"
1054 "<pre>$numpages</pre>\n"
1055 "\n"
1056 "<h4>Arguments</h4>\n"
1057 "None\n"
1058 "\n"
1059 "<h4>Example</h4>\n"
1060 "<pre>$numpages &rarr; 42</pre>\n"
1061 "\n"
1062 "") );
1063  gFunctionHelpTexts.insert( "Math", QCoreApplication::translate( "function_help", "<h3>Math Group</h3>\n"
1064 "This group contains math functions e.g square root, sin and cos\n"
1065 "") );
1066  gFunctionHelpTexts.insert( "CASE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
1067 "A conditional expression that can be used to evaluate multiple expressions and\n"
1068 "return a result.\n"
1069 "\n"
1070 "<h4>Syntax</h4>\n"
1071 "<pre>\n"
1072 " CASE\n"
1073 " WHEN <i>condition</i> THEN <i>result</i>\n"
1074 " [ ...n ]\n"
1075 " [ ELSE <i>result</i> ]\n"
1076 " END\n"
1077 "</pre>\n"
1078 "[ ] marks optional components\n"
1079 "\n"
1080 "<h4>Arguments</h4>\n"
1081 "<!-- List args for functions here-->\n"
1082 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
1083 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
1084 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
1085 "\n"
1086 "<h4>Example</h4>\n"
1087 "<!-- Show example of function.-->\n"
1088 "<pre>\n"
1089 " CASE\n"
1090 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
1091 " END\n"
1092 "</pre>\n"
1093 "") );
1094  gFunctionHelpTexts.insert( "second", QCoreApplication::translate( "function_help", "<h3>second() function</h3>\n"
1095 "Extract the seconds from a datetime or time, or the number of seconds\n"
1096 "from a <code>Interval</code>\n"
1097 "\n"
1098 "<h4>Syntax</h4>\n"
1099 "<code>second(datetime)</code><br>\n"
1100 "<code>second(Interval)</code><br>\n"
1101 "\n"
1102 "<h4>Arguments</h4>\n"
1103 "<code>date</code> - is datetime or time. The date to extract the second from.\n"
1104 "<br>\n"
1105 "<code>Interval</code> - is Interval. The Interval to return the number of seconds from.\n"
1106 "\n"
1107 "<h4>Example</h4>\n"
1108 "<!-- Show example of function.-->\n"
1109 "<code>second('2012-07-22T13:24:57') &rarr; 57</code><br>\n"
1110 "<code>second(tointerval('3 seconds')) &rarr; 3</code><br>\n"
1111 "<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 1200</code><br>\n"
1112 "<code>second(age('2012-01-01','2010-01-01')) &rarr; 63072000</code><br>\n"
1113 "\n"
1114 "") );
1115  gFunctionHelpTexts.insert( "$perimeter", QCoreApplication::translate( "function_help", "<h3>$perimeter function</h3>\n"
1116 "Returns the perimeter length of the current feature.\n"
1117 "\n"
1118 "<h4>Syntax</h4>\n"
1119 "<pre>$perimeter</pre>\n"
1120 "\n"
1121 "<h4>Arguments</h4>\n"
1122 "None\n"
1123 "\n"
1124 "<h4>Example</h4>\n"
1125 "<pre>$perimeter &rarr; 42</pre>\n"
1126 "\n"
1127 "") );
1128  gFunctionHelpTexts.insert( "round", QCoreApplication::translate( "function_help", "<h3>round() function</h3>\n"
1129 "Rounds a number to number of decimal places.\n"
1130 "<br>\n"
1131 "This function can take one or two arguments depending on what is needed.\n"
1132 "<h4>Syntax</h4>\n"
1133 "<code>round(decimal,places)</code><br>\n"
1134 "<code>round(decimal)</code><br>\n"
1135 "\n"
1136 "<h4>Arguments</h4>\n"
1137 "<code>decimal</code> - is decimal. The decimal number to be rounded.\n"
1138 "<br>\n"
1139 "<code>places</code> - is int. The number of places to round decimal too. Can be negative.\n"
1140 "\n"
1141 "<h4>Example</h4>\n"
1142 "<!-- Show example of function.-->\n"
1143 "<code>round(1234.567, 2 ) &rarr; 1234.57</code><br>\n"
1144 "use <code>round(decimal)</code> to round to the nearest integer<br>\n"
1145 "<code>round(1234.567) &rarr; 1235</code><br>\n"
1146 "\n"
1147 "\n"
1148 "") );
1149  gFunctionHelpTexts.insert( "log", QCoreApplication::translate( "function_help", "<h3>log() function</h3>\n"
1150 "Returns the value of the logarithm of the passed value and base.\n"
1151 "<br>\n"
1152 "This function takes two arguments.\n"
1153 "<h4>Syntax</h4>\n"
1154 "<code>log(base, value)</code><br>\n"
1155 "\n"
1156 "<h4>Arguments</h4>\n"
1157 "<code>base</code> - any positive number.<br>\n"
1158 "<code>value</code> - any positive number.\n"
1159 "<br>\n"
1160 "\n"
1161 "<h4>Example</h4>\n"
1162 "<!-- Show example of function.-->\n"
1163 "<code>log(2, 32) &rarr; 5</code><br>\n"
1164 "<code>log(0.5, 32) &rarr; -5</code><br>\n"
1165 "") );
1166  gFunctionHelpTexts.insert( "Operators", QCoreApplication::translate( "function_help", "<h3>Operators Group</h3>\n"
1167 "This group contains operators e.g + - * \n"
1168 "") );
1169  gFunctionHelpTexts.insert( "$rownum", QCoreApplication::translate( "function_help", "<h3>$rownum function</h3>\n"
1170 "Returns the number of the current row.\n"
1171 "\n"
1172 "<h4>Syntax</h4>\n"
1173 "<pre>$rownum</pre>\n"
1174 "\n"
1175 "<h4>Arguments</h4>\n"
1176 "None\n"
1177 "\n"
1178 "<h4>Example</h4>\n"
1179 "<pre>$rownum &rarr; 4711</pre>\n"
1180 "\n"
1181 "") );
1182  gFunctionHelpTexts.insert( "tointerval", QCoreApplication::translate( "function_help", "<h3>tointerval() function</h3>\n"
1183 "Converts a string to a interval type. Can be used to take days, hours, month, etc off a date. \n"
1184 "\n"
1185 "<h4>Syntax</h4>\n"
1186 "<code>tointerval('string')</code><br>\n"
1187 "\n"
1188 "<h4>Arguments</h4>\n"
1189 "<code>string</code> - is string. Format {n} days {n} hours {n} months\n"
1190 "<br>\n"
1191 "\n"
1192 "<h4>Example</h4>\n"
1193 "<!-- Show example of function.-->\n"
1194 "<code>todatetime('2012-05-05 12:00:00') - tointerval('1 day 2 hours') &rarr; 2012-05-04T10:00:00</code><br>") );
1195  gFunctionHelpTexts.insert( "left", QCoreApplication::translate( "function_help", "<h3>left() function</h3>\n"
1196 "Returns a substring that contains the <i>n</i> leftmost characters of the string.\n"
1197 "\n"
1198 "<h4>Syntax</h4>\n"
1199 "<code>left(string, length)</code><br>\n"
1200 "\n"
1201 "<h4>Arguments</h4>\n"
1202 "<code>string</code> - is string. The string.\n"
1203 "<br>\n"
1204 "<code>length</code> - is int. The number of characters from the left to return.\n"
1205 "\n"
1206 "<h4>Example</h4>\n"
1207 "<!-- Show example of function.-->\n"
1208 "<code>left('Hello World',5) &rarr; 'Hello'</code><br>\n"
1209 "\n"
1210 "") );
1211  gFunctionHelpTexts.insert( "max", QCoreApplication::translate( "function_help", "<h3>max() function</h3>\n"
1212 "Returns the largest value in a set of values.\n"
1213 "\n"
1214 "<h4>Syntax</h4>\n"
1215 " max(<i>value<i>[,<i>value</i>...])\n"
1216 "\n"
1217 "<h4>Arguments</h4>\n"
1218 "<!-- List args for functions here-->\n"
1219 "<i> value</i> &rarr; a number.<br>\n"
1220 "\n"
1221 "<h4>Example</h4>\n"
1222 "<!-- Show example of function.-->\n"
1223 " max(2,10.2,5.5) &rarr; 10.2\n"
1224 "") );
1225  gFunctionHelpTexts.insert( "upper", QCoreApplication::translate( "function_help", "<h3>upper() function</h3>\n"
1226 "Converts a string to upper case letters.\n"
1227 "\n"
1228 "<p><h4>Syntax</h4>\n"
1229 " upper(<i>string</i>)</p>\n"
1230 "\n"
1231 "<p><h4>Arguments</h4>\n"
1232 "<!-- List args for functions here-->\n"
1233 "<i> string</i> &rarr; is string. The String to convert to upper case.</p>\n"
1234 "\n"
1235 "<p><h4>Example</h4>\n"
1236 "<!-- Show example of function.-->\n"
1237 " upper('hello WOrld') &rarr; 'HELLO WORLD'</p>\n"
1238 "") );
1239  gFunctionHelpTexts.insert( "color_hsl", QCoreApplication::translate( "function_help", "<h3>color_hsl() function</h3>\n"
1240 "Returns a string representation of a color based on its hue, saturation, and lightness attributes\n"
1241 "\n"
1242 "<p><h4>Syntax</h4>\n"
1243 " color_hsl(<i>hue, saturation, lightness</i>)</p>\n"
1244 "\n"
1245 "<p><h4>Arguments</h4>\n"
1246 "<!-- List args for functions here-->\n"
1247 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
1248 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
1249 "<i> lightness</i> &rarr; the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
1250 "\n"
1251 "<p><h4>Example</h4>\n"
1252 "<!-- Show example of function.-->\n"
1253 " color_hsl(100,50,70) &rarr; '#a6d98c'</p>\n"
1254 "") );
1255  gFunctionHelpTexts.insert( "length", QCoreApplication::translate( "function_help", "<h3>length() function</h3>\n"
1256 "Returns the length of a string.\n"
1257 "\n"
1258 "<p><h4>Syntax</h4>\n"
1259 " length(<i>string</i>)</p>\n"
1260 "\n"
1261 "<p><h4>Arguments</h4>\n"
1262 "<!-- List args for functions here-->\n"
1263 "<i> string</i> &rarr; is string. The String to count the length of.</p>\n"
1264 "\n"
1265 "<p><h4>Example</h4>\n"
1266 "<!-- Show example of function.-->\n"
1267 " length('HELLO') &rarr; 5</p>\n"
1268 "") );
1269  gFunctionHelpTexts.insert( "Fields and Values", QCoreApplication::translate( "function_help", "<h3>Fields and Values</h3>\n"
1270 "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\n"
1271 "<br><br>\n"
1272 "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"
1273 "\n"
1274 "<p><h4>Note:</h4>\n"
1275 "Loading field values from WFS layers isn't supported, before the layer is\n"
1276 "actually inserted, ie. when building queries.\n"
1277 "</p>\n"
1278 "") );
1279  gFunctionHelpTexts.insert( "year", QCoreApplication::translate( "function_help", "<h3>year() function</h3>\n"
1280 "Extract the year part from a date, or the number of years\n"
1281 "from a <code>Interval</code>\n"
1282 "\n"
1283 "<h4>Syntax</h4>\n"
1284 "<code>year(date)</code><br>\n"
1285 "<code>year(Interval)</code><br>\n"
1286 "\n"
1287 "<h4>Arguments</h4>\n"
1288 "<code>date</code> - is date or datetime. The date to extract the year from.\n"
1289 "<br>\n"
1290 "<code>Interval</code> - is Interval. The Interval to return the number of years from.\n"
1291 "\n"
1292 "<h4>Example</h4>\n"
1293 "<!-- Show example of function.-->\n"
1294 "<code>year('2012-05-12') &rarr; 2012</code><br>\n"
1295 "<code>year(tointerval('3 Years')) &rarr; 3</code><br>\n"
1296 "<code>year(age('2012-01-01','2010-01-01')) &rarr; 1.9986..</code><br>\n"
1297 "\n"
1298 "") );
1299  gFunctionHelpTexts.insert( "totime", QCoreApplication::translate( "function_help", "<h3>totime() function</h3>\n"
1300 "Convert a string into Qt time type.\n"
1301 "\n"
1302 "<h4>Syntax</h4>\n"
1303 "<code>totime('string')</code><br>\n"
1304 "\n"
1305 "<h4>Arguments</h4>\n"
1306 "<code>string</code> - is string in Qt time format.\n"
1307 "<br>\n"
1308 "\n"
1309 "<h4>Example</h4>\n"
1310 "<!-- Show example of function.-->\n"
1311 "<code>totime('12:30:01') &rarr; 12:30:01</code><br>") );
1312  gFunctionHelpTexts.insert( "sin", QCoreApplication::translate( "function_help", "<h3>sin() function</h3>\n"
1313 "Returns sinus of an angle.\n"
1314 "\n"
1315 "\n"
1316 "<p><h4>Syntax</h4>\n"
1317 " sin(<i>real</i>)</p>\n"
1318 "\n"
1319 "<p><h4>Arguments</h4>\n"
1320 "<i>real</i> &rarr; angle in radians.</p>\n"
1321 "\n"
1322 "<p><h4>Example</h4>\n"
1323 " sin(1.571) &rarr; 0.999999682931835</p>\n"
1324 "") );
1325  gFunctionHelpTexts.insert( "concat", QCoreApplication::translate( "function_help", "<h3>concat() function</h3>\n"
1326 "Concatenates several strings to one.\n"
1327 "\n"
1328 "<h4>Syntax</h4>\n"
1329 " concat(<i>string<i>[,<i>string</i>...])\n"
1330 "\n"
1331 "<h4>Arguments</h4>\n"
1332 "<!-- List args for functions here-->\n"
1333 "<i> string</i> &rarr; is string. a string.<br>\n"
1334 "\n"
1335 "<h4>Example</h4>\n"
1336 "<!-- Show example of function.-->\n"
1337 " concat('a','b','c','d','e') &rarr; 'abcde'\n"
1338 "") );
1339  gFunctionHelpTexts.insert( "atan", QCoreApplication::translate( "function_help", "<h3>atan() function</h3>\n"
1340 "Returns arcustanget of a value in radians.\n"
1341 "\n"
1342 "\n"
1343 "<p><h4>Syntax</h4>\n"
1344 " atan(<i>real</i>)</p>\n"
1345 "\n"
1346 "<p><h4>Arguments</h4>\n"
1347 "<i>real</i> &rarr; tan of an angle.</p>\n"
1348 "\n"
1349 "<p><h4>Example</h4>\n"
1350 " atan(0.5) &rarr; 0.463647609000806</p>\n"
1351 "") );
1352  gFunctionHelpTexts.insert( "color_cmyka", QCoreApplication::translate( "function_help", "\n"
1353 "<h3>color_cmyka() function</h3>\n"
1354 "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components\n"
1355 "\n"
1356 "<p><h4>Syntax</h4>\n"
1357 " color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p>\n"
1358 "\n"
1359 "<p><h4>Arguments</h4>\n"
1360 "<!-- List args for functions here-->\n"
1361 "<i> cyan</i> &rarr; the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
1362 "<i> magenta</i> &rarr; the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
1363 "<i> yellow</i> &rarr; the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
1364 "<i> black</i> &rarr; the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
1365 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
1366 "\n"
1367 "<p><h4>Example</h4>\n"
1368 "<!-- Show example of function.-->\n"
1369 " color_cmyka(100,50,0,10,200) &rarr; '0,115,230,200'</p>\n"
1370 "") );
1371  gFunctionHelpTexts.insert( "minute", QCoreApplication::translate( "function_help", "<h3>minute() function</h3>\n"
1372 "Extract the minute from a datetime or time, or the number of minutes\n"
1373 "from a <code>Interval</code>\n"
1374 "\n"
1375 "<h4>Syntax</h4>\n"
1376 "<code>minute(datetime)</code><br>\n"
1377 "<code>minute(Interval)</code><br>\n"
1378 "\n"
1379 "<h4>Arguments</h4>\n"
1380 "<code>date</code> - is datetime or time. The date to extract the minute from.\n"
1381 "<br>\n"
1382 "<code>Interval</code> - is Interval. The Interval to return the number of minutes from.\n"
1383 "\n"
1384 "<h4>Example</h4>\n"
1385 "<!-- Show example of function.-->\n"
1386 "<code>minute('2012-07-22T13:24:57') &rarr; 24</code><br>\n"
1387 "<code>minute(tointerval('3 minutes')) &rarr; 3</code><br>\n"
1388 "<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 20</code><br>\n"
1389 "<code>minute(age('2012-01-01','2010-01-01')) &rarr; 1051200</code><br>\n"
1390 "\n"
1391 "") );
1392  gFunctionHelpTexts.insert( "week", QCoreApplication::translate( "function_help", "<h3>week() function</h3>\n"
1393 "Extract the week number from a date, or the number of weeks\n"
1394 "from a <code>Interval</code>\n"
1395 "\n"
1396 "<h4>Syntax</h4>\n"
1397 "<code>week(date)</code><br>\n"
1398 "<code>week(Interval)</code><br>\n"
1399 "\n"
1400 "<h4>Arguments</h4>\n"
1401 "<code>date</code> - is date or datetime. The date to extract the week from.\n"
1402 "<br>\n"
1403 "<code>Interval</code> - is Interval. The Interval to return the number of weeks from.\n"
1404 "\n"
1405 "<h4>Example</h4>\n"
1406 "<!-- Show example of function.-->\n"
1407 "<code>week('2012-05-12') &rarr; 19</code><br>\n"
1408 "<code>week(tointerval('3 weeks')) &rarr; 3</code><br>\n"
1409 "<code>week(age('2012-01-01','2010-01-01')) &rarr; 104.285...</code><br>\n"
1410 "\n"
1411 "") );
1412  gFunctionHelpTexts.insert( "floor", QCoreApplication::translate( "function_help", "<h3>floor() function</h3>\n"
1413 "Rounds a number downwards.\n"
1414 "\n"
1415 "<h4>Syntax</h4>\n"
1416 "<code>floor(value)</code><br>\n"
1417 "\n"
1418 "<h4>Arguments</h4>\n"
1419 "<code>value</code> - a number.\n"
1420 "<br>\n"
1421 "\n"
1422 "<h4>Example</h4>\n"
1423 "<!-- Show example of function.-->\n"
1424 "<code>floor(4.9) &rarr; 4</code><br>\n"
1425 "<code>floor(-4.9) &rarr; -5</code><br>\n"
1426 "") );
1427  gFunctionHelpTexts.insert( "regexp_substr", QCoreApplication::translate( "function_help", "<h3>regexp_substr() function</h3>\n"
1428 "Returns the portion of a string which matches a supplied regular expression.\n"
1429 "\n"
1430 "<p><h4>Syntax</h4>\n"
1431 " regexp_substr(<i>string,regex</i>)</p>\n"
1432 "\n"
1433 "<p><h4>Arguments</h4>\n"
1434 "<!-- List args for functions here-->\n"
1435 "<i> string</i> &rarr; is string. The input string.<br>\n"
1436 "<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"
1437 "\n"
1438 "<p><h4>Example</h4>\n"
1439 "<!-- Show example of function.-->\n"
1440 " regexp_substr('abc123','(&#92;&#92;d+)') &rarr; '123'</p>\n"
1441 "") );
1442  gFunctionHelpTexts.insert( "clamp", QCoreApplication::translate( "function_help", "<h3>clamp() function</h3>\n"
1443 "Restricts an input value to a specified range.\n"
1444 "\n"
1445 "<p><h4>Syntax</h4>\n"
1446 " clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>\n"
1447 "\n"
1448 "<p><h4>Arguments</h4>\n"
1449 "<!-- List args for functions here-->\n"
1450 "<i> minimum</i> &rarr; The smallest value <i>input</i> is allowed to take.<br>\n"
1451 "<i> input</i> &rarr; a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>\n"
1452 "<i> maximum</i> &rarr; The largest value <i>input</i> is allowed to take.<br>\n"
1453 "\n"
1454 "<h4>Example</h4>\n"
1455 "<!-- Show example of function.-->\n"
1456 " clamp(1,5,10) &rarr; 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>\n"
1457 " clamp(1,0,10) &rarr; 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>\n"
1458 " clamp(1,11,10) &rarr; 10 (<i>input</i> is greater than maximum value of 10, so function returns 11)<br>\n"
1459 " \n"
1460 " \n"
1461 "") );
1462  gFunctionHelpTexts.insert( "ceil", QCoreApplication::translate( "function_help", "<h3>ceil() function</h3>\n"
1463 "Rounds a number upwards.\n"
1464 "\n"
1465 "<h4>Syntax</h4>\n"
1466 "<code>ceil(value)</code><br>\n"
1467 "\n"
1468 "<h4>Arguments</h4>\n"
1469 "<code>value</code> - a number.\n"
1470 "<br>\n"
1471 "\n"
1472 "<h4>Example</h4>\n"
1473 "<!-- Show example of function.-->\n"
1474 "<code>ceil(4.9) &rarr; 5</code><br>\n"
1475 "<code>ceil(-4.9) &rarr; -4</code><br>\n"
1476 "") );
1477  gFunctionHelpTexts.insert( "xat", QCoreApplication::translate( "function_help", "<h3>xat() function</h3>\n"
1478 "Retrieves a x coordinate of the current feature\n"
1479 "\n"
1480 "<h4>Syntax</h4>\n"
1481 "<code>xat(i)</code>\n"
1482 "\n"
1483 "<h4>Arguments</h4>\n"
1484 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
1485 "\n"
1486 "<h4>Example</h4>\n"
1487 "<pre>xat(1) &rarr; 5</pre>\n"
1488 "") );
1489  gFunctionHelpTexts.insert( "$y", QCoreApplication::translate( "function_help", "<h3>$y function</h3>\n"
1490 "Returns the y coordinate of the current feature.\n"
1491 "\n"
1492 "<h4>Syntax</h4>\n"
1493 "<pre>$y</pre>\n"
1494 "\n"
1495 "<h4>Arguments</h4>\n"
1496 "None\n"
1497 "\n"
1498 "<h4>Example</h4>\n"
1499 "<pre>$y &rarr; 42</pre>\n"
1500 "\n"
1501 "") );
1502  gFunctionHelpTexts.insert( "$x", QCoreApplication::translate( "function_help", "<h3>$x function</h3>\n"
1503 "Returns the x coordinate of the current feature.\n"
1504 "\n"
1505 "<h4>Syntax</h4>\n"
1506 "<pre>$x</pre>\n"
1507 "\n"
1508 "<h4>Arguments</h4>\n"
1509 "None\n"
1510 "\n"
1511 "<h4>Example</h4>\n"
1512 "<pre>$x &rarr; 42</pre>\n"
1513 "\n"
1514 "") );
1515  gFunctionHelpTexts.insert( "regexp_replace", QCoreApplication::translate( "function_help", "<h3>regexp_replace() function</h3>\n"
1516 "Returns a string with the supplied regular expression replaced.\n"
1517 "\n"
1518 "<p><h4>Syntax</h4>\n"
1519 " regexp_replace(<i>string,regex,after</i>)</p>\n"
1520 "\n"
1521 "<p><h4>Arguments</h4>\n"
1522 "<!-- List args for functions here-->\n"
1523 "<i> string</i> &rarr; is string. The start string.<br>\n"
1524 "<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"
1525 "<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"
1526 "\n"
1527 "<p><h4>Example</h4>\n"
1528 "<!-- Show example of function.-->\n"
1529 " regexp_replace('QGIS SHOULD ROCK','&#92;&#92;sSHOULD&#92;&#92;s',' DOES ') &rarr; 'QGIS DOES ROCK'</p>\n"
1530 "") );
1531  gFunctionHelpTexts.insert( "substr", QCoreApplication::translate( "function_help", "<h3>substr() function</h3>\n"
1532 "Return a part of a string\n"
1533 "\n"
1534 "<p><h4>Syntax</h4>\n"
1535 " substr(<i>string,startpos,length</i>)</p>\n"
1536 "\n"
1537 "<p><h4>Arguments</h4>\n"
1538 "<!-- List args for functions here-->\n"
1539 "<i> string</i> &rarr; is string. The full string.<br>\n"
1540 "<i> startpos</i> &rarr; is number. The start position to extract from.<br>\n"
1541 "<i> length</i> &rarr; is number. The length of the string to extract.<br></p>\n"
1542 "\n"
1543 "<p><h4>Example</h4>\n"
1544 "<!-- Show example of function.-->\n"
1545 " substr('HELLO WORLD',3,5) &rarr; 'LLO W'</p>\n"
1546 "") );
1547  gFunctionHelpTexts.insert( "exp", QCoreApplication::translate( "function_help", "<h3>exp() function</h3>\n"
1548 "Returns exponential of an value.\n"
1549 "\n"
1550 "\n"
1551 "<p><h4>Syntax</h4>\n"
1552 " exp(<i>real</i>)</p>\n"
1553 "\n"
1554 "<p><h4>Arguments</h4>\n"
1555 "<i>real</i> &rarr; number.</p>\n"
1556 "\n"
1557 "<p><h4>Example</h4>\n"
1558 " exp(1.0) &rarr; 2.71828182845905</p>\n"
1559 "") );
1560  gFunctionHelpTexts.insert( "$numfeatures", QCoreApplication::translate( "function_help", "<h3>$numfeatures function</h3>\n"
1561 "In atlas generation, returns the total number of features within the coverage layer.\n"
1562 "\n"
1563 "<h4>Syntax</h4>\n"
1564 "<pre>$numfeatures</pre>\n"
1565 "\n"
1566 "<h4>Arguments</h4>\n"
1567 "None\n"
1568 "\n"
1569 "<h4>Example</h4>\n"
1570 "<pre>$numfeatures &rarr; 42</pre>\n"
1571 "\n"
1572 "") );
1573  gFunctionHelpTexts.insert( "color_rgb", QCoreApplication::translate( "function_help", "\n"
1574 "<h3>color_rgb() function</h3>\n"
1575 "Returns a string representation of a color based on its red, green, and blue components\n"
1576 "\n"
1577 "<p><h4>Syntax</h4>\n"
1578 " color_rgb(<i>red, green, blue</i>)</p>\n"
1579 "\n"
1580 "<p><h4>Arguments</h4>\n"
1581 "<!-- List args for functions here-->\n"
1582 "<i> red</i> &rarr; the red component as an integer value from 0 to 255.<br>\n"
1583 "<i> green</i> &rarr; the green component as an integer value from 0 to 255.<br>\n"
1584 "<i> blue</i> &rarr; the blue component as an integer value from 0 to 255.<br>\n"
1585 "\n"
1586 "<p><h4>Example</h4>\n"
1587 "<!-- Show example of function.-->\n"
1588 " color_rgb(255,127,0) &rarr; '#ff7f00'</p>\n"
1589 "") );
1590 }
static QHash< QString, QString > gFunctionHelpTexts
static void initFunctionHelp()