mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
131 lines
4.9 KiB
Plaintext
131 lines
4.9 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsnetworkaccessmanager.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsNetworkAccessManager : QNetworkAccessManager
|
|
{
|
|
%Docstring
|
|
network access manager for QGIS
|
|
|
|
This class implements the QGIS network access manager. It's a singleton
|
|
that can be used across QGIS.
|
|
|
|
Plugins can insert proxy factories and thereby redirect requests to
|
|
individual proxies.
|
|
|
|
If no proxy factories are there or none returns a proxy for an URL a
|
|
fallback proxy can be set. There's also a exclude list that defines URLs
|
|
that the fallback proxy should not be used for, then no proxy will be used.
|
|
|
|
.. versionadded:: 1.5
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsnetworkaccessmanager.h"
|
|
%End
|
|
public:
|
|
|
|
static QgsNetworkAccessManager *instance( Qt::ConnectionType connectionType = Qt::BlockingQueuedConnection );
|
|
%Docstring
|
|
Returns a pointer to the active QgsNetworkAccessManager
|
|
for the current thread.
|
|
|
|
With the ``connectionType`` parameter it is possible to setup the default connection
|
|
type that is used to handle signals that might require user interaction and therefore
|
|
need to be handled on the main thread. See in-depth discussion below.
|
|
|
|
:param connectionType: In most cases the default of using a ``Qt.BlockingQueuedConnection``
|
|
is ok, to make a background thread wait for the main thread to answer such a request is
|
|
fine and anything else is dangerous.
|
|
However, in case the request was started on the main thread, one should execute a
|
|
local event loop in a helper thread and freeze the main thread for the duration of the
|
|
download. In this case, if an authentication request is sent from the background thread
|
|
network access manager, the background thread should be blocked, the main thread be woken
|
|
up, processEvents() executed once, the main thread frozen again and the background thread
|
|
continued.
|
|
%End
|
|
|
|
QgsNetworkAccessManager( QObject *parent = 0 );
|
|
|
|
void insertProxyFactory( QNetworkProxyFactory *factory /Transfer/ );
|
|
%Docstring
|
|
insert a factory into the proxy factories list
|
|
%End
|
|
|
|
void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );
|
|
%Docstring
|
|
remove a factory from the proxy factories list
|
|
%End
|
|
|
|
const QList<QNetworkProxyFactory *> proxyFactories() const;
|
|
%Docstring
|
|
retrieve proxy factory list
|
|
%End
|
|
|
|
const QNetworkProxy &fallbackProxy() const;
|
|
%Docstring
|
|
retrieve fall back proxy (for urls that no factory returned proxies for)
|
|
%End
|
|
|
|
QStringList excludeList() const;
|
|
%Docstring
|
|
retrieve exclude list (urls shouldn't use the fallback proxy)
|
|
%End
|
|
|
|
void setFallbackProxyAndExcludes( const QNetworkProxy &proxy, const QStringList &excludes );
|
|
%Docstring
|
|
Sets fallback proxy and URL that shouldn't use it.
|
|
%End
|
|
|
|
static QString cacheLoadControlName( QNetworkRequest::CacheLoadControl control );
|
|
%Docstring
|
|
Gets name for QNetworkRequest.CacheLoadControl
|
|
%End
|
|
|
|
static QNetworkRequest::CacheLoadControl cacheLoadControlFromName( const QString &name );
|
|
%Docstring
|
|
Gets QNetworkRequest.CacheLoadControl from name
|
|
%End
|
|
|
|
void setupDefaultProxyAndCache( Qt::ConnectionType connectionType = Qt::BlockingQueuedConnection );
|
|
%Docstring
|
|
Setup the QgsNetworkAccessManager (NAM) according to the user's settings.
|
|
The ``connectionType`` sets up the default connection type that is used to
|
|
handle signals that might require user interaction and therefore
|
|
need to be handled on the main thread. See in-depth discussion in the documentation
|
|
for the constructor of this class.
|
|
%End
|
|
|
|
bool useSystemProxy() const;
|
|
%Docstring
|
|
Returns whether the system proxy should be used
|
|
%End
|
|
|
|
signals:
|
|
void requestAboutToBeCreated( QNetworkAccessManager::Operation, const QNetworkRequest &, QIODevice * );
|
|
void requestCreated( QNetworkReply * );
|
|
void requestTimedOut( QNetworkReply * );
|
|
|
|
protected:
|
|
virtual QNetworkReply *createRequest( QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0 );
|
|
|
|
|
|
};
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsnetworkaccessmanager.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|