Rocket::Core::ElementTextDefault Class Reference

#include <ElementTextDefault.h>

Inheritance diagram for Rocket::Core::ElementTextDefault:
Collaboration diagram for Rocket::Core::ElementTextDefault:

Public Member Functions

 ElementTextDefault (const String &tag)
virtual void SetText (const WString &text)
virtual const WStringGetText () const
virtual void OnRender ()
 Called during render after backgrounds, borders, decorators, but before children, are rendered.
virtual bool GenerateToken (float &token_width, int token_begin)
virtual bool GenerateLine (WString &line, int &line_length, float &line_width, int line_begin, float maximum_line_width, float right_spacing_width, bool trim_whitespace_prefix)
virtual void ClearLines ()
 Clears all lines of generated text and prepares the element for generating new lines.
virtual void AddLine (const Vector2f &line_position, const WString &line)
virtual void SuppressAutoLayout ()
 Prevents the element from dirtying its document's layout when its text is changed.

Protected Member Functions

virtual void OnPropertyChange (const PropertyNameList &properties)
virtual void GetRML (String &content)
virtual void DirtyFont ()
 Forces a reevaluation of applicable font effects.

Data Structures

struct  Line

Detailed Description

Author:
Peter Curry

Member Function Documentation

void Rocket::Core::ElementTextDefault::SetText ( const WString text  )  [virtual]

Sets the raw string this text element contains. The actual rendered text may be different due to whitespace formatting.

Parameters:
[in] text The new string to set on this element.

Implements Rocket::Core::ElementText.

const WString & Rocket::Core::ElementTextDefault::GetText (  )  const [virtual]

Returns the raw string this text element contains.

Returns:
This element's raw text.

Implements Rocket::Core::ElementText.

bool Rocket::Core::ElementTextDefault::GenerateToken ( float &  token_width,
int  token_begin 
) [virtual]

Generates a token of text from this element, returning only the width.

Parameters:
[out] token_width The window (in pixels) of the token.
[in] token_begin The first character to be included in the token.
Returns:
True if the token is the end of the element's text, false if not.

Implements Rocket::Core::ElementText.

bool Rocket::Core::ElementTextDefault::GenerateLine ( WString line,
int &  line_length,
float &  line_width,
int  line_begin,
float  maximum_line_width,
float  right_spacing_width,
bool  trim_whitespace_prefix 
) [virtual]

Generates a line of text rendered from this element

Parameters:
[out] line The characters making up the line, with white-space characters collapsed and endlines processed appropriately.
[out] line_length The number of characters from the source string consumed making up this string; this may very well be different from line.size()!
[out] line_width The width (in pixels) of the generated line.
[in] line_begin The first character to be rendered in the line.
[in] maximum_line_width The width (in pixels) of space allowed for the line, or -1 for unlimited space.
[in] right_spacing_width The width (in pixels) of the spacing (consisting of margins, padding, etc) that must be remaining on the right of the line if the last of the text is rendered onto this line.
[in] trim_whitespace_prefix If we're collapsing whitespace, whether or remove all prefixing whitespace or collapse it down to a single space.
Returns:
True if the line reached the end of the element's text, false if not.

Implements Rocket::Core::ElementText.

void Rocket::Core::ElementTextDefault::AddLine ( const Vector2f line_position,
const WString line 
) [virtual]

Adds a new line into the text element.

Parameters:
[in] line_position The position of this line, as an offset from the first line.
[in] line The contents of the line..

Implements Rocket::Core::ElementText.

void Rocket::Core::ElementTextDefault::OnPropertyChange ( const PropertyNameList &  changed_properties  )  [protected, virtual]

Called when properties on the element are changed.

Parameters:
[in] changed_properties The properties changed on the element.

Reimplemented from Rocket::Core::Element.

void Rocket::Core::ElementTextDefault::GetRML ( String content  )  [protected, virtual]

Returns the RML of this element

Parameters:
content[out] The raw text.

Reimplemented from Rocket::Core::Element.


The documentation for this class was generated from the following files: