summaryrefslogtreecommitdiffstats
path: root/python/pyqt/sip/qt/qnetworkprotocol.sip
blob: 67ccc7f1fffc9c05c73dfa231770b16473282cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
// This is the SIP interface definition for QNetworkOperation, QNetworkProtocol
// and QNetworkProtocolFactoryBase.
//
// Copyright (c) 2007
// 	Riverbank Computing Limited <info@riverbankcomputing.co.uk>
// 
// This file is part of PyQt.
// 
// This copy of PyQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
// 
// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
// details.
// 
// You should have received a copy of the GNU General Public License along with
// PyQt; see the file LICENSE.  If not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


%ExportedDoc
<Sect2><Title>QNetworkOperation (Qt v2.1+)</Title>
<Para>
<Literal>QNetworkOperation</Literal> is fully implemented.
</Para>
</Sect2>

<Sect2><Title>QNetworkProtocol (Qt v2.1+)</Title>
<Para>
<Literal>QNetworkProtocol</Literal> is fully implemented.
</Para>
</Sect2>

<Sect2><Title>QNetworkProtocolFactoryBase (Qt v2.1+)</Title>
<Para>
<Literal>QNetworkProtocolFactoryBase</Literal> is fully implemented.
</Para>
</Sect2>
%End


%If (Qt_NETWORKPROTOCOL)
%If (Qt_2_1_0 -)

class QNetworkProtocolFactoryBase
{
%TypeHeaderCode
#include <qnetworkprotocol.h>
%End

public:
	virtual QNetworkProtocol *createObject() = 0 /Factory/;

};


class QNetworkProtocol : QObject
{
%TypeHeaderCode
#include <qnetworkprotocol.h>
%End

public:
	enum State {
		StWaiting,
		StInProgress,
		StDone,
		StFailed,
		StStopped
	};

%If (- Qt_3_0_0)
	enum Operation {
		OpListChildren,
		OpMkdir,
		OpRemove,
		OpRename,
		OpGet,
		OpPut
	};
%End
%If (Qt_3_0_0 -)
	enum Operation {
		OpListChildren,
		OpMkDir,
		OpRemove,
		OpRename,
		OpGet,
		OpPut
	};
%End

	enum ConnectionState {
		ConHostFound,
		ConConnected,
		ConClosed
	};

%If (- Qt_3_0_0)
	enum Error {
		NoError,
		ErrValid,
		ErrUnknownProtocol,
		ErrUnsupported,
		ErrParse,
		ErrLoginIncorrect,
		ErrHostNotFound,
		ErrListChlidren,
		ErrMkdir,
		ErrRemove,
		ErrRename,
		ErrGet,
		ErrPut,
		ErrFileNotExisting,
		ErrPermissionDenied
	};
%End
%If (Qt_3_0_0 -)
	enum Error {
		NoError,
		ErrValid,
		ErrUnknownProtocol,
		ErrUnsupported,
		ErrParse,
		ErrLoginIncorrect,
		ErrHostNotFound,
		ErrListChildren,
		ErrMkDir,
		ErrRemove,
		ErrRename,
		ErrGet,
		ErrPut,
		ErrFileNotExisting,
		ErrPermissionDenied
	};
%End

	QNetworkProtocol();

	virtual void setUrl(QUrlOperator *);

	virtual void setAutoDelete(bool,int = 10000);
	bool autoDelete() const;

	static void registerNetworkProtocol(const QString &,
					    QNetworkProtocolFactoryBase *);
	static QNetworkProtocol *getNetworkProtocol(const QString &) /Factory/;
	static bool hasOnlyLocalFileSystem();

	virtual int supportedOperations() const;
	virtual void addOperation(QNetworkOperation *);

	QUrlOperator *url() const;
	QNetworkOperation *operationInProgress() const;
	virtual void clearOperationQueue();
	virtual void stop();

signals:
	void data(const QByteArray &,QNetworkOperation *);
	void connectionStateChanged(int,const QString &);
	void finished(QNetworkOperation *);
	void start(QNetworkOperation *);
	void newChildren(const QValueList<QUrlInfo> &,QNetworkOperation *);
	void newChild(const QUrlInfo &,QNetworkOperation *);
	void createdDirectory(const QUrlInfo &,QNetworkOperation *);
	void removed(QNetworkOperation *);
	void itemChanged(QNetworkOperation *);
	void dataTransferProgress(int,int,QNetworkOperation *);

protected:
	virtual void processOperation(QNetworkOperation *);
	virtual void operationListChildren(QNetworkOperation *);
	virtual void operationMkDir(QNetworkOperation *);
	virtual void operationRemove(QNetworkOperation *);
	virtual void operationRename(QNetworkOperation *);
	virtual void operationGet(QNetworkOperation *);
	virtual void operationPut(QNetworkOperation *);
%If (Qt_3_0_0 -)
	virtual void operationPutChunk(QNetworkOperation *);
%End
	virtual bool checkConnection(QNetworkOperation *);

private:
%If (Qt_3_1_0 -)
	QNetworkProtocol(const QNetworkProtocol &);
%End
};


class QNetworkOperation : QObject
{
%TypeHeaderCode
#include <qnetworkprotocol.h>
%End

public:
	QNetworkOperation(QNetworkProtocol::Operation,const QString &,
			  const QString &,const QString &);
	QNetworkOperation(QNetworkProtocol::Operation,const QByteArray &,
			  const QByteArray &,const QByteArray &);

	void setState(QNetworkProtocol::State);
	void setProtocolDetail(const QString &);
	void setErrorCode(int);
	void setArg(int,const QString &);
	void setRawArg(int,const QByteArray &);

	QNetworkProtocol::Operation operation() const;
	QNetworkProtocol::State state() const;
	QString arg(int) const;
	QByteArray rawArg(int) const;
	QString protocolDetail() const;
	int errorCode() const;

	void free();

private:
%If (Qt_3_1_0 -)
	QNetworkOperation(const QNetworkOperation &);
%End
};

%End
%End