MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
Mezzanine::UI::RightToLeftTextLine Class Reference

This is a TextLine specialization class for text read from the right to the left. More...

#include <textline.h>

+ Inheritance diagram for Mezzanine::UI::RightToLeftTextLine:
+ Collaboration diagram for Mezzanine::UI::RightToLeftTextLine:

Public Member Functions

 RightToLeftTextLine (TextLayer *ParentLayer)
 Class constructor. More...
 
virtual ~RightToLeftTextLine ()
 Class destructor.
 
Boolean AppendCharacters (CharacterIterator First, CharacterIterator Last)
 Adds a series of Characters to the end of this TextLine. More...
 
CharacterIterator AppendFittingCharacters (CharacterIterator First, CharacterIterator Last)
 
Real GetCursorStartPosition () const
 Gets the offset position of the cursor based on the text order of the layer this text line belongs to. More...
 
CharacterIterator GetFirstCharacter ()
 Gets the first character in this TextLine. More...
 
CharacterIterator GetLastCharacter ()
 Gets the last character in this TextLine. More...
 
CharacterIterator GetNextCharacter (CharacterIterator Current)
 Gets an iterator to the next Character. More...
 
void RemoveFirstCharacter ()
 Removes the character at the start of this TextLine. More...
 
void RemoveLastCharacter ()
 Removes the character at the end of this TextLine. More...
 
- Public Member Functions inherited from Mezzanine::UI::TextLine
 TextLine (TextLayer *ParentLayer)
 Class constructor. More...
 
virtual ~TextLine ()
 Class destructor.
 
Boolean AppendCharacter (Character *ToAdd)
 Adds a Character to the end of this TextLine. More...
 
Boolean AppendCharacters (CharacterContainer &ToAdd)
 Adds a series of Characters to the end of this TextLine. More...
 
Boolean AppendCharacters (CharacterIteratorPair Pair)
 Adds a series of Characters to the end of this TextLine. More...
 
CharacterIterator AppendFittingCharacters (CharacterContainer &ToAdd)
 Adds as many Characters in a range as will fit to this TextLine. More...
 
CharacterIterator AppendFittingCharacters (CharacterIteratorPair Pair)
 Adds as many Characters in a range as will fit to this TextLine. More...
 
CharacterIterator BeginCharacter ()
 Gets an iterator to the first Character. More...
 
ConstCharacterIterator BeginCharacter () const
 Gets a const iterator to the first Character. More...
 
CharacterIterator EndCharacter ()
 Gets an iterator to one passed the last Character. More...
 
ConstCharacterIterator EndCharacter () const
 Gets an iterator to one passed the last Character. More...
 
UI::LinearAlignment GetAlignment () const
 Gets the current alignment for the text in this line of text. More...
 
OffsetResultPair GetCharacterAndCursorPositionAtOffset (const Real &Offset) const
 Gets the character at the provided offset as well as the nearest valid position the cursor can take. More...
 
CharacterGetCharacterAtIndex (const UInt32 &Index)
 Gets the character in this textline at the specified index. More...
 
CharacterGetCharacterAtOffset (const Real &Offset)
 Gets the character in this textline at the specified offset. More...
 
Real GetClosestCursorPosition (const Real &Offset)
 Gets the closest valid cursor position to the offset provided. More...
 
Real GetCurrentLength () const
 Calculates the current length of this text line. More...
 
Integer GetIndexAtOffset (const Real &Offset) const
 Gets the index of the character at the provided offset. More...
 
Real GetLeftMostCursorPosition () const
 Gets the offset position of the left-most part of this TextLine. More...
 
Real GetLineHeight () const
 Gets the size of this TextLine on the Y axis. More...
 
UInt32 GetNumCharacters () const
 Gets the number of characters in this TextLine. More...
 
Real GetOffsetAtIndex (const Integer &Index) const
 Gets the Offset position of the character at the specified index. More...
 
Real GetPositionOffset () const
 Gets the offset on the Y axis from the parent layer. More...
 
Real GetRightMostCursorPosition () const
 Gets the offset position of the right-most part of this TextLine. More...
 
void RemoveAllCharacters ()
 Removes all characters from this TextLine.
 
void SetAlignment (const UI::LinearAlignment Align)
 Aligns the text of the caption. More...
 
void SetPositionOffset (const Real &Offset)
 Sets the offset on the Y axis from the parent layer. More...
 

Protected Member Functions

void AppendToBack (Character *ToAppend)
 Adds a character such that it becomes the last in the sequence. More...
 
void AppendToBack (CharacterIterator First, CharacterIterator Last)
 Adds a series of characters to the end of this line. More...
 
CharacterGetSecondFromLastCharacter () const
 Gets the character before the last character. More...
 
void RecalculateOffsets ()
 Recalculates the offset for every character in this line. More...
 
- Protected Member Functions inherited from Mezzanine::UI::TextLine
Real GetMaxWidth () const
 Gets the maximum width this text line can be. More...
 

Additional Inherited Members

- Public Types inherited from Mezzanine::UI::TextLine
typedef std::list< Character * > CharacterContainer
 Basic container type for Character storage by this class.
 
typedef
CharacterContainer::iterator 
CharacterIterator
 Iterator type for Character instances stored by this class.
 
typedef std::pair
< CharacterIterator,
CharacterIterator
CharacterIteratorPair
 An std::pair storing two CharacterIterators, usually for expressing a range.
 
typedef
CharacterContainer::const_iterator 
ConstCharacterIterator
 Const Iterator type for Character instances stored by this class.
 
typedef std::pair< Character
*, Vector2
OffsetResultPair
 An std::pair storing a Character and it's offset position (relative to the parent layer).
 
typedef
CharacterContainer::reverse_iterator 
ReverseCharacterIterator
 Reverse Iterator type for Character instances stored by this class.
 
typedef
CharacterContainer::const_reverse_iterator 
ReverseConstCharacterIterator
 Const Reverse Iterator type for Character instances stored by this class.
 
- Protected Attributes inherited from Mezzanine::UI::TextLine
UI::LinearAlignment Alignment
 The alignment of the text on the X axis in this line. More...
 
CharacterContainer Characters
 Vector containing all the characters belonging to this TextLine. More...
 
Real CurrLength
 The current length of this TextLine. More...
 
TextLayerParent
 The parent layer this text line belongs to. More...
 
Real PositionOffset
 The offset in pixels from the parent layer on the Y axis. More...
 
Real TallestHeight
 The size of the largest glyph on the Y axis. More...
 

Detailed Description

This is a TextLine specialization class for text read from the right to the left.

Definition at line 316 of file textline.h.

Constructor & Destructor Documentation

Mezzanine::UI::RightToLeftTextLine::RightToLeftTextLine ( TextLayer ParentLayer)

Class constructor.

Parameters
ParentLayerThe TextLayer that this TextLine belongs to.

Definition at line 472 of file textline.cpp.

Member Function Documentation

Boolean Mezzanine::UI::RightToLeftTextLine::AppendCharacters ( TextLine::CharacterIterator  First,
TextLine::CharacterIterator  Last 
)
virtual

Adds a series of Characters to the end of this TextLine.

Parameters
FirstIterator to the first Character in the series to be added.
LastIterator to one passed the last Character in the series to be added.
Returns
Returns true if all characters were successfully added, false otherwise.

Implements Mezzanine::UI::TextLine.

Definition at line 519 of file textline.cpp.

TextLine::CharacterIterator Mezzanine::UI::RightToLeftTextLine::AppendFittingCharacters ( TextLine::CharacterIterator  First,
TextLine::CharacterIterator  Last 
)
virtual

Implements Mezzanine::UI::TextLine.

Definition at line 554 of file textline.cpp.

void Mezzanine::UI::RightToLeftTextLine::AppendToBack ( Character ToAppend)
protectedvirtual

Adds a character such that it becomes the last in the sequence.

Implements Mezzanine::UI::TextLine.

Definition at line 498 of file textline.cpp.

void Mezzanine::UI::RightToLeftTextLine::AppendToBack ( TextLine::CharacterIterator  First,
TextLine::CharacterIterator  Last 
)
protectedvirtual

Adds a series of characters to the end of this line.

Implements Mezzanine::UI::TextLine.

Definition at line 503 of file textline.cpp.

Real Mezzanine::UI::RightToLeftTextLine::GetCursorStartPosition ( ) const
virtual

Gets the offset position of the cursor based on the text order of the layer this text line belongs to.

Returns
Returns the left most cursor position if text is ordered left to right, and vice versa.

Implements Mezzanine::UI::TextLine.

Definition at line 511 of file textline.cpp.

TextLine::CharacterIterator Mezzanine::UI::RightToLeftTextLine::GetFirstCharacter ( )
virtual

Gets the first character in this TextLine.

Note
The first character is based on the order in which the characters are read. If the characters are meant to be read left-to-right then this will be the left most character. If the characters are meant to be read right-to-left, this will be the right most character.
Returns
Returns an iterator to the first character in this TextLine.

Implements Mezzanine::UI::TextLine.

Definition at line 592 of file textline.cpp.

TextLine::CharacterIterator Mezzanine::UI::RightToLeftTextLine::GetLastCharacter ( )
virtual

Gets the last character in this TextLine.

Note
The last character is based on the order in which the characters are read. If the characters are meant to be read left-to-right then this will be the right most character. If the characters are meant to be read right-to-left, this will be the left most character.
Returns
Returns an iterator to the last character in this TextLine.

Implements Mezzanine::UI::TextLine.

Definition at line 598 of file textline.cpp.

TextLine::CharacterIterator Mezzanine::UI::RightToLeftTextLine::GetNextCharacter ( TextLine::CharacterIterator  Current)
virtual

Gets an iterator to the next Character.

Parameters
CurrentAn iterator to a valid Character.
Returns
Returns an iterator to the next Character in the sequence.

Implements Mezzanine::UI::TextLine.

Definition at line 604 of file textline.cpp.

Character * Mezzanine::UI::RightToLeftTextLine::GetSecondFromLastCharacter ( ) const
protectedvirtual

Gets the character before the last character.

Implements Mezzanine::UI::TextLine.

Definition at line 479 of file textline.cpp.

void Mezzanine::UI::RightToLeftTextLine::RecalculateOffsets ( )
protectedvirtual

Recalculates the offset for every character in this line.

Implements Mezzanine::UI::TextLine.

Definition at line 485 of file textline.cpp.

void Mezzanine::UI::RightToLeftTextLine::RemoveFirstCharacter ( )
virtual

Removes the character at the start of this TextLine.

Implements Mezzanine::UI::TextLine.

Definition at line 611 of file textline.cpp.

void Mezzanine::UI::RightToLeftTextLine::RemoveLastCharacter ( )
virtual

Removes the character at the end of this TextLine.

Implements Mezzanine::UI::TextLine.

Definition at line 617 of file textline.cpp.


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