Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 263

wt-doc-3.2.3-1.fc18.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Wt examples: ChatEvent Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt examples
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">ChatEvent Class Reference<div class="ingroups"><a class="el" href="group__chatexample.html">Chat example</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="ChatEvent" -->
<p>Encapsulate a chat event.  
 <a href="classChatEvent.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>&gt;</code></p>

<p><a href="classChatEvent-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> { <a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6">Login</a>, 
<a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171">Logout</a>, 
<a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8">Rename</a>, 
<a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration for the event type.  <a href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#ac932234e63d23080f4f91f7ae1167418">type</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the event type.  <a href="#ac932234e63d23080f4f91f7ae1167418"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#adbeff19aece69e75ab0b69f2adecc5b6">user</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the user who caused the event.  <a href="#adbeff19aece69e75ab0b69f2adecc5b6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a1e73c4e7d9a59d790d4ba3a5bb36902d">message</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the message of the event.  <a href="#a1e73c4e7d9a59d790d4ba3a5bb36902d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a7a16dc199e1da813b8fc6bc155dc04e2">data</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the extra data for this event.  <a href="#a7a16dc199e1da813b8fc6bc155dc04e2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a459911a1ba1c3e793c6c797e534691b7">formattedHTML</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;user, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/namespaceWt.html#a140dea437d52d3d7c438ea3bd16a1480">Wt::TextFormat</a> format) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the message formatted as HTML, rendered for the given user.  <a href="#a459911a1ba1c3e793c6c797e534691b7"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a87e8c95da862b11466c9de1c9039cf6b">ChatEvent</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;user, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;message)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a78a7f54e8a39eb3448197461bcc7b125">ChatEvent</a> (<a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> type, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;user, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;data=<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a511a12bce677dc733bd7b6b9415bff73">Wt::WString::Empty</a>)</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#ac99c17370c25b3c92dbb0578e4298ade">SimpleChatServer</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Encapsulate a chat event. </p>

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00030">30</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61"></a><!-- doxytag: member="ChatEvent::Type" ref="afa84446dae17c08fe15cf932fc0b7d61" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">ChatEvent::Type</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Enumeration for the event type. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6"></a><!-- doxytag: member="Login" ref="afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6" args="" -->Login</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171"></a><!-- doxytag: member="Logout" ref="afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171" args="" -->Logout</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8"></a><!-- doxytag: member="Rename" ref="afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8" args="" -->Rename</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1"></a><!-- doxytag: member="Message" ref="afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1" args="" -->Message</em>&nbsp;</td><td>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00035">35</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
<div class="fragment"><pre class="fragment">{ <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6">Login</a>, <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171">Logout</a>, <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8">Rename</a>, <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a> };
</pre></div>
</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a87e8c95da862b11466c9de1c9039cf6b"></a><!-- doxytag: member="ChatEvent::ChatEvent" ref="a87e8c95da862b11466c9de1c9039cf6b" args="(const Wt::WString &amp;user, const Wt::WString &amp;message)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ChatEvent::ChatEvent </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td>
          <td class="paramname"><em>message</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00069">69</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
<div class="fragment"><pre class="fragment">    : <a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>(<a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a>), <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>(user), <a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>(message)
  { }
</pre></div>
</div>
</div>
<a class="anchor" id="a78a7f54e8a39eb3448197461bcc7b125"></a><!-- doxytag: member="ChatEvent::ChatEvent" ref="a78a7f54e8a39eb3448197461bcc7b125" args="(Type type, const Wt::WString &amp;user, const Wt::WString &amp;data=Wt::WString::Empty)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ChatEvent::ChatEvent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td>
          <td class="paramname"><em>data</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a511a12bce677dc733bd7b6b9415bff73">Wt::WString::Empty</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00073">73</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
<div class="fragment"><pre class="fragment">    : <a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>(<a class="code" href="classChatEvent.html#ac932234e63d23080f4f91f7ae1167418" title="Get the event type.">type</a>), <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>(user), <a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a>(data)
  { }
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a7a16dc199e1da813b8fc6bc155dc04e2"></a><!-- doxytag: member="ChatEvent::data" ref="a7a16dc199e1da813b8fc6bc155dc04e2" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>&amp; ChatEvent::data </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the extra data for this event. </p>

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00051">51</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
<div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a>; }
</pre></div>
</div>
</div>
<a class="anchor" id="a459911a1ba1c3e793c6c797e534691b7"></a><!-- doxytag: member="ChatEvent::formattedHTML" ref="a459911a1ba1c3e793c6c797e534691b7" args="(const Wt::WString &amp;user, Wt::TextFormat format) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> ChatEvent::formattedHTML </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &amp;&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/namespaceWt.html#a140dea437d52d3d7c438ea3bd16a1480">Wt::TextFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the message formatted as HTML, rendered for the given user. </p>
<p>The <code>format</code> indicates how the message should be formatted. </p>

<p>Definition at line <a class="el" href="SimpleChatServer_8C_source.html#l00015">15</a> of file <a class="el" href="SimpleChatServer_8C_source.html">SimpleChatServer.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="keywordflow">switch</span> (<a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>) {
  <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6">Login</a>:
    <span class="keywordflow">return</span> WString::fromUTF8(<span class="stringliteral">&quot;&lt;span class=&#39;chat-info&#39;&gt;&quot;</span>)
      + WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) + <span class="stringliteral">&quot; joined.&lt;/span&gt;&quot;</span>;
  <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171">Logout</a>:
    <span class="keywordflow">return</span> WString::fromUTF8(<span class="stringliteral">&quot;&lt;span class=&#39;chat-info&#39;&gt;&quot;</span>)
      + ((user == <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) ?
         WString::fromUTF8(<span class="stringliteral">&quot;You&quot;</span>) :
         WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>))
      + <span class="stringliteral">&quot; logged out.&lt;/span&gt;&quot;</span>;
  <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8">Rename</a>:
    <span class="keywordflow">return</span> <span class="stringliteral">&quot;&lt;span class=&#39;chat-info&#39;&gt;&quot;</span>
      + ((user == <a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a> || user == <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) ?
         <span class="stringliteral">&quot;You are&quot;</span> :
         (WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) + <span class="stringliteral">&quot; is&quot;</span>)) 
      + <span class="stringliteral">&quot; now known as &quot;</span> + WWebWidget::escapeText(<a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a>) + <span class="stringliteral">&quot;.&lt;/span&gt;&quot;</span>;
  <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a>:{
    <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> result;

    result = <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a>(<span class="stringliteral">&quot;&lt;span class=&#39;&quot;</span>)
      + ((user == <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) ?
         <span class="stringliteral">&quot;chat-self&quot;</span> :
         <span class="stringliteral">&quot;chat-user&quot;</span>)
      + <span class="stringliteral">&quot;&#39;&gt;&quot;</span> + WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) + <span class="stringliteral">&quot;:&lt;/span&gt;&quot;</span>;

    <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> msg
      = (format == <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/namespaceWt.html#a140dea437d52d3d7c438ea3bd16a1480a847ab5a73b906fea275bd16877b420a4">XHTMLText</a> ? <a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a> : WWebWidget::escapeText(<a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>));

    <span class="keywordflow">if</span> (<a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a159d088da6e8f2be1035b2341889254c">toUTF8</a>().find(user.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a159d088da6e8f2be1035b2341889254c">toUTF8</a>()) != std::string::npos)
      <span class="keywordflow">return</span> result + <span class="stringliteral">&quot;&lt;span class=&#39;chat-highlight&#39;&gt;&quot;</span> + msg + <span class="stringliteral">&quot;&lt;/span&gt;&quot;</span>;
    <span class="keywordflow">else</span>
      <span class="keywordflow">return</span> result + msg;
  }
  <span class="keywordflow">default</span>:
    <span class="keywordflow">return</span> <span class="stringliteral">&quot;&quot;</span>;
  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="a1e73c4e7d9a59d790d4ba3a5bb36902d"></a><!-- doxytag: member="ChatEvent::message" ref="a1e73c4e7d9a59d790d4ba3a5bb36902d" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>&amp; ChatEvent::message </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the message of the event. </p>

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00047">47</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
<div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>; }
</pre></div>
</div>
</div>
<a class="anchor" id="ac932234e63d23080f4f91f7ae1167418"></a><!-- doxytag: member="ChatEvent::type" ref="ac932234e63d23080f4f91f7ae1167418" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> ChatEvent::type </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the event type. </p>

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00039">39</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
<div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>; }
</pre></div>
</div>
</div>
<a class="anchor" id="adbeff19aece69e75ab0b69f2adecc5b6"></a><!-- doxytag: member="ChatEvent::user" ref="adbeff19aece69e75ab0b69f2adecc5b6" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>&amp; ChatEvent::user </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the user who caused the event. </p>

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00043">43</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>
<div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>; }
</pre></div>
</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="ac99c17370c25b3c92dbb0578e4298ade"></a><!-- doxytag: member="ChatEvent::SimpleChatServer" ref="ac99c17370c25b3c92dbb0578e4298ade" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classSimpleChatServer.html">SimpleChatServer</a><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00078">78</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="af24b35a3833777adff7e149383225e41"></a><!-- doxytag: member="ChatEvent::data_" ref="af24b35a3833777adff7e149383225e41" args="" -->
<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_1WString.html">Wt::WString</a> <a class="el" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">ChatEvent::data_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00063">63</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad51677c773550286593db4793dae62eb"></a><!-- doxytag: member="ChatEvent::message_" ref="ad51677c773550286593db4793dae62eb" args="" -->
<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_1WString.html">Wt::WString</a> <a class="el" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">ChatEvent::message_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00064">64</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8a55c20da17f812694469924b04bfd4c"></a><!-- doxytag: member="ChatEvent::type_" ref="a8a55c20da17f812694469924b04bfd4c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> <a class="el" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">ChatEvent::type_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00061">61</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3e2d08dca6b95343ad494e796a320eec"></a><!-- doxytag: member="ChatEvent::user_" ref="a3e2d08dca6b95343ad494e796a320eec" args="" -->
<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_1WString.html">Wt::WString</a> <a class="el" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">ChatEvent::user_</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00062">62</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/koen/project/wt/public-git/wt/examples/simplechat/<a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a></li>
<li>/home/koen/project/wt/public-git/wt/examples/simplechat/<a class="el" href="SimpleChatServer_8C_source.html">SimpleChatServer.C</a></li>
</ul>
</div>
<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>