File: group__chatexample.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (210 lines) | stat: -rw-r--r-- 15,570 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt examples: Chat example</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Chat example</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatApplication.html">ChatApplication</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A chat demo application.  <a href="classChatApplication.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html">ChatEvent</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Encapsulate a chat event.  <a href="classChatEvent.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleChatServer.html">SimpleChatServer</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A simple chat server.  <a href="classSimpleChatServer.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleChatWidget.html">SimpleChatWidget</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A self-contained chat widget.  <a href="classSimpleChatWidget.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html">WApplication</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__chatexample.html#gcb337c09cd35644b56da8b0e5bb17b9c">createApplication</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;env)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__chatexample.html#g3c04138a5bfe5d72780bb7e82a18e627">main</a> (int argc, char **argv)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__chatexample.html#ge1537d19ec87de98d5e4b81513dfd1c8">ChatApplication::ChatApplication</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;env)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a new instance.  <a href="#ge1537d19ec87de98d5e4b81513dfd1c8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__chatexample.html#g5dac9dfcc18f0d42adb57760b1da24d9">ChatApplication::addChatWidget</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add another chat client.  <a href="#g5dac9dfcc18f0d42adb57760b1da24d9"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classSimpleChatServer.html">SimpleChatServer</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__chatexample.html#g7406b76fb4dd4a62fc4e9fcde0a88f94">theServer</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The single chat server instance.  <a href="#g7406b76fb4dd4a62fc4e9fcde0a88f94"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g5dac9dfcc18f0d42adb57760b1da24d9"></a><!-- doxytag: member="ChatApplication::addChatWidget" ref="g5dac9dfcc18f0d42adb57760b1da24d9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ChatApplication::addChatWidget           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [private, inherited]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add another chat client. 
<p>

<p>Definition at line <a class="el" href="simpleChat_8C-source.html#l00060">60</a> of file <a class="el" href="simpleChat_8C-source.html">simpleChat.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00061"></a>00061 {
<a name="l00062"></a>00062   <a class="code" href="classSimpleChatWidget.html" title="A self-contained chat widget.">SimpleChatWidget</a> *chatWidget2 = <span class="keyword">new</span> <a class="code" href="classSimpleChatWidget.html" title="A self-contained chat widget.">SimpleChatWidget</a>(<a class="code" href="group__chatexample.html#g7406b76fb4dd4a62fc4e9fcde0a88f94" title="The single chat server instance.">theServer</a>, <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>());
<a name="l00063"></a>00063   chatWidget2-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"chat"</span>);
<a name="l00064"></a>00064 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="ge1537d19ec87de98d5e4b81513dfd1c8"></a><!-- doxytag: member="ChatApplication::ChatApplication" ref="ge1537d19ec87de98d5e4b81513dfd1c8" args="(const WEnvironment &amp;env)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ChatApplication::ChatApplication           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>env</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inherited]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a new instance. 
<p>

<p>Definition at line <a class="el" href="simpleChat_8C-source.html#l00041">41</a> of file <a class="el" href="simpleChat_8C-source.html">simpleChat.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00042"></a>00042   : <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#e29a843f4d50159b17abfa9503c389db">WApplication</a>(env)
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#71a3f7da5abb9a76df94fab69ba61670">setTitle</a>(<span class="stringliteral">"Wt Chat"</span>);
<a name="l00045"></a>00045   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#f377d541443b4bcea5fcc40be7c70173">useStyleSheet</a>(<span class="stringliteral">"simplechat.css"</span>);
<a name="l00046"></a>00046   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#5386565e35a58c94ccbbfab48f2212a4">messageResourceBundle</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WMessageResourceBundle.html#01368946b2a2aaceab3a64cddb1cb1e2">use</a>(<span class="stringliteral">"simplechat"</span>);
<a name="l00047"></a>00047 
<a name="l00048"></a>00048   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(WString::tr(<span class="stringliteral">"introduction"</span>)));
<a name="l00049"></a>00049 
<a name="l00050"></a>00050   <a class="code" href="classSimpleChatWidget.html" title="A self-contained chat widget.">SimpleChatWidget</a> *chatWidget = <span class="keyword">new</span> <a class="code" href="classSimpleChatWidget.html" title="A self-contained chat widget.">SimpleChatWidget</a>(<a class="code" href="group__chatexample.html#g7406b76fb4dd4a62fc4e9fcde0a88f94" title="The single chat server instance.">theServer</a>, <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>());
<a name="l00051"></a>00051   chatWidget-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"chat"</span>);
<a name="l00052"></a>00052 
<a name="l00053"></a>00053   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(WString::tr(<span class="stringliteral">"details"</span>)));
<a name="l00054"></a>00054 
<a name="l00055"></a>00055   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a> *b = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a>(<span class="stringliteral">"I'm schizophrenic ..."</span>, <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>());
<a name="l00056"></a>00056   b-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#e11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(SLOT(b, WPushButton::hide));
<a name="l00057"></a>00057   b-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#e11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(SLOT(<span class="keyword">this</span>, <a class="code" href="group__chatexample.html#g5dac9dfcc18f0d42adb57760b1da24d9" title="Add another chat client.">ChatApplication::addChatWidget</a>));
<a name="l00058"></a>00058 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="gcb337c09cd35644b56da8b0e5bb17b9c"></a><!-- doxytag: member="simpleChat.C::createApplication" ref="gcb337c09cd35644b56da8b0e5bb17b9c" args="(const WEnvironment &amp;env)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html">WApplication</a>* createApplication           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>env</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="simpleChat_8C-source.html#l00066">66</a> of file <a class="el" href="simpleChat_8C-source.html">simpleChat.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00067"></a>00067 {
<a name="l00068"></a>00068   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classChatApplication.html" title="A chat demo application.">ChatApplication</a>(env);
<a name="l00069"></a>00069 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="g3c04138a5bfe5d72780bb7e82a18e627"></a><!-- doxytag: member="simpleChat.C::main" ref="g3c04138a5bfe5d72780bb7e82a18e627" args="(int argc, char **argv)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&nbsp;</td>
          <td class="paramname"> <em>argv</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="simpleChat_8C-source.html#l00071">71</a> of file <a class="el" href="simpleChat_8C-source.html">simpleChat.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00072"></a>00072 {
<a name="l00073"></a>00073   <span class="keywordflow">return</span> WRun(argc, argv, &amp;<a class="code" href="ComposeExample_8C.html#cb337c09cd35644b56da8b0e5bb17b9c">createApplication</a>);
<a name="l00074"></a>00074 }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="g7406b76fb4dd4a62fc4e9fcde0a88f94"></a><!-- doxytag: member="simpleChat.C::theServer" ref="g7406b76fb4dd4a62fc4e9fcde0a88f94" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSimpleChatServer.html">SimpleChatServer</a> <a class="el" href="group__chatexample.html#g7406b76fb4dd4a62fc4e9fcde0a88f94">theServer</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The single chat server instance. 
<p>

<p>Definition at line <a class="el" href="simpleChat_8C-source.html#l00024">24</a> of file <a class="el" href="simpleChat_8C-source.html">simpleChat.C</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:12 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>