From c2e294c3fa3dc71f4fd0bcc55f1fb6992b18ac30 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 28 Mar 2025 10:08:48 +1000 Subject: [PATCH] Use class with static public methods instead of namespace Namespaces don't work well with sip, eg losing the class docstrings. --- .../core/auto_generated/qgshstoreutils.sip.in | 18 +- .../core/auto_generated/qgstestutils.sip.in | 15 +- .../core/auto_generated/qgsziputils.sip.in | 23 +- .../auto_generated/qgsserverfeatureid.sip.in | 24 +- .../qgsserverprojectutils.sip.in | 120 ++++----- .../core/auto_generated/qgshstoreutils.sip.in | 18 +- .../core/auto_generated/qgstestutils.sip.in | 15 +- python/core/auto_generated/qgsziputils.sip.in | 23 +- .../auto_generated/qgsserverfeatureid.sip.in | 24 +- .../qgsserverprojectutils.sip.in | 120 ++++----- src/core/qgshstoreutils.h | 35 ++- src/core/qgstestutils.h | 35 ++- src/core/qgsziputils.h | 117 +++++---- src/server/qgsserverfeatureid.h | 32 +-- src/server/qgsserverprojectutils.h | 232 +++++++++--------- 15 files changed, 433 insertions(+), 418 deletions(-) diff --git a/python/PyQt6/core/auto_generated/qgshstoreutils.sip.in b/python/PyQt6/core/auto_generated/qgshstoreutils.sip.in index 5c65a2780ed..39e0c47846f 100644 --- a/python/PyQt6/core/auto_generated/qgshstoreutils.sip.in +++ b/python/PyQt6/core/auto_generated/qgshstoreutils.sip.in @@ -8,14 +8,20 @@ -%ModuleHeaderCode -#include "qgshstoreutils.h" +class QgsHstoreUtils +{ +%Docstring(signature="appended") +Provides utility functions for handling hstore-formatted strings. + +.. versionadded:: 3.4 %End -namespace QgsHstoreUtils -{ +%TypeHeaderCode +#include "qgshstoreutils.h" +%End + public: - QVariantMap parse( const QString &string ); + static QVariantMap parse( const QString &string ); %Docstring Returns a QVariantMap object containing the key and values from a hstore-formatted string. @@ -24,7 +30,7 @@ Returns a QVariantMap object containing the key and values from a hstore-formatt .. versionadded:: 3.4 %End - QString build( const QVariantMap &map ); + static QString build( const QVariantMap &map ); %Docstring Build a hstore-formatted string from a QVariantMap. diff --git a/python/PyQt6/core/auto_generated/qgstestutils.sip.in b/python/PyQt6/core/auto_generated/qgstestutils.sip.in index 8648f101b26..faf9bb067e1 100644 --- a/python/PyQt6/core/auto_generated/qgstestutils.sip.in +++ b/python/PyQt6/core/auto_generated/qgstestutils.sip.in @@ -9,15 +9,16 @@ -%ModuleHeaderCode -#include "qgstestutils.h" -%End - -namespace QgsTestUtils +class QgsTestUtils { - bool testProviderIteratorThreadSafety( QgsVectorDataProvider *provider, const QgsFeatureRequest &request = QgsFeatureRequest() ); +%TypeHeaderCode +#include "qgstestutils.h" +%End + public: + + static bool testProviderIteratorThreadSafety( QgsVectorDataProvider *provider, const QgsFeatureRequest &request = QgsFeatureRequest() ); %Docstring Runs a thready safety test on iterators from a vector data ``provider``, by concurrently requesting features from the provider. @@ -25,7 +26,7 @@ requesting features from the provider. This method returns ``True``... or it segfaults. %End - bool compareDomElements( const QDomElement &element1, const QDomElement &element2 ); + static bool compareDomElements( const QDomElement &element1, const QDomElement &element2 ); %Docstring Compares two DOM elements and returns ``True`` if they are equivalent. diff --git a/python/PyQt6/core/auto_generated/qgsziputils.sip.in b/python/PyQt6/core/auto_generated/qgsziputils.sip.in index 357b17ae0a5..a2411551f17 100644 --- a/python/PyQt6/core/auto_generated/qgsziputils.sip.in +++ b/python/PyQt6/core/auto_generated/qgsziputils.sip.in @@ -8,14 +8,20 @@ -%ModuleHeaderCode -#include "qgsziputils.h" +class QgsZipUtils +{ +%Docstring(signature="appended") +Provides utility functions for working with zip files. + +.. versionadded:: 3.0 %End -namespace QgsZipUtils -{ +%TypeHeaderCode +#include "qgsziputils.h" +%End + public: - bool isZipFile( const QString &filename ); + static bool isZipFile( const QString &filename ); %Docstring Returns ``True`` if the file name is a zipped file ( i.e with a '.qgz' extension, ``False`` otherwise. @@ -25,7 +31,7 @@ extension, ``False`` otherwise. :return: ``True`` if the file is zipped, ``False`` otherwise %End - bool unzip( const QString &zip, const QString &dir, QStringList &files /Out/, bool checkConsistency = true ); + static bool unzip( const QString &zip, const QString &dir, QStringList &files /Out/, bool checkConsistency = true ); %Docstring Unzip a zip file in an output directory. @@ -37,7 +43,7 @@ Unzip a zip file in an output directory. - files: The absolute path of unzipped files %End - bool zip( const QString &zip, const QStringList &files ); + static bool zip( const QString &zip, const QStringList &files ); %Docstring Zip the list of files in the zip file. If the zip file already exists or is empty, an error is returned. If an input file does not exist, an error is @@ -50,8 +56,7 @@ also returned. - - const QStringList files( const QString &zip ); + static const QStringList files( const QString &zip ); %Docstring Returns the list of files within a ``zip`` file diff --git a/python/PyQt6/server/auto_generated/qgsserverfeatureid.sip.in b/python/PyQt6/server/auto_generated/qgsserverfeatureid.sip.in index a4e3d988cf9..c4abeb42d8c 100644 --- a/python/PyQt6/server/auto_generated/qgsserverfeatureid.sip.in +++ b/python/PyQt6/server/auto_generated/qgsserverfeatureid.sip.in @@ -11,15 +11,19 @@ +class QgsServerFeatureId +{ +%Docstring(signature="appended") +Contains utility functions for using primary keys for feature IDs. -%ModuleHeaderCode -#include "qgsserverfeatureid.h" +.. versionadded:: 3.4.9 %End - - namespace QgsServerFeatureId -{ - QString getServerFid( const QgsFeature &feature, const QgsAttributeList &pkAttributes ); +%TypeHeaderCode +#include "qgsserverfeatureid.h" +%End + public: + static QString getServerFid( const QgsFeature &feature, const QgsAttributeList &pkAttributes ); %Docstring Returns the feature id based on primary keys. @@ -31,12 +35,12 @@ Returns the feature id based on primary keys. .. versionadded:: 3.4.9 %End - QgsFeatureRequest updateFeatureRequestFromServerFids( QgsFeatureRequest & featureRequest, const QStringList &serverFids, const QgsVectorDataProvider *provider ); + static QgsFeatureRequest updateFeatureRequestFromServerFids( QgsFeatureRequest &featureRequest, const QStringList &serverFids, const QgsVectorDataProvider *provider ); %Docstring Returns the feature request based on feature ids build with primary keys. :param featureRequest: the feature request to update -:param serverFids: the feature ids build with :py:class:`QgsServerFeatureId`.getServerFid +:param serverFids: the feature ids build with QgsServerFeatureId.getServerFid :param provider: the vector layer provider to provide fields and primary keys list :return: the feature request updated @@ -44,7 +48,7 @@ Returns the feature request based on feature ids build with primary keys. .. versionadded:: 3.4.9 %End - QString getExpressionFromServerFid( const QString &serverFid, const QgsVectorDataProvider *provider ); + static QString getExpressionFromServerFid( const QString &serverFid, const QgsVectorDataProvider *provider ); %Docstring Returns the expression feature id based on primary keys. @@ -56,7 +60,7 @@ Returns the expression feature id based on primary keys. .. versionadded:: 3.4.9 %End - QString pkSeparator(); + static QString pkSeparator(); %Docstring Returns the primary keys separator diff --git a/python/PyQt6/server/auto_generated/qgsserverprojectutils.sip.in b/python/PyQt6/server/auto_generated/qgsserverprojectutils.sip.in index 9859a7d19e0..2f3983bff9c 100644 --- a/python/PyQt6/server/auto_generated/qgsserverprojectutils.sip.in +++ b/python/PyQt6/server/auto_generated/qgsserverprojectutils.sip.in @@ -11,16 +11,20 @@ -%ModuleHeaderCode -#include "qgsserverprojectutils.h" +class QgsServerProjectUtils +{ +%Docstring(signature="appended") +The :py:class:`QgsServerProjectUtils` namespace provides a way to retrieve specific +entries from a :py:class:`QgsProject`. %End - - namespace QgsServerProjectUtils -{ +%TypeHeaderCode +#include "qgsserverprojectutils.h" +%End + public: - bool owsServiceCapabilities( const QgsProject &project ); + static bool owsServiceCapabilities( const QgsProject &project ); %Docstring Returns if owsService capabilities are enabled. @@ -29,7 +33,7 @@ Returns if owsService capabilities are enabled. :return: if owsService capabilities are enabled. %End - QString owsServiceTitle( const QgsProject &project ); + static QString owsServiceTitle( const QgsProject &project ); %Docstring Returns the owsService title defined in project. @@ -38,7 +42,7 @@ Returns the owsService title defined in project. :return: the owsService title if defined in project with project title as fallback, "Untitled" otherwise. %End - QString owsServiceAbstract( const QgsProject &project ); + static QString owsServiceAbstract( const QgsProject &project ); %Docstring Returns the owsService abstract defined in project. @@ -47,7 +51,7 @@ Returns the owsService abstract defined in project. :return: the owsService abstract if defined in project. %End - QStringList owsServiceKeywords( const QgsProject &project ); + static QStringList owsServiceKeywords( const QgsProject &project ); %Docstring Returns the owsService keywords defined in project. @@ -56,7 +60,7 @@ Returns the owsService keywords defined in project. :return: the owsService keywords if defined in project. %End - QString owsServiceOnlineResource( const QgsProject &project ); + static QString owsServiceOnlineResource( const QgsProject &project ); %Docstring Returns the owsService online resource defined in project. @@ -65,7 +69,7 @@ Returns the owsService online resource defined in project. :return: the owsService online resource if defined in project. %End - QString owsServiceContactOrganization( const QgsProject &project ); + static QString owsServiceContactOrganization( const QgsProject &project ); %Docstring Returns the owsService contact organization defined in project. @@ -74,7 +78,7 @@ Returns the owsService contact organization defined in project. :return: the owsService contact organization if defined in project. %End - QString owsServiceContactPosition( const QgsProject &project ); + static QString owsServiceContactPosition( const QgsProject &project ); %Docstring Returns the owsService contact position defined in project. @@ -83,7 +87,7 @@ Returns the owsService contact position defined in project. :return: the owsService contact position if defined in project. %End - QString owsServiceContactPerson( const QgsProject &project ); + static QString owsServiceContactPerson( const QgsProject &project ); %Docstring Returns the owsService contact person defined in project. @@ -92,7 +96,7 @@ Returns the owsService contact person defined in project. :return: the owsService contact person if defined in project. %End - QString owsServiceContactMail( const QgsProject &project ); + static QString owsServiceContactMail( const QgsProject &project ); %Docstring Returns the owsService contact mail defined in project. @@ -101,7 +105,7 @@ Returns the owsService contact mail defined in project. :return: the owsService contact mail if defined in project. %End - QString owsServiceContactPhone( const QgsProject &project ); + static QString owsServiceContactPhone( const QgsProject &project ); %Docstring Returns the owsService contact phone defined in project. @@ -110,7 +114,7 @@ Returns the owsService contact phone defined in project. :return: the owsService contact phone if defined in project. %End - QString owsServiceFees( const QgsProject &project ); + static QString owsServiceFees( const QgsProject &project ); %Docstring Returns the owsService fees defined in project. @@ -119,7 +123,7 @@ Returns the owsService fees defined in project. :return: the owsService fees if defined in project. %End - QString owsServiceAccessConstraints( const QgsProject &project ); + static QString owsServiceAccessConstraints( const QgsProject &project ); %Docstring Returns the owsService access constraints defined in project. @@ -128,7 +132,7 @@ Returns the owsService access constraints defined in project. :return: the owsService access constraints if defined in project. %End - int wmsMaxWidth( const QgsProject &project ); + static int wmsMaxWidth( const QgsProject &project ); %Docstring Returns the maximum width for WMS images defined in a QGIS project. @@ -137,7 +141,7 @@ Returns the maximum width for WMS images defined in a QGIS project. :return: width if defined in project, -1 otherwise. %End - int wmsMaxHeight( const QgsProject &project ); + static int wmsMaxHeight( const QgsProject &project ); %Docstring Returns the maximum height for WMS images defined in a QGIS project. @@ -146,7 +150,7 @@ Returns the maximum height for WMS images defined in a QGIS project. :return: height if defined in project, -1 otherwise. %End - int wmsImageQuality( const QgsProject &project ); + static int wmsImageQuality( const QgsProject &project ); %Docstring Returns the quality for WMS images defined in a QGIS project. @@ -155,7 +159,7 @@ Returns the quality for WMS images defined in a QGIS project. :return: quality if defined in project, -1 otherwise. %End - int wmsTileBuffer( const QgsProject &project ); + static int wmsTileBuffer( const QgsProject &project ); %Docstring Returns the tile buffer in pixels for WMS images defined in a QGIS project. @@ -166,7 +170,7 @@ Returns the tile buffer in pixels for WMS images defined in a QGIS project. .. versionadded:: 3.10 %End - bool wmsRenderMapTiles( const QgsProject &project ); + static bool wmsRenderMapTiles( const QgsProject &project ); %Docstring Returns ``True`` if WMS requests should use the :py:class:`QgsMapSettings`.RenderMapTile flag, so that no visible artifacts are visible between adjacent tiles. @@ -181,7 +185,7 @@ setting is enabled in the project. .. versionadded:: 3.18 %End - int wmsMaxAtlasFeatures( const QgsProject &project ); + static int wmsMaxAtlasFeatures( const QgsProject &project ); %Docstring Returns the maximum number of atlas features which can be printed in a request @@ -190,7 +194,7 @@ Returns the maximum number of atlas features which can be printed in a request :return: the number of atlas features %End - double wmsDefaultMapUnitsPerMm( const QgsProject &project ); + static double wmsDefaultMapUnitsPerMm( const QgsProject &project ); %Docstring Returns the default number of map units per millimeters in case of the scale is not given @@ -201,7 +205,7 @@ Returns the default number of map units per millimeters in case of the scale is .. versionadded:: 3.4 %End - bool wmsUseLayerIds( const QgsProject &project ); + static bool wmsUseLayerIds( const QgsProject &project ); %Docstring Returns if layer ids are used as name in WMS. @@ -210,7 +214,7 @@ Returns if layer ids are used as name in WMS. :return: if layer ids are used as name. %End - bool wmsInfoFormatSia2045( const QgsProject &project ); + static bool wmsInfoFormatSia2045( const QgsProject &project ); %Docstring Returns if the info format is SIA20145. @@ -219,7 +223,7 @@ Returns if the info format is SIA20145. :return: if the info format is SIA20145. %End - bool wmsFeatureInfoAddWktGeometry( const QgsProject &project ); + static bool wmsFeatureInfoAddWktGeometry( const QgsProject &project ); %Docstring Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request. @@ -228,7 +232,7 @@ Returns if the geometry is displayed as Well Known Text in GetFeatureInfo reques :return: if the geometry is displayed as Well Known Text in GetFeatureInfo request. %End - bool wmsFeatureInfoUseAttributeFormSettings( const QgsProject &project ); + static bool wmsFeatureInfoUseAttributeFormSettings( const QgsProject &project ); %Docstring Returns if feature form settings should be considered for the format of the feature info response @@ -237,7 +241,7 @@ Returns if feature form settings should be considered for the format of the feat :return: true if the feature form settings shall be considered for the feature info response %End - bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project ); + static bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project ); %Docstring Returns if the geometry has to be segmentize in GetFeatureInfo request. @@ -246,7 +250,7 @@ Returns if the geometry has to be segmentize in GetFeatureInfo request. :return: if the geometry has to be segmentize in GetFeatureInfo request. %End - bool wmsAddLegendGroupsLegendGraphic( const QgsProject &project ); + static bool wmsAddLegendGroupsLegendGraphic( const QgsProject &project ); %Docstring Returns if legend groups should be in the legend graphic response if GetLegendGraphic is called on a layer group. @@ -255,7 +259,7 @@ Returns if legend groups should be in the legend graphic response if GetLegendGr :return: if the GetLegendGraphic response has to contain legend groups %End - bool wmsSkipNameForGroup( const QgsProject &project ); + static bool wmsSkipNameForGroup( const QgsProject &project ); %Docstring Returns if name attribute should be skipped for groups in WMS capabilities document. @@ -266,7 +270,7 @@ Returns if name attribute should be skipped for groups in WMS capabilities docum .. versionadded:: 3.36 %End - int wmsFeatureInfoPrecision( const QgsProject &project ); + static int wmsFeatureInfoPrecision( const QgsProject &project ); %Docstring Returns the geometry precision for GetFeatureInfo request. @@ -275,7 +279,7 @@ Returns the geometry precision for GetFeatureInfo request. :return: the geometry precision for GetFeatureInfo request. %End - QString wmsFeatureInfoDocumentElement( const QgsProject &project ); + static QString wmsFeatureInfoDocumentElement( const QgsProject &project ); %Docstring Returns the document element name for XML GetFeatureInfo request. @@ -284,7 +288,7 @@ Returns the document element name for XML GetFeatureInfo request. :return: the document element name for XML GetFeatureInfo request. %End - QString wmsFeatureInfoDocumentElementNs( const QgsProject &project ); + static QString wmsFeatureInfoDocumentElementNs( const QgsProject &project ); %Docstring Returns the document element namespace for XML GetFeatureInfo request. @@ -293,7 +297,7 @@ Returns the document element namespace for XML GetFeatureInfo request. :return: the document element namespace for XML GetFeatureInfo request. %End - QString wmsFeatureInfoSchema( const QgsProject &project ); + static QString wmsFeatureInfoSchema( const QgsProject &project ); %Docstring Returns the schema URL for XML GetFeatureInfo request. @@ -302,7 +306,7 @@ Returns the schema URL for XML GetFeatureInfo request. :return: the schema URL for XML GetFeatureInfo request. %End - QHash wmsFeatureInfoLayerAliasMap( const QgsProject &project ); + static QHash wmsFeatureInfoLayerAliasMap( const QgsProject &project ); %Docstring Returns the mapping between layer name and wms layer name for GetFeatureInfo request. @@ -311,7 +315,7 @@ Returns the mapping between layer name and wms layer name for GetFeatureInfo req :return: the mapping between layer name and wms layer name for GetFeatureInfo request. %End - bool wmsInspireActivate( const QgsProject &project ); + static bool wmsInspireActivate( const QgsProject &project ); %Docstring Returns if Inspire is activated. @@ -320,7 +324,7 @@ Returns if Inspire is activated. :return: if Inspire is activated. %End - QString wmsInspireLanguage( const QgsProject &project ); + static QString wmsInspireLanguage( const QgsProject &project ); %Docstring Returns the Inspire language. @@ -329,7 +333,7 @@ Returns the Inspire language. :return: the Inspire language if defined in project. %End - QString wmsInspireMetadataUrl( const QgsProject &project ); + static QString wmsInspireMetadataUrl( const QgsProject &project ); %Docstring Returns the Inspire metadata URL. @@ -338,7 +342,7 @@ Returns the Inspire metadata URL. :return: the Inspire metadata URL if defined in project. %End - QString wmsInspireMetadataUrlType( const QgsProject &project ); + static QString wmsInspireMetadataUrlType( const QgsProject &project ); %Docstring Returns the Inspire metadata URL type. @@ -347,7 +351,7 @@ Returns the Inspire metadata URL type. :return: the Inspire metadata URL type if defined in project. %End - QString wmsInspireTemporalReference( const QgsProject &project ); + static QString wmsInspireTemporalReference( const QgsProject &project ); %Docstring Returns the Inspire temporal reference. @@ -356,7 +360,7 @@ Returns the Inspire temporal reference. :return: the Inspire temporal reference if defined in project. %End - QString wmsInspireMetadataDate( const QgsProject &project ); + static QString wmsInspireMetadataDate( const QgsProject &project ); %Docstring Returns the Inspire metadata date. @@ -365,7 +369,7 @@ Returns the Inspire metadata date. :return: the Inspire metadata date if defined in project. %End - QStringList wmsRestrictedComposers( const QgsProject &project ); + static QStringList wmsRestrictedComposers( const QgsProject &project ); %Docstring Returns the restricted composer list. @@ -374,7 +378,7 @@ Returns the restricted composer list. :return: the restricted composer list if defined in project. %End - QString wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WMS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -386,7 +390,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. :return: url to use for this service %End - QString wmsRootName( const QgsProject &project ); + static QString wmsRootName( const QgsProject &project ); %Docstring Returns the WMS root layer name defined in a QGIS project. @@ -395,7 +399,7 @@ Returns the WMS root layer name defined in a QGIS project. :return: root layer name to use for this service %End - QStringList wmsRestrictedLayers( const QgsProject &project ); + static QStringList wmsRestrictedLayers( const QgsProject &project ); %Docstring Returns the restricted layer name list. @@ -404,7 +408,7 @@ Returns the restricted layer name list. :return: the restricted layer name list if defined in project. %End - QStringList wmsOutputCrsList( const QgsProject &project ); + static QStringList wmsOutputCrsList( const QgsProject &project ); %Docstring Returns the WMS output CRS list. @@ -413,7 +417,7 @@ Returns the WMS output CRS list. :return: the WMS output CRS list. %End - QgsRectangle wmsExtent( const QgsProject &project ); + static QgsRectangle wmsExtent( const QgsProject &project ); %Docstring Returns the WMS Extent restriction. @@ -422,7 +426,7 @@ Returns the WMS Extent restriction. :return: the WMS Extent restriction. %End - QString wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WFS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -434,7 +438,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. :return: url to use for this service %End - QStringList wfsLayerIds( const QgsProject &project ); + static QStringList wfsLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published in WFS. @@ -444,7 +448,7 @@ Returns the Layer ids list defined in a QGIS project as published in WFS. %End - int wfsLayerPrecision( const QgsProject &project, const QString &layerId ); + static int wfsLayerPrecision( const QgsProject &project, const QString &layerId ); %Docstring Returns the Layer precision defined in a QGIS project for the WFS GetFeature. @@ -454,7 +458,7 @@ Returns the Layer precision defined in a QGIS project for the WFS GetFeature. :return: the layer precision for WFS GetFeature. %End - QStringList wfstUpdateLayerIds( const QgsProject &project ); + static QStringList wfstUpdateLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities. @@ -463,7 +467,7 @@ Returns the Layer ids list defined in a QGIS project as published as WFS-T with :return: the Layer ids list. %End - QStringList wfstInsertLayerIds( const QgsProject &project ); + static QStringList wfstInsertLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities. @@ -472,7 +476,7 @@ Returns the Layer ids list defined in a QGIS project as published as WFS-T with :return: the Layer ids list. %End - QStringList wfstDeleteLayerIds( const QgsProject &project ); + static QStringList wfstDeleteLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities. @@ -481,7 +485,7 @@ Returns the Layer ids list defined in a QGIS project as published as WFS-T with :return: the Layer ids list. %End - QString wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WCS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -493,7 +497,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. :return: url to use for this service %End - QStringList wcsLayerIds( const QgsProject &project ); + static QStringList wcsLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published in WCS. @@ -502,7 +506,7 @@ Returns the Layer ids list defined in a QGIS project as published in WCS. :return: the Layer ids list. %End - QString wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WMTS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -516,7 +520,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. .. versionadded:: 3.4 %End - QString serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings ); + static QString serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings ); %Docstring Returns the service url defined in the environment variable or with HTTP header. This is calculated from (in order of precedence): diff --git a/python/core/auto_generated/qgshstoreutils.sip.in b/python/core/auto_generated/qgshstoreutils.sip.in index 5c65a2780ed..39e0c47846f 100644 --- a/python/core/auto_generated/qgshstoreutils.sip.in +++ b/python/core/auto_generated/qgshstoreutils.sip.in @@ -8,14 +8,20 @@ -%ModuleHeaderCode -#include "qgshstoreutils.h" +class QgsHstoreUtils +{ +%Docstring(signature="appended") +Provides utility functions for handling hstore-formatted strings. + +.. versionadded:: 3.4 %End -namespace QgsHstoreUtils -{ +%TypeHeaderCode +#include "qgshstoreutils.h" +%End + public: - QVariantMap parse( const QString &string ); + static QVariantMap parse( const QString &string ); %Docstring Returns a QVariantMap object containing the key and values from a hstore-formatted string. @@ -24,7 +30,7 @@ Returns a QVariantMap object containing the key and values from a hstore-formatt .. versionadded:: 3.4 %End - QString build( const QVariantMap &map ); + static QString build( const QVariantMap &map ); %Docstring Build a hstore-formatted string from a QVariantMap. diff --git a/python/core/auto_generated/qgstestutils.sip.in b/python/core/auto_generated/qgstestutils.sip.in index 8648f101b26..faf9bb067e1 100644 --- a/python/core/auto_generated/qgstestutils.sip.in +++ b/python/core/auto_generated/qgstestutils.sip.in @@ -9,15 +9,16 @@ -%ModuleHeaderCode -#include "qgstestutils.h" -%End - -namespace QgsTestUtils +class QgsTestUtils { - bool testProviderIteratorThreadSafety( QgsVectorDataProvider *provider, const QgsFeatureRequest &request = QgsFeatureRequest() ); +%TypeHeaderCode +#include "qgstestutils.h" +%End + public: + + static bool testProviderIteratorThreadSafety( QgsVectorDataProvider *provider, const QgsFeatureRequest &request = QgsFeatureRequest() ); %Docstring Runs a thready safety test on iterators from a vector data ``provider``, by concurrently requesting features from the provider. @@ -25,7 +26,7 @@ requesting features from the provider. This method returns ``True``... or it segfaults. %End - bool compareDomElements( const QDomElement &element1, const QDomElement &element2 ); + static bool compareDomElements( const QDomElement &element1, const QDomElement &element2 ); %Docstring Compares two DOM elements and returns ``True`` if they are equivalent. diff --git a/python/core/auto_generated/qgsziputils.sip.in b/python/core/auto_generated/qgsziputils.sip.in index 357b17ae0a5..a2411551f17 100644 --- a/python/core/auto_generated/qgsziputils.sip.in +++ b/python/core/auto_generated/qgsziputils.sip.in @@ -8,14 +8,20 @@ -%ModuleHeaderCode -#include "qgsziputils.h" +class QgsZipUtils +{ +%Docstring(signature="appended") +Provides utility functions for working with zip files. + +.. versionadded:: 3.0 %End -namespace QgsZipUtils -{ +%TypeHeaderCode +#include "qgsziputils.h" +%End + public: - bool isZipFile( const QString &filename ); + static bool isZipFile( const QString &filename ); %Docstring Returns ``True`` if the file name is a zipped file ( i.e with a '.qgz' extension, ``False`` otherwise. @@ -25,7 +31,7 @@ extension, ``False`` otherwise. :return: ``True`` if the file is zipped, ``False`` otherwise %End - bool unzip( const QString &zip, const QString &dir, QStringList &files /Out/, bool checkConsistency = true ); + static bool unzip( const QString &zip, const QString &dir, QStringList &files /Out/, bool checkConsistency = true ); %Docstring Unzip a zip file in an output directory. @@ -37,7 +43,7 @@ Unzip a zip file in an output directory. - files: The absolute path of unzipped files %End - bool zip( const QString &zip, const QStringList &files ); + static bool zip( const QString &zip, const QStringList &files ); %Docstring Zip the list of files in the zip file. If the zip file already exists or is empty, an error is returned. If an input file does not exist, an error is @@ -50,8 +56,7 @@ also returned. - - const QStringList files( const QString &zip ); + static const QStringList files( const QString &zip ); %Docstring Returns the list of files within a ``zip`` file diff --git a/python/server/auto_generated/qgsserverfeatureid.sip.in b/python/server/auto_generated/qgsserverfeatureid.sip.in index a4e3d988cf9..c4abeb42d8c 100644 --- a/python/server/auto_generated/qgsserverfeatureid.sip.in +++ b/python/server/auto_generated/qgsserverfeatureid.sip.in @@ -11,15 +11,19 @@ +class QgsServerFeatureId +{ +%Docstring(signature="appended") +Contains utility functions for using primary keys for feature IDs. -%ModuleHeaderCode -#include "qgsserverfeatureid.h" +.. versionadded:: 3.4.9 %End - - namespace QgsServerFeatureId -{ - QString getServerFid( const QgsFeature &feature, const QgsAttributeList &pkAttributes ); +%TypeHeaderCode +#include "qgsserverfeatureid.h" +%End + public: + static QString getServerFid( const QgsFeature &feature, const QgsAttributeList &pkAttributes ); %Docstring Returns the feature id based on primary keys. @@ -31,12 +35,12 @@ Returns the feature id based on primary keys. .. versionadded:: 3.4.9 %End - QgsFeatureRequest updateFeatureRequestFromServerFids( QgsFeatureRequest & featureRequest, const QStringList &serverFids, const QgsVectorDataProvider *provider ); + static QgsFeatureRequest updateFeatureRequestFromServerFids( QgsFeatureRequest &featureRequest, const QStringList &serverFids, const QgsVectorDataProvider *provider ); %Docstring Returns the feature request based on feature ids build with primary keys. :param featureRequest: the feature request to update -:param serverFids: the feature ids build with :py:class:`QgsServerFeatureId`.getServerFid +:param serverFids: the feature ids build with QgsServerFeatureId.getServerFid :param provider: the vector layer provider to provide fields and primary keys list :return: the feature request updated @@ -44,7 +48,7 @@ Returns the feature request based on feature ids build with primary keys. .. versionadded:: 3.4.9 %End - QString getExpressionFromServerFid( const QString &serverFid, const QgsVectorDataProvider *provider ); + static QString getExpressionFromServerFid( const QString &serverFid, const QgsVectorDataProvider *provider ); %Docstring Returns the expression feature id based on primary keys. @@ -56,7 +60,7 @@ Returns the expression feature id based on primary keys. .. versionadded:: 3.4.9 %End - QString pkSeparator(); + static QString pkSeparator(); %Docstring Returns the primary keys separator diff --git a/python/server/auto_generated/qgsserverprojectutils.sip.in b/python/server/auto_generated/qgsserverprojectutils.sip.in index 9859a7d19e0..2f3983bff9c 100644 --- a/python/server/auto_generated/qgsserverprojectutils.sip.in +++ b/python/server/auto_generated/qgsserverprojectutils.sip.in @@ -11,16 +11,20 @@ -%ModuleHeaderCode -#include "qgsserverprojectutils.h" +class QgsServerProjectUtils +{ +%Docstring(signature="appended") +The :py:class:`QgsServerProjectUtils` namespace provides a way to retrieve specific +entries from a :py:class:`QgsProject`. %End - - namespace QgsServerProjectUtils -{ +%TypeHeaderCode +#include "qgsserverprojectutils.h" +%End + public: - bool owsServiceCapabilities( const QgsProject &project ); + static bool owsServiceCapabilities( const QgsProject &project ); %Docstring Returns if owsService capabilities are enabled. @@ -29,7 +33,7 @@ Returns if owsService capabilities are enabled. :return: if owsService capabilities are enabled. %End - QString owsServiceTitle( const QgsProject &project ); + static QString owsServiceTitle( const QgsProject &project ); %Docstring Returns the owsService title defined in project. @@ -38,7 +42,7 @@ Returns the owsService title defined in project. :return: the owsService title if defined in project with project title as fallback, "Untitled" otherwise. %End - QString owsServiceAbstract( const QgsProject &project ); + static QString owsServiceAbstract( const QgsProject &project ); %Docstring Returns the owsService abstract defined in project. @@ -47,7 +51,7 @@ Returns the owsService abstract defined in project. :return: the owsService abstract if defined in project. %End - QStringList owsServiceKeywords( const QgsProject &project ); + static QStringList owsServiceKeywords( const QgsProject &project ); %Docstring Returns the owsService keywords defined in project. @@ -56,7 +60,7 @@ Returns the owsService keywords defined in project. :return: the owsService keywords if defined in project. %End - QString owsServiceOnlineResource( const QgsProject &project ); + static QString owsServiceOnlineResource( const QgsProject &project ); %Docstring Returns the owsService online resource defined in project. @@ -65,7 +69,7 @@ Returns the owsService online resource defined in project. :return: the owsService online resource if defined in project. %End - QString owsServiceContactOrganization( const QgsProject &project ); + static QString owsServiceContactOrganization( const QgsProject &project ); %Docstring Returns the owsService contact organization defined in project. @@ -74,7 +78,7 @@ Returns the owsService contact organization defined in project. :return: the owsService contact organization if defined in project. %End - QString owsServiceContactPosition( const QgsProject &project ); + static QString owsServiceContactPosition( const QgsProject &project ); %Docstring Returns the owsService contact position defined in project. @@ -83,7 +87,7 @@ Returns the owsService contact position defined in project. :return: the owsService contact position if defined in project. %End - QString owsServiceContactPerson( const QgsProject &project ); + static QString owsServiceContactPerson( const QgsProject &project ); %Docstring Returns the owsService contact person defined in project. @@ -92,7 +96,7 @@ Returns the owsService contact person defined in project. :return: the owsService contact person if defined in project. %End - QString owsServiceContactMail( const QgsProject &project ); + static QString owsServiceContactMail( const QgsProject &project ); %Docstring Returns the owsService contact mail defined in project. @@ -101,7 +105,7 @@ Returns the owsService contact mail defined in project. :return: the owsService contact mail if defined in project. %End - QString owsServiceContactPhone( const QgsProject &project ); + static QString owsServiceContactPhone( const QgsProject &project ); %Docstring Returns the owsService contact phone defined in project. @@ -110,7 +114,7 @@ Returns the owsService contact phone defined in project. :return: the owsService contact phone if defined in project. %End - QString owsServiceFees( const QgsProject &project ); + static QString owsServiceFees( const QgsProject &project ); %Docstring Returns the owsService fees defined in project. @@ -119,7 +123,7 @@ Returns the owsService fees defined in project. :return: the owsService fees if defined in project. %End - QString owsServiceAccessConstraints( const QgsProject &project ); + static QString owsServiceAccessConstraints( const QgsProject &project ); %Docstring Returns the owsService access constraints defined in project. @@ -128,7 +132,7 @@ Returns the owsService access constraints defined in project. :return: the owsService access constraints if defined in project. %End - int wmsMaxWidth( const QgsProject &project ); + static int wmsMaxWidth( const QgsProject &project ); %Docstring Returns the maximum width for WMS images defined in a QGIS project. @@ -137,7 +141,7 @@ Returns the maximum width for WMS images defined in a QGIS project. :return: width if defined in project, -1 otherwise. %End - int wmsMaxHeight( const QgsProject &project ); + static int wmsMaxHeight( const QgsProject &project ); %Docstring Returns the maximum height for WMS images defined in a QGIS project. @@ -146,7 +150,7 @@ Returns the maximum height for WMS images defined in a QGIS project. :return: height if defined in project, -1 otherwise. %End - int wmsImageQuality( const QgsProject &project ); + static int wmsImageQuality( const QgsProject &project ); %Docstring Returns the quality for WMS images defined in a QGIS project. @@ -155,7 +159,7 @@ Returns the quality for WMS images defined in a QGIS project. :return: quality if defined in project, -1 otherwise. %End - int wmsTileBuffer( const QgsProject &project ); + static int wmsTileBuffer( const QgsProject &project ); %Docstring Returns the tile buffer in pixels for WMS images defined in a QGIS project. @@ -166,7 +170,7 @@ Returns the tile buffer in pixels for WMS images defined in a QGIS project. .. versionadded:: 3.10 %End - bool wmsRenderMapTiles( const QgsProject &project ); + static bool wmsRenderMapTiles( const QgsProject &project ); %Docstring Returns ``True`` if WMS requests should use the :py:class:`QgsMapSettings`.RenderMapTile flag, so that no visible artifacts are visible between adjacent tiles. @@ -181,7 +185,7 @@ setting is enabled in the project. .. versionadded:: 3.18 %End - int wmsMaxAtlasFeatures( const QgsProject &project ); + static int wmsMaxAtlasFeatures( const QgsProject &project ); %Docstring Returns the maximum number of atlas features which can be printed in a request @@ -190,7 +194,7 @@ Returns the maximum number of atlas features which can be printed in a request :return: the number of atlas features %End - double wmsDefaultMapUnitsPerMm( const QgsProject &project ); + static double wmsDefaultMapUnitsPerMm( const QgsProject &project ); %Docstring Returns the default number of map units per millimeters in case of the scale is not given @@ -201,7 +205,7 @@ Returns the default number of map units per millimeters in case of the scale is .. versionadded:: 3.4 %End - bool wmsUseLayerIds( const QgsProject &project ); + static bool wmsUseLayerIds( const QgsProject &project ); %Docstring Returns if layer ids are used as name in WMS. @@ -210,7 +214,7 @@ Returns if layer ids are used as name in WMS. :return: if layer ids are used as name. %End - bool wmsInfoFormatSia2045( const QgsProject &project ); + static bool wmsInfoFormatSia2045( const QgsProject &project ); %Docstring Returns if the info format is SIA20145. @@ -219,7 +223,7 @@ Returns if the info format is SIA20145. :return: if the info format is SIA20145. %End - bool wmsFeatureInfoAddWktGeometry( const QgsProject &project ); + static bool wmsFeatureInfoAddWktGeometry( const QgsProject &project ); %Docstring Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request. @@ -228,7 +232,7 @@ Returns if the geometry is displayed as Well Known Text in GetFeatureInfo reques :return: if the geometry is displayed as Well Known Text in GetFeatureInfo request. %End - bool wmsFeatureInfoUseAttributeFormSettings( const QgsProject &project ); + static bool wmsFeatureInfoUseAttributeFormSettings( const QgsProject &project ); %Docstring Returns if feature form settings should be considered for the format of the feature info response @@ -237,7 +241,7 @@ Returns if feature form settings should be considered for the format of the feat :return: true if the feature form settings shall be considered for the feature info response %End - bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project ); + static bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project ); %Docstring Returns if the geometry has to be segmentize in GetFeatureInfo request. @@ -246,7 +250,7 @@ Returns if the geometry has to be segmentize in GetFeatureInfo request. :return: if the geometry has to be segmentize in GetFeatureInfo request. %End - bool wmsAddLegendGroupsLegendGraphic( const QgsProject &project ); + static bool wmsAddLegendGroupsLegendGraphic( const QgsProject &project ); %Docstring Returns if legend groups should be in the legend graphic response if GetLegendGraphic is called on a layer group. @@ -255,7 +259,7 @@ Returns if legend groups should be in the legend graphic response if GetLegendGr :return: if the GetLegendGraphic response has to contain legend groups %End - bool wmsSkipNameForGroup( const QgsProject &project ); + static bool wmsSkipNameForGroup( const QgsProject &project ); %Docstring Returns if name attribute should be skipped for groups in WMS capabilities document. @@ -266,7 +270,7 @@ Returns if name attribute should be skipped for groups in WMS capabilities docum .. versionadded:: 3.36 %End - int wmsFeatureInfoPrecision( const QgsProject &project ); + static int wmsFeatureInfoPrecision( const QgsProject &project ); %Docstring Returns the geometry precision for GetFeatureInfo request. @@ -275,7 +279,7 @@ Returns the geometry precision for GetFeatureInfo request. :return: the geometry precision for GetFeatureInfo request. %End - QString wmsFeatureInfoDocumentElement( const QgsProject &project ); + static QString wmsFeatureInfoDocumentElement( const QgsProject &project ); %Docstring Returns the document element name for XML GetFeatureInfo request. @@ -284,7 +288,7 @@ Returns the document element name for XML GetFeatureInfo request. :return: the document element name for XML GetFeatureInfo request. %End - QString wmsFeatureInfoDocumentElementNs( const QgsProject &project ); + static QString wmsFeatureInfoDocumentElementNs( const QgsProject &project ); %Docstring Returns the document element namespace for XML GetFeatureInfo request. @@ -293,7 +297,7 @@ Returns the document element namespace for XML GetFeatureInfo request. :return: the document element namespace for XML GetFeatureInfo request. %End - QString wmsFeatureInfoSchema( const QgsProject &project ); + static QString wmsFeatureInfoSchema( const QgsProject &project ); %Docstring Returns the schema URL for XML GetFeatureInfo request. @@ -302,7 +306,7 @@ Returns the schema URL for XML GetFeatureInfo request. :return: the schema URL for XML GetFeatureInfo request. %End - QHash wmsFeatureInfoLayerAliasMap( const QgsProject &project ); + static QHash wmsFeatureInfoLayerAliasMap( const QgsProject &project ); %Docstring Returns the mapping between layer name and wms layer name for GetFeatureInfo request. @@ -311,7 +315,7 @@ Returns the mapping between layer name and wms layer name for GetFeatureInfo req :return: the mapping between layer name and wms layer name for GetFeatureInfo request. %End - bool wmsInspireActivate( const QgsProject &project ); + static bool wmsInspireActivate( const QgsProject &project ); %Docstring Returns if Inspire is activated. @@ -320,7 +324,7 @@ Returns if Inspire is activated. :return: if Inspire is activated. %End - QString wmsInspireLanguage( const QgsProject &project ); + static QString wmsInspireLanguage( const QgsProject &project ); %Docstring Returns the Inspire language. @@ -329,7 +333,7 @@ Returns the Inspire language. :return: the Inspire language if defined in project. %End - QString wmsInspireMetadataUrl( const QgsProject &project ); + static QString wmsInspireMetadataUrl( const QgsProject &project ); %Docstring Returns the Inspire metadata URL. @@ -338,7 +342,7 @@ Returns the Inspire metadata URL. :return: the Inspire metadata URL if defined in project. %End - QString wmsInspireMetadataUrlType( const QgsProject &project ); + static QString wmsInspireMetadataUrlType( const QgsProject &project ); %Docstring Returns the Inspire metadata URL type. @@ -347,7 +351,7 @@ Returns the Inspire metadata URL type. :return: the Inspire metadata URL type if defined in project. %End - QString wmsInspireTemporalReference( const QgsProject &project ); + static QString wmsInspireTemporalReference( const QgsProject &project ); %Docstring Returns the Inspire temporal reference. @@ -356,7 +360,7 @@ Returns the Inspire temporal reference. :return: the Inspire temporal reference if defined in project. %End - QString wmsInspireMetadataDate( const QgsProject &project ); + static QString wmsInspireMetadataDate( const QgsProject &project ); %Docstring Returns the Inspire metadata date. @@ -365,7 +369,7 @@ Returns the Inspire metadata date. :return: the Inspire metadata date if defined in project. %End - QStringList wmsRestrictedComposers( const QgsProject &project ); + static QStringList wmsRestrictedComposers( const QgsProject &project ); %Docstring Returns the restricted composer list. @@ -374,7 +378,7 @@ Returns the restricted composer list. :return: the restricted composer list if defined in project. %End - QString wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WMS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -386,7 +390,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. :return: url to use for this service %End - QString wmsRootName( const QgsProject &project ); + static QString wmsRootName( const QgsProject &project ); %Docstring Returns the WMS root layer name defined in a QGIS project. @@ -395,7 +399,7 @@ Returns the WMS root layer name defined in a QGIS project. :return: root layer name to use for this service %End - QStringList wmsRestrictedLayers( const QgsProject &project ); + static QStringList wmsRestrictedLayers( const QgsProject &project ); %Docstring Returns the restricted layer name list. @@ -404,7 +408,7 @@ Returns the restricted layer name list. :return: the restricted layer name list if defined in project. %End - QStringList wmsOutputCrsList( const QgsProject &project ); + static QStringList wmsOutputCrsList( const QgsProject &project ); %Docstring Returns the WMS output CRS list. @@ -413,7 +417,7 @@ Returns the WMS output CRS list. :return: the WMS output CRS list. %End - QgsRectangle wmsExtent( const QgsProject &project ); + static QgsRectangle wmsExtent( const QgsProject &project ); %Docstring Returns the WMS Extent restriction. @@ -422,7 +426,7 @@ Returns the WMS Extent restriction. :return: the WMS Extent restriction. %End - QString wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WFS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -434,7 +438,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. :return: url to use for this service %End - QStringList wfsLayerIds( const QgsProject &project ); + static QStringList wfsLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published in WFS. @@ -444,7 +448,7 @@ Returns the Layer ids list defined in a QGIS project as published in WFS. %End - int wfsLayerPrecision( const QgsProject &project, const QString &layerId ); + static int wfsLayerPrecision( const QgsProject &project, const QString &layerId ); %Docstring Returns the Layer precision defined in a QGIS project for the WFS GetFeature. @@ -454,7 +458,7 @@ Returns the Layer precision defined in a QGIS project for the WFS GetFeature. :return: the layer precision for WFS GetFeature. %End - QStringList wfstUpdateLayerIds( const QgsProject &project ); + static QStringList wfstUpdateLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities. @@ -463,7 +467,7 @@ Returns the Layer ids list defined in a QGIS project as published as WFS-T with :return: the Layer ids list. %End - QStringList wfstInsertLayerIds( const QgsProject &project ); + static QStringList wfstInsertLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities. @@ -472,7 +476,7 @@ Returns the Layer ids list defined in a QGIS project as published as WFS-T with :return: the Layer ids list. %End - QStringList wfstDeleteLayerIds( const QgsProject &project ); + static QStringList wfstDeleteLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities. @@ -481,7 +485,7 @@ Returns the Layer ids list defined in a QGIS project as published as WFS-T with :return: the Layer ids list. %End - QString wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WCS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -493,7 +497,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. :return: url to use for this service %End - QStringList wcsLayerIds( const QgsProject &project ); + static QStringList wcsLayerIds( const QgsProject &project ); %Docstring Returns the Layer ids list defined in a QGIS project as published in WCS. @@ -502,7 +506,7 @@ Returns the Layer ids list defined in a QGIS project as published in WCS. :return: the Layer ids list. %End - QString wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); %Docstring Returns the WMTS service url. The URL defined in the project or if not defined the URL from serviceUrl. @@ -516,7 +520,7 @@ The URL defined in the project or if not defined the URL from serviceUrl. .. versionadded:: 3.4 %End - QString serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings ); + static QString serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings ); %Docstring Returns the service url defined in the environment variable or with HTTP header. This is calculated from (in order of precedence): diff --git a/src/core/qgshstoreutils.h b/src/core/qgshstoreutils.h index 53226a82b89..d2f5ef43823 100644 --- a/src/core/qgshstoreutils.h +++ b/src/core/qgshstoreutils.h @@ -19,33 +19,28 @@ #include "qgis_core.h" #include "qgis.h" -#ifdef SIP_RUN -% ModuleHeaderCode -#include "qgshstoreutils.h" -% End -#endif - /** * \ingroup core - * \brief The QgsHstoreUtils namespace provides functions to handle hstore-formatted strings. + * \brief Provides utility functions for handling hstore-formatted strings. * \since QGIS 3.4 */ -namespace QgsHstoreUtils +class CORE_EXPORT QgsHstoreUtils { + public: - /** - * Returns a QVariantMap object containing the key and values from a hstore-formatted string. - * \param string The hstored-formatted string - * \since QGIS 3.4 - */ - CORE_EXPORT QVariantMap parse( const QString &string ); + /** + * Returns a QVariantMap object containing the key and values from a hstore-formatted string. + * \param string The hstored-formatted string + * \since QGIS 3.4 + */ + static QVariantMap parse( const QString &string ); - /** - * Build a hstore-formatted string from a QVariantMap. - * \param map The map to format as a string - * \since QGIS 3.4 - */ - CORE_EXPORT QString build( const QVariantMap &map ); + /** + * Build a hstore-formatted string from a QVariantMap. + * \param map The map to format as a string + * \since QGIS 3.4 + */ + static QString build( const QVariantMap &map ); }; diff --git a/src/core/qgstestutils.h b/src/core/qgstestutils.h index c756f28bee3..c04bdf9711f 100644 --- a/src/core/qgstestutils.h +++ b/src/core/qgstestutils.h @@ -22,32 +22,27 @@ class QgsVectorDataProvider; -#ifdef SIP_RUN -% ModuleHeaderCode -#include "qgstestutils.h" -% End -#endif - ///@cond PRIVATE // Used only for utilities required for the QGIS Python unit tests - not stable or public API -namespace QgsTestUtils +class CORE_EXPORT QgsTestUtils { + public: - /** - * Runs a thready safety test on iterators from a vector data \a provider, by concurrently - * requesting features from the provider. - * - * This method returns TRUE... or it segfaults. - */ - CORE_EXPORT bool testProviderIteratorThreadSafety( QgsVectorDataProvider *provider, const QgsFeatureRequest &request = QgsFeatureRequest() ); + /** + * Runs a thready safety test on iterators from a vector data \a provider, by concurrently + * requesting features from the provider. + * + * This method returns TRUE... or it segfaults. + */ + static bool testProviderIteratorThreadSafety( QgsVectorDataProvider *provider, const QgsFeatureRequest &request = QgsFeatureRequest() ); - /** - * Compares two DOM elements and returns TRUE if they are equivalent. - * - * Dumps useful diff information to the console if the elements differ. - */ - CORE_EXPORT bool compareDomElements( const QDomElement &element1, const QDomElement &element2 ); + /** + * Compares two DOM elements and returns TRUE if they are equivalent. + * + * Dumps useful diff information to the console if the elements differ. + */ + static bool compareDomElements( const QDomElement &element1, const QDomElement &element2 ); }; diff --git a/src/core/qgsziputils.h b/src/core/qgsziputils.h index 909623b90ad..ec67ccbc625 100644 --- a/src/core/qgsziputils.h +++ b/src/core/qgsziputils.h @@ -20,73 +20,72 @@ #include "qgis_sip.h" #include -#ifdef SIP_RUN -% ModuleHeaderCode -#include "qgsziputils.h" -% End -#endif - -namespace QgsZipUtils +/** + * \ingroup core + * \brief Provides utility functions for working with zip files. + * \since QGIS 3.0 + */ +class CORE_EXPORT QgsZipUtils { + public: - /** - * Returns TRUE if the file name is a zipped file ( i.e with a '.qgz' - * extension, FALSE otherwise. - * \param filename The name of the file - * \returns TRUE if the file is zipped, FALSE otherwise - */ - CORE_EXPORT bool isZipFile( const QString &filename ); + /** + * Returns TRUE if the file name is a zipped file ( i.e with a '.qgz' + * extension, FALSE otherwise. + * \param filename The name of the file + * \returns TRUE if the file is zipped, FALSE otherwise + */ + static bool isZipFile( const QString &filename ); - /** - * Unzip a zip file in an output directory. - * \param zip The zip filename - * \param dir The output directory - * \param files The absolute path of unzipped files - * \param checkConsistency Perform additional stricter consistency checks on the archive, and error if they fail (since QGIS 3.30) - * \returns FALSE if the zip filename does not exist, the output directory does not exist or is not writable. - */ - CORE_EXPORT bool unzip( const QString &zip, const QString &dir, QStringList &files SIP_OUT, bool checkConsistency = true ); + /** + * Unzip a zip file in an output directory. + * \param zip The zip filename + * \param dir The output directory + * \param files The absolute path of unzipped files + * \param checkConsistency Perform additional stricter consistency checks on the archive, and error if they fail (since QGIS 3.30) + * \returns FALSE if the zip filename does not exist, the output directory does not exist or is not writable. + */ + static bool unzip( const QString &zip, const QString &dir, QStringList &files SIP_OUT, bool checkConsistency = true ); - /** - * Zip the list of files in the zip file. If the zip file already exists or is - * empty, an error is returned. If an input file does not exist, an error is - * also returned. - * \param zip The zip filename - * \param files The absolute path to files to embed within the zip - */ - CORE_EXPORT bool zip( const QString &zip, const QStringList &files ); + /** + * Zip the list of files in the zip file. If the zip file already exists or is + * empty, an error is returned. If an input file does not exist, an error is + * also returned. + * \param zip The zip filename + * \param files The absolute path to files to embed within the zip + */ + static bool zip( const QString &zip, const QStringList &files ); + /** + * Decodes gzip byte stream, returns TRUE on success. Useful for reading vector tiles. + * + * \note Not available in Python bindings + * \since QGIS 3.26 + */ + static bool decodeGzip( const QByteArray &bytesIn, QByteArray &bytesOut ) SIP_SKIP; - /** - * Decodes gzip byte stream, returns TRUE on success. Useful for reading vector tiles. - * - * \note Not available in Python bindings - * \since QGIS 3.26 - */ - CORE_EXPORT bool decodeGzip( const QByteArray &bytesIn, QByteArray &bytesOut ) SIP_SKIP; + /** + * Decodes gzip byte stream, returns TRUE on success. Useful for reading vector tiles. + * + * \note Not available in Python bindings + * \since QGIS 3.26 + */ + static bool decodeGzip( const char *bytesIn, std::size_t size, QByteArray &bytesOut ) SIP_SKIP; - /** - * Decodes gzip byte stream, returns TRUE on success. Useful for reading vector tiles. - * - * \note Not available in Python bindings - * \since QGIS 3.26 - */ - CORE_EXPORT bool decodeGzip( const char *bytesIn, std::size_t size, QByteArray &bytesOut ) SIP_SKIP; + /** + * Encodes gzip byte stream, returns TRUE on success. Useful for writing vector tiles. + * + * \note Not available in Python bindings + * \since QGIS 3.26 + */ + static bool encodeGzip( const QByteArray &bytesIn, QByteArray &bytesOut ) SIP_SKIP; - /** - * Encodes gzip byte stream, returns TRUE on success. Useful for writing vector tiles. - * - * \note Not available in Python bindings - * \since QGIS 3.26 - */ - CORE_EXPORT bool encodeGzip( const QByteArray &bytesIn, QByteArray &bytesOut ) SIP_SKIP; - - /** - * Returns the list of files within a \a zip file - * - * \since QGIS 3.30 - */ - CORE_EXPORT const QStringList files( const QString &zip ); + /** + * Returns the list of files within a \a zip file + * + * \since QGIS 3.30 + */ + static const QStringList files( const QString &zip ); }; diff --git a/src/server/qgsserverfeatureid.h b/src/server/qgsserverfeatureid.h index 1581a75f155..3bca0f6eba7 100644 --- a/src/server/qgsserverfeatureid.h +++ b/src/server/qgsserverfeatureid.h @@ -28,32 +28,24 @@ class QgsVectorDataProvider; class QgsFeature; class QgsFeatureRequest; - -#ifdef SIP_RUN -% ModuleHeaderCode -#include "qgsserverfeatureid.h" - % End -#endif - - - /** +/** * \ingroup server - * \brief The QgsServerFeatureId namespace provides a way to use primary keys for - * feature id. + * \brief Contains utility functions for using primary keys for feature IDs. * \since QGIS 3.4.9 */ - namespace QgsServerFeatureId +class SERVER_EXPORT QgsServerFeatureId { - /** + public: + /** * Returns the feature id based on primary keys. * \param feature the feature * \param pkAttributes the primary keys list * \returns the feature id based on primary keys * \since QGIS 3.4.9 */ - SERVER_EXPORT QString getServerFid( const QgsFeature &feature, const QgsAttributeList &pkAttributes ); + static QString getServerFid( const QgsFeature &feature, const QgsAttributeList &pkAttributes ); - /** + /** * Returns the feature request based on feature ids build with primary keys. * \param featureRequest the feature request to update * \param serverFids the feature ids build with QgsServerFeatureId::getServerFid @@ -61,23 +53,23 @@ class QgsFeatureRequest; * \returns the feature request updated * \since QGIS 3.4.9 */ - SERVER_EXPORT QgsFeatureRequest updateFeatureRequestFromServerFids( QgsFeatureRequest & featureRequest, const QStringList &serverFids, const QgsVectorDataProvider *provider ); + static QgsFeatureRequest updateFeatureRequestFromServerFids( QgsFeatureRequest &featureRequest, const QStringList &serverFids, const QgsVectorDataProvider *provider ); - /** + /** * Returns the expression feature id based on primary keys. * \param serverFid the feature id build with primary keys * \param provider the vector layer provider to provide fields and primary keys list * \returns the feature id based on primary keys * \since QGIS 3.4.9 */ - SERVER_EXPORT QString getExpressionFromServerFid( const QString &serverFid, const QgsVectorDataProvider *provider ); + static QString getExpressionFromServerFid( const QString &serverFid, const QgsVectorDataProvider *provider ); - /** + /** * Returns the primary keys separator * \returns @@ the primary keys separator * \since QGIS 3.4.9 */ - SERVER_EXPORT QString pkSeparator(); + static QString pkSeparator(); }; #endif diff --git a/src/server/qgsserverprojectutils.h b/src/server/qgsserverprojectutils.h index 79bff7e73c0..19f15d0a21b 100644 --- a/src/server/qgsserverprojectutils.h +++ b/src/server/qgsserverprojectutils.h @@ -30,148 +30,142 @@ class QgsProject; class QgsRectangle; -#ifdef SIP_RUN -% ModuleHeaderCode -#include "qgsserverprojectutils.h" - % End -#endif - - - /** +/** * \ingroup server * \brief The QgsServerProjectUtils namespace provides a way to retrieve specific * entries from a QgsProject. */ - namespace QgsServerProjectUtils +class SERVER_EXPORT QgsServerProjectUtils { - /** + public: + /** * Returns a double greater than \a number to the specified number of \a places. * * \since QGIS 3.10.1 */ - SERVER_EXPORT double ceilWithPrecision( double number, int places ) SIP_SKIP; + static double ceilWithPrecision( double number, int places ) SIP_SKIP; - /** + /** * Returns a double less than \a number to the specified number of \a places. * * \since QGIS 3.10.1 */ - SERVER_EXPORT double floorWithPrecision( double number, int places ) SIP_SKIP; + static double floorWithPrecision( double number, int places ) SIP_SKIP; - /** + /** * Returns if owsService capabilities are enabled. * \param project the QGIS project * \returns if owsService capabilities are enabled. */ - SERVER_EXPORT bool owsServiceCapabilities( const QgsProject &project ); + static bool owsServiceCapabilities( const QgsProject &project ); - /** + /** * Returns the owsService title defined in project. * \param project the QGIS project * \returns the owsService title if defined in project with project title as fallback, "Untitled" otherwise. */ - SERVER_EXPORT QString owsServiceTitle( const QgsProject &project ); + static QString owsServiceTitle( const QgsProject &project ); - /** + /** * Returns the owsService abstract defined in project. * \param project the QGIS project * \returns the owsService abstract if defined in project. */ - SERVER_EXPORT QString owsServiceAbstract( const QgsProject &project ); + static QString owsServiceAbstract( const QgsProject &project ); - /** + /** * Returns the owsService keywords defined in project. * \param project the QGIS project * \returns the owsService keywords if defined in project. */ - SERVER_EXPORT QStringList owsServiceKeywords( const QgsProject &project ); + static QStringList owsServiceKeywords( const QgsProject &project ); - /** + /** * Returns the owsService online resource defined in project. * \param project the QGIS project * \returns the owsService online resource if defined in project. */ - SERVER_EXPORT QString owsServiceOnlineResource( const QgsProject &project ); + static QString owsServiceOnlineResource( const QgsProject &project ); - /** + /** * Returns the owsService contact organization defined in project. * \param project the QGIS project * \returns the owsService contact organization if defined in project. */ - SERVER_EXPORT QString owsServiceContactOrganization( const QgsProject &project ); + static QString owsServiceContactOrganization( const QgsProject &project ); - /** + /** * Returns the owsService contact position defined in project. * \param project the QGIS project * \returns the owsService contact position if defined in project. */ - SERVER_EXPORT QString owsServiceContactPosition( const QgsProject &project ); + static QString owsServiceContactPosition( const QgsProject &project ); - /** + /** * Returns the owsService contact person defined in project. * \param project the QGIS project * \returns the owsService contact person if defined in project. */ - SERVER_EXPORT QString owsServiceContactPerson( const QgsProject &project ); + static QString owsServiceContactPerson( const QgsProject &project ); - /** + /** * Returns the owsService contact mail defined in project. * \param project the QGIS project * \returns the owsService contact mail if defined in project. */ - SERVER_EXPORT QString owsServiceContactMail( const QgsProject &project ); + static QString owsServiceContactMail( const QgsProject &project ); - /** + /** * Returns the owsService contact phone defined in project. * \param project the QGIS project * \returns the owsService contact phone if defined in project. */ - SERVER_EXPORT QString owsServiceContactPhone( const QgsProject &project ); + static QString owsServiceContactPhone( const QgsProject &project ); - /** + /** * Returns the owsService fees defined in project. * \param project the QGIS project * \returns the owsService fees if defined in project. */ - SERVER_EXPORT QString owsServiceFees( const QgsProject &project ); + static QString owsServiceFees( const QgsProject &project ); - /** + /** * Returns the owsService access constraints defined in project. * \param project the QGIS project * \returns the owsService access constraints if defined in project. */ - SERVER_EXPORT QString owsServiceAccessConstraints( const QgsProject &project ); + static QString owsServiceAccessConstraints( const QgsProject &project ); - /** + /** * Returns the maximum width for WMS images defined in a QGIS project. * \param project the QGIS project * \returns width if defined in project, -1 otherwise. */ - SERVER_EXPORT int wmsMaxWidth( const QgsProject &project ); + static int wmsMaxWidth( const QgsProject &project ); - /** + /** * Returns the maximum height for WMS images defined in a QGIS project. * \param project the QGIS project * \returns height if defined in project, -1 otherwise. */ - SERVER_EXPORT int wmsMaxHeight( const QgsProject &project ); + static int wmsMaxHeight( const QgsProject &project ); - /** + /** * Returns the quality for WMS images defined in a QGIS project. * \param project the QGIS project * \returns quality if defined in project, -1 otherwise. */ - SERVER_EXPORT int wmsImageQuality( const QgsProject &project ); + static int wmsImageQuality( const QgsProject &project ); - /** + /** * Returns the tile buffer in pixels for WMS images defined in a QGIS project. * \param project the QGIS project * \returns tile buffer if defined in project, 0 otherwise. * \since QGIS 3.10 */ - SERVER_EXPORT int wmsTileBuffer( const QgsProject &project ); + static int wmsTileBuffer( const QgsProject &project ); - /** + /** * Returns TRUE if WMS requests should use the QgsMapSettings::RenderMapTile flag, * so that no visible artifacts are visible between adjacent tiles. * @@ -183,158 +177,158 @@ class QgsRectangle; * * \since QGIS 3.18 */ - SERVER_EXPORT bool wmsRenderMapTiles( const QgsProject &project ); + static bool wmsRenderMapTiles( const QgsProject &project ); - /** + /** * Returns the maximum number of atlas features which can be printed in a request * \param project the QGIS project * \return the number of atlas features */ - SERVER_EXPORT int wmsMaxAtlasFeatures( const QgsProject &project ); + static int wmsMaxAtlasFeatures( const QgsProject &project ); - /** + /** * Returns the default number of map units per millimeters in case of the scale is not given * \param project the QGIS project * \returns the default number of map units per millimeter * \since QGIS 3.4 */ - SERVER_EXPORT double wmsDefaultMapUnitsPerMm( const QgsProject &project ); + static double wmsDefaultMapUnitsPerMm( const QgsProject &project ); - /** + /** * Returns if layer ids are used as name in WMS. * \param project the QGIS project * \returns if layer ids are used as name. */ - SERVER_EXPORT bool wmsUseLayerIds( const QgsProject &project ); + static bool wmsUseLayerIds( const QgsProject &project ); - /** + /** * Returns if the info format is SIA20145. * \param project the QGIS project * \returns if the info format is SIA20145. */ - SERVER_EXPORT bool wmsInfoFormatSia2045( const QgsProject &project ); + static bool wmsInfoFormatSia2045( const QgsProject &project ); - /** + /** * Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request. * \param project the QGIS project * \returns if the geometry is displayed as Well Known Text in GetFeatureInfo request. */ - SERVER_EXPORT bool wmsFeatureInfoAddWktGeometry( const QgsProject &project ); + static bool wmsFeatureInfoAddWktGeometry( const QgsProject &project ); - /** + /** * Returns if feature form settings should be considered for the format of the feature info response * \param project the QGIS project * \returns true if the feature form settings shall be considered for the feature info response */ - SERVER_EXPORT bool wmsFeatureInfoUseAttributeFormSettings( const QgsProject &project ); + static bool wmsFeatureInfoUseAttributeFormSettings( const QgsProject &project ); - /** + /** * Returns if the geometry has to be segmentize in GetFeatureInfo request. * \param project the QGIS project * \returns if the geometry has to be segmentize in GetFeatureInfo request. */ - SERVER_EXPORT bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project ); + static bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project ); - /** + /** * Returns if legend groups should be in the legend graphic response if GetLegendGraphic is called on a layer group. * \param project the QGIS project * \returns if the GetLegendGraphic response has to contain legend groups */ - SERVER_EXPORT bool wmsAddLegendGroupsLegendGraphic( const QgsProject &project ); + static bool wmsAddLegendGroupsLegendGraphic( const QgsProject &project ); - /** + /** * Returns if name attribute should be skipped for groups in WMS capabilities document. * \param project the QGIS project * \returns if name attribute should be skipped for groups in capabilities * \since QGIS 3.36 */ - SERVER_EXPORT bool wmsSkipNameForGroup( const QgsProject &project ); + static bool wmsSkipNameForGroup( const QgsProject &project ); - /** + /** * Returns the geometry precision for GetFeatureInfo request. * \param project the QGIS project * \returns the geometry precision for GetFeatureInfo request. */ - SERVER_EXPORT int wmsFeatureInfoPrecision( const QgsProject &project ); + static int wmsFeatureInfoPrecision( const QgsProject &project ); - /** + /** * Returns the document element name for XML GetFeatureInfo request. * \param project the QGIS project * \returns the document element name for XML GetFeatureInfo request. */ - SERVER_EXPORT QString wmsFeatureInfoDocumentElement( const QgsProject &project ); + static QString wmsFeatureInfoDocumentElement( const QgsProject &project ); - /** + /** * Returns the document element namespace for XML GetFeatureInfo request. * \param project the QGIS project * \returns the document element namespace for XML GetFeatureInfo request. */ - SERVER_EXPORT QString wmsFeatureInfoDocumentElementNs( const QgsProject &project ); + static QString wmsFeatureInfoDocumentElementNs( const QgsProject &project ); - /** + /** * Returns the schema URL for XML GetFeatureInfo request. * \param project the QGIS project * \returns the schema URL for XML GetFeatureInfo request. */ - SERVER_EXPORT QString wmsFeatureInfoSchema( const QgsProject &project ); + static QString wmsFeatureInfoSchema( const QgsProject &project ); - /** + /** * Returns the mapping between layer name and wms layer name for GetFeatureInfo request. * \param project the QGIS project * \returns the mapping between layer name and wms layer name for GetFeatureInfo request. */ - SERVER_EXPORT QHash wmsFeatureInfoLayerAliasMap( const QgsProject &project ); + static QHash wmsFeatureInfoLayerAliasMap( const QgsProject &project ); - /** + /** * Returns if Inspire is activated. * \param project the QGIS project * \returns if Inspire is activated. */ - SERVER_EXPORT bool wmsInspireActivate( const QgsProject &project ); + static bool wmsInspireActivate( const QgsProject &project ); - /** + /** * Returns the Inspire language. * \param project the QGIS project * \returns the Inspire language if defined in project. */ - SERVER_EXPORT QString wmsInspireLanguage( const QgsProject &project ); + static QString wmsInspireLanguage( const QgsProject &project ); - /** + /** * Returns the Inspire metadata URL. * \param project the QGIS project * \returns the Inspire metadata URL if defined in project. */ - SERVER_EXPORT QString wmsInspireMetadataUrl( const QgsProject &project ); + static QString wmsInspireMetadataUrl( const QgsProject &project ); - /** + /** * Returns the Inspire metadata URL type. * \param project the QGIS project * \returns the Inspire metadata URL type if defined in project. */ - SERVER_EXPORT QString wmsInspireMetadataUrlType( const QgsProject &project ); + static QString wmsInspireMetadataUrlType( const QgsProject &project ); - /** + /** * Returns the Inspire temporal reference. * \param project the QGIS project * \returns the Inspire temporal reference if defined in project. */ - SERVER_EXPORT QString wmsInspireTemporalReference( const QgsProject &project ); + static QString wmsInspireTemporalReference( const QgsProject &project ); - /** + /** * Returns the Inspire metadata date. * \param project the QGIS project * \returns the Inspire metadata date if defined in project. */ - SERVER_EXPORT QString wmsInspireMetadataDate( const QgsProject &project ); + static QString wmsInspireMetadataDate( const QgsProject &project ); - /** + /** * Returns the restricted composer list. * \param project the QGIS project * \returns the restricted composer list if defined in project. */ - SERVER_EXPORT QStringList wmsRestrictedComposers( const QgsProject &project ); + static QStringList wmsRestrictedComposers( const QgsProject &project ); - /** + /** * Returns the WMS service url. * The URL defined in the project or if not defined the URL from serviceUrl. * @@ -343,37 +337,37 @@ class QgsRectangle; * \param settings the server settings * \returns url to use for this service */ - SERVER_EXPORT QString wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); - /** + /** * Returns the WMS root layer name defined in a QGIS project. * \param project the QGIS project * \returns root layer name to use for this service */ - SERVER_EXPORT QString wmsRootName( const QgsProject &project ); + static QString wmsRootName( const QgsProject &project ); - /** + /** * Returns the restricted layer name list. * \param project the QGIS project * \returns the restricted layer name list if defined in project. */ - SERVER_EXPORT QStringList wmsRestrictedLayers( const QgsProject &project ); + static QStringList wmsRestrictedLayers( const QgsProject &project ); - /** + /** * Returns the WMS output CRS list. * \param project the QGIS project * \returns the WMS output CRS list. */ - SERVER_EXPORT QStringList wmsOutputCrsList( const QgsProject &project ); + static QStringList wmsOutputCrsList( const QgsProject &project ); - /** + /** * Returns the WMS Extent restriction. * \param project the QGIS project * \returns the WMS Extent restriction. */ - SERVER_EXPORT QgsRectangle wmsExtent( const QgsProject &project ); + static QgsRectangle wmsExtent( const QgsProject &project ); - /** + /** * Returns the WFS service url. * The URL defined in the project or if not defined the URL from serviceUrl. * @@ -382,46 +376,46 @@ class QgsRectangle; * \param settings the server settings * \returns url to use for this service */ - SERVER_EXPORT QString wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); - /** + /** * Returns the Layer ids list defined in a QGIS project as published in WFS. * \param project the QGIS project * \return the Layer ids list. */ - SERVER_EXPORT QStringList wfsLayerIds( const QgsProject &project ); + static QStringList wfsLayerIds( const QgsProject &project ); - /** + /** * Returns the Layer precision defined in a QGIS project for the WFS GetFeature. * \param project the QGIS project * \param layerId the layer id in the project * \return the layer precision for WFS GetFeature. */ - SERVER_EXPORT int wfsLayerPrecision( const QgsProject &project, const QString &layerId ); + static int wfsLayerPrecision( const QgsProject &project, const QString &layerId ); - /** + /** * Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities. * \param project the QGIS project * \return the Layer ids list. */ - SERVER_EXPORT QStringList wfstUpdateLayerIds( const QgsProject &project ); + static QStringList wfstUpdateLayerIds( const QgsProject &project ); - /** + /** * Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities. * \param project the QGIS project * \return the Layer ids list. */ - SERVER_EXPORT QStringList wfstInsertLayerIds( const QgsProject &project ); + static QStringList wfstInsertLayerIds( const QgsProject &project ); - /** + /** * Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities. * \param project the QGIS project * \return the Layer ids list. */ - SERVER_EXPORT QStringList wfstDeleteLayerIds( const QgsProject &project ); + static QStringList wfstDeleteLayerIds( const QgsProject &project ); - /** + /** * Returns the WCS service url. * The URL defined in the project or if not defined the URL from serviceUrl. * @@ -430,16 +424,16 @@ class QgsRectangle; * \param settings the server settings * \returns url to use for this service */ - SERVER_EXPORT QString wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); - /** + /** * Returns the Layer ids list defined in a QGIS project as published in WCS. * \param project the QGIS project * \returns the Layer ids list. */ - SERVER_EXPORT QStringList wcsLayerIds( const QgsProject &project ); + static QStringList wcsLayerIds( const QgsProject &project ); - /** + /** * Returns the WMTS service url. * The URL defined in the project or if not defined the URL from serviceUrl. * @@ -449,9 +443,9 @@ class QgsRectangle; * \returns url to use for this service * \since QGIS 3.4 */ - SERVER_EXPORT QString wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); + static QString wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() ); - /** + /** * Returns the service url defined in the environment variable or with HTTP header. * This is calculated from (in order of precedence): * @@ -471,7 +465,7 @@ class QgsRectangle; * \returns url to use for this service * \since QGIS 3.20 */ - SERVER_EXPORT QString serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings ); + static QString serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings ); }; #endif