QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QgsWms::QgsWmsParameter Class Reference

WMS parameter received from the client. More...

#include <qgswmsparameters.h>

Inheritance diagram for QgsWms::QgsWmsParameter:
Inheritance graph
[legend]

Public Types

enum  Name {
  UNKNOWN , BOXSPACE , CRS , SRS ,
  WIDTH , HEIGHT , BBOX , ICONLABELSPACE ,
  IMAGE_QUALITY , ITEMFONTFAMILY , ITEMFONTBOLD , ITEMFONTITALIC ,
  ITEMFONTSIZE , ITEMFONTCOLOR , LAYER , LAYERFONTFAMILY ,
  LAYERFONTBOLD , LAYERFONTITALIC , LAYERFONTSIZE , LAYERFONTCOLOR ,
  LAYERTITLE , LAYERS , LAYERSPACE , LAYERTITLESPACE ,
  QUERY_LAYERS , FEATURE_COUNT , SHOWFEATURECOUNT , STYLE ,
  STYLES , SYMBOLSPACE , SYMBOLHEIGHT , SYMBOLWIDTH ,
  OPACITIES , SLD , SLD_BODY , FI_POLYGON_TOLERANCE ,
  FI_LINE_TOLERANCE , FI_POINT_TOLERANCE , FILTER , FILTER_GEOM ,
  FORMAT , INFO_FORMAT , I , J ,
  X , Y , RULE , RULELABEL ,
  SCALE , SELECTION , SHOWRULEDETAILS , HIGHLIGHT_GEOM ,
  HIGHLIGHT_SYMBOL , HIGHLIGHT_LABELSTRING , HIGHLIGHT_LABELFONT , HIGHLIGHT_LABELSIZE ,
  HIGHLIGHT_LABELWEIGHT , HIGHLIGHT_LABELCOLOR , HIGHLIGHT_LABELBUFFERCOLOR , HIGHLIGHT_LABELBUFFERSIZE ,
  HIGHLIGHT_LABEL_ROTATION , HIGHLIGHT_LABEL_DISTANCE , HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT , HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT ,
  WMS_PRECISION , TRANSPARENT , BGCOLOR , DPI ,
  TEMPLATE , EXTENT , ROTATION , GRID_INTERVAL_X ,
  GRID_INTERVAL_Y , WITH_GEOMETRY , WITH_MAPTIP , WITH_DISPLAY_NAME ,
  WMTVER , ATLAS_PK , FORMAT_OPTIONS , SRCWIDTH ,
  SRCHEIGHT , TILED , ADDLAYERGROUPS
}
 Available parameters for WMS requests. More...
 

Public Member Functions

 QgsWmsParameter (const QgsWmsParameter::Name name=QgsWmsParameter::UNKNOWN, const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
 Constructor for QgsWmsParameter.
 
virtual ~QgsWmsParameter () override=default
 Default destructor for QgsWmsParameter.
 
bool isValid () const override
 Returns true if the parameter is valid, false otherwise.
 
QString loadUrl () const
 Loads the data associated to the parameter converted into an url.
 
QString name () const
 Returns the name of the parameter.
 
void raiseError () const
 Raises an error in case of an invalid conversion.
 
QColor toColor () const
 Converts the parameter into a color.
 
QList< QColor > toColorList (const char delimiter=',') const
 Converts the parameter into a list of colors.
 
double toDouble () const
 Converts the parameter into a double.
 
QList< double > toDoubleList (const char delimiter=',') const
 Converts the parameter into a list of doubles.
 
QList< QgsGeometrytoGeomList (const char delimiter=',') const
 Converts the parameter into a list of geometries.
 
int toInt () const
 Converts the parameter into an integer.
 
QList< int > toIntList (const char delimiter=',') const
 Converts the parameter into a list of integers.
 
QgsRectangle toRectangle () const
 Converts the parameter into a rectangle.
 
QStringList toStyleList (const char delimiter=',') const
 Converts the parameter into a list of strings and keeps empty parts Default style value is an empty string.
 
QUrl toUrl () const
 Converts the parameter into an url.
 
- Public Member Functions inherited from QgsServerParameterDefinition
 QgsServerParameterDefinition (const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
 Constructor for QgsServerParameterDefinition.
 
Q_DECL_DEPRECATED QgsServerParameterDefinition (const QVariant::Type type, const QVariant defaultValue=QVariant("")) SIP_DEPRECATED
 Constructor for QgsServerParameterDefinition.
 
virtual ~QgsServerParameterDefinition ()=default
 
QString loadUrl (bool &ok) const
 Loads the data associated to the parameter converted into an url.
 
bool toBool () const
 Converts the parameter into a boolean.
 
QColor toColor (bool &ok) const
 Converts the parameter into a color.
 
QList< QColor > toColorList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of colors.
 
double toDouble (bool &ok) const
 Converts the parameter into a double.
 
QList< double > toDoubleList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of doubles.
 
QStringList toExpressionList () const
 Converts the parameter into a list of QGIS expressions.
 
QList< QgsGeometrytoGeomList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of geometries.
 
int toInt (bool &ok) const
 Converts the parameter into an integer.
 
QList< int > toIntList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of integers.
 
QStringList toOgcFilterList () const
 Converts the parameter into a list of OGC filters.
 
QgsRectangle toRectangle (bool &ok) const
 Converts the parameter into a rectangle.
 
QString toString (bool defaultValue=false) const
 Converts the parameter into a string.
 
QStringList toStringList (char delimiter=',', bool skipEmptyParts=true) const
 Converts the parameter into a list of strings.
 
QUrl toUrl (bool &ok) const
 Converts the parameter into an url.
 
QString typeName () const
 Returns the type of the parameter as a string.
 

Static Public Member Functions

static QString name (const QgsWmsParameter::Name)
 Converts a parameter's name into its string representation.
 
static QgsWmsParameter::Name name (const QString &name)
 Converts a string into a parameter's name (UNKNOWN in case of an invalid string).
 
- Static Public Member Functions inherited from QgsServerParameterDefinition
static void raiseError (const QString &msg)
 Raises an exception in case of an invalid parameters.
 

Public Attributes

int mMapId = -1
 Map id for prefixed parameters (e.g. "0" for "map0:LAYERS" in GetPrint requests)
 
QgsWmsParameter::Name mName
 
- Public Attributes inherited from QgsServerParameterDefinition
QVariant mDefaultValue
 
QMetaType::Type mType
 
QVariant mValue
 

Detailed Description

WMS parameter received from the client.

Since
QGIS 3.4

Definition at line 101 of file qgswmsparameters.h.

Member Enumeration Documentation

◆ Name

Available parameters for WMS requests.

Enumerator
UNKNOWN 
BOXSPACE 
CRS 
SRS 
WIDTH 
HEIGHT 
BBOX 
ICONLABELSPACE 
IMAGE_QUALITY 
ITEMFONTFAMILY 
ITEMFONTBOLD 
ITEMFONTITALIC 
ITEMFONTSIZE 
ITEMFONTCOLOR 
LAYER 
LAYERFONTFAMILY 
LAYERFONTBOLD 
LAYERFONTITALIC 
LAYERFONTSIZE 
LAYERFONTCOLOR 
LAYERTITLE 
LAYERS 
LAYERSPACE 
LAYERTITLESPACE 
QUERY_LAYERS 
FEATURE_COUNT 
SHOWFEATURECOUNT 
STYLE 
STYLES 
SYMBOLSPACE 
SYMBOLHEIGHT 
SYMBOLWIDTH 
OPACITIES 
SLD 
SLD_BODY 
FI_POLYGON_TOLERANCE 
FI_LINE_TOLERANCE 
FI_POINT_TOLERANCE 
FILTER 
FILTER_GEOM 
FORMAT 
INFO_FORMAT 
RULE 
RULELABEL 
SCALE 
SELECTION 
SHOWRULEDETAILS 
HIGHLIGHT_GEOM 
HIGHLIGHT_SYMBOL 
HIGHLIGHT_LABELSTRING 
HIGHLIGHT_LABELFONT 
HIGHLIGHT_LABELSIZE 
HIGHLIGHT_LABELWEIGHT 
HIGHLIGHT_LABELCOLOR 
HIGHLIGHT_LABELBUFFERCOLOR 
HIGHLIGHT_LABELBUFFERSIZE 
HIGHLIGHT_LABEL_ROTATION 
HIGHLIGHT_LABEL_DISTANCE 
HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT 
HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT 
WMS_PRECISION 
TRANSPARENT 
BGCOLOR 
DPI 
TEMPLATE 
EXTENT 
ROTATION 
GRID_INTERVAL_X 
GRID_INTERVAL_Y 
WITH_GEOMETRY 
WITH_MAPTIP 
WITH_DISPLAY_NAME 
WMTVER 
ATLAS_PK 
FORMAT_OPTIONS 
SRCWIDTH 
SRCHEIGHT 
TILED 
ADDLAYERGROUPS 

Definition at line 107 of file qgswmsparameters.h.

Constructor & Destructor Documentation

◆ QgsWmsParameter()

QgsWms::QgsWmsParameter::QgsWmsParameter ( const QgsWmsParameter::Name  name = QgsWmsParameter::UNKNOWN,
const QMetaType::Type  type = QMetaType::Type::QString,
const QVariant  defaultValue = QVariant( "" ) 
)

Constructor for QgsWmsParameter.

Parameters
nameName of the WMS parameter
typeType of the parameter
defaultValueDefault value of the parameter

Definition at line 35 of file qgswmsparameters.cpp.

◆ ~QgsWmsParameter()

virtual QgsWms::QgsWmsParameter::~QgsWmsParameter ( )
overridevirtualdefault

Default destructor for QgsWmsParameter.

Member Function Documentation

◆ isValid()

bool QgsWms::QgsWmsParameter::isValid ( ) const
overridevirtual

Returns true if the parameter is valid, false otherwise.

Reimplemented from QgsServerParameterDefinition.

Definition at line 43 of file qgswmsparameters.cpp.

◆ loadUrl()

QString QgsWms::QgsWmsParameter::loadUrl ( ) const

Loads the data associated to the parameter converted into an url.

Returns
The content loaded
Exceptions
QgsBadRequestExceptionInvalid parameter exception
Since
QGIS 3.4

Definition at line 100 of file qgswmsparameters.cpp.

◆ name() [1/3]

QString QgsWms::QgsWmsParameter::name ( ) const

Returns the name of the parameter.

Since
QGIS 3.8

Definition at line 198 of file qgswmsparameters.cpp.

◆ name() [2/3]

QString QgsWms::QgsWmsParameter::name ( const QgsWmsParameter::Name  name)
static

Converts a parameter's name into its string representation.

Definition at line 203 of file qgswmsparameters.cpp.

◆ name() [3/3]

QgsWmsParameter::Name QgsWms::QgsWmsParameter::name ( const QString &  name)
static

Converts a string into a parameter's name (UNKNOWN in case of an invalid string).

Definition at line 209 of file qgswmsparameters.cpp.

◆ raiseError()

void QgsWms::QgsWmsParameter::raiseError ( ) const

Raises an error in case of an invalid conversion.

Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 48 of file qgswmsparameters.cpp.

◆ toColor()

QColor QgsWms::QgsWmsParameter::toColor ( ) const

Converts the parameter into a color.

Returns
A color
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 130 of file qgswmsparameters.cpp.

◆ toColorList()

QList< QColor > QgsWms::QgsWmsParameter::toColorList ( const char  delimiter = ',') const

Converts the parameter into a list of colors.

Parameters
delimiterThe character delimiting string colors
Returns
A list of colors
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 143 of file qgswmsparameters.cpp.

◆ toDouble()

double QgsWms::QgsWmsParameter::toDouble ( ) const

Converts the parameter into a double.

Returns
A double
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 185 of file qgswmsparameters.cpp.

◆ toDoubleList()

QList< double > QgsWms::QgsWmsParameter::toDoubleList ( const char  delimiter = ',') const

Converts the parameter into a list of doubles.

Parameters
delimiterThe character delimiting string doubles
Returns
A list of doubles
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 171 of file qgswmsparameters.cpp.

◆ toGeomList()

QList< QgsGeometry > QgsWms::QgsWmsParameter::toGeomList ( const char  delimiter = ',') const

Converts the parameter into a list of geometries.

Parameters
delimiterThe character delimiting string geometries
Returns
A list of geometries
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 59 of file qgswmsparameters.cpp.

◆ toInt()

int QgsWms::QgsWmsParameter::toInt ( ) const

Converts the parameter into an integer.

Returns
An integer
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 87 of file qgswmsparameters.cpp.

◆ toIntList()

QList< int > QgsWms::QgsWmsParameter::toIntList ( const char  delimiter = ',') const

Converts the parameter into a list of integers.

Parameters
delimiterThe character delimiting string integers
Returns
A list of integers
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 157 of file qgswmsparameters.cpp.

◆ toRectangle()

QgsRectangle QgsWms::QgsWmsParameter::toRectangle ( ) const

Converts the parameter into a rectangle.

Returns
A rectangle
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 73 of file qgswmsparameters.cpp.

◆ toStyleList()

QStringList QgsWms::QgsWmsParameter::toStyleList ( const char  delimiter = ',') const

Converts the parameter into a list of strings and keeps empty parts Default style value is an empty string.

Parameters
delimiterThe character used for delimiting
Returns
A list of strings
Since
QGIS 3.8

Definition at line 54 of file qgswmsparameters.cpp.

◆ toUrl()

QUrl QgsWms::QgsWmsParameter::toUrl ( ) const

Converts the parameter into an url.

Returns
An url
Exceptions
QgsBadRequestExceptionInvalid parameter exception
Since
QGIS 3.4

Definition at line 117 of file qgswmsparameters.cpp.

Member Data Documentation

◆ mMapId

int QgsWms::QgsWmsParameter::mMapId = -1

Map id for prefixed parameters (e.g. "0" for "map0:LAYERS" in GetPrint requests)

Definition at line 326 of file qgswmsparameters.h.

◆ mName

QgsWmsParameter::Name QgsWms::QgsWmsParameter::mName

Definition at line 323 of file qgswmsparameters.h.


The documentation for this class was generated from the following files: