1QNetworkOperation(3qt) QNetworkOperation(3qt)
2
3
4
6 QNetworkOperation - Common operations for network protocols
7
9 #include <qnetworkprotocol.h>
10
11 Inherits QObject.
12
13 Public Members
14 QNetworkOperation ( QNetworkProtocol::Operation operation, const
15 QString & arg0, const QString & arg1, const QString & arg2 )
16 QNetworkOperation ( QNetworkProtocol::Operation operation, const
17 QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2
18 )
19 ~QNetworkOperation ()
20 void setState ( QNetworkProtocol::State state )
21 void setProtocolDetail ( const QString & detail )
22 void setErrorCode ( int ec )
23 void setArg ( int num, const QString & arg )
24 void setRawArg ( int num, const QByteArray & arg )
25 QNetworkProtocol::Operation operation () const
26 QNetworkProtocol::State state () const
27 QString arg ( int num ) const
28 QByteArray rawArg ( int num ) const
29 QString protocolDetail () const
30 int errorCode () const
31 void free ()
32
34 The QNetworkOperation class provides common operations for network
35 protocols.
36
37 An object is created to describe the operation and the current state
38 for each operation that a network protocol should process.
39
40 For a detailed description of the Qt Network Architecture and how to
41 implement and use network protocols in Qt, see the Qt Network
42 Documentation.
43
44 See also QNetworkProtocol and Input/Output and Networking.
45
48 const QString & arg0, const QString & arg1, const QString & arg2 )
49 Constructs a network operation object. operation is the type of the
50 operation, and arg0, arg1 and arg2 are the first three arguments of the
51 operation. The state is initialized to QNetworkProtocol::StWaiting.
52
53 See also QNetworkProtocol::Operation and QNetworkProtocol::State.
54
56 const QByteArray & arg0, const QByteArray & arg1, const QByteArray &
57 arg2 )
58 Constructs a network operation object. operation is the type of the
59 operation, and arg0, arg1 and arg2 are the first three raw data
60 arguments of the operation. The state is initialized to
61 QNetworkProtocol::StWaiting.
62
63 See also QNetworkProtocol::Operation and QNetworkProtocol::State.
64
66 Destructor.
67
69 Returns the operation's num-th argument. If this argument was not
70 already set, an empty string is returned.
71
72 Example: network/networkprotocol/nntp.cpp.
73
75 Returns the error code for the last error that occurred.
76
78 Sets this object to delete itself when it hasn't been used for one
79 second.
80
81 Because QNetworkOperation pointers are passed around a lot the
82 QNetworkProtocol generally does not have enough knowledge to delete
83 these at the correct time. If a QNetworkProtocol doesn't need an
84 operation any more it will call this function instead.
85
86 Note: you should never need to call the method yourself.
87
89 Returns the type of the operation.
90
92 Returns a detailed error message for the last error. This must have
93 been set using setProtocolDetail().
94
96 Returns the operation's num-th raw data argument. If this argument was
97 not already set, an empty bytearray is returned.
98
100 Sets the network operation's num-th argument to arg.
101
103 Sets the error code to ec.
104
105 If the operation failed, the protocol should set an error code to
106 describe the error in more detail. If possible, one of the error codes
107 defined in QNetworkProtocol should be used.
108
109 See also setProtocolDetail() and QNetworkProtocol::Error.
110
112 If the operation failed, the error message can be specified as detail.
113
115 Sets the network operation's num-th raw data argument to arg.
116
118 Sets the state of the operation object. This should be done by the
119 network protocol during processing; at the end it should be set to
120 QNetworkProtocol::StDone or QNetworkProtocol::StFailed, depending on
121 success or failure.
122
123 See also QNetworkProtocol::State.
124
126 Returns the state of the operation. You can determine whether an
127 operation is still waiting to be processed, is being processed, has
128 been processed successfully, or failed.
129
130
132 http://doc.trolltech.com/qnetworkoperation.html
133 http://www.trolltech.com/faq/tech.html
134
136 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
137 license file included in the distribution for a complete license
138 statement.
139
141 Generated automatically from the source code.
142
144 If you find a bug in Qt, please report it as described in
145 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
146 help you. Thank you.
147
148 The definitive Qt documentation is provided in HTML format; it is
149 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
150 web browser. This man page is provided as a convenience for those users
151 who prefer man pages, although this format is not officially supported
152 by Trolltech.
153
154 If you find errors in this manual page, please report them to qt-
155 bugs@trolltech.com. Please include the name of the manual page
156 (qnetworkoperation.3qt) and the Qt version (3.3.8).
157
158
159
160Trolltech AS 2 February 2007 QNetworkOperation(3qt)