10#if !defined(GUIEDITABLETEXT__H_)
11#define GUIEDITABLETEXT__H_
17#include "eC_TList_doubleLinked.h"
72 eC_UInt uiCharIndex = 0,
73 eC_UInt uiLineIndex = 0) :
116 const eC_String &kText,
117 const eC_Value& vXPos = eC_FromInt(0),
118 const eC_Value& vYPos = eC_FromInt(0),
119 const eC_Value& vTextWidth = eC_FromInt(0),
120 eC_Bool bWordWrap =
false);
136 const eC_String*
const pkText,
137 const eC_Value& vXPos = eC_FromInt(0),
138 const eC_Value& vYPos = eC_FromInt(0),
139 const eC_Value& vTextWidth = eC_FromInt(0),
140 eC_Bool bWordWrap =
false);
157 const eC_Value& vXPos = eC_FromInt(0),
158 const eC_Value& vYPos = eC_FromInt(0),
159 const eC_Value& vTextWidth = eC_FromInt(0),
160 eC_Bool bWordWrap =
false);
192 eC_UInt uiCursorPosAtStartLine,
193 eC_UInt uiCursorPosAtEndLine,
194 eC_UInt uiStartLine = 0,
195 eC_UInt uiEndLine = 0);
260 eC_UInt uiCursorPosAtLine,
261 eC_UInt uiCurrentLine = 0);
333 void SetWordWrap(eC_Bool bWordWrap,
const eC_Value& vWidth = eC_FromInt(0));
444#ifdef GUILIANI_STREAM_GUI
448#ifdef GUILIANI_WRITE_GUI
457 eC_Bool m_bRtLEmbedding;
471 eC_UInt uiCursorIndex,
474 m_uiCursorIndex(uiCursorIndex),
475 m_kCursorIter(kCursorIter),
492 CursorIndex_t& operator++()
494 if ((m_pList != NULL) && (m_uiCursorIndex + 1 < m_pList->GetQuantity()))
506 CursorIndex_t operator++(
int)
508 CursorIndex_t kResult = *
this;
517 CursorIndex_t& operator--()
519 if (m_uiCursorIndex > 0)
531 CursorIndex_t operator--(
int)
533 CursorIndex_t kResult = *
this;
543 if (m_kCursorIter.IsValid())
545 return *m_kCursorIter;
547 return eC_FromInt(0);
553 eC_Bool
operator==(CursorIndex_t kCursorIndex)
555 return m_uiCursorIndex == kCursorIndex.m_uiCursorIndex &&
556 m_kCursorIter == kCursorIndex.m_kCursorIter;
564 return m_uiCursorIndex == uiCursorIndex;
570 eC_Bool
operator!=(CursorIndex_t kCursorIndex)
580 return m_uiCursorIndex != uiCursorIndex;
587 eC_Bool operator>(eC_UInt uiCursorIndex)
589 return m_uiCursorIndex > uiCursorIndex;
596 eC_Bool operator<(eC_UInt uiCursorIndex)
598 return m_uiCursorIndex < uiCursorIndex;
607 void SetCursorIndex(eC_UInt uiCursorIndex,
const WidthListIterator& kCursorIter, WidthList* pList)
609 m_uiCursorIndex = uiCursorIndex;
610 m_kCursorIter = kCursorIter;
617 eC_UInt GetCursorIndex()
const
619 return m_uiCursorIndex;
626 WidthListIterator GetCursorIter()
const
628 return m_kCursorIter;
633 eC_UInt m_uiCursorIndex;
637 WidthListIterator m_kCursorIter;
650 void Init(
const eC_Value& vTextWidth);
658 virtual void SetTextSingleLine(
const eC_Bool &bSingleLine);
660 virtual void CollectHyphenationMarks(eC_String& rkStr, eC_UInt uiOffset);
664 void DrawSelection();
674 void SetIndexOfWidthList(eC_UInt uiIndexOfWidthList);
684 void SetSelection(eC_UInt uiStartIndexOfWidthList, eC_UInt uiEndIndexOfWidthList);
694 void RemoveString(eC_UInt uiStartIndexOfWidthList, eC_UInt uiEndIndexOfWidthList);
700 eC_UInt LinePosToIndexOfWidthList(
const CursorPos_t &tCursorLinePos);
706 CursorPos_t GetCursorPositionFromIndex(eC_UInt uiIndexOfWidthList);
720 void ComputeWidths(
const eC_String &kAdjustedStr, eC_UInt uiStartIndexOfWidthList);
727 void ComputeBidiWidths(
const eC_String &kAdjustedStr, eC_UInt uiStartIndexOfWidthList);
740 WidthListIterator &StartWidthIter,
741 WidthListIterator &EndWidthIter);
755 eC_UInt MoveCurrentWidthIndexToSafePos(
756 eC_UInt uiCurrentWidthIndex,
757 eC_UInt uiCursorPosAtCurrentLine,
771 eC_String* pkResultStr,
772 eC_String* pkStrToAnalyse,
773 eC_String* pkRestStr,
774 WidthListIterator &StartWidthIter);
778 void EnsureMinimumTextWidth();
791 WidthList m_kAccumulatedWidth;
793 static const eC_UInt INDEX_COLOR_SELECTION;
794 static int ms_aiEmbeddingLevels[BIDI_MAX_CCH];
797 CursorIndex_t m_kIndexOfWidthList;
800 CursorIndex_t m_kSelStartIndexOfWidthList;
803 CursorIndex_t m_kSelEndIndexOfWidthList;
806 eC_Value m_vCursorWidth;
809 eC_Bool m_bCursorVisible;
812 eC_Bool m_bPasswordMode;
815 eC_String* m_pkPassword;
818 eC_String m_kPwdChar;
820 static const eC_UInt ms_uiInvalidPivot;
FontResource_t
List of font resource ids.
Definition: GUIFontResource.h:54
Helper Macros in Guiliani
GlobalProperty_t
List of property resource ids.
Definition: GUIPropertyResource.h:67
TextResource_t
List of text resource ids.
Definition: GUITextResource.h:40
Specialization of CGUIText that allows for modification and selection of text.
Definition: GUIEditableText.h:62
virtual void WriteToStream(const eC_Bool bWriteTextType=false)
eC_UInt GetRtlTurnPnt(eC_UInt currentIndex)
CursorPos_t GetBestCursorPosition(const eC_Value &vRelXPos, const eC_Value &vRelYPos)
void Delete(eC_UInt uiCursorPosAtStartLine, eC_UInt uiCursorPosAtEndLine, eC_UInt uiStartLine=0, eC_UInt uiEndLine=0)
CGUIEditableText(const CGUIObject *const pkParentObject, 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 CGUIEditableText &rkSource)
eC_Bool GetRectOfIndex(eC_UInt uiIndex, CGUIRect &rect)
void SetWordWrap(eC_Bool bWordWrap, const eC_Value &vWidth=eC_FromInt(0))
virtual CGUIEditableText * Clone() const
BidiTurningPoint_t m_kBidiTurnPoints
turning-points
Definition: GUIEditableText.h:100
eC_Value GetLineHeight()
Definition: GUIEditableText.h:435
CursorPos_t GetLastCursorPos()
CursorPos_t GetCursorPosition()
virtual void SetFont(const FontResource_t &eFontID)
void SetEmbeddingDirection(const eC_Bool bRightToLeft)
virtual void SetTextString(const eC_String &rkTextString)
eC_UInt GetSelectionColor() const
CursorPos_t GetCursorPosByCharIndex(eC_UInt uiCharIndex)
CursorPos_t GetSelectionStart()
void Insert(const eC_String &kInsChars)
void SetSelectionColor(const eC_UInt &uiSelectionColor)
CursorPos_t GetSelectionEnd()
eC_Bool IsInLtRField(eC_UInt currentIndex)
CGUIEditableText(const CGUIObject *const pkParentObject, const TextResource_t &eTextID, 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)
void SetSelectionColor(const GlobalProperty_t &uiSelectionColor)
CGUIEditableText & operator=(const CGUIEditableText &rkSource)
eC_String GetStrOfLine(eC_UInt uiCurrentLine) const
void ResetTurningPoints()
eC_String GetSelectedText()
eC_Bool IsLeftToRightEmbedding()
CGUIRect GetCursorAbsRect()
void SetCursorVisible(eC_Bool bVisible)
virtual const eC_String *const GetPassword()
void ExtendSelection(eC_UInt uiCharIndex, eC_UInt uiLineIndex=0)
void SetCursorPosition(eC_UInt uiCursorPosAtLine, eC_UInt uiCurrentLine=0)
eC_Value GetCursorWidth() const
eC_UInt GetLtrTurnPnt(eC_UInt currentIndex)
void SetPasswordCharacter(eC_String &kPwdStr)
eC_Bool GetLTRpivotField(eC_UInt currentIndex, LeftEmbedding <rPivotPair)
void SetCursorWidth(eC_Value vWidth)
eC_Bool IsCursorVisible() const
void SetPasswordMode(eC_Bool bPasswordMode)
CGUIEditableText(const CGUIObject *const pkParentObject, 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)
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:81
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
Class for handling a text.
Definition: GUIText.h:103
eC_Value m_vLineHeight
The height of one text line with this text's font.
Definition: GUIText.h:980
eC_TIterator< ExtendedString_t > Iterator
Iterator is typedef'd as eC_TIterator ot type T.
Definition: eC_TList_doubleLinked.h:74
bool operator==(const NSmartPtr::SharedPtr< C1 > &a, const NSmartPtr::SharedPtr< C2 > &b)
Definition: SharedPtr.h:240
bool operator!=(const NSmartPtr::SharedPtr< C1 > &a, const NSmartPtr::SharedPtr< C2 > &b)
Definition: SharedPtr.h:226
Definition: GUIEditableText.h:86
eC_TList< eC_UInt > fromRtLIndex
List of Turning points which indicate the indexes of changes from writing RTL chars to LTR ones.
Definition: GUIEditableText.h:88
eC_TList< LeftEmbedding > leftEmbeddingLevels
Definition: GUIEditableText.h:94
eC_TList< RightEmbedding > rightEmbeddingLevels
Definition: GUIEditableText.h:98
eC_TList< eC_UInt > fromLtRIndex
List of Turning points which indicate the indexes of changes from writing LTR chars to RTL ones.
Definition: GUIEditableText.h:90
Holds a cursor position.
Definition: GUIEditableText.h:66
CursorPos_t(eC_UInt uiCharIndex=0, eC_UInt uiLineIndex=0)
Definition: GUIEditableText.h:71
eC_UInt m_uiCharIndex
Cursor position of current line starting from index 0.
Definition: GUIEditableText.h:78
eC_UInt m_uiLineIndex
The line where the cursor is located.
Definition: GUIEditableText.h:79