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::LeftToRightTextLine Class Reference

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

#include <textline.h>

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

Public Member Functions

 LeftToRightTextLine (TextLayer *ParentLayer)
 Class constructor. More...
 
virtual ~LeftToRightTextLine ()
 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 left to the right.

Definition at line 268 of file textline.h.

Constructor & Destructor Documentation

Mezzanine::UI::LeftToRightTextLine::LeftToRightTextLine ( TextLayer ParentLayer)

Class constructor.

Parameters
ParentLayerThe TextLayer that this TextLine belongs to.

Definition at line 327 of file textline.cpp.

Member Function Documentation

Boolean Mezzanine::UI::LeftToRightTextLine::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 374 of file textline.cpp.

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

Implements Mezzanine::UI::TextLine.

Definition at line 403 of file textline.cpp.

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

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

Implements Mezzanine::UI::TextLine.

Definition at line 353 of file textline.cpp.

void Mezzanine::UI::LeftToRightTextLine::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 358 of file textline.cpp.

Real Mezzanine::UI::LeftToRightTextLine::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 366 of file textline.cpp.

TextLine::CharacterIterator Mezzanine::UI::LeftToRightTextLine::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 435 of file textline.cpp.

TextLine::CharacterIterator Mezzanine::UI::LeftToRightTextLine::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 441 of file textline.cpp.

TextLine::CharacterIterator Mezzanine::UI::LeftToRightTextLine::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 447 of file textline.cpp.

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

Gets the character before the last character.

Implements Mezzanine::UI::TextLine.

Definition at line 334 of file textline.cpp.

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

Recalculates the offset for every character in this line.

Implements Mezzanine::UI::TextLine.

Definition at line 340 of file textline.cpp.

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

Removes the character at the start of this TextLine.

Implements Mezzanine::UI::TextLine.

Definition at line 456 of file textline.cpp.

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

Removes the character at the end of this TextLine.

Implements Mezzanine::UI::TextLine.

Definition at line 463 of file textline.cpp.


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