Spinning Topp Logo BlackTopp Studios
inc
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.
 
Boole AppendCharacters (CharacterIterator First, CharacterIterator Last, const Real MaxWidth)
 Adds a series of Characters to the end of this TextLine. More...
 
CharacterIterator AppendFittingCharacters (CharacterIterator First, CharacterIterator Last, const Real MaxWidth)
 Adds as many Characters in a range as will fit to this TextLine. More...
 
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.
 
Boole AppendCharacter (Character *ToAdd, const Real MaxWidth)
 Adds a Character to the end of this TextLine. More...
 
Boole AppendCharacters (CharacterContainer &ToAdd, const Real MaxWidth)
 Adds a series of Characters to the end of this TextLine. More...
 
Boole AppendCharacters (CharacterIteratorPair Pair, const Real MaxWidth)
 Adds a series of Characters to the end of this TextLine. More...
 
CharacterIterator AppendFittingCharacters (CharacterContainer &ToAdd, const Real MaxWidth)
 Adds as many Characters in a range as will fit to this TextLine. More...
 
CharacterIterator AppendFittingCharacters (CharacterIteratorPair Pair, const Real MaxWidth)
 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)
 Sets the current alignment for the text in this line of text. 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...
 

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, CharacterIteratorCharacterIteratorPair
 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 *, Vector2OffsetResultPair
 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 275 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 333 of file textline.cpp.

Member Function Documentation

Boole Mezzanine::UI::LeftToRightTextLine::AppendCharacters ( TextLine::CharacterIterator  First,
TextLine::CharacterIterator  Last,
const Real  MaxWidth 
)
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.
MaxWidthThe maximum line width to assume for all text lines that are to be populated.
Returns
Returns true if all characters were successfully added, false otherwise.

Implements Mezzanine::UI::TextLine.

Definition at line 380 of file textline.cpp.

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

Adds as many Characters in a range as will fit to 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.
MaxWidthThe maximum line width to assume for all text lines that are to be populated.
Returns
Returns a CharacterIterator to the first character that was not added in the range. This can be the left-most non-added Character when added to Left-To-Right TextLines, or the right-most non-added Character in Right-To-Left TextLines.

Implements Mezzanine::UI::TextLine.

Definition at line 410 of file textline.cpp.

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

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

Parameters
ToAppendThe character to be appended.

Implements Mezzanine::UI::TextLine.

Definition at line 359 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.

Parameters
FirstThe first Character in a range to be appended.
LastThe last Character in a range to be appended.

Implements Mezzanine::UI::TextLine.

Definition at line 364 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 372 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 441 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 447 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 453 of file textline.cpp.

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

Gets the character before the last character.

Returns
Returns a pointer to the requested character.

Implements Mezzanine::UI::TextLine.

Definition at line 340 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 346 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 462 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 469 of file textline.cpp.


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