/*************************************************************************** qgswmsserver.sip ------------------- begin : May 2, 2015 copyright : (C) 2015 by Alessandro Pasotti email : a dot pasotti at itopen dot it ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "qgsowsserver.h" #include "qgswmsconfigparser.h" #include #include #include #include #include class QgsCapabilitiesCache; class QgsCoordinateReferenceSystem; class QgsComposerLayerItem; class QgsComposerLegendItem; class QgsComposition; class QgsConfigParser; class QgsFeature; class QgsFeatureRendererV2; class QgsMapLayer; class QgsMapRenderer; class QgsPoint; class QgsRasterLayer; class QgsRasterRenderer; class QgsRectangle; class QgsRenderContext; class QgsVectorLayer; class QgsSymbol; class QgsSymbolV2; class QColor; class QFile; class QFont; class QImage; class QPaintDevice; class QPainter; class QStandardItem; /** This class handles all the wms server requests. The parameters and values have to be passed in the form of a map. This map is usually generated by a subclass of QgsWMSRequestHandler, which makes QgsWMSServer independent from any server side technology*/ class QgsWMSServer: public QgsOWSServer { public: /** Constructor. Does _NOT_ take ownership of QgsConfigParser, QgsCapabilitiesCache and QgsMapRenderer*/ QgsWMSServer( const QString& configFilePath, QMap ¶meters, QgsWMSConfigParser* cp, QgsRequestHandler* rh, QgsMapRenderer* renderer, QgsCapabilitiesCache* capCache ); ~QgsWMSServer(); void executeRequest() override; /** Returns an XML file with the capabilities description (as described in the WMS specs) @param version WMS version (1.1.1 or 1.3.0) @param fullProjectInformation If true: add extended project information (does not validate against WMS schema)*/ QDomDocument getCapabilities( QString version = "1.3.0", bool fullProjectInformation = false ); QDomDocument getContext(); /** Returns the map legend as an image (or a null pointer in case of error). The caller takes ownership of the image object*/ QImage* getLegendGraphics(); typedef QSet SymbolV2Set; typedef QMap HitTest; /** Returns the map as an image (or a null pointer in case of error). The caller takes ownership of the image object). If an instance to existing hit test structure is passed, instead of rendering it will fill the structure with symbols that would be used for rendering */ QImage* getMap( HitTest* hitTest = 0 ); /** Returns an SLD file with the style of the requested layer. Exception is raised in case of troubles :-)*/ QDomDocument getStyle(); /** Returns an SLD file with the styles of the requested layers. Exception is raised in case of troubles :-)*/ QDomDocument getStyles(); /** Returns a describeLayer file with the onlineResource of the requested layers. Exception is raised in case of troubles :-)*/ QDomDocument describeLayer(); /** Returns printed page as binary @param formatString out: format of the print output (e.g. pdf, svg, png, ...) @return printed page as binary or 0 in case of error*/ QByteArray* getPrint( const QString& formatString ); /** Creates an xml document that describes the result of the getFeatureInfo request. @return 0 in case of success*/ int getFeatureInfo( QDomDocument& result, QString version = "1.3.0" ); /** Sets configuration parser for administration settings. Does not take ownership*/ void setAdminConfigParser( QgsWMSConfigParser* parser ) { mConfigParser = parser; } /** Returns the schemaExtension for WMS 1.3.0 capabilities*/ QDomDocument getSchemaExtension(); private: /** Don't use the default constructor*/ QgsWMSServer(); };