author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 01:19:32 +0300 | |
changeset 37 | 758a864f9613 |
parent 33 | 3e2da88830cd |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtNetwork module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QNETWORKREQUEST_H |
|
43 |
#define QNETWORKREQUEST_H |
|
44 |
||
45 |
#include <QtCore/QSharedDataPointer> |
|
46 |
#include <QtCore/QString> |
|
47 |
#include <QtCore/QUrl> |
|
48 |
#include <QtCore/QVariant> |
|
49 |
||
50 |
QT_BEGIN_HEADER |
|
51 |
||
52 |
QT_BEGIN_NAMESPACE |
|
53 |
||
54 |
QT_MODULE(Network) |
|
55 |
||
56 |
class QSslConfiguration; |
|
57 |
||
58 |
class QNetworkRequestPrivate; |
|
59 |
class Q_NETWORK_EXPORT QNetworkRequest |
|
60 |
{ |
|
61 |
public: |
|
62 |
enum KnownHeaders { |
|
63 |
ContentTypeHeader, |
|
64 |
ContentLengthHeader, |
|
65 |
LocationHeader, |
|
66 |
LastModifiedHeader, |
|
67 |
CookieHeader, |
|
68 |
SetCookieHeader |
|
69 |
}; |
|
70 |
enum Attribute { |
|
71 |
HttpStatusCodeAttribute, |
|
72 |
HttpReasonPhraseAttribute, |
|
73 |
RedirectionTargetAttribute, |
|
74 |
ConnectionEncryptedAttribute, |
|
75 |
CacheLoadControlAttribute, |
|
76 |
CacheSaveControlAttribute, |
|
77 |
SourceIsFromCacheAttribute, |
|
78 |
DoNotBufferUploadDataAttribute, |
|
79 |
HttpPipeliningAllowedAttribute, |
|
80 |
HttpPipeliningWasUsedAttribute, |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
81 |
CustomVerbAttribute, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
82 |
CookieLoadControlAttribute, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
83 |
AuthenticationReuseAttribute, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
84 |
CookieSaveControlAttribute, |
33
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
85 |
MaximumDownloadBufferSizeAttribute, // internal |
3e2da88830cd
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
86 |
DownloadBufferAttribute, // internal |
0 | 87 |
|
88 |
User = 1000, |
|
89 |
UserMax = 32767 |
|
90 |
}; |
|
91 |
enum CacheLoadControl { |
|
92 |
AlwaysNetwork, |
|
93 |
PreferNetwork, |
|
94 |
PreferCache, |
|
95 |
AlwaysCache |
|
96 |
}; |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
97 |
enum LoadControl { |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
98 |
Automatic = 0, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
99 |
Manual |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
100 |
}; |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
101 |
|
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
102 |
enum Priority { |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
103 |
HighPriority = 1, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
104 |
NormalPriority = 3, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
105 |
LowPriority = 5 |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
106 |
}; |
0 | 107 |
|
108 |
explicit QNetworkRequest(const QUrl &url = QUrl()); |
|
109 |
QNetworkRequest(const QNetworkRequest &other); |
|
110 |
~QNetworkRequest(); |
|
111 |
QNetworkRequest &operator=(const QNetworkRequest &other); |
|
112 |
||
113 |
bool operator==(const QNetworkRequest &other) const; |
|
114 |
inline bool operator!=(const QNetworkRequest &other) const |
|
115 |
{ return !operator==(other); } |
|
116 |
||
117 |
QUrl url() const; |
|
118 |
void setUrl(const QUrl &url); |
|
119 |
||
120 |
// "cooked" headers |
|
121 |
QVariant header(KnownHeaders header) const; |
|
122 |
void setHeader(KnownHeaders header, const QVariant &value); |
|
123 |
||
124 |
// raw headers: |
|
125 |
bool hasRawHeader(const QByteArray &headerName) const; |
|
126 |
QList<QByteArray> rawHeaderList() const; |
|
127 |
QByteArray rawHeader(const QByteArray &headerName) const; |
|
128 |
void setRawHeader(const QByteArray &headerName, const QByteArray &value); |
|
129 |
||
130 |
// attributes |
|
131 |
QVariant attribute(Attribute code, const QVariant &defaultValue = QVariant()) const; |
|
132 |
void setAttribute(Attribute code, const QVariant &value); |
|
133 |
||
134 |
#ifndef QT_NO_OPENSSL |
|
135 |
QSslConfiguration sslConfiguration() const; |
|
136 |
void setSslConfiguration(const QSslConfiguration &configuration); |
|
137 |
#endif |
|
138 |
||
139 |
void setOriginatingObject(QObject *object); |
|
140 |
QObject *originatingObject() const; |
|
141 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
142 |
Priority priority() const; |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
143 |
void setPriority(Priority priority); |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
144 |
|
0 | 145 |
private: |
146 |
QSharedDataPointer<QNetworkRequestPrivate> d; |
|
147 |
friend class QNetworkRequestPrivate; |
|
148 |
}; |
|
149 |
||
150 |
QT_END_NAMESPACE |
|
151 |
||
152 |
Q_DECLARE_METATYPE(QNetworkRequest) |
|
153 |
||
154 |
QT_END_HEADER |
|
155 |
||
156 |
#endif |