QGIS API Documentation  2.99.0-Master (c558d51)
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QgsNetworkAccessManager Class Reference

network access manager for QGIS More...

#include <qgsnetworkaccessmanager.h>

Inheritance diagram for QgsNetworkAccessManager:
Inheritance graph
[legend]

Signals

void requestAboutToBeCreated (QNetworkAccessManager::Operation, const QNetworkRequest &, QIODevice *)
 
void requestCreated (QNetworkReply *)
 
void requestTimedOut (QNetworkReply *)
 

Public Member Functions

 QgsNetworkAccessManager (QObject *parent=nullptr)
 
 ~QgsNetworkAccessManager ()
 destructor More...
 
const QStringList & excludeList () const
 retrieve exclude list (urls shouldn't use the fallback proxy) More...
 
const QNetworkProxy & fallbackProxy () const
 retrieve fall back proxy (for urls that no factory returned proxies for) More...
 
void insertProxyFactory (QNetworkProxyFactory *factory)
 insert a factory into the proxy factories list More...
 
const QList< QNetworkProxyFactory * > proxyFactories () const
 retrieve proxy factory list More...
 
void removeProxyFactory (QNetworkProxyFactory *factory)
 remove a factory from the proxy factories list More...
 
void setFallbackProxyAndExcludes (const QNetworkProxy &proxy, const QStringList &excludes)
 set fallback proxy and URL that shouldn't use it. More...
 
void setupDefaultProxyAndCache ()
 Setup the NAM according to the user's settings. More...
 
bool useSystemProxy () const
 return whether the system proxy should be used More...
 

Static Public Member Functions

static QNetworkRequest::CacheLoadControl cacheLoadControlFromName (const QString &theName)
 Get QNetworkRequest::CacheLoadControl from name. More...
 
static QString cacheLoadControlName (QNetworkRequest::CacheLoadControl theControl)
 Get name for QNetworkRequest::CacheLoadControl. More...
 
static QgsNetworkAccessManagerinstance ()
 returns a pointer to the single instance More...
 

Protected Member Functions

virtual QNetworkReply * createRequest (QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData=nullptr) override
 

Detailed Description

network access manager for QGIS

Since
1.5

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.

Definition at line 44 of file qgsnetworkaccessmanager.h.

Constructor & Destructor Documentation

QgsNetworkAccessManager::QgsNetworkAccessManager ( QObject *  parent = nullptr)

Definition at line 117 of file qgsnetworkaccessmanager.cpp.

QgsNetworkAccessManager::~QgsNetworkAccessManager ( )

destructor

Definition at line 125 of file qgsnetworkaccessmanager.cpp.

Member Function Documentation

QNetworkRequest::CacheLoadControl QgsNetworkAccessManager::cacheLoadControlFromName ( const QString &  theName)
static

Get QNetworkRequest::CacheLoadControl from name.

Definition at line 267 of file qgsnetworkaccessmanager.cpp.

QString QgsNetworkAccessManager::cacheLoadControlName ( QNetworkRequest::CacheLoadControl  theControl)
static

Get name for QNetworkRequest::CacheLoadControl.

Definition at line 249 of file qgsnetworkaccessmanager.cpp.

QNetworkReply * QgsNetworkAccessManager::createRequest ( QNetworkAccessManager::Operation  op,
const QNetworkRequest &  req,
QIODevice *  outgoingData = nullptr 
)
overrideprotectedvirtual

Definition at line 173 of file qgsnetworkaccessmanager.cpp.

const QStringList & QgsNetworkAccessManager::excludeList ( ) const

retrieve exclude list (urls shouldn't use the fallback proxy)

Definition at line 144 of file qgsnetworkaccessmanager.cpp.

const QNetworkProxy & QgsNetworkAccessManager::fallbackProxy ( ) const

retrieve fall back proxy (for urls that no factory returned proxies for)

Definition at line 149 of file qgsnetworkaccessmanager.cpp.

void QgsNetworkAccessManager::insertProxyFactory ( QNetworkProxyFactory *  factory)

insert a factory into the proxy factories list

Definition at line 129 of file qgsnetworkaccessmanager.cpp.

QgsNetworkAccessManager * QgsNetworkAccessManager::instance ( )
static

returns a pointer to the single instance

Definition at line 103 of file qgsnetworkaccessmanager.cpp.

const QList< QNetworkProxyFactory * > QgsNetworkAccessManager::proxyFactories ( ) const

retrieve proxy factory list

Definition at line 139 of file qgsnetworkaccessmanager.cpp.

void QgsNetworkAccessManager::removeProxyFactory ( QNetworkProxyFactory *  factory)

remove a factory from the proxy factories list

Definition at line 134 of file qgsnetworkaccessmanager.cpp.

void QgsNetworkAccessManager::requestAboutToBeCreated ( QNetworkAccessManager::Operation  ,
const QNetworkRequest &  ,
QIODevice *   
)
signal
void QgsNetworkAccessManager::requestCreated ( QNetworkReply *  )
signal
void QgsNetworkAccessManager::requestTimedOut ( QNetworkReply *  )
signal
void QgsNetworkAccessManager::setFallbackProxyAndExcludes ( const QNetworkProxy &  proxy,
const QStringList &  excludes 
)

set fallback proxy and URL that shouldn't use it.

Definition at line 154 of file qgsnetworkaccessmanager.cpp.

void QgsNetworkAccessManager::setupDefaultProxyAndCache ( )

Setup the NAM according to the user's settings.

Definition at line 288 of file qgsnetworkaccessmanager.cpp.

bool QgsNetworkAccessManager::useSystemProxy ( ) const
inline

return whether the system proxy should be used

Definition at line 86 of file qgsnetworkaccessmanager.h.


The documentation for this class was generated from the following files: