|
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 |
21 | 18 | { |
| 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 | + |
22 | 24 | %TypeHeaderCode |
23 | | -#include "qgsserverexception.h" |
24 | 25 | #include "qgsrequesthandler.h" |
25 | 26 | %End |
26 | | - |
27 | 27 | public: |
28 | 28 |
|
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 | + |
30 | 37 | 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 |
31 | 49 |
|
32 | | - //! Set an HTTP response header |
33 | 50 | void setResponseHeader( const QString &name, const QString &value ); |
| 51 | +%Docstring |
| 52 | +Set an HTTP response header |
| 53 | +%End |
34 | 54 |
|
35 | | - //! Remove an HTTP response header |
36 | 55 | void removeResponseHeader( const QString &name ); |
| 56 | +%Docstring |
| 57 | +Remove an HTTP response header |
| 58 | +%End |
37 | 59 |
|
38 | | - //! Retrieve response header value |
39 | 60 | QString responseHeader( const QString &name ) const; |
| 61 | +%Docstring |
| 62 | +Retrieve response header value |
| 63 | + :rtype: str |
| 64 | +%End |
40 | 65 |
|
41 | | - //! Return the response headers |
42 | 66 | QMap<QString, QString> responseHeaders() const; |
| 67 | +%Docstring |
| 68 | +Return the response headers |
| 69 | + :rtype: QMap<str, QString> |
| 70 | +%End |
43 | 71 |
|
44 | | - //! Set an HTTP request header |
45 | 72 | void setRequestHeader( const QString &name, const QString &value ); |
| 73 | +%Docstring |
| 74 | +Set an HTTP request header |
| 75 | +%End |
46 | 76 |
|
47 | | - //! Remove an HTTP request header |
48 | 77 | void removeRequestHeader( const QString &name ); |
| 78 | +%Docstring |
| 79 | +Remove an HTTP request header |
| 80 | +%End |
49 | 81 |
|
50 | | - //! Retrieve request header value |
51 | 82 | QString requestHeader( const QString &name ) const; |
| 83 | +%Docstring |
| 84 | +Retrieve request header value |
| 85 | + :rtype: str |
| 86 | +%End |
52 | 87 |
|
53 | | - //! Return the Request headers |
54 | 88 | 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 |
55 | 98 |
|
56 | | - /** Append the bytestream to response body*/ |
57 | 99 | void appendBody( const QByteArray &body ); |
| 100 | +%Docstring |
| 101 | +Set the info format string such as "text/xml" |
| 102 | +%End |
58 | 103 |
|
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 |
61 | 109 |
|
62 | | - //! Set response http status code |
63 | | - void setStatusCode( int code ); |
| 110 | + void clearBody(); |
| 111 | +%Docstring |
| 112 | +Clear response buffer |
| 113 | +%End |
64 | 114 |
|
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 |
67 | 120 |
|
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 |
70 | 126 |
|
71 | | - /** Clear response buffer */ |
72 | | - void clearBody(); |
| 127 | + QString url() const; |
| 128 | +%Docstring |
| 129 | +Return request url |
| 130 | + :rtype: str |
| 131 | +%End |
73 | 132 |
|
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 |
76 | 137 |
|
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 |
79 | 143 |
|
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 | | - */ |
84 | 144 | 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 |
85 | 151 |
|
86 | | - /** Set a request parameter*/ |
87 | 152 | 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 |
88 | 162 |
|
89 | | - /** Remove a request parameter*/ |
90 | 163 | void removeParameter( const QString &key ); |
| 164 | +%Docstring |
| 165 | +Remove a request parameter |
| 166 | +%End |
91 | 167 |
|
92 | | - /** Return a request parameter*/ |
93 | | - QString parameter( const QString &key ) const; |
94 | 168 |
|
95 | | - /** Return the requested format string*/ |
96 | 169 | QString format() const; |
| 170 | +%Docstring |
| 171 | +Return the requested format string |
| 172 | + :rtype: str |
| 173 | +%End |
97 | 174 |
|
98 | | - /** Return true if the HTTP headers were already sent to the client*/ |
99 | 175 | bool headersSent() const; |
| 176 | +%Docstring |
| 177 | +Return true if the HTTP headers were already sent to the client |
| 178 | + :rtype: bool |
| 179 | +%End |
| 180 | + |
100 | 181 | }; |
| 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