File: qgsserverinterface.sip

package info (click to toggle)
qgis 2.14.11%2Bdfsg-3%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 991,448 kB
  • ctags: 73,105
  • sloc: cpp: 535,362; python: 162,580; xml: 16,494; ansic: 8,031; sh: 1,788; perl: 1,559; sql: 727; yacc: 319; lex: 269; makefile: 251
file content (73 lines) | stat: -rw-r--r-- 3,253 bytes parent folder | download | duplicates (2)
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
73
/***************************************************************************
                          qgsserverinterface.sip

  Class defining the interface made available to QGIS Server plugins.
  -------------------
  begin                : 2014-09-10
  copyright            : (C) 2014 by Alessandro Pasotti
  email                : a dot pasotti at itopen dot it
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

/**
 * \class QgsServerInterface
 * \brief Class defining the interface made available to server plugins.
 *
 * This class provides methods to access the request handler and
 * the capabilties cache. A method to read the environment
 * variables set in the main FCGI loop is also available.
 * Plugins can add listeners (instances of QgsServerFilter) with
 * a certain priority through the registerFilter( QgsServerFilter* , int) method.
 */


typedef QMultiMap<int, QgsServerFilter*> QgsServerFiltersMap;



class QgsServerInterface
{
%TypeHeaderCode
  #include "qgsserverinterface.h"
%End

  public:
    /** Returns the current request handler*/
    virtual QgsRequestHandler* requestHandler() = 0 /KeepReference/;
    /** Returns the capabilities cache*/
    virtual QgsCapabilitiesCache* capabiblitiesCache() = 0 /KeepReference/;
    // Tansfer ownership to avoid garbage collector to call dtor
    /** Register a filter with the given priority. The filter's requestReady()
     * and responseReady() methods will be called from the loop*/
    virtual void registerFilter( QgsServerFilter* filter /Transfer/, int priority = 0 ) = 0;
    /** Set the filters map */
    virtual void setFilters( QgsServerFiltersMap* filters /Transfer/) = 0;
    /** Register a security module with the given priority.*/
    virtual void registerAccessControl( QgsAccessControlFilter* accessControl /Transfer/, int priority = 0 ) = 0;
    /** Gets the registred access control filters */
    virtual const QgsAccessControl* accessControls() const = 0;
    /** Return an environment variable set by FCGI*/
    virtual QString getEnv(const QString& name ) const = 0;
    // Commented because of problems with typedef QgsServerFiltersMap, provided
    // methods to alter the filters map into QgsRequestHandler API
    virtual QgsServerFiltersMap filters() = 0;
    /** Returns the configFilePath as seen by the server, this value is only
     * available after requestReady has been called.*/
    virtual QString configFilePath() = 0;
    /** Set the config file path */
    virtual void setConfigFilePath( const QString& configFilePath) = 0;

private:
    /** Constructor */
    QgsServerInterface();

};