Qt 4.8
qnetworkaccessmanager_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtNetwork module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QNETWORKACCESSMANAGER_P_H
43 #define QNETWORKACCESSMANAGER_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists for the convenience
50 // of the Network Access API. This header file may change from
51 // version to version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "qnetworkaccessmanager.h"
57 #include "qnetworkaccesscache_p.h"
59 #include "private/qobject_p.h"
60 #include "QtNetwork/qnetworkproxy.h"
61 #include "QtNetwork/qnetworksession.h"
63 
65 
66 class QAuthenticator;
69 class QNetworkCookieJar;
70 
72 {
73 public:
75  : networkCache(0), cookieJar(0),
76  httpThread(0),
77 #ifndef QT_NO_NETWORKPROXY
78  proxyFactory(0),
79 #endif
80 #ifndef QT_NO_BEARERMANAGEMENT
84  online(false),
85  initializeSession(true),
86 #endif
87  cookieJarCreated(false),
89  { }
91 
92  void _q_replyFinished();
93  void _q_replySslErrors(const QList<QSslError> &errors);
95  void createCookieJar() const;
96 
97  void authenticationRequired(QNetworkAccessBackend *backend, QAuthenticator *authenticator);
98  void cacheCredentials(const QUrl &url, const QAuthenticator *auth);
100  const QAuthenticator *auth = 0);
101 
102 #ifndef QT_NO_NETWORKPROXY
104  QAuthenticator *authenticator);
105  void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth);
107  const QAuthenticator *auth = 0);
109 #endif
110 
112 
113 #ifndef QT_NO_BEARERMANAGEMENT
114  void createSession(const QNetworkConfiguration &config);
116 
120  bool isSeamless);
122 #endif
123 
125 
126  // this is the cache for storing downloaded files
128 
130 
132 
133 
134 #ifndef QT_NO_NETWORKPROXY
137 #endif
138 
139 #ifndef QT_NO_BEARERMANAGEMENT
146  bool online;
148 #endif
149 
151 
152  // The cache with authorization data:
154 
155  // this cache can be used by individual backends to cache e.g. their TCP connections to a server
156  // and use the connections for multiple requests.
159  { return &backend->manager->objectCache; }
160  Q_AUTOTEST_EXPORT static void clearCache(QNetworkAccessManager *manager);
161 
163 };
164 
166 
167 #endif
void _q_replySslErrors(const QList< QSslError > &errors)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
Definition: qnetworkreply.h:65
Operation
Indicates the operation this reply is processing.
State
This enum describes the connectivity state of the session.
void proxyAuthenticationRequired(QNetworkAccessBackend *backend, const QNetworkProxy &proxy, QAuthenticator *authenticator)
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QNetworkProxyFactory class provides fine-grained proxy selection.
void createSession(const QNetworkConfiguration &config)
QWeakPointer< QNetworkSession > networkSessionWeakRef
QSharedPointer< QNetworkSession > getNetworkSession() const
QNetworkRequest prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart)
QNetworkAuthenticationCredential * fetchCachedProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth=0)
NetworkAccessibility
Indicates whether the network is accessible via this network access manager.
QNetworkAccessManagerPrivate * manager
The QNetworkProxy class provides a network layer proxy.
void cacheCredentials(const QUrl &url, const QAuthenticator *auth)
The QNetworkConfiguration class provides an abstraction of one or more access point configurations...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
void _q_networkSessionNewConfigurationActivated()
static QNetworkAccessCache * getObjectCache(QNetworkAccessBackend *backend)
QNetworkAccessManager::NetworkAccessibility networkAccessible
void _q_networkSessionPreferredConfigurationChanged(const QNetworkConfiguration &config, bool isSeamless)
The QNetworkAccessManager class allows the application to send network requests and receive replies...
#define QT_NO_NETWORKPROXY
The QAuthenticator class provides an authentication object.
QSharedPointer< QNetworkAccessAuthenticationManager > authenticationManager
The QNetworkCookieJar class implements a simple jar of QNetworkCookie objects.
The QNetworkProxyQuery class is used to query the proxy settings for a socket.
Definition: qnetworkproxy.h:60
static Q_AUTOTEST_EXPORT void clearCache(QNetworkAccessManager *manager)
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
The QNetworkSession class provides control over the system&#39;s access points and enables session manage...
void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth)
QNetworkReply * postProcess(QNetworkReply *reply)
QNetworkAuthenticationCredential * fetchCachedCredentials(const QUrl &url, const QAuthenticator *auth=0)
#define Q_AUTOTEST_EXPORT
Definition: qglobal.h:1510
The QHttpMultiPart class resembles a MIME multipart message to be sent over HTTP. ...
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
void authenticationRequired(QNetworkAccessBackend *backend, QAuthenticator *authenticator)
QNetworkAccessBackend * findBackend(QNetworkAccessManager::Operation op, const QNetworkRequest &request)
void _q_networkSessionStateChanged(QNetworkSession::State state)
QNetworkSession::State lastSessionState
QAbstractNetworkCache * networkCache
QList< QNetworkProxy > queryProxy(const QNetworkProxyQuery &query)
The QThread class provides a platform-independent way to manage threads.
Definition: qthread.h:59
The QAbstractNetworkCache class provides the interface for cache implementations. ...
QSharedPointer< QNetworkSession > networkSessionStrongRef