Guiliani  Version 2.4 revision 5970 (build 3)
CGUIEditableText Class Reference

Specialization of CGUIText that allows for modification and selection of text. More...

#include <GUIEditableText.h>

Inheritance diagram for CGUIEditableText:

Classes

struct  BidiTurningPoint_t
 
struct  CursorPos_t
 Holds a cursor position. More...
 

Public Member Functions

 CGUIEditableText (const CGUIObject *const pParentObject, const eC_String &kText, const eC_Value &vXPos=eC_FromInt(0), const eC_Value &vYPos=eC_FromInt(0), const eC_Value &vTextWidth=eC_FromInt(0), eC_Bool bWordWrap=false)
 
 CGUIEditableText (const CGUIObject *const pParentObject, const eC_String *const pkText, const eC_Value &vXPos=eC_FromInt(0), const eC_Value &vYPos=eC_FromInt(0), const eC_Value &vTextWidth=eC_FromInt(0), eC_Bool bWordWrap=false)
 
 CGUIEditableText (const CGUIEditableText &rkSource)
 
 ~CGUIEditableText ()
 
virtual CGUIEditableTextClone () const
 
void Delete (eC_UInt uiCursorPosAtStartLine, eC_UInt uiCursorPosAtEndLine, eC_UInt uiStartLine=0, eC_UInt uiEndLine=0)
 
void DeleteSelection ()
 
void ExtendSelection (eC_UInt uiCharIndex, eC_UInt uiLineIndex=0)
 
CursorPos_t GetBestCursorPosition (const eC_Value &vRelXPos, const eC_Value &vRelYPos)
 
CGUIRect GetCursorAbsRect ()
 
CursorPos_t GetCursorPosByCharIndex (eC_UInt uiCharIndex)
 
CursorPos_t GetCursorPosition ()
 
eC_Value GetCursorWidth () const
 
CursorPos_t GetLastCursorPos ()
 
eC_Value GetLineHeight ()
 
eC_Bool GetLTRpivotField (eC_UInt currentIndex, LeftEmbedding &ltrPivotPair)
 
eC_UInt GetLtrTurnPnt (eC_UInt currentIndex)
 
virtual const eC_String *const GetPassword ()
 
eC_Bool GetRectOfIndex (eC_UInt uiIndex, CGUIRect &rect)
 
eC_UInt GetRtlTurnPnt (eC_UInt currentIndex)
 
eC_String GetSelectedText ()
 
eC_UInt GetSelectionColor () const
 
CursorPos_t GetSelectionEnd ()
 
CursorPos_t GetSelectionStart ()
 
eC_String GetStrOfLine (eC_UInt uiCurrentLine) const
 
eC_Bool HasSelection ()
 
void Insert (const eC_String &kInsChars)
 
eC_Bool IsCursorVisible () const
 
eC_Bool IsInLtRField (eC_UInt currentIndex)
 
eC_Bool IsLeftToRightEmbedding ()
 
CGUIEditableTextoperator= (const CGUIEditableText &rkSource)
 
virtual void PrintText ()
 
void ReadFromStream ()
 
void ResetSelection ()
 
void ResetTurningPoints ()
 
void SelectAll ()
 
void SetCursorPosition (eC_UInt uiCursorPosAtLine, eC_UInt uiCurrentLine=0)
 
void SetCursorVisible (eC_Bool bVisible)
 
void SetCursorWidth (eC_Value vWidth)
 
void SetEmbeddingDirection (const eC_Bool bRightToLeft)
 
virtual void SetFont (const FontResource_t &eFontID)
 
void SetPasswordCharacter (eC_String &kPwdStr)
 
void SetPasswordMode (eC_Bool bPasswordMode)
 
void SetSelectionColor (const eC_UInt &uiSelectionColor)
 
void SetSelectionColor (const GlobalProperty_t &uiSelectionColor)
 
virtual void SetTextString (const eC_String &rkTextString)
 
void SetWordWrap (eC_Bool bWordWrap, const eC_Value &vWidth=eC_FromInt(0))
 
void ToggleCursor ()
 
virtual void WriteToStream (const eC_Bool bWriteTextType=false)
 
- Public Member Functions inherited from CGUIText
 CGUIText (const CGUIObject *const pParentObject, const eC_String &kText, const eC_Value &vXPos=eC_FromInt(0), const eC_Value &vYPos=eC_FromInt(0), const eC_Bool &bSingleLine=true)
 
 CGUIText (const CGUIObject *const pParentObject, const eC_String *const pkText, const eC_Value &vXPos=eC_FromInt(0), const eC_Value &vYPos=eC_FromInt(0), const eC_Bool &bSingleLine=true)
 
 CGUIText (const CGUIObject *const pParentObject, const TextResource_t &eTextID, const eC_Value &vXPos=eC_FromInt(0), const eC_Value &vYPos=eC_FromInt(0), const eC_Bool &bSingleLine=true)
 
 CGUIText (const CGUIText &kTextToBeCopied)
 
virtual ~CGUIText ()
 Destructor.
 
void FitHeightToContainedText ()
 
void GetAdjustment (eC_Value &vXAdjustment, eC_Value &vYAdjustment) const
 
eC_Bool GetAutoSize () const
 
const CGUIObjectGetContainingObject () const
 
FontResource_t GetFont () const
 
eC_Int GetFontSize () const
 
eC_Float GetFontSpacing () const
 
HorAligned_t GetHorAlign () const
 
virtual eC_Value GetLineSpacing () const
 
eC_UInt GetNumberOfLines ()
 
virtual eC_Value GetRelXPos () const
 
virtual eC_Value GetRelYPos () const
 
virtual void GetRequiredOrgTextSpace (eC_Value &vTextWidth, eC_Value &vTextHeight)
 
virtual eC_Value GetRequiredTextHeightForWidth (eC_Value vAvailableWidth=0)
 
virtual void GetRequiredTextSpace (eC_Value &vTextWidth, eC_Value &vTextHeight)
 
const CGUIRectGetSpecificClipRect () const
 
const eC_String * GetText () const
 
void GetTextColor (eC_UInt &uiTextColorStandard, eC_UInt &uiTextColorHighlighted, eC_UInt &uiTextColorGrayedOut, eC_UInt &uiTextColorPressed) const
 
void GetTextColor (GlobalProperty_t &eTextColorStandard, GlobalProperty_t &eTextColorHighlighted, GlobalProperty_t &eTextColorGrayedOut, GlobalProperty_t &eTextColorPressed) const
 
eC_UInt GetTextColorGrayedOut () const
 
eC_UInt GetTextColorHighlighted () const
 
eC_UInt GetTextColorPressed () const
 
eC_UInt GetTextColorStandard () const
 
virtual eC_Value GetTextHeight () const
 
TextResource_t GetTextID () const
 
virtual eC_Value GetTextWidth () const
 
VerAligned_t GetVerAlign () const
 
void InvalidateArea ()
 
eC_Bool IsBidi () const
 
eC_Bool IsTextCut ()
 
eC_Bool IsTextID () const
 
eC_Bool IsTextSingleLine () const
 
CGUITextoperator= (const CGUIText &kSource)
 
void SetAdjustment (const eC_Value &vXAdjustment, const eC_Value &vYAdjustment)
 
void SetAligned (const VerAligned_t &eVerAligned=V_TOP, const HorAligned_t &eHorAligned=H_LEFT)
 
void SetAlignedHorizontal (const HorAligned_t &eHorAligned=H_LEFT)
 
void SetAlignedVertical (const VerAligned_t &eVerAligned=V_TOP)
 
void SetAutoSize (const eC_Bool &bAutoSize)
 
void SetContainingObject (const CGUIObject *const pParent)
 
void SetFontSpacing (const eC_Float &fFontSpacing)
 
virtual void SetLineSpacing (const eC_Value vLineSpacing)
 
void SetRelRect (const CGUIRect &kRect)
 
virtual void SetRelXPos (const eC_Value &vRelXPos)
 
virtual void SetRelYPos (const eC_Value &vRelYPos)
 
void SetSpecificClipRect (const CGUIRect &kRect)
 
void SetTextAlignmentProperty (const GlobalProperty_t &eTextAlignmentProperty)
 
virtual void SetTextColor (const eC_UInt &uiTextColorStandard, const eC_UInt &uiTextColorHighlighted, const eC_UInt &uiTextColorGrayedOut, const eC_UInt &uiTextColorPressed)
 
virtual void SetTextColor (const GlobalProperty_t &eTextColorStandard, const GlobalProperty_t &eTextColorHighlighted, const GlobalProperty_t &eTextColorGrayedOut, const GlobalProperty_t &eTextColorPressed)
 
void SetTextColorGrayedOut (const eC_UInt &uiTextColorGrayedOut)
 
void SetTextColorGrayedOut (const GlobalProperty_t &eTextColorPropertyGrayedOut)
 
void SetTextColorHighlighted (const eC_UInt &uiTextColorHighlighted)
 
void SetTextColorHighlighted (const GlobalProperty_t &eTextColorPropertyHighlighted)
 
void SetTextColorPressed (const eC_UInt &uiTextColorPressed)
 
void SetTextColorPressed (const GlobalProperty_t &eTextColorPropertyPressed)
 
void SetTextColorStandard (const eC_UInt &uiTextColorStandard)
 
void SetTextColorStandard (const GlobalProperty_t &eTextColorPropertyStandard)
 
virtual void SetTextHeight (const eC_Value &vTextHeight)
 
virtual void SetTextID (const TextResource_t &eTextID)
 
void SetTextString (const eC_String *pkTextString)
 
virtual void SetTextWidth (const eC_Value &vTextWidth)
 
- Public Member Functions inherited from CGUIColorPropertyObserver
 CGUIColorPropertyObserver ()
 default-constructor
 
 ~CGUIColorPropertyObserver ()
 destructor
 
eC_UInt AddColorProperty (const eC_Bool &bColorIsProperty, const eC_UInt &uiColorValue, const GlobalProperty_t &eColorProperty)
 
void AddColorProperty (const eC_UInt &uiIndex, const eC_Bool &bColorIsProperty, const eC_UInt &uiColorValue, const GlobalProperty_t &eColorProperty)
 
ColorValue_t GetColorProperty (const eC_UInt &uiIndex) const
 
eC_UInt GetColorValue (const eC_UInt &uiIndex) const
 
virtual void OnColorPropertyChange ()
 
void RemoveColorProperty (const eC_UInt &uiIndex)
 
void SetColorProperty (const eC_UInt &uiIndex, const eC_UInt &uiColorValue)
 
void SetColorProperty (const eC_UInt &uiIndex, const GlobalProperty_t &eColorProperty)
 
void SetColorProperty (const eC_UInt &uiIndex, const ColorValue_t &kColorValue)
 
- Public Member Functions inherited from CGUIObserver
 CGUIObserver ()
 Default constructor.
 
virtual ~CGUIObserver ()
 Default destructor. Notifies all subjects of destruction.
 
const eC_TListDoubleLinked< CGUISubject * > & GetSubjectList () const
 
virtual void OnNotification (const eC_String &kMessage)
 
virtual void OnNotification (const CGUIObject *const pkUpdatedObject)
 
virtual void OnNotification (const CGUIValue &kObservedValue, const CGUIObject *const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
void SetAutoDelete (const eC_Bool bAutoDelete)
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
void SetXMLTag (const eC_String &kXMLTag)
 

Public Attributes

BidiTurningPoint_t m_kBidiTurnPoints
 turning-points
 

Additional Inherited Members

- Public Types inherited from CGUIText
enum  HorAligned_t { H_LEFT, H_CENTERED, H_RIGHT, H_PROPERTY }
 Possible horizontal alignments. More...
 
enum  TextColorTypeFlags_t { TEXT_COLOR_STANDARD_IS_PROPERTY = 1, TEXT_COLOR_HIGHLIGHTED_IS_PROPERTY = 2, TEXT_COLOR_GRAYED_OUT_IS_PROPERTY = 4, TEXT_COLOR_PRESSED_IS_PROPERTY = 8 }
 Enumeration indicating if a property or a color value is used for each text color.
 
enum  VerAligned_t { V_TOP, V_CENTERED, V_BOTTOM }
 Possible vertical alignments. More...
 
- Static Public Member Functions inherited from CGUIText
static eC_String GetEllipsisString ()
 
static eC_String GetHyphenString ()
 
static void SetEllipsisString (const eC_String &kEllipsis)
 
static void SetHyphenString (const eC_String &kHyphen)
 
- Static Public Attributes inherited from CGUIText
static const eC_Char XMLTAG_TEXT_COLOR_GRAYEDOUT [] = "TextColorGrayedOut"
 xml-tag for grayedout-color
 
static const eC_Char XMLTAG_TEXT_COLOR_HIGHLIGHTED [] = "TextColorHighlighted"
 xml-tag for highlighted-color
 
static const eC_Char XMLTAG_TEXT_COLOR_PRESSED [] = "TextColorPressed"
 xml-tag for pressed-color
 
static const eC_Char XMLTAG_TEXT_COLOR_PROPERTY_FLAGS [] = "ColorPropertyFlags"
 XML tag to be used when writing text colors into a stream. More...
 
static const eC_Char XMLTAG_TEXT_COLOR_STANDARD [] = "TextColorStandard"
 xml-tag for standard-color
 
static const eC_Char XMLTAG_TEXTID [] = "TextID"
 XML tag to be used when writing a text ID into a stream.
 
static const eC_Char XMLTAG_TEXTTYPEID [] = "TextTypeID"
 XML tag to be used when writing a text type ID into a stream.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION [] = "ClassVersion"
 
- Protected Types inherited from CGUIText
typedef eC_TListDoubleLinked< ExtendedString_tExtendedStringList_t
 The extended string list is a double-linked list of extended strings.
 
typedef eC_TListDoubleLinked< eC_UInt > UIntList
 Double linked List of unsigned integers.
 
- Protected Member Functions inherited from CGUIText
virtual void AdaptText ()
 
eC_Bool ContainsHyphenationMarks (const eC_String &kStr) const
 
void CreateLocalTextCopy ()
 
virtual void FitString (ExtendedString_t &rkResultStrData, const eC_String &rkStrToAnalyse, eC_String &rkRestStr, eC_UInt &uiOffset)
 
virtual eC_Value GetPrintLineAbsXPos (const eC_Value vWidth)
 
virtual eC_Value GetPrintLineAbsXPos (const eC_UInt uiLine)
 
virtual eC_Value GetPrintLineAbsXPos ()
 
eC_Value GetRequiredTextHeight () const
 
eC_Value GetRequiredTextWidth () const
 
virtual eC_Value GetVerStartAbsYPos ()
 
virtual void OnNotification ()
 
eC_Bool PrepareClipRect ()
 
virtual void PreparePrint ()
 
void ReadFontColors (const eC_UInt uiVersion)
 
void SetRequiredTextHeight (eC_Value vRequiredTextHeight)
 
void SetRequiredTextWidth (eC_Value vRequiredTextWidth)
 
void SetTextCut (const eC_Bool bIsCut)
 
void WriteFontColors ()
 Helper function for WriteStream().
 
- Protected Member Functions inherited from CGUIObserver
virtual void AddSubject (CGUISubject *pSubjectToAdd)
 
virtual void RemoveSubject (CGUISubject *pSubjectToRemove)
 
- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
 
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
 
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const
 
- Protected Attributes inherited from CGUIText
eC_Bool m_bAdaptText
 
eC_Bool m_bSingleLine
 Indicates whether this text is single- or multi-line.
 
eC_Bool m_bTextIDLocalCopy
 
eC_Bool m_bTextIsBiDi
 Indicates whether the text is a BiDi-text.
 
eC_Bool m_bUseEllipsis
 use ellipsis if text is too long
 
HorAligned_t m_eHorAligned
 Horizontal alignment.
 
GlobalProperty_t m_eTextAlignmentProperty
 Property used for the text color for alignment. By default, this value is DUMMY_PROPERTY, i.e. a fixed alignment is used.
 
VerAligned_t m_eVerAligned
 Vertical alignment.
 
UIntList m_kHyphens
 List of hyphen positions in the original text.
 
ExtendedStringList_t m_kListStringsExtended
 List of strings to be printed, and their cached width and height.
 
const CGUIObjectm_pkParentObject
 The object containing (and printing) this text.
 
eC_String * m_pkText
 
eC_Value m_vLineHeight
 The height of one text line with this text's font.
 
eC_Value m_vLineSpacing
 The line spacing factor.
 
eC_Value m_vRelXPos
 X position of this text's printing area relative to the parent object.
 
eC_Value m_vRelYPos
 Y position of this text's printing area relative to the parent object.
 
eC_Value m_vRequiredOrgTextHeight
 
eC_Value m_vRequiredOrgTextWidth
 
eC_Value m_vTextHeight
 Height of this text's printing area.
 
eC_Value m_vTextWidth
 Width of this text's printing area.
 
eC_Value m_vXAdjustment
 Printing adjustment for m_vRelXPos.
 
eC_Value m_vYAdjustment
 Printing adjustment for m_vRelYPos.
 
- Static Protected Attributes inherited from CGUIText
static const ExtendedString_t ms_ckEmptyExtendedString
 An empty Extended String.
 
static const eC_String ms_ckEmptyString
 An empty string.
 
static const eC_String ms_ckSingleSpace
 A single space character for text size calculations.
 

Detailed Description

Specialization of CGUIText that allows for modification and selection of text.

This text maintains a cursor position and a selection, which can be thought of as two cursor positions. A cursor position is defined as a point (described by CursorPos_t) denoting the position of a character. Cursor position (W, Y) indicates that the cursor is to the left of the W-th character in Line Y. The default cursor position after constructing an instance of this class is at the end of the text.

The cursor position can be visualized by drawing a cursor whose width and visibility can be influenced. The cursor is represented by a vertical line that has the same height as one text line and a configurable width (default is 1 pixel).

The color of the base class (CGUIText) standard text is used. Note that since this text is no CGUIObject it does not perform a blinking animation for the cursor, it rather draws the cursor or not. See CGUIEdit or CGUIMultiLineEdit for controls that use this text to display a blinking cursor.

A continuous portion of the text can be selected. The selection range is described by two cursor positions, a 'start' and an 'end' position relative to the cursor position. If these two values are the same, no text is selected. If they differ, the text from 'start' to 'end' is selected and is marked visually by a different background color, which is also configurable, see SetSelectionColor(). There are various methods to influence the selection from outside and to obtain information about the current selection.

It is possible to insert a string into the text at current cursor position or delete string from the text by giving start and end cursor positions.

The word wrap functionality is enabled at construction time. It can also be configured with SetWordWrap().

The password mode enables the editable text to obfuscate the input using a specified character that is displayed instead of the actual user input.

Note that only left-aligned text is allowed within GUIEditableText.

Constructor & Destructor Documentation

◆ CGUIEditableText() [1/3]

CGUIEditableText::CGUIEditableText ( const CGUIObject *const  pParentObject,
const eC_String &  kText,
const eC_Value &  vXPos = eC_FromInt(0),
const eC_Value &  vYPos = eC_FromInt(0),
const eC_Value &  vTextWidth = eC_FromInt(0),
eC_Bool  bWordWrap = false 
)

Constructor. With word wrap is enabled, the default width is set to be given width. If word wrap is disabled, the default width is set to be the required width of the given text string.

Parameters
pParentObjectPointer to object containing the text.
kTextReference of text string.
vXPosX position of text relative to the parent.
vYPosY position of text relative to the parent.
vTextWidthThe width of the text.
bWordWrapfalse: text is always displayed in a single line, true: lines can be wrapped.

◆ CGUIEditableText() [2/3]

CGUIEditableText::CGUIEditableText ( const CGUIObject *const  pParentObject,
const eC_String *const  pkText,
const eC_Value &  vXPos = eC_FromInt(0),
const eC_Value &  vYPos = eC_FromInt(0),
const eC_Value &  vTextWidth = eC_FromInt(0),
eC_Bool  bWordWrap = false 
)

Constructor. With word wrap is enabled, the default width is set to be given width. If word wrap is disabled, the default width is set to be the required width of the given text string.

Parameters
pParentObjectPointer to object containing the text.
pkTextPointer of text string.
vXPosX position of text relative to the parent.
vYPosY position of text relative to the parent.
vTextWidthThe width of the text.
bWordWrapfalse: text is always displayed in a single line, true: lines can be wrapped.

◆ CGUIEditableText() [3/3]

CGUIEditableText::CGUIEditableText ( const CGUIEditableText rkSource)

Copy constructor.

Parameters
rkSourceThe text instance to be copied.

◆ ~CGUIEditableText()

CGUIEditableText::~CGUIEditableText ( )

Destructor.

Member Function Documentation

◆ Clone()

CGUIEditableText * CGUIEditableText::Clone ( ) const
virtual

Clones the instance of the GUIEditableText object.

Returns
Pointer to the cloned GUIEditableText object.

Reimplemented from CGUIText.

◆ Delete()

void CGUIEditableText::Delete ( eC_UInt  uiCursorPosAtStartLine,
eC_UInt  uiCursorPosAtEndLine,
eC_UInt  uiStartLine = 0,
eC_UInt  uiEndLine = 0 
)

Delete strings from the start cursor position of given start line and column to the end cursor position of given end line and column.

Parameters
uiCursorPosAtStartLineThe cursor position index of the line where the deletion starts.
uiCursorPosAtEndLineThe cursor position index of the line where the deletion finishes.
uiStartLineLine where the deletion starts.
uiEndLineLine where the deletion finishes.

◆ DeleteSelection()

void CGUIEditableText::DeleteSelection ( )

Deletes the current selection. Results in a call to Delete() with the current selection start/end indices.

◆ ExtendSelection()

void CGUIEditableText::ExtendSelection ( eC_UInt  uiCharIndex,
eC_UInt  uiLineIndex = 0 
)

Extends the current selection up to a specific position. The selection area is from the current cursor to the specific position, and the current cursor position becomes the specific position.

Parameters
uiCharIndexThe character index up to which the selection is extended.
uiLineIndexThe line up to which the selection is extended.

◆ GetBestCursorPosition()

CGUIEditableText::CursorPos_t CGUIEditableText::GetBestCursorPosition ( const eC_Value &  vRelXPos,
const eC_Value &  vRelYPos 
)

Finds the closest cursor position to an arbitrary pixel position, for instance a mouse position.

Parameters
vRelXPosX position relative to this text's containing CGUIObject.
vRelYPosY position relative to this text's containing CGUIObject.
Returns
The cursor position to be obtained.
See also
CursorPos_t

◆ GetCursorAbsRect()

CGUIRect CGUIEditableText::GetCursorAbsRect ( )

Get the absolute rectangle of the cursor.

Returns
The absolute rectangle of the cursor.

◆ GetCursorPosByCharIndex()

CGUIEditableText::CursorPos_t CGUIEditableText::GetCursorPosByCharIndex ( eC_UInt  uiCharIndex)

Get the cursor position by the char index of the current text string.

Parameters
uiCharIndexThe char index of the current text. Note: The char index starts from 1.
Returns
The cursor position to be found.
See also
CursorPos_t

◆ GetCursorPosition()

CGUIEditableText::CursorPos_t CGUIEditableText::GetCursorPosition ( )

Get the cursor position index and the line where the cursor locates.

Returns
The cursor position and current line stored in CursorPos_t structure.
See also
CursorPos_t

◆ GetCursorWidth()

eC_Value CGUIEditableText::GetCursorWidth ( ) const

Returns the width of the cursor.

Returns
the width of the vertical cursor line.

◆ GetLastCursorPos()

CGUIEditableText::CursorPos_t CGUIEditableText::GetLastCursorPos ( )

Determines the last valid cursor position of this text (position after the last character).

Returns
The last cursor position.
See also
CursorPos_t

◆ GetLineHeight()

eC_Value CGUIEditableText::GetLineHeight ( )
inline

Returns the height of one line of text. Not to be confused with GetTextHeight().

Returns
line-height

◆ GetLTRpivotField()

eC_Bool CGUIEditableText::GetLTRpivotField ( eC_UInt  currentIndex,
LeftEmbedding ltrPivotPair 
)

Get left-to-right turning-points

Parameters
currentIndex
ltrPivotPair
Returns
true if ...

◆ GetLtrTurnPnt()

eC_UInt CGUIEditableText::GetLtrTurnPnt ( eC_UInt  currentIndex)

Get left-to-right turning-points

Parameters
currentIndex
Returns
turning-point

◆ GetPassword()

const eC_String *const CGUIEditableText::GetPassword ( )
virtual

Retrieves the password. If the text is currently not in password mode, the visible text is returned.

Returns
A pointer to the password or visible text.

◆ GetRectOfIndex()

eC_Bool CGUIEditableText::GetRectOfIndex ( eC_UInt  uiIndex,
CGUIRect rect 
)

Return the region for an index

Parameters
uiIndexindex
rectrect for the index
Returns
true if index was valid

◆ GetRtlTurnPnt()

eC_UInt CGUIEditableText::GetRtlTurnPnt ( eC_UInt  currentIndex)

Get right-to-left turning-points

Parameters
currentIndex
Returns
turning-point

◆ GetSelectedText()

eC_String CGUIEditableText::GetSelectedText ( )

Returns the currently selected text.

Returns
The selected text if there is selection, otherwise an empty string.

◆ GetSelectionColor()

eC_UInt CGUIEditableText::GetSelectionColor ( ) const

Returns the background color of selected text.

Returns
the background color of selected text.

◆ GetSelectionEnd()

CGUIEditableText::CursorPos_t CGUIEditableText::GetSelectionEnd ( )

Get the selected end cursor position and the end line. Note: The cursor index starts at 0.

Returns
The cursor position and end line stored in CursorPos_t structure.
See also
CursorPos_t

◆ GetSelectionStart()

CGUIEditableText::CursorPos_t CGUIEditableText::GetSelectionStart ( )

Get the selected start cursor position and the start line.

Returns
The cursor position and start line stored in CursorPos_t structure.
See also
CursorPos_t

◆ GetStrOfLine()

eC_String CGUIEditableText::GetStrOfLine ( eC_UInt  uiCurrentLine) const

Get the string of the given line.

Parameters
uiCurrentLineThe line number
Returns
The string of the given line.

◆ HasSelection()

eC_Bool CGUIEditableText::HasSelection ( )

Determines whether this text currently has a selection.

Returns
True if there is a selection, otherwise False.

◆ Insert()

void CGUIEditableText::Insert ( const eC_String &  kInsChars)

Inserts characters at the current cursor position. After this call returns, the cursor is positioned at the end of the inserted text.

Parameters
kInsCharsThe character string to be inserted.

◆ IsCursorVisible()

eC_Bool CGUIEditableText::IsCursorVisible ( ) const

Determines the current visibility of the cursor.

Returns
True if the cursor is currently visible, otherwise False.

◆ IsInLtRField()

eC_Bool CGUIEditableText::IsInLtRField ( eC_UInt  currentIndex)

Return if index is in ltr-field

Parameters
currentIndex
Returns
true if in ltr-field

◆ IsLeftToRightEmbedding()

eC_Bool CGUIEditableText::IsLeftToRightEmbedding ( )

Return if text is containing LTR-embedding

Returns
true if contains embedding

◆ operator=()

CGUIEditableText & CGUIEditableText::operator= ( const CGUIEditableText rkSource)

Assignment operator.

Parameters
rkSourceText instance, which is the source of the assignment.
Returns
The assignment destination

◆ PrintText()

void CGUIEditableText::PrintText ( )
virtual

Draws the text and everything that belongs to it. This includes drawing the selection if there is one, calling the base class implementation to print the text and drawing the cursor if it is set to be visible.

See also
SetSelectionColor()
SetCursorVisible()
CGUIText::PrintText()

Reimplemented from CGUIText.

◆ ReadFromStream()

void CGUIEditableText::ReadFromStream ( )
virtual

Reads attributes from the streaming file. Only for use with GUIFactoryManager.

See also
CGUIObject::ReadFromStream()

Reimplemented from CGUIText.

◆ ResetSelection()

void CGUIEditableText::ResetSelection ( )

Deselects all characters so that there is no selection.

Note
Internally, this method sets the selection 'start' and 'end' positions equal to the current cursor position. This way, a subsequent call to ExtendSelection() starts the 'new' selection at this position.

◆ ResetTurningPoints()

void CGUIEditableText::ResetTurningPoints ( )

Reset all turning points

◆ SelectAll()

void CGUIEditableText::SelectAll ( )

Selects all characters and positions the cursor at the end of the text.

◆ SetCursorPosition()

void CGUIEditableText::SetCursorPosition ( eC_UInt  uiCursorPosAtLine,
eC_UInt  uiCurrentLine = 0 
)

Set the cursor position of given line. Note: The cursor position starts at 0.

Parameters
uiCursorPosAtLineThe cursor position.
uiCurrentLineThe line where the cursor locates.

◆ SetCursorVisible()

void CGUIEditableText::SetCursorVisible ( eC_Bool  bVisible)

Sets the cursor visibility. If the cursor is set to visible, it is drawn in the next call of PrintText().

Parameters
bVisibleThe visibility of the cursor.

◆ SetCursorWidth()

void CGUIEditableText::SetCursorWidth ( eC_Value  vWidth)

Sets the width of the cursor.

Parameters
vWidthThe width of the vertical cursor line.

◆ SetEmbeddingDirection()

void CGUIEditableText::SetEmbeddingDirection ( const eC_Bool  bRightToLeft)

Set the embedding direction

Parameters
bRightToLeft

◆ SetFont()

void CGUIEditableText::SetFont ( const FontResource_t eFontID)
virtual

Calls the base class implementation and updates the character widths.

Parameters
eFontIDThe new font for the text.

Reimplemented from CGUIText.

◆ SetPasswordCharacter()

void CGUIEditableText::SetPasswordCharacter ( eC_String &  kPwdStr)

Activate the password mode to obfuscate the input using a specified character that is displayed instead.

Parameters
kPwdStrThe character that shall be displayed. Pass an empty string to disable the password mode and display readable text.

◆ SetPasswordMode()

void CGUIEditableText::SetPasswordMode ( eC_Bool  bPasswordMode)

Set the password-mode or clear it

Parameters
bPasswordModestate of password-mode

◆ SetSelectionColor() [1/2]

void CGUIEditableText::SetSelectionColor ( const eC_UInt &  uiSelectionColor)

Sets the color used for drawing the background of selected text.

Parameters
uiSelectionColorThe background color of selected text.

◆ SetSelectionColor() [2/2]

void CGUIEditableText::SetSelectionColor ( const GlobalProperty_t uiSelectionColor)

Sets the color used for drawing the background of selected text.

Parameters
uiSelectionColorThe background color of selected text.

◆ SetTextString()

void CGUIEditableText::SetTextString ( const eC_String &  rkTextString)
virtual

Replaces the current text with another one. This results in deleting the current text and inserting the new one. The cursor position is at the beginning of the new text and ResetSelection() is called.

Note
This is a time-consuming function.
Parameters
rkTextStringThe new text.

Reimplemented from CGUIText.

◆ SetWordWrap()

void CGUIEditableText::SetWordWrap ( eC_Bool  bWordWrap,
const eC_Value &  vWidth = eC_FromInt(0) 
)

Enables or disables the word wrap functionalities. If the word wrap is enabled, the text width is set to be the given width. Otherwise, the text width is adjusted to be the required width of current text string.

Parameters
bWordWrapIndicate whether the word wrap is enabled or not.
vWidthThe width that is set to the control is the word wrap is enabled.

◆ ToggleCursor()

void CGUIEditableText::ToggleCursor ( )

Toggles the cursor visibility. Convenience method for controls that implement a blinking cursor.

See also
SetCursorVisible()

◆ WriteToStream()

void CGUIEditableText::WriteToStream ( const eC_Bool  bWriteTextType = false)
virtual

Called by the framework when writing streaming files. When deriving a new text class in an application, re-implement this method.

Parameters
bWriteTextTypeIndicates whether the ID needs to be written. If the framework calls this method, it passes true here. The base class implementation has to be called with false (default). If called with true, the first two tags written must be this text's XML name tag (see GetXMLTag()) and its text type ID. After all attributes are written, the name tag has to be written again as a closing tag (preceded by a slash).

Reimplemented from CGUIText.


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