source: trunk/doc/html/qnetworkprotocol-h.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.7 KB
RevLine 
[190]1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qnetworkprotocol.h:1 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>qnetworkprotocol.h Include File</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qnetworkprotocol.h</h1>
33
34<p>This is the verbatim text of the qnetworkprotocol.h include file. It is provided only for illustration; the copyright remains with Trolltech.
35<hr>
36<pre>
37/****************************************************************************
38** $Id: qnetworkprotocol-h.html 2051 2007-02-21 10:04:20Z chehrlic $
39**
40** Definition of QNetworkProtocol class
41**
42** Created : 950429
43**
44** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
45**
46** This file is part of the kernel module of the Qt GUI Toolkit.
47**
48** This file may be distributed under the terms of the Q Public License
49** as defined by Trolltech ASA of Norway and appearing in the file
50** LICENSE.QPL included in the packaging of this file.
51**
52** This file may be distributed and/or modified under the terms of the
53** GNU General Public License version 2 as published by the Free Software
54** Foundation and appearing in the file LICENSE.GPL included in the
55** packaging of this file.
56**
57** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
58** licenses may use this file in accordance with the Qt Commercial License
59** Agreement provided with the Software.
60**
61** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
62** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
63**
64** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
65** information about Qt Commercial License Agreements.
66** See http://www.trolltech.com/qpl/ for QPL licensing information.
67** See http://www.trolltech.com/gpl/ for GPL licensing information.
68**
69** Contact info@trolltech.com if any conditions of this licensing are
70** not clear to you.
71**
72**********************************************************************/
73
74#ifndef QNETWORKPROTOCOL_H
75#define QNETWORKPROTOCOL_H
76
77#ifndef QT_H
78#include "qurlinfo.h"
79#include "qstring.h"
80#include "qdict.h"
81#include "qobject.h"
82#endif // QT_H
83
84#ifndef QT_NO_NETWORKPROTOCOL
85
86#if __GNUC__ - 0 &gt; 3
87#pragma GCC system_header
88#endif
89
90class QNetworkProtocol;
91class QNetworkOperation;
92class QTimer;
93class QUrlOperator;
94class QNetworkProtocolPrivate;
95template &lt;class T&gt; class QValueList;
96
97class Q_EXPORT QNetworkProtocolFactoryBase
98{
99public:
100 virtual QNetworkProtocol *createObject() = 0;
101
102};
103
104template&lt; class T &gt;
105class QNetworkProtocolFactory : public QNetworkProtocolFactoryBase
106{
107public:
108 QNetworkProtocol *createObject() {
109 return new T;
110 }
111
112};
113
114typedef QDict&lt; QNetworkProtocolFactoryBase &gt; QNetworkProtocolDict;
115
116class Q_EXPORT QNetworkProtocol : public QObject
117{
118 Q_OBJECT
119
120public:
121 enum State {
122 StWaiting = 0,
123 StInProgress,
124 StDone,
125 StFailed,
126 StStopped
127 };
128
129 enum Operation {
130 OpListChildren = 1,
131 OpMkDir = 2,
132 OpMkdir = OpMkDir, // ### remove in 4.0
133 OpRemove = 4,
134 OpRename = 8,
135 OpGet = 32,
136 OpPut = 64
137 };
138
139 enum ConnectionState {
140 ConHostFound,
141 ConConnected,
142 ConClosed
143 };
144
145 enum Error {
146 // no error
147 NoError = 0,
148 // general errors
149 ErrValid,
150 ErrUnknownProtocol,
151 ErrUnsupported,
152 ErrParse,
153 // errors on connect
154 ErrLoginIncorrect,
155 ErrHostNotFound,
156 // protocol errors
157 ErrListChildren,
158 ErrListChlidren = ErrListChildren, // ### remove in 4.0
159 ErrMkDir,
160 ErrMkdir = ErrMkDir, // ### remove in 4.0
161 ErrRemove,
162 ErrRename,
163 ErrGet,
164 ErrPut,
165 ErrFileNotExisting,
166 ErrPermissionDenied
167 };
168
169 QNetworkProtocol();
170 virtual ~QNetworkProtocol();
171
172 virtual void setUrl( QUrlOperator *u );
173
174 virtual void setAutoDelete( bool b, int i = 10000 );
175 bool autoDelete() const;
176
177 static void registerNetworkProtocol( const QString &amp;protocol,
178 QNetworkProtocolFactoryBase *protocolFactory );
179 static QNetworkProtocol *getNetworkProtocol( const QString &amp;protocol );
180 static bool hasOnlyLocalFileSystem();
181
182 virtual int supportedOperations() const;
183 virtual void addOperation( QNetworkOperation *op );
184
185 QUrlOperator *url() const;
186 QNetworkOperation *operationInProgress() const;
187 virtual void clearOperationQueue();
188 virtual void stop();
189
190signals:
191 void data( const QByteArray &amp;, QNetworkOperation *res );
192 void connectionStateChanged( int state, const QString &amp;data );
193 void finished( QNetworkOperation *res );
194 void start( QNetworkOperation *res );
195 void newChildren( const QValueList&lt;QUrlInfo&gt; &amp;, QNetworkOperation *res );
196 void newChild( const QUrlInfo &amp;, QNetworkOperation *res );
197 void createdDirectory( const QUrlInfo &amp;, QNetworkOperation *res );
198 void removed( QNetworkOperation *res );
199 void itemChanged( QNetworkOperation *res );
200 void dataTransferProgress( int bytesDone, int bytesTotal, QNetworkOperation *res );
201
202protected:
203 virtual void processOperation( QNetworkOperation *op );
204 virtual void operationListChildren( QNetworkOperation *op );
205 virtual void operationMkDir( QNetworkOperation *op );
206 virtual void operationRemove( QNetworkOperation *op );
207 virtual void operationRename( QNetworkOperation *op );
208 virtual void operationGet( QNetworkOperation *op );
209 virtual void operationPut( QNetworkOperation *op );
210 virtual void operationPutChunk( QNetworkOperation *op );
211 virtual bool checkConnection( QNetworkOperation *op );
212
213private:
214 QNetworkProtocolPrivate *d;
215
216private slots:
217 void processNextOperation( QNetworkOperation *old );
218 void startOps();
219 void emitNewChildren( const QUrlInfo &amp;i, QNetworkOperation *op );
220
221 void removeMe();
222
223private: // Disabled copy constructor and operator=
224#if defined(Q_DISABLE_COPY)
225 QNetworkProtocol( const QNetworkProtocol &amp; );
226 QNetworkProtocol &amp;operator=( const QNetworkProtocol &amp; );
227#endif
228};
229
230class QNetworkOperationPrivate;
231
232class Q_EXPORT QNetworkOperation : public QObject
233{
234 Q_OBJECT
235 friend class QUrlOperator;
236
237public:
238 QNetworkOperation( QNetworkProtocol::Operation operation,
239 const QString &amp;arg0, const QString &amp;arg1,
240 const QString &amp;arg2 );
241 QNetworkOperation( QNetworkProtocol::Operation operation,
242 const QByteArray &amp;arg0, const QByteArray &amp;arg1,
243 const QByteArray &amp;arg2 );
244 ~QNetworkOperation();
245
246 void setState( QNetworkProtocol::State state );
247 void setProtocolDetail( const QString &amp;detail );
248 void setErrorCode( int ec );
249 void setArg( int num, const QString &amp;arg );
250 void setRawArg( int num, const QByteArray &amp;arg );
251
252 QNetworkProtocol::Operation operation() const;
253 QNetworkProtocol::State state() const;
254 QString arg( int num ) const;
255 QByteArray rawArg( int num ) const;
256 QString protocolDetail() const;
257 int errorCode() const;
258
259 void free();
260
261private slots:
262 void deleteMe();
263
264private:
265 QByteArray &amp;raw( int num ) const;
266 QNetworkOperationPrivate *d;
267
268private: // Disabled copy constructor and operator=
269#if defined(Q_DISABLE_COPY)
270 QNetworkOperation( const QNetworkOperation &amp; );
271 QNetworkOperation &amp;operator=( const QNetworkOperation &amp; );
272#endif
273};
274
275#endif // QT_NO_NETWORKPROTOCOL
276
277#endif // QNETWORKPROTOCOL_H
278</pre>
279<!-- eof -->
280<p><address><hr><div align=center>
281<table width=100% cellspacing=0 border=0><tr>
282<td>Copyright &copy; 2007
283<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
284<td align=right><div align=right>Qt 3.3.8</div>
285</table></div></address></body>
286</html>
Note: See TracBrowser for help on using the repository browser.