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
|
<!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: /home/koen/project/wt/public-git/wt/examples/simplechat/SimpleChatWidget.h Source File</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 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 class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>/home/koen/project/wt/public-git/wt/examples/simplechat/SimpleChatWidget.h</h1><a href="SimpleChatWidget_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This may look like C code, but it's really -*- C++ -*-</span>
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Emweb bvba, Heverlee, Belgium.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * See the LICENSE file for terms of use.</span>
<a name="l00006"></a>00006 <span class="comment"> */</span>
<a name="l00007"></a>00007
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef SIMPLECHATWIDGET_H_</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define SIMPLECHATWIDGET_H_</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include <Wt/WContainerWidget></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include <Wt/WJavaScript></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include <Wt/WSound></span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="keyword">namespace </span>Wt {
<a name="l00016"></a>00016 <span class="keyword">class </span>WApplication;
<a name="l00017"></a>00017 <span class="keyword">class </span>WPushButton;
<a name="l00018"></a>00018 <span class="keyword">class </span>WText;
<a name="l00019"></a>00019 <span class="keyword">class </span>WLineEdit;
<a name="l00020"></a>00020 <span class="keyword">class </span>WTextArea;
<a name="l00021"></a>00021 }
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="keyword">class </span><a class="code" href="classSimpleChatServer.html" title="A simple chat server.">SimpleChatServer</a>;
<a name="l00024"></a>00024 <span class="keyword">class </span><a class="code" href="classChatEvent.html" title="Encapsulate a chat event.">ChatEvent</a>;
<a name="l00025"></a>00025
<a name="l00030"></a>00030
<a name="l00033"></a><a class="code" href="classSimpleChatWidget.html">00033</a> <span class="keyword">class </span><a class="code" href="classSimpleChatWidget.html" title="A self-contained chat widget.">SimpleChatWidget</a> : <span class="keyword">public</span> Wt::<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#520ba6e52a36a7f2efbef1a31a69e898">WContainerWidget</a>
<a name="l00034"></a>00034 {
<a name="l00035"></a>00035 <span class="keyword">public</span>:
<a name="l00038"></a>00038 <a class="code" href="classSimpleChatWidget.html#a1cdfd4ad4b7442304c6f44b3346f2e0" title="Create a chat widget that will connect to the given server.">SimpleChatWidget</a>(<a class="code" href="classSimpleChatServer.html" title="A simple chat server.">SimpleChatServer</a>& server, <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#3461e31818c4d2f516641bdaf508312a">parent</a> = 0);
<a name="l00039"></a>00039
<a name="l00042"></a>00042 <a class="code" href="classSimpleChatWidget.html#fdf56768400ee025d0b71ccce476b1bf" title="Delete a chat widget.">~SimpleChatWidget</a>();
<a name="l00043"></a>00043
<a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="classSimpleChatWidget.html#71d98bf20e007af247f3b5a74f35efa2" title="Show a simple login screen.">letLogin</a>();
<a name="l00047"></a>00047
<a name="l00052"></a>00052 <span class="keywordtype">bool</span> <a class="code" href="classSimpleChatWidget.html#19c0deeaf8952ec36791c3f444964878" title="Start a chat for the given user.">startChat</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>& user);
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <span class="keyword">private</span>:
<a name="l00055"></a><a class="code" href="classSimpleChatWidget.html#e3fdaeefe19e26c6c6ad9f7c0445af57">00055</a> <span class="keyword">typedef</span> std::map<Wt::WString, bool> <a class="code" href="classSimpleChatWidget.html#e3fdaeefe19e26c6c6ad9f7c0445af57">UserMap</a>;
<a name="l00056"></a><a class="code" href="classSimpleChatWidget.html#fe3350a7929733a5b93db803dee8704b">00056</a> <a class="code" href="classSimpleChatWidget.html#e3fdaeefe19e26c6c6ad9f7c0445af57">UserMap</a> <a class="code" href="classSimpleChatWidget.html#fe3350a7929733a5b93db803dee8704b">users_</a>;
<a name="l00057"></a>00057
<a name="l00058"></a><a class="code" href="classSimpleChatWidget.html#b29db4cbc3935964daf6b6c264ce68d3">00058</a> <a class="code" href="classSimpleChatServer.html" title="A simple chat server.">SimpleChatServer</a>& <a class="code" href="classSimpleChatWidget.html#b29db4cbc3935964daf6b6c264ce68d3">server_</a>;
<a name="l00059"></a><a class="code" href="classSimpleChatWidget.html#f27ada14cf08ce58437c2f3f72f0c4d1">00059</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html">Wt::WApplication</a> *<a class="code" href="classSimpleChatWidget.html#f27ada14cf08ce58437c2f3f72f0c4d1">app_</a>;
<a name="l00060"></a>00060
<a name="l00061"></a><a class="code" href="classSimpleChatWidget.html#7e58bf2312b413d2d649500c26a6f8d6">00061</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1JSlot.html">Wt::JSlot</a> <a class="code" href="classSimpleChatWidget.html#7e58bf2312b413d2d649500c26a6f8d6">clearInput_</a>;
<a name="l00062"></a>00062
<a name="l00063"></a><a class="code" href="classSimpleChatWidget.html#596f7cbf70f45da9af017ac9d6f55ebc">00063</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> <a class="code" href="classSimpleChatWidget.html#596f7cbf70f45da9af017ac9d6f55ebc">user_</a>;
<a name="l00064"></a>00064
<a name="l00065"></a><a class="code" href="classSimpleChatWidget.html#6216e8cf4d368c1550562e1c5525d34b">00065</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html">Wt::WLineEdit</a> *<a class="code" href="classSimpleChatWidget.html#6216e8cf4d368c1550562e1c5525d34b">userNameEdit_</a>;
<a name="l00066"></a><a class="code" href="classSimpleChatWidget.html#98f69adc6f2381cd98584566ed4c497e">00066</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">Wt::WText</a> *<a class="code" href="classSimpleChatWidget.html#98f69adc6f2381cd98584566ed4c497e">statusMsg_</a>;
<a name="l00067"></a>00067
<a name="l00068"></a><a class="code" href="classSimpleChatWidget.html#32a593ed511997f32a33a55d651ce79d">00068</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *<a class="code" href="classSimpleChatWidget.html#32a593ed511997f32a33a55d651ce79d">messages_</a>;
<a name="l00069"></a><a class="code" href="classSimpleChatWidget.html#cf8ebb5abeec698a1f363a139d1dbf6a">00069</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *<a class="code" href="classSimpleChatWidget.html#cf8ebb5abeec698a1f363a139d1dbf6a">messageEditArea_</a>;
<a name="l00070"></a><a class="code" href="classSimpleChatWidget.html#4b658b56ef4ba1862765b9ad84fd9a9c">00070</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTextArea.html">Wt::WTextArea</a> *<a class="code" href="classSimpleChatWidget.html#4b658b56ef4ba1862765b9ad84fd9a9c">messageEdit_</a>;
<a name="l00071"></a><a class="code" href="classSimpleChatWidget.html#a9a81423eda8238f8aa37be1a5a5bee8">00071</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WPushButton.html">Wt::WPushButton</a> *<a class="code" href="classSimpleChatWidget.html#a9a81423eda8238f8aa37be1a5a5bee8">sendButton_</a>;
<a name="l00072"></a><a class="code" href="classSimpleChatWidget.html#ee074d5eb739091af79eb8dccc90853e">00072</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *<a class="code" href="classSimpleChatWidget.html#ee074d5eb739091af79eb8dccc90853e">userList_</a>;
<a name="l00073"></a>00073
<a name="l00074"></a><a class="code" href="classSimpleChatWidget.html#9a6485984b400d54882606f2c947a286">00074</a> boost::signals::connection <a class="code" href="classSimpleChatWidget.html#9a6485984b400d54882606f2c947a286">eventConnection_</a>;
<a name="l00075"></a>00075
<a name="l00076"></a><a class="code" href="classSimpleChatWidget.html#47d6f7d355107d9d44d3662b8c3de442">00076</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WSound.html">Wt::WSound</a> <a class="code" href="classSimpleChatWidget.html#47d6f7d355107d9d44d3662b8c3de442">messageReceived_</a>;
<a name="l00077"></a>00077
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="classSimpleChatWidget.html#e085fda18af441e1630342395499478c">login</a>();
<a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="classSimpleChatWidget.html#bff498a5a43a7e0caac5f2140f14e301">logout</a>();
<a name="l00080"></a>00080 <span class="keywordtype">void</span> <a class="code" href="classSimpleChatWidget.html#d1c4dc9e6aca0c5b8e1db81ee7c5fad3">send</a>();
<a name="l00081"></a>00081 <span class="keywordtype">void</span> <a class="code" href="classSimpleChatWidget.html#282d3fa5a7aceea89558de31db4bb6e0">updateUsers</a>();
<a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="classSimpleChatWidget.html#76509fdffaf6a244c99977cf587c42e0">updateUser</a>();
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <span class="comment">/* called from another session */</span>
<a name="l00085"></a>00085 <span class="keywordtype">void</span> <a class="code" href="classSimpleChatWidget.html#cda2bbe138c3119e4c62a6132801a232">processChatEvent</a>(<span class="keyword">const</span> <a class="code" href="classChatEvent.html" title="Encapsulate a chat event.">ChatEvent</a>& event);
<a name="l00086"></a>00086 };
<a name="l00087"></a>00087
<a name="l00090"></a>00090 <span class="preprocessor">#endif // SIMPLECHATWIDGET</span>
</pre></div></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 <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>
|