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 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
|
<!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: AddresseeEdit 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
 <span id="projectnumber">3.2.1</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 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 List</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pri-methods">Private Member Functions</a> |
<a href="#pri-attribs">Private Attributes</a> </div>
<div class="headertitle">
<div class="title">AddresseeEdit Class Reference<div class="ingroups"><a class="el" href="group__composerexample.html">Composer example</a></div></div> </div>
</div>
<div class="contents">
<!-- doxytag: class="AddresseeEdit" --><!-- doxytag: inherits="Wt::WTextArea" -->
<p>An edit field for an email addressee.
<a href="classAddresseeEdit.html#details">More...</a></p>
<p><code>#include <<a class="el" href="AddresseeEdit_8h_source.html">AddresseeEdit.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for AddresseeEdit:</div>
<div class="dyncontent">
<div class="center"><img src="classAddresseeEdit__inherit__graph.png" border="0" usemap="#AddresseeEdit_inherit__map" alt="Inheritance graph"/></div>
<map name="AddresseeEdit_inherit__map" id="AddresseeEdit_inherit__map">
<area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTextArea.html" title="Wt::WTextArea" alt="" coords="23,379,132,405"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WFormWidget.html" title="Wt::WFormWidget" alt="" coords="12,304,143,331"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html" title="Wt::WInteractWidget" alt="" coords="5,229,149,256"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWebWidget.html" title="Wt::WWebWidget" alt="" coords="13,155,141,181"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html" title="Wt::WWidget" alt="" coords="28,80,127,107"/><area shape="rect" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="29,5,125,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classAddresseeEdit-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classAddresseeEdit.html#aac9972a5a209f9e2b5aeb05a8e4f9f8d">AddresseeEdit</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> &<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WFormWidget.html#a82f0eaf7fb35132644b429e2b3b8930f">label</a>, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a3461e31818c4d2f516641bdaf508312a">parent</a>, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *labelParent)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new addressee edit with the given label. <a href="#aac9972a5a209f9e2b5aeb05a8e4f9f8d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classAddresseeEdit.html#adbf088c1a833e6bdc8d3f3f551d42a98">setAddressees</a> (const std::vector< <a class="el" href="structContact.html">Contact</a> > &contacts)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a list of addressees. <a href="#adbf088c1a833e6bdc8d3f3f551d42a98"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::vector< <a class="el" href="structContact.html">Contact</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classAddresseeEdit.html#ab7dbde2bff2fef234d20617b7ae42e26">addressees</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a list of addressees. <a href="#ab7dbde2bff2fef234d20617b7ae42e26"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classAddresseeEdit.html#a2d51bbf9a25701171fae40058fc8e462">setHidden</a> (bool hidden, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WAnimation.html">WAnimation</a> &animation)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Reimplement <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a0825c3ccbd4999afc1a88fafa6aa6fc7">hide()</a> and <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a52dcef5a385ddfa0a8c3e6c20000f181">show()</a> to also <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a0825c3ccbd4999afc1a88fafa6aa6fc7">hide()</a> and <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a52dcef5a385ddfa0a8c3e6c20000f181">show()</a> the label. <a href="#a2d51bbf9a25701171fae40058fc8e462"></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">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classAddresseeEdit.html#a6315749900d4e9aea13e5447f8bca027">parse</a> (std::vector< <a class="el" href="structContact.html">Contact</a> > &contacts) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Parse the addressees into a list of contacts. <a href="#a6315749900d4e9aea13e5447f8bca027"></a><br/></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="classLabel.html">Label</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAddresseeEdit.html#a593dba58d431415e256615718c32cbfc">label_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The label associated with this edit. <a href="#a593dba58d431415e256615718c32cbfc"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An edit field for an email addressee. </p>
<p>This widget is part of the Wt composer example. </p>
<p>Definition at line <a class="el" href="AddresseeEdit_8h_source.html#l00031">31</a> of file <a class="el" href="AddresseeEdit_8h_source.html">AddresseeEdit.h</a>.</p>
</div><hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="aac9972a5a209f9e2b5aeb05a8e4f9f8d"></a><!-- doxytag: member="AddresseeEdit::AddresseeEdit" ref="aac9972a5a209f9e2b5aeb05a8e4f9f8d" args="(const WString &label, WContainerWidget *parent, WContainerWidget *labelParent)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">AddresseeEdit::AddresseeEdit </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"><em>label</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> * </td>
<td class="paramname"><em>parent</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> * </td>
<td class="paramname"><em>labelParent</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a new addressee edit with the given label. </p>
<p>Constructs also a widget to hold the label in the labelParent. The label will be hidden and shown together with this field. </p>
<p>Definition at line <a class="el" href="AddresseeEdit_8C_source.html#l00015">15</a> of file <a class="el" href="AddresseeEdit_8C_source.html">AddresseeEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"> : <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTextArea.html#ad083421ca4fe15da882440d506cab05b">WTextArea</a>(parent)
{
<a class="code" href="classAddresseeEdit.html#a593dba58d431415e256615718c32cbfc" title="The label associated with this edit.">label_</a> = <span class="keyword">new</span> <a class="code" href="classLabel.html" title="A label.">Label</a>(label, labelParent);
<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTextArea.html#ade46b47350f427f45c9b53ac7e41c5b2">setRows</a>(3); <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTextArea.html#af429ed3a2b6011c97b4f9ea7f910e079">setColumns</a>(55);
<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWebWidget.html#a4762c1aa0b5788e54a52270674f21e23">resize</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WLength.html">WLength</a>(99, WLength::Percentage), WLength::Auto);
<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWebWidget.html#ad0957c892e70c6bf5399cf71e66f3e11">setInline</a>(<span class="keyword">false</span>); <span class="comment">// for IE to position the suggestions well</span>
}
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab7dbde2bff2fef234d20617b7ae42e26"></a><!-- doxytag: member="AddresseeEdit::addressees" ref="ab7dbde2bff2fef234d20617b7ae42e26" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector< <a class="el" href="structContact.html">Contact</a> > AddresseeEdit::addressees </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get a list of addressees. </p>
<p>Definition at line <a class="el" href="AddresseeEdit_8C_source.html#l00074">74</a> of file <a class="el" href="AddresseeEdit_8C_source.html">AddresseeEdit.C</a>.</p>
<div class="fragment"><pre class="fragment">{
std::vector<Contact> result;
<a class="code" href="classAddresseeEdit.html#a6315749900d4e9aea13e5447f8bca027" title="Parse the addressees into a list of contacts.">parse</a>(result);
<span class="keywordflow">return</span> result;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a6315749900d4e9aea13e5447f8bca027"></a><!-- doxytag: member="AddresseeEdit::parse" ref="a6315749900d4e9aea13e5447f8bca027" args="(std::vector< Contact > &contacts) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool AddresseeEdit::parse </td>
<td>(</td>
<td class="paramtype">std::vector< <a class="el" href="structContact.html">Contact</a> > & </td>
<td class="paramname"><em>contacts</em></td><td>)</td>
<td> const<code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Parse the addressees into a list of contacts. </p>
<p>Definition at line <a class="el" href="AddresseeEdit_8C_source.html#l00040">40</a> of file <a class="el" href="AddresseeEdit_8C_source.html">AddresseeEdit.C</a>.</p>
<div class="fragment"><pre class="fragment">{
<span class="keyword">typedef</span> boost::tokenizer<boost::escaped_list_separator<wchar_t>,
std::wstring::const_iterator, std::wstring>
CsvTokenizer;
std::wstring t = <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTextArea.html#ad8b89ce30df2b02894c53b6ed71fe4a6">text</a>();
CsvTokenizer tok(t);
<span class="keywordflow">for</span> (CsvTokenizer::iterator i = tok.begin(); i != tok.end(); ++i) {
std::wstring addressee = *i;
boost::trim(addressee);
std::wstring::size_type pos = addressee.find_last_of(<span class="charliteral">' '</span>);
<span class="keywordflow">if</span> (pos != std::string::npos) {
std::wstring email = addressee.substr(pos + 1);
std::wstring name = addressee.substr(0, pos);
boost::trim(email);
boost::trim(name);
<span class="keywordflow">if</span> (email[0] == <span class="charliteral">'<'</span>)
email = email.substr(1);
<span class="keywordflow">if</span> (email[email.length() - 1] == <span class="charliteral">'>'</span>)
email = email.substr(0, email.length() - 1);
<span class="keywordflow">if</span> (!email.empty())
contacts.push_back(<a class="code" href="structContact.html" title="An email contact.">Contact</a>(name, email));
} <span class="keywordflow">else</span>
<span class="keywordflow">if</span> (!addressee.empty())
contacts.push_back(<a class="code" href="structContact.html" title="An email contact.">Contact</a>(L<span class="stringliteral">""</span>, addressee));
}
<span class="keywordflow">return</span> <span class="keyword">true</span>;
}
</pre></div>
</div>
</div>
<a class="anchor" id="adbf088c1a833e6bdc8d3f3f551d42a98"></a><!-- doxytag: member="AddresseeEdit::setAddressees" ref="adbf088c1a833e6bdc8d3f3f551d42a98" args="(const std::vector< Contact > &contacts)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AddresseeEdit::setAddressees </td>
<td>(</td>
<td class="paramtype">const std::vector< <a class="el" href="structContact.html">Contact</a> > & </td>
<td class="paramname"><em>contacts</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set a list of addressees. </p>
<p>Definition at line <a class="el" href="AddresseeEdit_8C_source.html#l00027">27</a> of file <a class="el" href="AddresseeEdit_8C_source.html">AddresseeEdit.C</a>.</p>
<div class="fragment"><pre class="fragment">{
std::wstring <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTextArea.html#ad8b89ce30df2b02894c53b6ed71fe4a6">text</a>;
<span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i < contacts.size(); ++i) {
<span class="keywordflow">if</span> (i != 0)
text += L<span class="stringliteral">", "</span>;
text += contacts[i].formatted();
}
<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTextArea.html#a1f05060c037d13c2c6c26f51f1fb9640">setText</a>(text);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a2d51bbf9a25701171fae40058fc8e462"></a><!-- doxytag: member="AddresseeEdit::setHidden" ref="a2d51bbf9a25701171fae40058fc8e462" args="(bool hidden, const WAnimation &animation)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AddresseeEdit::setHidden </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>hidden</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_1WAnimation.html">WAnimation</a> & </td>
<td class="paramname"><em>animation</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reimplement <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a0825c3ccbd4999afc1a88fafa6aa6fc7">hide()</a> and <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a52dcef5a385ddfa0a8c3e6c20000f181">show()</a> to also <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a0825c3ccbd4999afc1a88fafa6aa6fc7">hide()</a> and <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html#a52dcef5a385ddfa0a8c3e6c20000f181">show()</a> the label. </p>
<p>Reimplemented from <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WFormWidget.html#a5dc109a9dce086ac204887947d85bd29">Wt::WFormWidget</a>.</p>
<p>Definition at line <a class="el" href="AddresseeEdit_8C_source.html#l00082">82</a> of file <a class="el" href="AddresseeEdit_8C_source.html">AddresseeEdit.C</a>.</p>
<div class="fragment"><pre class="fragment">{
<a class="code" href="classAddresseeEdit.html#a2d51bbf9a25701171fae40058fc8e462" title="Reimplement hide() and show() to also hide() and show() the label.">WTextArea::setHidden</a>(hidden, animation);
<a class="code" href="classAddresseeEdit.html#a593dba58d431415e256615718c32cbfc" title="The label associated with this edit.">label_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWebWidget.html#a8130c7caf29b2bcb2d347a69e13b17eb">setHidden</a>(hidden, animation);
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a593dba58d431415e256615718c32cbfc"></a><!-- doxytag: member="AddresseeEdit::label_" ref="a593dba58d431415e256615718c32cbfc" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classLabel.html">Label</a>* <a class="el" href="classAddresseeEdit.html#a593dba58d431415e256615718c32cbfc">AddresseeEdit::label_</a><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The label associated with this edit. </p>
<p>Definition at line <a class="el" href="AddresseeEdit_8h_source.html#l00055">55</a> of file <a class="el" href="AddresseeEdit_8h_source.html">AddresseeEdit.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/composer/<a class="el" href="AddresseeEdit_8h_source.html">AddresseeEdit.h</a></li>
<li>/home/koen/project/wt/public-git/wt/examples/composer/<a class="el" href="AddresseeEdit_8C_source.html">AddresseeEdit.C</a></li>
</ul>
</div>
<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Fri Mar 30 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by <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>
|