|
@@ -12,41 +12,145 @@ |
|
|
class QgsServerParameterDefinition |
|
|
{ |
|
|
%Docstring |
|
|
************************************************************************* |
|
|
Definition of a parameter with basic conversion methods |
|
|
|
|
|
This program is free software; you can redistribute it and/or modify * |
|
|
it under the terms of the GNU General Public License as published by * |
|
|
the Free Software Foundation; either version 2 of the License, or * |
|
|
(at your option) any later version. * |
|
|
|
|
|
************************************************************************** |
|
|
.. versionadded:: 3.4 |
|
|
%End |
|
|
|
|
|
%TypeHeaderCode |
|
|
#include "qgsserverparameters.h" |
|
|
%End |
|
|
public: |
|
|
|
|
|
QgsServerParameterDefinition( const QVariant::Type type = QVariant::String, |
|
|
const QVariant defaultValue = QVariant( "" ) ); |
|
|
%Docstring |
|
|
Constructor for QgsServerParameterDefinition. |
|
|
|
|
|
:param type: The type of the parameter |
|
|
:param defaultValue: The default value of the parameter |
|
|
%End |
|
|
|
|
|
virtual ~QgsServerParameterDefinition(); |
|
|
|
|
|
QString typeName() const; |
|
|
%Docstring |
|
|
Returns the type of the parameter as a string. |
|
|
%End |
|
|
|
|
|
virtual bool isValid() const; |
|
|
%Docstring |
|
|
Returns true if the parameter is valid, false otherwise. |
|
|
%End |
|
|
|
|
|
QString toString() const; |
|
|
%Docstring |
|
|
Converts the parameter into a string. |
|
|
%End |
|
|
|
|
|
QStringList toStringList( char delimiter = ',' ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a list of strings. |
|
|
|
|
|
:param delimiter: The character used for delimiting |
|
|
|
|
|
:return: A list of strings |
|
|
%End |
|
|
|
|
|
QList<int> toIntList( bool &ok, char delimiter = ',' ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a list of integers. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
:param delimiter: The character used for delimiting |
|
|
|
|
|
:return: A list of integers |
|
|
%End |
|
|
|
|
|
QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a list of doubles. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
:param delimiter: The character used for delimiting |
|
|
|
|
|
:return: A list of doubles |
|
|
%End |
|
|
|
|
|
QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a list of colors. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
:param delimiter: The character used for delimiting |
|
|
|
|
|
:return: A list of colors |
|
|
%End |
|
|
|
|
|
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a list of geometries. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
:param delimiter: The character used for delimiting |
|
|
|
|
|
:return: A list of geometries |
|
|
%End |
|
|
|
|
|
QgsRectangle toRectangle( bool &ok ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a rectangle. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
|
|
|
:return: A rectangle |
|
|
%End |
|
|
|
|
|
int toInt( bool &ok ) const; |
|
|
%Docstring |
|
|
Converts the parameter into an integer. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
|
|
|
:return: An integer |
|
|
%End |
|
|
|
|
|
double toDouble( bool &ok ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a double. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
|
|
|
:return: A double |
|
|
%End |
|
|
|
|
|
bool toBool() const; |
|
|
%Docstring |
|
|
Converts the parameter into a boolean. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
:param delimiter: The character used for delimiting |
|
|
|
|
|
:return: A boolean |
|
|
%End |
|
|
|
|
|
QColor toColor( bool &ok ) const; |
|
|
%Docstring |
|
|
Converts the parameter into a color. |
|
|
|
|
|
:param ok: True if there's no error during the conversion, false otherwise |
|
|
:param delimiter: The character used for delimiting |
|
|
|
|
|
:return: A color |
|
|
%End |
|
|
|
|
|
static void raiseError( const QString &msg ); |
|
|
%Docstring |
|
|
Raises an exception in case of an invalid parameters. |
|
|
|
|
|
:param msg: The message describing the exception |
|
|
\throws QgsBadRequestException Invalid parameter exception |
|
|
%End |
|
|
|
|
|
QVariant::Type mType; |
|
|
QVariant mValue; |
|
|