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