File: qgsrequesthandler.sip

package info (click to toggle)
qgis 2.18.28%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,007,948 kB
  • sloc: cpp: 671,774; python: 158,539; xml: 35,690; ansic: 8,346; sh: 1,766; perl: 1,669; sql: 999; yacc: 836; lex: 461; makefile: 292
file content (72 lines) | stat: -rw-r--r-- 2,939 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/***************************************************************************
                          qgsrequesthandler.sip

  This class is an interface hiding the details of reading input and
  writing output from/to a wms request mechanism
  -------------------
  begin                : 2014-09-10
  copyright            : (C) 2014 by Alessandro Pasotti
  email                : a dot pasotti at itopen dot it
 ***************************************************************************/


/**
 * \ingroup server
 * This class is an interface hiding the details of reading input and writing
 * output from/to a wms request mechanism.
 * Examples of possible mechanisms are cgi Get, cgi Post, SOAP or the usage
 * as a standalone command line executable
 */
class QgsRequestHandler
{
%TypeHeaderCode
#include "qgsmapserviceexception.h"
#include "qgsrequesthandler.h"
%End

  public:

    /** Allow plugins to return a QgsMapServiceException*/
    virtual void setServiceException( QgsMapServiceException ex /Transfer/ ) = 0;
    virtual void setDefaultHeaders();
    /** Set an HTTP header*/
    virtual void setHeader( const QString &name, const QString &value ) = 0;
    /** Remove an HTTP header*/
    virtual int removeHeader( const QString &name ) = 0;
    /** Delete all HTTP headers*/
    virtual void clearHeaders() = 0;
    /** Append the bytestream to response body*/
    virtual void appendBody( const QByteArray &body ) = 0;
    /** Clears the response body*/
    virtual void clearBody() = 0;
    /** Return the response body*/
    virtual QByteArray body();
    /** Set the info format string such as "text/xml"*/
    virtual void setInfoFormat( const QString &format ) = 0;
    /** Check whether there is any header set or the body is not empty*/
    virtual bool responseReady() const = 0;
    /** Send out HTTP headers and flush output buffer*/
    virtual void sendResponse() = 0;
    /** Pointer to last raised exception*/
    virtual bool exceptionRaised() const = 0;
    /** Return a copy of the parsed parameters as a key-value pair, to modify
     * a parameter setParameter( const QString &key, const QString &value)
     * and removeParameter(const QString &key) must be used
     */
    QMap<QString, QString> parameterMap();
    /** Set a request parameter*/
    virtual void setParameter( const QString &key, const QString &value ) = 0;
    /** Remove a request parameter*/
    virtual int removeParameter( const QString &key ) = 0;
    /** Return a request parameter*/
    virtual QString parameter( const QString &key ) const = 0;
    /** Return the requested format string*/
    QString format() const;
    /** Return the mime type for the response*/
    QString infoFormat() const;
    /** Return true if the HTTP headers were already sent to the client*/
    bool headersSent();
private:
    /** Parses the input and creates a request neutral Parameter/Value map*/
    virtual void parseInput() = 0;
};