1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/network/q3networkprotocol.cpp -->
7
<title>Qt 4.0: Q3NetworkOperation Class Reference</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3NetworkOperation Class Reference</h1>
21
<p>The Q3NetworkOperation class provides common operations for network protocols. <a href="#details">More...</a></p>
22
<pre>#include <Q3NetworkOperation></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
24
<p>Inherits <a href="qobject.html">QObject</a>.</p>
26
<li><a href="q3networkoperation-members.html">List of all members, including inherited members</a></li>
28
<a name="public-functions"></a>
29
<h3>Public Functions</h3>
31
<li><div class="fn"/><b><a href="q3networkoperation.html#Q3NetworkOperation">Q3NetworkOperation</a></b> ( Q3NetworkProtocol::Operation <i>operation</i>, const QString & <i>arg0</i>, const QString & <i>arg1</i>, const QString & <i>arg2</i> )</li>
32
<li><div class="fn"/><b><a href="q3networkoperation.html#Q3NetworkOperation-2">Q3NetworkOperation</a></b> ( Q3NetworkProtocol::Operation <i>operation</i>, const QByteArray & <i>arg0</i>, const QByteArray & <i>arg1</i>, const QByteArray & <i>arg2</i> )</li>
33
<li><div class="fn"/><b><a href="q3networkoperation.html#dtor.Q3NetworkOperation">~Q3NetworkOperation</a></b> ()</li>
34
<li><div class="fn"/>QString <b><a href="q3networkoperation.html#arg">arg</a></b> ( int <i>num</i> ) const</li>
35
<li><div class="fn"/>int <b><a href="q3networkoperation.html#errorCode">errorCode</a></b> () const</li>
36
<li><div class="fn"/>void <b><a href="q3networkoperation.html#free">free</a></b> ()</li>
37
<li><div class="fn"/>Q3NetworkProtocol::Operation <b><a href="q3networkoperation.html#operation">operation</a></b> () const</li>
38
<li><div class="fn"/>QString <b><a href="q3networkoperation.html#protocolDetail">protocolDetail</a></b> () const</li>
39
<li><div class="fn"/>QByteArray <b><a href="q3networkoperation.html#rawArg">rawArg</a></b> ( int <i>num</i> ) const</li>
40
<li><div class="fn"/>void <b><a href="q3networkoperation.html#setArg">setArg</a></b> ( int <i>num</i>, const QString & <i>arg</i> )</li>
41
<li><div class="fn"/>void <b><a href="q3networkoperation.html#setErrorCode">setErrorCode</a></b> ( int <i>ec</i> )</li>
42
<li><div class="fn"/>void <b><a href="q3networkoperation.html#setProtocolDetail">setProtocolDetail</a></b> ( const QString & <i>detail</i> )</li>
43
<li><div class="fn"/>void <b><a href="q3networkoperation.html#setRawArg">setRawArg</a></b> ( int <i>num</i>, const QByteArray & <i>arg</i> )</li>
44
<li><div class="fn"/>void <b><a href="q3networkoperation.html#setState">setState</a></b> ( Q3NetworkProtocol::State <i>state</i> )</li>
45
<li><div class="fn"/>Q3NetworkProtocol::State <b><a href="q3networkoperation.html#state">state</a></b> () const</li>
48
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
50
<h3>Additional Inherited Members</h3>
52
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
53
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
54
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
55
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
56
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
58
<a name="details"></a>
60
<h2>Detailed Description</h2>
61
<p>The Q3NetworkOperation class provides common operations for network protocols.</p>
62
<p>An object is created to describe the operation and the current state for each operation that a network protocol should process.</p>
63
<p>See also <a href="q3networkprotocol.html">Q3NetworkProtocol</a>.</p>
65
<h2>Member Function Documentation</h2>
66
<h3 class="fn"><a name="Q3NetworkOperation"></a>Q3NetworkOperation::Q3NetworkOperation ( <a href="q3networkprotocol.html#Operation-enum">Q3NetworkProtocol::Operation</a> <i>operation</i>, const <a href="qstring.html">QString</a> & <i>arg0</i>, const <a href="qstring.html">QString</a> & <i>arg1</i>, const <a href="qstring.html">QString</a> & <i>arg2</i> )</h3>
67
<p>Constructs a network operation object. <i>operation</i> is the type of the operation, and <i>arg0</i>, <i>arg1</i> and <i>arg2</i> are the first three arguments of the operation. The state is initialized to <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::StWaiting</a>.</p>
68
<p>See also <a href="q3networkprotocol.html#Operation-enum">Q3NetworkProtocol::Operation</a> and <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::State</a>.</p>
69
<h3 class="fn"><a name="Q3NetworkOperation-2"></a>Q3NetworkOperation::Q3NetworkOperation ( <a href="q3networkprotocol.html#Operation-enum">Q3NetworkProtocol::Operation</a> <i>operation</i>, const <a href="qbytearray.html">QByteArray</a> & <i>arg0</i>, const <a href="qbytearray.html">QByteArray</a> & <i>arg1</i>, const <a href="qbytearray.html">QByteArray</a> & <i>arg2</i> )</h3>
70
<p>Constructs a network operation object. <i>operation</i> is the type of the operation, and <i>arg0</i>, <i>arg1</i> and <i>arg2</i> are the first three raw data arguments of the operation. The state is initialized to <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::StWaiting</a>.</p>
71
<p>See also <a href="q3networkprotocol.html#Operation-enum">Q3NetworkProtocol::Operation</a> and <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::State</a>.</p>
72
<h3 class="fn"><a name="dtor.Q3NetworkOperation"></a>Q3NetworkOperation::~Q3NetworkOperation ()</h3>
74
<h3 class="fn"><a name="arg"></a><a href="qstring.html">QString</a> Q3NetworkOperation::arg ( int <i>num</i> ) const</h3>
75
<p>Returns the operation's <i>num</i>-th argument. If this argument was not already set, an empty string is returned.</p>
76
<h3 class="fn"><a name="errorCode"></a>int Q3NetworkOperation::errorCode () const</h3>
77
<p>Returns the error code for the last error that occurred.</p>
78
<h3 class="fn"><a name="free"></a>void Q3NetworkOperation::free ()</h3>
79
<p>Sets this object to delete itself when it hasn't been used for one second.</p>
80
<p>Because <a href="q3networkoperation.html">Q3NetworkOperation</a> pointers are passed around a lot the <a href="q3networkprotocol.html">Q3NetworkProtocol</a> generally does not have enough knowledge to delete these at the correct time. If a <a href="q3networkprotocol.html">Q3NetworkProtocol</a> doesn't need an operation any more it will call this function instead.</p>
81
<p>Note: you should never need to call the method yourself.</p>
82
<h3 class="fn"><a name="operation"></a><a href="q3networkprotocol.html#Operation-enum">Q3NetworkProtocol::Operation</a> Q3NetworkOperation::operation () const</h3>
83
<p>Returns the type of the operation.</p>
84
<h3 class="fn"><a name="protocolDetail"></a><a href="qstring.html">QString</a> Q3NetworkOperation::protocolDetail () const</h3>
85
<p>Returns a detailed error message for the last error. This must have been set using <a href="q3networkoperation.html#setProtocolDetail">setProtocolDetail</a>().</p>
86
<h3 class="fn"><a name="rawArg"></a><a href="qbytearray.html">QByteArray</a> Q3NetworkOperation::rawArg ( int <i>num</i> ) const</h3>
87
<p>Returns the operation's <i>num</i>-th raw data argument. If this argument was not already set, an empty bytearray is returned.</p>
88
<h3 class="fn"><a name="setArg"></a>void Q3NetworkOperation::setArg ( int <i>num</i>, const <a href="qstring.html">QString</a> & <i>arg</i> )</h3>
89
<p>Sets the network operation's <i>num</i>-th argument to <i>arg</i>.</p>
90
<h3 class="fn"><a name="setErrorCode"></a>void Q3NetworkOperation::setErrorCode ( int <i>ec</i> )</h3>
91
<p>Sets the error code to <i>ec</i>.</p>
92
<p>If the operation failed, the protocol should set an error code to describe the error in more detail. If possible, one of the error codes defined in <a href="q3networkprotocol.html">Q3NetworkProtocol</a> should be used.</p>
93
<p>See also <a href="q3networkoperation.html#setProtocolDetail">setProtocolDetail</a>() and <a href="q3networkprotocol.html#Error-enum">Q3NetworkProtocol::Error</a>.</p>
94
<h3 class="fn"><a name="setProtocolDetail"></a>void Q3NetworkOperation::setProtocolDetail ( const <a href="qstring.html">QString</a> & <i>detail</i> )</h3>
95
<p>If the operation failed, the error message can be specified as <i>detail</i>.</p>
96
<h3 class="fn"><a name="setRawArg"></a>void Q3NetworkOperation::setRawArg ( int <i>num</i>, const <a href="qbytearray.html">QByteArray</a> & <i>arg</i> )</h3>
97
<p>Sets the network operation's <i>num</i>-th raw data argument to <i>arg</i>.</p>
98
<h3 class="fn"><a name="setState"></a>void Q3NetworkOperation::setState ( <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::State</a> <i>state</i> )</h3>
99
<p>Sets the <i>state</i> of the operation object. This should be done by the network protocol during processing; at the end it should be set to <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::StDone</a> or <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::StFailed</a>, depending on success or failure.</p>
100
<p>See also <a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::State</a>.</p>
101
<h3 class="fn"><a name="state"></a><a href="q3networkprotocol.html#State-enum">Q3NetworkProtocol::State</a> Q3NetworkOperation::state () const</h3>
102
<p>Returns the state of the operation. You can determine whether an operation is still waiting to be processed, is being processed, has been processed successfully, or failed.</p>
103
<p /><address><hr /><div align="center">
104
<table width="100%" cellspacing="0" border="0"><tr class="address">
105
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
106
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
107
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
108
</tr></table></div></address></body>