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 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
|
<!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: Wt::WText Class Reference</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="pages.html"><span>Related Pages</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>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="classWt_1_1WText.html">WText</a>
</div>
</div>
<div class="contents">
<h1>Wt::WText Class Reference</h1><!-- doxytag: class="Wt::WText" --><!-- doxytag: inherits="Wt::WInteractWidget" -->A widget that renders (XHTML) text.
<a href="#_details">More...</a>
<p>
<code>#include <Wt/WText></code>
<p>
<div class="dynheader">
Inheritance diagram for Wt::WText:</div>
<div class="dynsection">
<p><center><img src="classWt_1_1WText__inherit__graph.png" border="0" usemap="#Wt_1_1WText__inherit__map" alt="Inheritance graph"></center>
<map name="Wt_1_1WText__inherit__map">
<area shape="rect" href="classWt_1_1WDefaultLoadingIndicator.html" title="A default loading indicator." alt="" coords="5,379,197,405"><area shape="rect" href="classWt_1_1WInteractWidget.html" title="An abstract widget that can receive user-interface interaction." alt="" coords="31,229,172,256"><area shape="rect" href="classWt_1_1WWebWidget.html" title="A base class for widgets with an HTML counterpart." alt="" coords="40,155,163,181"><area shape="rect" href="classWt_1_1WWidget.html" title="The abstract base class for a user-interface component." alt="" coords="53,80,149,107"><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="53,5,149,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="classWt_1_1WText-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="49bf5785263785717834a9d1a7a52399"></a><!-- doxytag: member="Wt::WText::WText" ref="49bf5785263785717834a9d1a7a52399" args="(WContainerWidget *parent=0)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#49bf5785263785717834a9d1a7a52399">WText</a> (<a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a text widget with an empty text. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#bd144b9486708726fbb535c3f5b144c2">WText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &text, <a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a text widget with given text. <a href="#bd144b9486708726fbb535c3f5b144c2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#49fd6775622dd40cd3676f0945723d98">WText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &text, <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480">TextFormat</a> textFormat, <a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a text widget with given text and format. <a href="#49fd6775622dd40cd3676f0945723d98"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#1081f42ae498fa8d23656cec207a4a76">text</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the text. <a href="#1081f42ae498fa8d23656cec207a4a76"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &text)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the text. <a href="#2f788aa524d51b3962642c9f565e66e6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#f22c64c4c5fed3d2aef0915a7e5c5866">setTextFormat</a> (<a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480">TextFormat</a> format)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the text format. <a href="#f22c64c4c5fed3d2aef0915a7e5c5866"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480">TextFormat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#c0976c36c5181a534f161ca3724d4296">textFormat</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the text format. <a href="#c0976c36c5181a534f161ca3724d4296"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#06fd47b48126caf4881b027d35ba066b">setWordWrap</a> (bool wordWrap)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Configures word wrapping. <a href="#06fd47b48126caf4881b027d35ba066b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#b2259537310561d9352f63d566b63fd6">wordWrap</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether the widget may break lines. <a href="#b2259537310561d9352f63d566b63fd6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WText.html#465517b955bf7bbe086401b57d888552">refresh</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Refresh the widget. <a href="#465517b955bf7bbe086401b57d888552"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A widget that renders (XHTML) text.
<p>
The text is provided through a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>, which may either hold a literal text, or a key to localized text which is looked up in locale dependent XML files (see <a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">WString::tr()</a>).<p>
Use <a class="el" href="classWt_1_1WText.html#f22c64c4c5fed3d2aef0915a7e5c5866" title="Sets the text format.">setTextFormat()</a> to configure the textFormat of the text. The default textFormat is <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>, which allows XHMTL markup to be included in the text. Tags and attributes that indicate "active" content are not allowed and stripped out, to avoid security risks exposed by JavaScript such as the common web-based <a href="http://en.wikipedia.org/wiki/Cross_site_scriptingCross-Site">Cross-Site Scripting (XSS)</a> malicious attack. XSS is the situation where one user of your web application is able to execute a script in another user's browser while your application only intended to display a message entered by the mailicious user to the other user. To defeat this attack, Wt assumes that content in a WText is intended to be passive, and not contain any scripting elements.<p>
The <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480e06bb9ae9a26d13c3dcf9f20d5067885" title="Format text as plain text.">Wt::PlainText</a> format will display the text literally (escaping any HTML special characters).<p>
In some situations, <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480eff9ccfd4130ea9922c46d94f82119b7" title="Format text as XHTML markup'ed text.">Wt::XHTMLUnsafeText</a> may be useful to explicitly allow scripting content. Like XHTMLText, it allows XHTML markup, but it also allows potentially dangerous tags and attributes. Use this if you're sure that a user cannot interfere with the text set, and XHTMLText is too limiting.<p>
WText is by default <a class="el" href="classWt_1_1WWidget.html#c78e3af143883334c82031790c87416e">inline</a>, unless the XHTML contents starts with an element such as <code><div></code>, <code><h></code> or <code><p></code> that is displayed as a block, in which case the widget will also display as a block.<p>
Usage examples: <div class="fragment"><pre class="fragment"> <a class="code" href="classWt_1_1WContainerWidget.html" title="A widget that holds and manages child widgets.">Wt::WContainerWidget</a> *container = <span class="keyword">new</span> <a class="code" href="classWt_1_1WContainerWidget.html" title="A widget that holds and manages child widgets.">Wt::WContainerWidget</a>();
<span class="comment">// display an XHTML text:</span>
container-><a class="code" href="classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2" title="Adds a child widget to this container.">addWidget</a>(<span class="keyword">new</span> <a class="code" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">Wt::WText</a>(<span class="stringliteral">"Hello <i>dear</i> visitor."</span>));
<span class="comment">// display a plain text:</span>
container-><a class="code" href="classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2" title="Adds a child widget to this container.">addWidget</a>(<span class="keyword">new</span> <a class="code" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">Wt::WText</a>(<span class="stringliteral">"The <i> tag displays italic text."</span>, <a class="code" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480e06bb9ae9a26d13c3dcf9f20d5067885" title="Format text as plain text.">Wt::PlainText</a>));
<span class="comment">// display an XHTML fragment from a resource bundle:</span>
container-><a class="code" href="classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2" title="Adds a child widget to this container.">addWidget</a>(<span class="keyword">new</span> <a class="code" href="classWt_1_1WText.html" title="A widget that renders (XHTML) text.">Wt::WText</a>(<a class="code" href="classWt_1_1WWidget.html#a651f107ec7cf080faef6c435705fc44" title="Short hand for WString::tr().">tr</a>(<span class="stringliteral">"introduction"</span>)));
</pre></div><p>
<h3>CSS</h3>
<p>
The widget corresponds to an HTML <code><span></code> tag or an HTML <code><div></code> depending on whether the widget is inline.<p>
This widget does not provide styling, and can be styled using inline or external CSS as appropriate.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WApplication.html#5c9cc1350019d69f154a2b44cdaf2596" title="Changes the locale.">WApplication::setLocale()</a><p>
<a class="el" href="classWt_1_1WApplication.html#5386565e35a58c94ccbbfab48f2212a4" title="Returns the message resource bundle.">WApplication::messageResourceBundle()</a> </dd></dl>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="bd144b9486708726fbb535c3f5b144c2"></a><!-- doxytag: member="Wt::WText::WText" ref="bd144b9486708726fbb535c3f5b144c2" args="(const WString &text, WContainerWidget *parent=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WText::WText </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>text</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> * </td>
<td class="paramname"> <em>parent</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a text widget with given text.
<p>
The textFormat is set to <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>, unless the <code>text</code> is literal (not created using <a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">WString::tr()</a>) and it could not be parsed as valid XML. In that case the textFormat is set to <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480e06bb9ae9a26d13c3dcf9f20d5067885" title="Format text as plain text.">Wt::PlainText</a>.<p>
Therefore, if you wish to use <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>, but cannot be sure about <code>text</code> being valid XML, you should verify that the <a class="el" href="classWt_1_1WText.html#c0976c36c5181a534f161ca3724d4296" title="Returns the text format.">textFormat()</a> is <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a> after construction.<p>
The XML parser will silently discard malicious tags and attributes for literal <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a> text.
</div>
</div><p>
<a class="anchor" name="49fd6775622dd40cd3676f0945723d98"></a><!-- doxytag: member="Wt::WText::WText" ref="49fd6775622dd40cd3676f0945723d98" args="(const WString &text, TextFormat textFormat, WContainerWidget *parent=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WText::WText </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>text</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480">TextFormat</a> </td>
<td class="paramname"> <em>textFormat</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classWt_1_1WContainerWidget.html">WContainerWidget</a> * </td>
<td class="paramname"> <em>parent</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a text widget with given text and format.
<p>
If <em>textFormat</em> is <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a> and <code>text</code> is not literal (not created using <a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">WString::tr()</a>), then if the <code>text</code> could not be parsed as valid XML, the textFormat is changed to <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480e06bb9ae9a26d13c3dcf9f20d5067885" title="Format text as plain text.">Wt::PlainText</a>.<p>
Therefore, if you wish to use <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>, but cannot be sure about <code>text</code> being valid XML, you should verify that the <a class="el" href="classWt_1_1WText.html#c0976c36c5181a534f161ca3724d4296" title="Returns the text format.">textFormat()</a> is <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a> after construction.<p>
The XML parser will silently discard malicious tags and attributes for literal <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a> text.
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="1081f42ae498fa8d23656cec207a4a76"></a><!-- doxytag: member="Wt::WText::text" ref="1081f42ae498fa8d23656cec207a4a76" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classWt_1_1WString.html">WString</a>& Wt::WText::text </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the text.
<p>
When a literal XHTMLFormatted text was set, this may differ from the text that was set since malicious tags/attributes may have been stripped.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6" title="Sets the text.">setText(const WString&)</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="2f788aa524d51b3962642c9f565e66e6"></a><!-- doxytag: member="Wt::WText::setText" ref="2f788aa524d51b3962642c9f565e66e6" args="(const WString &text)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WText::setText </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>text</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the text.
<p>
When the current format is <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>, and <code>text</code> is literal (not created using <a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">WString::tr()</a>), it is parsed using an XML parser which discards malicious tags and attributes silently. When the parser encounters an XML parse error, the textFormat is changed to <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480e06bb9ae9a26d13c3dcf9f20d5067885" title="Format text as plain text.">Wt::PlainText</a>.<p>
Returns whether the text could be set using the current textFormat. A return value of <code>false</code> indicates that the textFormat was changed in order to be able to accept the new text.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WText.html#1081f42ae498fa8d23656cec207a4a76" title="Returns the text.">text()</a>, <a class="el" href="classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6" title="Sets the text.">setText()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="f22c64c4c5fed3d2aef0915a7e5c5866"></a><!-- doxytag: member="Wt::WText::setTextFormat" ref="f22c64c4c5fed3d2aef0915a7e5c5866" args="(TextFormat format)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WText::setTextFormat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480">TextFormat</a> </td>
<td class="paramname"> <em>format</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the text format.
<p>
The textFormat controls how the string should be interpreted: either as plain text, which is displayed literally, or as XHTML-markup.<p>
When changing the textFormat to <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>, and the current text is literal (not created using <a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">WString::tr()</a>), the current text is parsed using an XML parser which discards malicious tags and attributes silently. When the parser encounters an XML parse error, the textFormat is left unchanged, and this method returns false.<p>
Returns whether the textFormat could be set for the current text.<p>
The default format is <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>.
</div>
</div><p>
<a class="anchor" name="c0976c36c5181a534f161ca3724d4296"></a><!-- doxytag: member="Wt::WText::textFormat" ref="c0976c36c5181a534f161ca3724d4296" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480">TextFormat</a> Wt::WText::textFormat </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the text format.
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WText.html#f22c64c4c5fed3d2aef0915a7e5c5866" title="Sets the text format.">setTextFormat()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="06fd47b48126caf4881b027d35ba066b"></a><!-- doxytag: member="Wt::WText::setWordWrap" ref="06fd47b48126caf4881b027d35ba066b" args="(bool wordWrap)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Wt::WText::setWordWrap </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>wordWrap</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Configures word wrapping.
<p>
When <code>wordWrap</code> is <code>true</code>, the widget may break lines, creating a multi-line text. When <code>wordWrap</code> is <code>false</code>, the text will displayed on a single line, unless the text contains end-of-lines (for <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480e06bb9ae9a26d13c3dcf9f20d5067885" title="Format text as plain text.">Wt::PlainText</a>) or <br /> tags or other block-level tags (for <a class="el" href="namespaceWt.html#140dea437d52d3d7c438ea3bd16a1480847ab5a73b906fea275bd16877b420a4" title="Format text as XSS-safe XHTML markup'ed text.">Wt::XHTMLText</a>).<p>
The default value is <code>true</code>.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WText.html#b2259537310561d9352f63d566b63fd6" title="Returns whether the widget may break lines.">wordWrap()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="b2259537310561d9352f63d566b63fd6"></a><!-- doxytag: member="Wt::WText::wordWrap" ref="b2259537310561d9352f63d566b63fd6" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WText::wordWrap </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns whether the widget may break lines.
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WText.html#06fd47b48126caf4881b027d35ba066b" title="Configures word wrapping.">setWordWrap(bool)</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="465517b955bf7bbe086401b57d888552"></a><!-- doxytag: member="Wt::WText::refresh" ref="465517b955bf7bbe086401b57d888552" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Wt::WText::refresh </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Refresh the widget.
<p>
The refresh method is invoked when the locale is changed using <a class="el" href="classWt_1_1WApplication.html#5c9cc1350019d69f154a2b44cdaf2596" title="Changes the locale.">WApplication::setLocale()</a> or when the user hit the refresh button.<p>
The widget must actualize its contents in response.
<p>Reimplemented from <a class="el" href="classWt_1_1WWebWidget.html#8d0b7883f2f77a0c24b8fb911a8086a8">Wt::WWebWidget</a>.</p>
</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:07 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>
|