Skip to content

Commit cbef51c

Browse files
committed
[server] Sipify QgsRequestHandler
1 parent 2f75bab commit cbef51c

File tree

2 files changed

+145
-57
lines changed

2 files changed

+145
-57
lines changed

python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ server/qgsaccesscontrolfilter.sip
450450
server/qgsaccesscontrol.sip
451451
server/qgsmapserviceexception.sip
452452
server/qgscapabilitiescache.sip
453-
server/qgsrequesthandler.sip
454453
server/qgsserverprojectparser.sip
455454
server/qgswmsconfigparser.sip
456455
server/qgswmsprojectparser.sip
Lines changed: 145 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,189 @@
1-
/***************************************************************************
2-
qgsrequesthandler.sip
3-
4-
This class is an interface hiding the details of reading input and
5-
writing output from/to a wms request mechanism
6-
-------------------
7-
begin : 2014-09-10
8-
copyright : (C) 2014 by Alessandro Pasotti
9-
email : a dot pasotti at itopen dot it
10-
***************************************************************************/
11-
12-
13-
/**
14-
* \ingroup server
15-
* This class is an interface hiding the details of reading input and writing
16-
* output from/to a wms request mechanism.
17-
* Examples of possible mechanisms are cgi Get, cgi Post, SOAP or the usage
18-
* as a standalone command line executable
19-
*/
20-
class QgsRequestHandler /Abstract/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/server/qgsrequesthandler.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
typedef QList< QPair<QRgb, int> > QgsColorBox; //Color / number of pixels
15+
typedef QMultiMap< int, QgsColorBox > QgsColorBoxMap; // sum of pixels / color box
16+
17+
class QgsRequestHandler
2118
{
19+
%Docstring
20+
This class is an interface hiding the details of reading input and writing
21+
output from/to a wms request mechanism.
22+
%End
23+
2224
%TypeHeaderCode
23-
#include "qgsserverexception.h"
2425
#include "qgsrequesthandler.h"
2526
%End
26-
2727
public:
2828

29-
/** Allow plugins to return a QgsServerException*/
29+
explicit QgsRequestHandler( QgsServerRequest &request, QgsServerResponse &response );
30+
%Docstring
31+
Constructor
32+
33+
Note that QgsServerRequest and QgsServerResponse MUST live in the same scope
34+
%End
35+
~QgsRequestHandler();
36+
3037
void setServiceException( const QgsServerException &ex );
38+
%Docstring
39+
Allow plugins to return a QgsMapServiceException
40+
%End
41+
42+
void sendResponse();
43+
%Docstring
44+
Send out HTTP headers and flush output buffer
45+
46+
This method is intended only for streaming
47+
partial content.
48+
%End
3149

32-
//! Set an HTTP response header
3350
void setResponseHeader( const QString &name, const QString &value );
51+
%Docstring
52+
Set an HTTP response header
53+
%End
3454

35-
//! Remove an HTTP response header
3655
void removeResponseHeader( const QString &name );
56+
%Docstring
57+
Remove an HTTP response header
58+
%End
3759

38-
//! Retrieve response header value
3960
QString responseHeader( const QString &name ) const;
61+
%Docstring
62+
Retrieve response header value
63+
:rtype: str
64+
%End
4065

41-
//! Return the response headers
4266
QMap<QString, QString> responseHeaders() const;
67+
%Docstring
68+
Return the response headers
69+
:rtype: QMap<str, QString>
70+
%End
4371

44-
//! Set an HTTP request header
4572
void setRequestHeader( const QString &name, const QString &value );
73+
%Docstring
74+
Set an HTTP request header
75+
%End
4676

47-
//! Remove an HTTP request header
4877
void removeRequestHeader( const QString &name );
78+
%Docstring
79+
Remove an HTTP request header
80+
%End
4981

50-
//! Retrieve request header value
5182
QString requestHeader( const QString &name ) const;
83+
%Docstring
84+
Retrieve request header value
85+
:rtype: str
86+
%End
5287

53-
//! Return the Request headers
5488
QMap<QString, QString> requestHeaders() const;
89+
%Docstring
90+
Return the Request headers
91+
:rtype: QMap<str, QString>
92+
%End
93+
94+
void clear();
95+
%Docstring
96+
Clears the response body and headers
97+
%End
5598

56-
/** Append the bytestream to response body*/
5799
void appendBody( const QByteArray &body );
100+
%Docstring
101+
Set the info format string such as "text/xml"
102+
%End
58103

59-
/** Send out HTTP headers and flush output buffer*/
60-
void sendResponse();
104+
bool exceptionRaised() const;
105+
%Docstring
106+
Pointer to last raised exception
107+
:rtype: bool
108+
%End
61109

62-
//! Set response http status code
63-
void setStatusCode( int code );
110+
void clearBody();
111+
%Docstring
112+
Clear response buffer
113+
%End
64114

65-
//! Return response http status code
66-
int statusCode( ) const;
115+
QByteArray body() const;
116+
%Docstring
117+
Return response body data
118+
:rtype: QByteArray
119+
%End
67120

68-
/** Pointer to last raised exception*/
69-
bool exceptionRaised() const;
121+
QByteArray data() const;
122+
%Docstring
123+
Return request POST data (can be null)
124+
:rtype: QByteArray
125+
%End
70126

71-
/** Clear response buffer */
72-
void clearBody();
127+
QString url() const;
128+
%Docstring
129+
Return request url
130+
:rtype: str
131+
%End
73132

74-
//! Clears the response body and headers
75-
void clear();
133+
void setStatusCode( int code );
134+
%Docstring
135+
Set response http status code
136+
%End
76137

77-
/** Return body data */
78-
QByteArray body() const;
138+
int statusCode( ) const;
139+
%Docstring
140+
Return response http status code
141+
:rtype: int
142+
%End
79143

80-
/** Return a copy of the parsed parameters as a key-value pair, to modify
81-
* a parameter setParameter( const QString &key, const QString &value)
82-
* and removeParameter(const QString &key) must be used
83-
*/
84144
QMap<QString, QString> parameterMap() const;
145+
%Docstring
146+
Return the parsed parameters as a key-value pair, to modify
147+
a parameter setParameter( const QString &key, const QString &value)
148+
and removeParameter(const QString &key) must be used
149+
:rtype: QMap<str, QString>
150+
%End
85151

86-
/** Set a request parameter*/
87152
void setParameter( const QString &key, const QString &value );
153+
%Docstring
154+
Set a request parameter
155+
%End
156+
157+
QString parameter( const QString &key ) const;
158+
%Docstring
159+
Return a request parameter
160+
:rtype: str
161+
%End
88162

89-
/** Remove a request parameter*/
90163
void removeParameter( const QString &key );
164+
%Docstring
165+
Remove a request parameter
166+
%End
91167

92-
/** Return a request parameter*/
93-
QString parameter( const QString &key ) const;
94168

95-
/** Return the requested format string*/
96169
QString format() const;
170+
%Docstring
171+
Return the requested format string
172+
:rtype: str
173+
%End
97174

98-
/** Return true if the HTTP headers were already sent to the client*/
99175
bool headersSent() const;
176+
%Docstring
177+
Return true if the HTTP headers were already sent to the client
178+
:rtype: bool
179+
%End
180+
100181
};
182+
183+
/************************************************************************
184+
* This file has been generated automatically from *
185+
* *
186+
* src/server/qgsrequesthandler.h *
187+
* *
188+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
189+
************************************************************************/

0 commit comments

Comments
 (0)