QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsserverapi.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsserverapi.h
3
4 Class defining the service interface for QGIS server APIs.
5 -------------------
6 begin : 2019-04-16
7 copyright : (C) 2019 by Alessandro Pasotti
8 email : elpaso at itopen dot it
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20
21#ifndef QGSSERVERAPI_H
22#define QGSSERVERAPI_H
23
24#include "qgis_server.h"
25#include <QRegularExpression>
26#include "qgsserverexception.h"
27#include "qgsserverrequest.h"
28
30class QgsProject;
33
79class SERVER_EXPORT QgsServerApi
80{
81 public:
85 QgsServerApi( QgsServerInterface *serverIface );
86
87 virtual ~QgsServerApi() = default;
88
92 virtual const QString name() const = 0;
93
97 virtual const QString description() const = 0;
98
103 virtual const QString version() const { return QString(); }
104
108 virtual const QString rootPath() const = 0;
109
113 virtual bool accept( const QUrl &url ) const;
114
118 virtual void executeRequest( const QgsServerApiContext &context ) const = 0;
119
123 QgsServerInterface *serverIface() const;
124
125 private:
126 QgsServerInterface *mServerIface = nullptr;
127};
128
129
130#endif // QGSSERVERAPI_H
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
The QgsServerApiContext class encapsulates the resources for a particular client request: the request...
Server generic API endpoint abstract base class.
virtual const QString version() const
Returns the version of the service.
virtual const QString description() const =0
Returns the API description.
virtual const QString name() const =0
Returns the API name.
virtual void executeRequest(const QgsServerApiContext &context) const =0
Executes a request by passing the given context to the API handlers.
virtual const QString rootPath() const =0
Returns the root path for the API.
virtual ~QgsServerApi()=default
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...