QGIS/python/server/qgsserverinterface.sip

138 lines
4.4 KiB
Plaintext
Raw Normal View History

2014-10-10 19:28:20 +02:00
/***************************************************************************
qgsserverinterface.sip
Class defining the interface made available to QGIS Server plugins.
2014-10-10 19:28:20 +02:00
-------------------
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. *
* *
***************************************************************************/
2014-10-09 15:05:19 +02:00
/**
2016-10-01 11:23:26 +02:00
* \ingroup server
* QgsServerInterface
* Class defining interfaces exposed by QGIS Server and
* made available to plugins.
2014-10-09 15:05:19 +02:00
*
2014-10-10 19:28:20 +02:00
* This class provides methods to access the request handler and
2017-01-12 22:01:50 +01:00
* the capabilities cache. A method to read the environment
2014-10-10 19:28:20 +02:00
* 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.
2016-10-01 11:23:26 +02:00
*
2014-10-09 15:05:19 +02:00
*/
typedef QMultiMap<int, QgsServerFilter*> QgsServerFiltersMap;
2014-10-09 15:05:19 +02:00
class QgsServerInterface
{
%TypeHeaderCode
2016-12-16 17:01:48 +01:00
#include "qgsserverinterface.h"
2014-10-09 15:05:19 +02:00
%End
public:
2016-10-01 11:23:26 +02:00
/**
* Set the request handler
* @param requestHandler request handler
* @note not available in Python bindings
*/
// virtual void setRequestHandler( QgsRequestHandler* requestHandler ) = 0;
/**
* Clear the request handler
*
* @note not available in python bindings
*/
// virtual void clearRequestHandler() = 0;
/**
* Get pointer to the capabiblities cache
* @return QgsCapabilitiesCache
*/
2016-12-16 17:01:48 +01:00
virtual QgsCapabilitiesCache* capabilitiesCache() = 0 / KeepReference /;
2016-10-01 11:23:26 +02:00
/**
* Get pointer to the request handler
* @return QgsRequestHandler
*/
2016-12-16 17:01:48 +01:00
virtual QgsRequestHandler* requestHandler() = 0 / KeepReference /;
2016-10-01 11:23:26 +02:00
/**
* Register a QgsServerFilter
* @param filter the QgsServerFilter to add
* @param priority an optional priority for the filter order
*/
2016-12-16 17:01:48 +01:00
virtual void registerFilter( QgsServerFilter* filter / Transfer / , int priority = 0 ) = 0;
2016-10-01 11:23:26 +02:00
/**
* Set the filters map
* @param filters the QgsServerFiltersMap
*/
2016-12-16 17:01:48 +01:00
virtual void setFilters( QgsServerFiltersMap* filters / Transfer / ) = 0;
2016-10-01 11:23:26 +02:00
/**
* Return the list of current QgsServerFilter
* @return QgsServerFiltersMap list of QgsServerFilter
*/
virtual QgsServerFiltersMap filters() = 0;
/** Register an access control filter
* @param accessControl the access control to register
* @param priority the priority used to order them
*/
2016-12-16 17:01:48 +01:00
virtual void registerAccessControl( QgsAccessControlFilter* accessControl / Transfer / , int priority = 0 ) = 0;
2016-10-01 11:23:26 +02:00
/** Gets the registered access control filters */
2016-02-14 03:50:23 +01:00
virtual const QgsAccessControl* accessControls() const = 0;
2016-10-01 11:23:26 +02:00
//! Return an enrironment variable, used to pass environment variables to python
2016-12-16 17:01:48 +01:00
virtual QString getEnv( const QString& name ) const = 0;
2016-10-01 11:23:26 +02:00
/**
* Return the configuration file path
* @return QString containing the configuration file path
*/
2016-02-14 03:50:23 +01:00
virtual QString configFilePath() = 0;
2016-10-01 11:23:26 +02:00
/**
* Set the configuration file path
* @param configFilePath QString with the configuration file path
*/
2016-12-16 17:01:48 +01:00
virtual void setConfigFilePath( const QString& configFilePath ) = 0;
2016-10-01 11:23:26 +02:00
/**
* Remove entry from config cache
* @param path the path of the file to remove
*/
virtual void removeConfigCacheEntry( const QString& path ) = 0;
2016-10-01 11:23:26 +02:00
/**
* Remove entries from layer cache
* @param path the path of the project which own the layers to be removed
*/
virtual void removeProjectLayers( const QString& path ) = 0;
2014-10-09 15:05:19 +02:00
/**
2016-12-16 17:01:48 +01:00
* Return the service registry
* @return QgsServiceResgistry
*/
2016-12-16 17:01:48 +01:00
virtual QgsServiceRegistry* serviceRegistry() = 0 / KeepReference /;
2016-10-01 11:23:26 +02:00
private:
2014-10-09 15:05:19 +02:00
/** Constructor */
2016-02-14 03:50:23 +01:00
QgsServerInterface();
2014-10-09 15:05:19 +02:00
};