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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QCopChannel Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QCopChannel Class Reference</h1><br clear="all">
<p>
This class provides communication capabilities between several clients.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qcopchannel_qws-h.html">qcopchannel_qws.h</a>></code>
<p>
Inherits <a href="qobject.html">QObject</a>.
<p><a href="qcopchannel-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#4b7c81"><b>QCopChannel</b></a>(constQCString&channel, QObject*parent=0, constchar*name=0)</div>
<li><div class="fn">virtual<a href="#f50d4d"><b>~QCopChannel</b></a>()</div>
<li><div class="fn">QCString<a href="#66dab8"><b>channel</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#fead71"><b>receive</b></a>(constQCString&msg, constQByteArray&data)</div>
</ul>
<h2>Signals</h2>
<ul>
<li><div class="fn">void<a href="#846bd4"><b>received</b></a>(constQCString&msg, constQByteArray&data)</div>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class="fn">bool<a href="#6a7c48"><b>isRegistered</b></a>(constQCString&channel)</div>
<li><div class="fn">bool<a href="#bcd4cb"><b>send</b></a>(constQCString&channel, constQCString&msg)</div>
<li><div class="fn">bool<a href="#21be7d"><b>send</b></a>(constQCString&channel, constQCString&msg, constQByteArray&data)</div>
<li><div class="fn">void<b>sendLocally</b>(constQCString&ch, constQCString&msg, constQByteArray&data)(internal)</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
This class provides communication capabilities between several clients.
<p>
The Qt Cop (QCOP) is a COmmunication Protocol, allowing clients to
communicate inside of the same address space or between different processes.
<p>Currently, this facility is only available on Qt/Embedded as on X11
and Windows we are exploring the use of existing standard such as
DCOP and COM.
<p>QCopChannel contains important functions like <a href="#21be7d">send</a>() and <a href="#6a7c48">isRegistered</a>()
which are static and therefore usable without an object.
<p>In order to <em>listen</em> to the traffic on the channel, you should either
subclass from QCopChannel and provide an re-implementation for <a href="#fead71">receive</a>(),
or you should <a href="qobject.html#7f8e37">connect</a>() to the <a href="#846bd4">received</a>() signal.
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="4b7c81"></a>QCopChannel::QCopChannel(const<a href="qcstring.html">QCString</a>&channel, <a href="qobject.html">QObject</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a QCop channel and registers it with the server under the name
<em>channel.</em> The standard <em>parent</em> and <em>name</em> arguments are passed on
to the <a href="qobject.html">QObject</a> constructor.
<h3 class="fn"><a name="f50d4d"></a>QCopChannel::~QCopChannel() <code>[virtual]</code></h3>
<p>Destructs the client's side end of the channel and notifies the server
about the closing. The server itself keeps the channel open until the
last registered client detaches.
<h3 class="fn"><a href="qcstring.html">QCString</a><a name="66dab8"></a>QCopChannel::channel()const</h3>
<p>Returns the name of the channel.
<h3 class="fn">bool<a name="6a7c48"></a>QCopChannel::isRegistered(const<a href="qcstring.html">QCString</a>&channel) <code>[static]</code></h3>
<p>Queries the server for the existance of <em>channel.</em>
<p>Returns TRUE if <em>channel</em> is registered.
<h3 class="fn">void<a name="fead71"></a>QCopChannel::receive(const<a href="qcstring.html">QCString</a>&msg, const<a href="qbytearray.html">QByteArray</a>&data) <code>[virtual]</code></h3>
<p>This virtual function allows subclasses of QCopChannel to
process data received from their channel.
<p>The default implementation emits the <a href="#846bd4">received</a>() signal.
<p>Note that the format of <em>data</em> has to be well defined in order to
demarshall the contained information.
<p>See also <a href="#21be7d">send</a>().
<h3 class="fn">void<a name="846bd4"></a>QCopChannel::received(const<a href="qcstring.html">QCString</a>&msg, const<a href="qbytearray.html">QByteArray</a>&data) <code>[signal]</code></h3>
<p>This signal is emitted whenever the <a href="#fead71">receive</a>() function gets incoming
data.
<h3 class="fn">bool<a name="bcd4cb"></a>QCopChannel::send(const<a href="qcstring.html">QCString</a>&channel, const<a href="qcstring.html">QCString</a>&msg) <code>[static]</code></h3>
<p>Send the message <em>msg</em> on <em>channel.</em> The message will be distributed
to all clients subscribed to the channel.
<p>See also <a href="#fead71">receive</a>().
<h3 class="fn">bool<a name="21be7d"></a>QCopChannel::send(const<a href="qcstring.html">QCString</a>&channel, const<a href="qcstring.html">QCString</a>&msg, const<a href="qbytearray.html">QByteArray</a>&data) <code>[static]</code></h3>
<p>Same as above function except the additional <em>data</em> parameter.
<a href="qdatastream.html">QDataStream</a> provides a convenient way to fill the byte array with
auxiliary data.
<h3 class="fn">void<a name="6168e8"></a>QCopChannel::sendLocally(const<a href="qcstring.html">QCString</a>&ch, const<a href="qcstring.html">QCString</a>&msg, const<a href="qbytearray.html">QByteArray</a>&data) <code>[static]</code></h3>
<p>For internal use only.
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|