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

Class for encapsulating the functionality of the text cursor/carat navigation in text layers. More...

#include <textcursor.h>

+ Collaboration diagram for Mezzanine::UI::TextCursor:

Public Member Functions

 TextCursor (TextLayer *Creator)
 Class constructor. More...
 
virtual ~TextCursor ()
 Class destructor.
 
virtual const ColourValueGetColour () const
 Gets the colour that the Text Cursor will be rendered as. More...
 
virtual Integer GetCursorIndex () const
 Gets the index position of this cursor. More...
 
virtual Rect GetCursorRect () const
 Gets a rect representing this cursors dimentions. More...
 
virtual TextLayer::CharOffsetPair GetOffsetPosition () const
 Gets the current offset position of this cursor. More...
 
virtual Boolean GetVisible () const
 Gets the visibility of this cursor. More...
 
virtual void InsertCharacterAtCursor (const UInt32 GlyphID)
 Creates a character from a Glyph ID and inserts it at the cursor position. More...
 
virtual void InsertCharactersAtCursor (const Char8 *Characters, const UInt32 BufSize)
 Creates a series of characters from a UTF-8 encoded string to be inserted at the cursor position. More...
 
virtual void InsertCharactersAtCursor (const UInt32 *Characters, const UInt32 BufSize)
 Creates a series of characters from a UTF-32 encoded string to be inserted at the cursor position. More...
 
virtual void MoveCursorLeft ()
 Decrements this cursors index position, moving it to the left.
 
virtual void MoveCursorRight ()
 Increments this cursors index position, moving it to the right.
 
virtual void ProtoDeSerialize (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite this object with it. More...
 
virtual void ProtoSerialize (XML::Node &ParentNode) const
 Convert this class to an XML::Node ready for serialization. More...
 
virtual void RemoveLeftCharacter ()
 Removes the character to the left (and decrements the index position) of this cursor.
 
virtual void RemoveRightCharacter ()
 Removes the character to the right of this cursor.
 
virtual void SetColour (const ColourValue &Colour)
 Sets the colour that the Text Cursor should be rendered as. More...
 
virtual void SetCursorIndex (const Integer &Index)
 Sets the index position of this cursor. More...
 
virtual void SetOffsetPosition (const Vector2 &Offset)
 Sets the offset position of this cursor to the nearest appropriate point. More...
 
virtual void SetVisible (Boolean Visible)
 Sets the visibility of this cursor. More...
 

Static Public Member Functions

static String GetSerializableName ()
 Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized. More...
 

Protected Attributes

ColourValue CursorColour
 The colour to be given to the TextCursor. More...
 
Integer IndexPosition
 The index of the character this TextCursor is to the left of. More...
 
TextLayerLayer
 The layer this TextCursor belongs to. More...
 
Boolean Visibility
 Stores the cursors current visibility state. More...
 

Detailed Description

Class for encapsulating the functionality of the text cursor/carat navigation in text layers.

Definition at line 58 of file textcursor.h.

Constructor & Destructor Documentation

Mezzanine::UI::TextCursor::TextCursor ( TextLayer Creator)

Class constructor.

Parameters
CreatorThe layer that this TextCursor belongs to.

Definition at line 55 of file textcursor.cpp.

Member Function Documentation

const ColourValue & Mezzanine::UI::TextCursor::GetColour ( ) const
virtual

Gets the colour that the Text Cursor will be rendered as.

Returns
Returns a const ColourValue reference of the Text Cursors colour.

Definition at line 125 of file textcursor.cpp.

Integer Mezzanine::UI::TextCursor::GetCursorIndex ( ) const
virtual

Gets the index position of this cursor.

Returns
Returns an Integer representing the index position of this cursor.

Definition at line 74 of file textcursor.cpp.

Rect Mezzanine::UI::TextCursor::GetCursorRect ( ) const
virtual

Gets a rect representing this cursors dimentions.

Returns
Returns a Rect containing the position and size of this TextCursor.

Definition at line 88 of file textcursor.cpp.

TextLayer::CharOffsetPair Mezzanine::UI::TextCursor::GetOffsetPosition ( ) const
virtual

Gets the current offset position of this cursor.

Returns
Returns a Vector2 containing the position of this cursor relative to the parent layer.

Definition at line 85 of file textcursor.cpp.

String Mezzanine::UI::TextCursor::GetSerializableName ( )
static

Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized.

Returns
A string containing the name of this class.

Definition at line 217 of file textcursor.cpp.

Boolean Mezzanine::UI::TextCursor::GetVisible ( ) const
virtual

Gets the visibility of this cursor.

Returns
Returns true if this cursor is being rendered along with it's parent TextLayer, false otherwise.

Definition at line 68 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::InsertCharacterAtCursor ( const UInt32  GlyphID)
virtual

Creates a character from a Glyph ID and inserts it at the cursor position.

Parameters
GlyphIDThe ID of the Glyph to be inserted.

Definition at line 139 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::InsertCharactersAtCursor ( const Char8 Characters,
const UInt32  BufSize 
)
virtual

Creates a series of characters from a UTF-8 encoded string to be inserted at the cursor position.

Parameters
CharactersAn array of Char8's encoded in UTF-8 to be inserted.
BufSizeThe size of the array of Char8's passed in.

Definition at line 142 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::InsertCharactersAtCursor ( const UInt32 Characters,
const UInt32  BufSize 
)
virtual

Creates a series of characters from a UTF-32 encoded string to be inserted at the cursor position.

Parameters
CharactersAn array of UInt32's encoded in UTF-32 to be inserted.
BufSizeThe size of the array of Char8's passed in.

Definition at line 145 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::ProtoDeSerialize ( const XML::Node SelfRoot)
virtual

Take the data stored in an XML Node and overwrite this object with it.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.

Definition at line 192 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::ProtoSerialize ( XML::Node ParentNode) const
virtual

Convert this class to an XML::Node ready for serialization.

Parameters
ParentNodeThe point in the XML hierarchy that this renderable should be appended to.

Definition at line 175 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::SetColour ( const ColourValue Colour)
virtual

Sets the colour that the Text Cursor should be rendered as.

Parameters
ColourThe colour to use when rendering the Text Cursor.

Definition at line 116 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::SetCursorIndex ( const Integer Index)
virtual

Sets the index position of this cursor.

Parameters
IndexThe index indicating the position of this cursor among the characters in the parent layer.

Definition at line 71 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::SetOffsetPosition ( const Vector2 Offset)
virtual

Sets the offset position of this cursor to the nearest appropriate point.

Parameters
OffsetThe position from the top left corner of the parent layer where the bottom left corner of this cursor is to be placed.

Definition at line 77 of file textcursor.cpp.

void Mezzanine::UI::TextCursor::SetVisible ( Boolean  Visible)
virtual

Sets the visibility of this cursor.

Parameters
VisibleTrue to enable rendering of this cursor, false otherwise.

Definition at line 65 of file textcursor.cpp.

Member Data Documentation

ColourValue Mezzanine::UI::TextCursor::CursorColour
protected

The colour to be given to the TextCursor.

Definition at line 63 of file textcursor.h.

Integer Mezzanine::UI::TextCursor::IndexPosition
protected

The index of the character this TextCursor is to the left of.

Definition at line 66 of file textcursor.h.

TextLayer* Mezzanine::UI::TextCursor::Layer
protected

The layer this TextCursor belongs to.

Definition at line 69 of file textcursor.h.

Boolean Mezzanine::UI::TextCursor::Visibility
protected

Stores the cursors current visibility state.

Definition at line 72 of file textcursor.h.


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