QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsserverapicontext.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsserverapicontext.h - QgsServerApiContext
3
4 ---------------------
5 begin : 13.5.2019
6 copyright : (C) 2019 by Alessandro Pasotti
7 email : elpaso at itopen dot it
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSSERVERAPICONTEXT_H
17#define QGSSERVERAPICONTEXT_H
18
19#include "qgis_server.h"
20
21#include <QString>
22
26class QgsProject;
27
40class SERVER_EXPORT QgsServerApiContext
41{
42 public:
54
58 const QgsServerRequest *request() const;
59
64
69 const QgsProject *project() const;
70
75 void setProject( const QgsProject *project );
76
81
92 const QString matchedPath() const;
93
97 QString apiRootPath() const;
98
102 void setRequest( const QgsServerRequest *request );
103
110 QString handlerPath() const;
111
112 private:
113 QString mApiRootPath;
114 const QgsServerRequest *mRequest = nullptr;
115 QgsServerResponse *mResponse = nullptr;
116 const QgsProject *mProject = nullptr;
117 QgsServerInterface *mServerInterface = nullptr;
118};
119
120#endif // QGSSERVERAPICONTEXT_H
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
const QgsProject * project() const
Returns the (possibly NULL) project.
QgsServerResponse * response() const
Returns the server response object.
QString handlerPath() const
Returns the handler component of the URL path, i.e.
const QgsServerRequest * request() const
Returns the server request object.
void setProject(const QgsProject *project)
Sets the project to project.
void setRequest(const QgsServerRequest *request)
Sets context request to request.
QgsServerInterface * serverInterface() const
Returns the server interface.
QString apiRootPath() const
Returns the API root path.
QgsServerApiContext(const QString &apiRootPath, const QgsServerRequest *request, QgsServerResponse *response, const QgsProject *project, QgsServerInterface *serverInterface)
QgsServerApiContext constructor.
const QString matchedPath() const
Returns the initial part of the incoming request URL path that matches the API root path.
Defines interfaces exposed by QGIS Server and made available to plugins.
Defines requests passed to QgsService classes.
Defines the response interface passed to QgsService.