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
|
2018-07-02 08:27:20 +01:00
|
|
|
*************************************************************************
|
2018-06-28 13:32:10 +01:00
|
|
|
|
2018-07-02 08:27:20 +01:00
|
|
|
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. *
|
|
|
|
|
|
|
|
**************************************************************************
|
2018-06-28 13:32:10 +01:00
|
|
|
%End
|
|
|
|
|
2018-07-02 08:27:20 +01:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsserverparameters.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsServerParameterDefinition( const QVariant::Type type = QVariant::String,
|
|
|
|
const QVariant defaultValue = QVariant( "" ) );
|
|
|
|
|
|
|
|
QString typeName() const;
|
|
|
|
virtual bool isValid() const;
|
|
|
|
|
|
|
|
QString toString() const;
|
|
|
|
QStringList toStringList( char delimiter = ',' ) const;
|
|
|
|
QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
|
|
|
|
QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
|
|
|
|
QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
|
|
|
|
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
|
|
|
|
QgsRectangle toRectangle( bool &ok ) const;
|
|
|
|
int toInt( bool &ok ) const;
|
|
|
|
double toDouble( bool &ok ) const;
|
|
|
|
bool toBool() const;
|
|
|
|
QColor toColor( bool &ok ) const;
|
|
|
|
|
|
|
|
static void raiseError( const QString &msg );
|
|
|
|
|
|
|
|
QVariant::Type mType;
|
|
|
|
QVariant mValue;
|
|
|
|
QVariant mDefaultValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsServerParameter : QgsServerParameterDefinition
|
|
|
|
{
|
|
|
|
|
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( "" ) );
|
|
|
|
|
|
|
|
void raiseError() const;
|
|
|
|
|
|
|
|
static QString name( const QgsServerParameter::Name name );
|
|
|
|
static QgsServerParameter::Name name( const QString &name );
|
|
|
|
|
|
|
|
QgsServerParameter::Name mName;
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsServerParameters
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
QgsServerParameters provides an interface to retrieve and manipulate
|
|
|
|
global parameters received from the client.
|
|
|
|
|
|
|
|
.. 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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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:
|
|
|
|
virtual bool loadParameter( const QPair<QString, QString> &item );
|
|
|
|
|
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 *
|
|
|
|
************************************************************************/
|