Wt  4.13.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Wt::WTextF Class Reference

A value class that defines a text. More...

#include <Wt/WTextF.h>

Inheritance diagram for Wt::WTextF:
[legend]

Public Member Functions

 WTextF ()
 Default constructor.
 
 WTextF (const WString &text)
 Construct text from WString.
 
 WTextF (const char *text)
 Construct text from string.
 
 WTextF (const std::string &text)
 Construct text from string.
 
WTextFoperator= (const WTextF &other)
 Internal assign method.
 
bool operator== (const WTextF &other) const
 Comparison operator.
 
bool empty () const
 Returns whether the text is empty or not.
 
void setText (const WString &text)
 Sets the content of the text.
 
WString text () const
 Returns the content of the text.
 
std::string jsValue () const override
 Returns a JavaScript representation of the value of this object.
 
 operator WString () const
 Convert WTextF to WString.
 
- Public Member Functions inherited from Wt::WJavaScriptExposableObject
bool isJavaScriptBound () const
 Returns whether this object is JavaScript bound.
 
std::string jsRef () const
 Returns a JavaScript reference to this object.
 

Detailed Description

A value class that defines a text.

The text is defined by a string.

JavaScript exposability

A WTextF is JavaScript exposable. If a WTextF is JavaScript bound, it can be accessed in your custom JavaScript code through its handle's jsRef(). A text is represented in JavaScript as a string.

Warning
A WTextF that is JavaScript exposed should be modified only through its handle. Any attempt at modifying it will cause an exception to be thrown.
See also
WPaintedWidget::createJSText()

Constructor & Destructor Documentation

◆ WTextF()

Wt::WTextF::WTextF ( )

Default constructor.

Constructs an empty text.

See also
empty()

Member Function Documentation

◆ jsValue()

std::string Wt::WTextF::jsValue ( ) const
overridevirtual

Returns a JavaScript representation of the value of this object.

Note
The value returned will reflect the current server side value of the object. If this object is JavaScript bound, this value may not reflect the actual client side value. If you need access to the client side value, use jsRef() intead.

Implements Wt::WJavaScriptExposableObject.

◆ operator WString()

Wt::WTextF::operator WString ( ) const

Convert WTextF to WString.

Exceptions
WExceptionif the text is JavaScript bound

◆ setText()

void Wt::WTextF::setText ( const WString text)

Sets the content of the text.

Exceptions
WExceptionif the text is JavaScript bound