QGIS/python/server/auto_generated/qgsserverparameters.sip.in

377 lines
8.6 KiB
Plaintext
Raw Normal View History

2018-06-28 13:32:10 +01:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverparameters.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2018-07-02 08:27:20 +01:00
class QgsServerParameterDefinition
2018-06-28 13:32:10 +01:00
{
%Docstring
Definition of a parameter with basic conversion methods
2018-06-28 13:32:10 +01:00
.. versionadded:: 3.4
2018-06-28 13:32:10 +01:00
%End
2018-07-02 08:27:20 +01:00
%TypeHeaderCode
#include "qgsserverparameters.h"
%End
public:
2018-07-02 08:27:20 +01:00
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
2018-07-02 08:27:20 +01:00
2018-07-06 17:50:37 +02:00
virtual ~QgsServerParameterDefinition();
2018-07-02 08:27:20 +01:00
QString typeName() const;
%Docstring
Returns the type of the parameter as a string.
%End
2018-07-02 08:27:20 +01:00
virtual bool isValid() const;
%Docstring
2019-02-26 19:54:09 +10:00
Returns ``True`` if the parameter is valid, ``False`` otherwise.
%End
2018-07-02 08:27:20 +01:00
2019-02-25 09:55:10 +00:00
QString toString( bool defaultValue = false ) const;
%Docstring
2019-02-25 09:55:10 +00:00
Converts the parameter into a string. If ``defaultValue`` is true
and current value is empty, then the default value is returned.
%End
QStringList toStringList( char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of strings
:param delimiter: The character used for delimiting
:param skipEmptyParts: To use QString.SkipEmptyParts for splitting
:return: A list of strings
%End
2018-07-02 08:27:20 +01:00
QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
%Docstring
Converts the parameter into a list of integers.
2019-02-26 19:54:09 +10:00
: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
2018-07-02 08:27:20 +01:00
QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
%Docstring
Converts the parameter into a list of doubles.
2019-02-26 19:54:09 +10:00
: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
2018-07-02 08:27:20 +01:00
QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
%Docstring
Converts the parameter into a list of colors.
2019-02-26 19:54:09 +10:00
: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
2018-07-02 08:27:20 +01:00
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
%Docstring
Converts the parameter into a list of geometries.
2019-02-26 19:54:09 +10:00
: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
2018-07-02 08:27:20 +01:00
QgsRectangle toRectangle( bool &ok ) const;
%Docstring
Converts the parameter into a rectangle.
2019-02-26 19:54:09 +10:00
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:return: A rectangle
%End
2018-07-02 08:27:20 +01:00
int toInt( bool &ok ) const;
%Docstring
Converts the parameter into an integer.
2019-02-26 19:54:09 +10:00
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:return: An integer
%End
2018-07-02 08:27:20 +01:00
double toDouble( bool &ok ) const;
%Docstring
Converts the parameter into a double.
2019-02-26 19:54:09 +10:00
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:return: A double
%End
2018-07-02 08:27:20 +01:00
bool toBool() const;
%Docstring
Converts the parameter into a boolean.
:return: A boolean
%End
2018-07-02 08:27:20 +01:00
QColor toColor( bool &ok ) const;
%Docstring
Converts the parameter into a color.
2019-02-26 19:54:09 +10:00
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:return: A color
%End
QUrl toUrl( bool &ok ) const;
%Docstring
Converts the parameter into an url.
2019-02-26 19:54:09 +10:00
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:return: An url
.. versionadded:: 3.4
%End
QString loadUrl( bool &ok ) const;
%Docstring
Loads the data associated to the parameter converted into an url.
2019-02-26 19:54:09 +10:00
:param ok: ``True`` if there's no error during the load, ``False`` otherwise
:return: The content loaded
.. versionadded:: 3.4
%End
2018-07-02 08:27:20 +01:00
static void raiseError( const QString &msg );
%Docstring
Raises an exception in case of an invalid parameters.
:param msg: The message describing the exception
:raises QgsBadRequestException: Invalid parameter exception
%End
2018-07-02 08:27:20 +01:00
QVariant::Type mType;
QVariant mValue;
QVariant mDefaultValue;
};
class QgsServerParameter : QgsServerParameterDefinition
{
%Docstring
Parameter common to all services (WMS, WFS, ...)
.. versionadded:: 3.4
%End
2018-07-02 08:27:20 +01:00
2018-06-28 13:32:10 +01:00
%TypeHeaderCode
#include "qgsserverparameters.h"
%End
public:
static const QMetaObject staticMetaObject;
public:
2018-07-02 08:27:20 +01:00
enum Name
2018-06-28 13:32:10 +01:00
{
2018-07-02 08:27:20 +01:00
UNKNOWN,
2018-06-28 13:32:10 +01:00
SERVICE,
VERSION_SERVICE,
REQUEST,
MAP,
FILE_NAME
};
2018-07-02 08:27:20 +01:00
QgsServerParameter( const QgsServerParameter::Name name = QgsServerParameter::UNKNOWN,
const QVariant::Type type = QVariant::String,
const QVariant defaultValue = QVariant( "" ) );
%Docstring
Constructor for QgsServerParameter.
:param name: The name of the parameter
:param type: The type of the parameter
:param defaultValue: The default value to use if not defined
%End
2018-07-02 08:27:20 +01:00
void raiseError() const;
%Docstring
Raises an error in case of an invalid conversion.
:raises QgsBadRequestException: Invalid parameter exception
%End
2018-07-02 08:27:20 +01:00
static QString name( const QgsServerParameter::Name name );
%Docstring
Converts a parameter's name into its string representation.
%End
2018-07-02 08:27:20 +01:00
static QgsServerParameter::Name name( const QString &name );
%Docstring
Converts a string into a parameter's name (UNKNOWN in case of an
invalid string).
%End
2018-07-02 08:27:20 +01:00
QgsServerParameter::Name mName;
};
class QgsServerParameters
{
%Docstring
QgsServerParameters provides an interface to retrieve and manipulate global parameters received from the client.
2018-07-02 08:27:20 +01:00
.. versionadded:: 3.4
%End
%TypeHeaderCode
#include "qgsserverparameters.h"
%End
public:
static const QMetaObject staticMetaObject;
public:
2018-06-28 13:32:10 +01:00
QgsServerParameters();
%Docstring
Constructor.
%End
QgsServerParameters( const QUrlQuery &query );
%Docstring
Constructor.
%End
2018-07-06 17:50:37 +02:00
virtual ~QgsServerParameters();
2018-06-28 13:32:10 +01:00
void load( const QUrlQuery &query );
%Docstring
Loads new parameters.
:param query: url query
%End
void clear();
%Docstring
Removes all parameters.
%End
void add( const QString &key, const QString &value );
%Docstring
Adds a parameter.
:param key: the name of the parameter
:param value: the value of the parameter
%End
void remove( const QString &key );
%Docstring
Removes a parameter.
:param key: the name of the parameter
%End
2018-07-03 01:34:07 +02:00
void remove( QgsServerParameter::Name name );
2018-07-19 22:36:54 +02:00
%Docstring
Removes a parameter.
:param name: The name of the parameter
.. versionadded:: 3.4
%End
2018-07-03 01:34:07 +02:00
2018-06-28 13:32:10 +01:00
QString value( const QString &key ) const;
%Docstring
Returns the value of a parameter.
:param key: the name of the parameter
%End
QUrlQuery urlQuery() const;
%Docstring
Returns a url query with underlying parameters.
%End
QMap<QString, QString> toMap() const;
%Docstring
Returns all parameters in a map.
%End
QString service() const;
%Docstring
Returns SERVICE parameter as a string or an empty string if not
defined.
:return: service
%End
QString request() const;
%Docstring
Returns REQUEST parameter as a string or an empty string if not
defined.
:return: request
%End
QString map() const;
%Docstring
Returns MAP parameter as a string or an empty string if not
defined.
:return: map
%End
QString fileName() const;
%Docstring
Returns FILE_NAME parameter as a string or an empty string if not
defined.
:return: filename
%End
QString version() const;
%Docstring
Returns VERSION parameter as a string or an empty string if not
defined.
:return: version
%End
2018-07-02 08:27:20 +01:00
protected:
2018-07-19 22:36:54 +02:00
2018-07-02 14:26:05 +01:00
virtual bool loadParameter( const QString &name, const QString &value );
2018-07-19 22:36:54 +02:00
%Docstring
Loads a parameter with a specific value. This method should be
implemented in subclasses.
%End
2018-07-02 08:27:20 +01:00
2018-06-28 13:32:10 +01:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverparameters.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/