source: trunk/doc/html/qnetworkoperation.html@ 190

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

reference documentation added

File size: 9.9 KB
Line 
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/src/kernel/qnetworkprotocol.cpp:974 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QNetworkOperation Class</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>QNetworkOperation Class Reference<br><small>[<a href="network.html">network module</a>]</small></h1>
33
34<p>The QNetworkOperation class provides common operations for network protocols.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qnetworkprotocol-h.html">qnetworkprotocol.h</a>&gt;</tt>
37<p>Inherits <a href="qobject.html">QObject</a>.
38<p><a href="qnetworkoperation-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QNetworkOperation"><b>QNetworkOperation</b></a> ( QNetworkProtocol::Operation&nbsp;operation, const&nbsp;QString&nbsp;&amp;&nbsp;arg0, const&nbsp;QString&nbsp;&amp;&nbsp;arg1, const&nbsp;QString&nbsp;&amp;&nbsp;arg2 )</li>
42<li class=fn><a href="#QNetworkOperation-2"><b>QNetworkOperation</b></a> ( QNetworkProtocol::Operation&nbsp;operation, const&nbsp;QByteArray&nbsp;&amp;&nbsp;arg0, const&nbsp;QByteArray&nbsp;&amp;&nbsp;arg1, const&nbsp;QByteArray&nbsp;&amp;&nbsp;arg2 )</li>
43<li class=fn><a href="#~QNetworkOperation"><b>~QNetworkOperation</b></a> ()</li>
44<li class=fn>void <a href="#setState"><b>setState</b></a> ( QNetworkProtocol::State&nbsp;state )</li>
45<li class=fn>void <a href="#setProtocolDetail"><b>setProtocolDetail</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;detail )</li>
46<li class=fn>void <a href="#setErrorCode"><b>setErrorCode</b></a> ( int&nbsp;ec )</li>
47<li class=fn>void <a href="#setArg"><b>setArg</b></a> ( int&nbsp;num, const&nbsp;QString&nbsp;&amp;&nbsp;arg )</li>
48<li class=fn>void <a href="#setRawArg"><b>setRawArg</b></a> ( int&nbsp;num, const&nbsp;QByteArray&nbsp;&amp;&nbsp;arg )</li>
49<li class=fn>QNetworkProtocol::Operation <a href="#operation"><b>operation</b></a> () const</li>
50<li class=fn>QNetworkProtocol::State <a href="#state"><b>state</b></a> () const</li>
51<li class=fn>QString <a href="#arg"><b>arg</b></a> ( int&nbsp;num ) const</li>
52<li class=fn>QByteArray <a href="#rawArg"><b>rawArg</b></a> ( int&nbsp;num ) const</li>
53<li class=fn>QString <a href="#protocolDetail"><b>protocolDetail</b></a> () const</li>
54<li class=fn>int <a href="#errorCode"><b>errorCode</b></a> () const</li>
55<li class=fn>void <a href="#free"><b>free</b></a> ()</li>
56</ul>
57<hr><a name="details"></a><h2>Detailed Description</h2>
58
59
60<p> The QNetworkOperation class provides common operations for network protocols.
61
62<p>
63
64<p> An object is created to describe the operation and the current
65state for each operation that a network protocol should process.
66<p> For a detailed description of the Qt Network Architecture and how
67to implement and use network protocols in Qt, see the <a href="network.html">Qt Network Documentation</a>.
68<p> <p>See also <a href="qnetworkprotocol.html">QNetworkProtocol</a> and <a href="io.html">Input/Output and Networking</a>.
69
70<hr><h2>Member Function Documentation</h2>
71<h3 class=fn><a name="QNetworkOperation"></a>QNetworkOperation::QNetworkOperation ( <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a>&nbsp;operation, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;arg0, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;arg1, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;arg2 )
72</h3>
73Constructs a network operation object. <em>operation</em> is the type of
74the operation, and <em>arg0</em>, <em>arg1</em> and <em>arg2</em> are the first
75three arguments of the operation. The state is initialized to
76QNetworkProtocol::StWaiting.
77<p> <p>See also <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> and <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a>.
78
79<h3 class=fn><a name="QNetworkOperation-2"></a>QNetworkOperation::QNetworkOperation ( <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a>&nbsp;operation, const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;arg0, const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;arg1, const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;arg2 )
80</h3>
81Constructs a network operation object. <em>operation</em> is the type of
82the operation, and <em>arg0</em>, <em>arg1</em> and <em>arg2</em> are the first
83three raw data arguments of the operation. The state is
84initialized to QNetworkProtocol::StWaiting.
85<p> <p>See also <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> and <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a>.
86
87<h3 class=fn><a name="~QNetworkOperation"></a>QNetworkOperation::~QNetworkOperation ()
88</h3>
89Destructor.
90
91<h3 class=fn><a href="qstring.html">QString</a> <a name="arg"></a>QNetworkOperation::arg ( int&nbsp;num ) const
92</h3>
93Returns the operation's <em>num</em>-th argument. If this argument was
94not already set, an empty string is returned.
95
96<p>Example: <a href="networkprotocol-example.html#x672">network/networkprotocol/nntp.cpp</a>.
97<h3 class=fn>int <a name="errorCode"></a>QNetworkOperation::errorCode () const
98</h3>
99Returns the error code for the last error that occurred.
100
101<h3 class=fn>void <a name="free"></a>QNetworkOperation::free ()
102</h3>
103Sets this object to delete itself when it hasn't been used for one
104second.
105<p> Because QNetworkOperation pointers are passed around a lot the
106<a href="qnetworkprotocol.html">QNetworkProtocol</a> generally does not have enough knowledge to
107delete these at the correct time. If a QNetworkProtocol doesn't
108need an operation any more it will call this function instead.
109<p> Note: you should never need to call the method yourself.
110
111<h3 class=fn><a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> <a name="operation"></a>QNetworkOperation::operation () const
112</h3>
113Returns the type of the operation.
114
115<h3 class=fn><a href="qstring.html">QString</a> <a name="protocolDetail"></a>QNetworkOperation::protocolDetail () const
116</h3>
117Returns a detailed error message for the last error. This must
118have been set using <a href="#setProtocolDetail">setProtocolDetail</a>().
119
120<h3 class=fn><a href="qbytearray.html">QByteArray</a> <a name="rawArg"></a>QNetworkOperation::rawArg ( int&nbsp;num ) const
121</h3>
122Returns the operation's <em>num</em>-th raw data argument. If this
123argument was not already set, an empty bytearray is returned.
124
125<h3 class=fn>void <a name="setArg"></a>QNetworkOperation::setArg ( int&nbsp;num, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;arg )
126</h3>
127Sets the network operation's <em>num</em>-th argument to <em>arg</em>.
128
129<h3 class=fn>void <a name="setErrorCode"></a>QNetworkOperation::setErrorCode ( int&nbsp;ec )
130</h3>
131Sets the error code to <em>ec</em>.
132<p> If the operation failed, the protocol should set an error code to
133describe the error in more detail. If possible, one of the error
134codes defined in <a href="qnetworkprotocol.html">QNetworkProtocol</a> should be used.
135<p> <p>See also <a href="#setProtocolDetail">setProtocolDetail</a>() and <a href="qnetworkprotocol.html#Error-enum">QNetworkProtocol::Error</a>.
136
137<h3 class=fn>void <a name="setProtocolDetail"></a>QNetworkOperation::setProtocolDetail ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;detail )
138</h3>
139If the operation failed, the error message can be specified as <em>detail</em>.
140
141<h3 class=fn>void <a name="setRawArg"></a>QNetworkOperation::setRawArg ( int&nbsp;num, const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;arg )
142</h3>
143Sets the network operation's <em>num</em>-th raw data argument to <em>arg</em>.
144
145<h3 class=fn>void <a name="setState"></a>QNetworkOperation::setState ( <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a>&nbsp;state )
146</h3>
147Sets the <em>state</em> of the operation object. This should be done by
148the network protocol during processing; at the end it should be
149set to QNetworkProtocol::StDone or QNetworkProtocol::StFailed,
150depending on success or failure.
151<p> <p>See also <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a>.
152
153<h3 class=fn><a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a> <a name="state"></a>QNetworkOperation::state () const
154</h3>
155Returns the state of the operation. You can determine whether an
156operation is still waiting to be processed, is being processed,
157has been processed successfully, or failed.
158
159<!-- eof -->
160<hr><p>
161This file is part of the <a href="index.html">Qt toolkit</a>.
162Copyright &copy; 1995-2007
163<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
164<table width=100% cellspacing=0 border=0><tr>
165<td>Copyright &copy; 2007
166<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
167<td align=right><div align=right>Qt 3.3.8</div>
168</table></div></address></body>
169</html>
Note: See TracBrowser for help on using the repository browser.