Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
CFDE_TextEditEngine Class Referencefinal

#include <cfde_texteditengine.h>

+ Inheritance diagram for CFDE_TextEditEngine:
+ Collaboration diagram for CFDE_TextEditEngine:

Classes

class  Delegate
 
class  Iterator
 
class  Operation
 
struct  TextChange
 

Public Types

enum class  RecordOperation { kInsertRecord , kSkipRecord , kSkipNotify }
 

Public Member Functions

 CFDE_TextEditEngine ()
 
 ~CFDE_TextEditEngine () override
 
wchar_t GetChar (size_t idx) const override
 
int32_t GetWidthOfChar (size_t idx) override
 
void SetDelegate (Delegate *delegate)
 
void Clear ()
 
void Insert (size_t idx, const WideString &text, RecordOperation add_operation=RecordOperation::kInsertRecord)
 
WideString Delete (size_t start_idx, size_t length, RecordOperation add_operation=RecordOperation::kInsertRecord)
 
WideString GetText () const
 
size_t GetLength () const
 
CFX_RectF GetContentsBoundingBox ()
 
void SetAvailableWidth (size_t width)
 
void SetFont (RetainPtr< CFGAS_GEFont > font)
 
RetainPtr< CFGAS_GEFontGetFont () const
 
void SetFontSize (float size)
 
float GetFontSize () const
 
void SetFontColor (FX_ARGB color)
 
FX_ARGB GetFontColor () const
 
void SetAlignment (uint32_t alignment)
 
float GetLineSpace () const
 
void SetLineSpace (float space)
 
void SetAliasChar (wchar_t alias)
 
void SetHasCharacterLimit (bool limit)
 
void SetCharacterLimit (size_t limit)
 
void SetCombText (bool enable)
 
void SetTabWidth (float width)
 
void SetVisibleLineCount (size_t lines)
 
void EnableValidation (bool val)
 
void EnablePasswordMode (bool val)
 
void EnableMultiLine (bool val)
 
void EnableLineWrap (bool val)
 
void LimitHorizontalScroll (bool val)
 
void LimitVerticalScroll (bool val)
 
bool CanUndo () const
 
bool CanRedo () const
 
bool Redo ()
 
bool Undo ()
 
void ClearOperationRecords ()
 
size_t GetIndexLeft (size_t pos) const
 
size_t GetIndexRight (size_t pos) const
 
size_t GetIndexUp (size_t pos) const
 
size_t GetIndexDown (size_t pos) const
 
size_t GetIndexAtStartOfLine (size_t pos) const
 
size_t GetIndexAtEndOfLine (size_t pos) const
 
void SelectAll ()
 
void SetSelection (size_t start_idx, size_t count)
 
void ClearSelection ()
 
bool HasSelection () const
 
std::pair< size_t, size_t > GetSelection () const
 
WideString GetSelectedText () const
 
WideString DeleteSelectedText (RecordOperation add_operation=RecordOperation::kInsertRecord)
 
void ReplaceSelectedText (const WideString &str)
 
void Layout ()
 
size_t GetIndexForPoint (const CFX_PointF &point)
 
std::pair< size_t, size_t > BoundsForWordAt (size_t idx) const
 
bool CanGenerateCharacterInfo () const
 
std::pair< int32_t, CFX_RectFGetCharacterInfo (int32_t start_idx)
 
std::vector< CFX_RectFGetCharacterRectsInRange (int32_t start_idx, int32_t count)
 
const std::vector< FDE_TEXTEDITPIECE > & GetTextPieces ()
 
std::vector< TextCharPosGetDisplayPos (const FDE_TEXTEDITPIECE &info)
 
void SetMaxEditOperationsForTesting (size_t max)
 
- Public Member Functions inherited from CFGAS_TxtBreak::Engine
virtual ~Engine ()
 

Detailed Description

Definition at line 41 of file cfde_texteditengine.h.

Member Enumeration Documentation

◆ RecordOperation

Enumerator
kInsertRecord 
kSkipRecord 
kSkipNotify 

Definition at line 86 of file cfde_texteditengine.h.

Constructor & Destructor Documentation

◆ CFDE_TextEditEngine()

CFDE_TextEditEngine::CFDE_TextEditEngine ( )

Definition at line 123 of file cfde_texteditengine.cpp.

◆ ~CFDE_TextEditEngine()

CFDE_TextEditEngine::~CFDE_TextEditEngine ( )
overridedefault

Member Function Documentation

◆ BoundsForWordAt()

std::pair< size_t, size_t > CFDE_TextEditEngine::BoundsForWordAt ( size_t idx) const

Definition at line 1169 of file cfde_texteditengine.cpp.

References CFDE_TextEditEngine::Iterator::Iterator().

+ Here is the call graph for this function:

◆ CanGenerateCharacterInfo()

bool CFDE_TextEditEngine::CanGenerateCharacterInfo ( ) const
inline

Definition at line 171 of file cfde_texteditengine.h.

◆ CanRedo()

bool CFDE_TextEditEngine::CanRedo ( ) const

Definition at line 538 of file cfde_texteditengine.cpp.

Referenced by Redo().

+ Here is the caller graph for this function:

◆ CanUndo()

bool CFDE_TextEditEngine::CanUndo ( ) const

Definition at line 533 of file cfde_texteditengine.cpp.

Referenced by Undo().

+ Here is the caller graph for this function:

◆ Clear()

void CFDE_TextEditEngine::Clear ( )

Definition at line 134 of file cfde_texteditengine.cpp.

References ClearOperationRecords(), and ClearSelection().

+ Here is the call graph for this function:

◆ ClearOperationRecords()

void CFDE_TextEditEngine::ClearOperationRecords ( )

Definition at line 390 of file cfde_texteditengine.cpp.

Referenced by Clear(), LimitHorizontalScroll(), LimitVerticalScroll(), SetAvailableWidth(), SetCharacterLimit(), and SetMaxEditOperationsForTesting().

+ Here is the caller graph for this function:

◆ ClearSelection()

void CFDE_TextEditEngine::ClearSelection ( )

Definition at line 726 of file cfde_texteditengine.cpp.

Referenced by Clear(), Delete(), Insert(), and SetSelection().

+ Here is the caller graph for this function:

◆ Delete()

WideString CFDE_TextEditEngine::Delete ( size_t start_idx,
size_t length,
RecordOperation add_operation = RecordOperation::kInsertRecord )

Definition at line 789 of file cfde_texteditengine.cpp.

References fxcrt::WideString::WideString(), CFDE_TextEditEngine::TextChange::cancelled, ClearSelection(), GetText(), and kInsertRecord.

+ Here is the call graph for this function:

◆ DeleteSelectedText()

WideString CFDE_TextEditEngine::DeleteSelectedText ( RecordOperation add_operation = RecordOperation::kInsertRecord)

Definition at line 781 of file cfde_texteditengine.cpp.

References fxcrt::WideString::WideString().

Referenced by Insert(), and ReplaceSelectedText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnableLineWrap()

void CFDE_TextEditEngine::EnableLineWrap ( bool val)

Definition at line 682 of file cfde_texteditengine.cpp.

◆ EnableMultiLine()

void CFDE_TextEditEngine::EnableMultiLine ( bool val)

Definition at line 667 of file cfde_texteditengine.cpp.

References CFGAS_Break::kSingleLine.

◆ EnablePasswordMode()

void CFDE_TextEditEngine::EnablePasswordMode ( bool val)
inline

Definition at line 130 of file cfde_texteditengine.h.

◆ EnableValidation()

void CFDE_TextEditEngine::EnableValidation ( bool val)
inline

Definition at line 129 of file cfde_texteditengine.h.

◆ GetChar()

wchar_t CFDE_TextEditEngine::GetChar ( size_t idx) const
overridevirtual

Implements CFGAS_TxtBreak::Engine.

Definition at line 889 of file cfde_texteditengine.cpp.

◆ GetCharacterInfo()

std::pair< int32_t, CFX_RectF > CFDE_TextEditEngine::GetCharacterInfo ( int32_t start_idx)

Definition at line 1120 of file cfde_texteditengine.cpp.

References Layout().

+ Here is the call graph for this function:

◆ GetCharacterRectsInRange()

std::vector< CFX_RectF > CFDE_TextEditEngine::GetCharacterRectsInRange ( int32_t start_idx,
int32_t count )

Definition at line 1137 of file cfde_texteditengine.cpp.

References Layout().

+ Here is the call graph for this function:

◆ GetContentsBoundingBox()

CFX_RectF CFDE_TextEditEngine::GetContentsBoundingBox ( )

Definition at line 573 of file cfde_texteditengine.cpp.

References Layout().

+ Here is the call graph for this function:

◆ GetDisplayPos()

◆ GetFont()

RetainPtr< CFGAS_GEFont > CFDE_TextEditEngine::GetFont ( ) const

Definition at line 628 of file cfde_texteditengine.cpp.

◆ GetFontColor()

FX_ARGB CFDE_TextEditEngine::GetFontColor ( ) const
inline

Definition at line 117 of file cfde_texteditengine.h.

◆ GetFontSize()

float CFDE_TextEditEngine::GetFontSize ( ) const
inline

Definition at line 115 of file cfde_texteditengine.h.

◆ GetIndexAtEndOfLine()

size_t CFDE_TextEditEngine::GetIndexAtEndOfLine ( size_t pos) const

Definition at line 505 of file cfde_texteditengine.cpp.

◆ GetIndexAtStartOfLine()

size_t CFDE_TextEditEngine::GetIndexAtStartOfLine ( size_t pos) const

Definition at line 484 of file cfde_texteditengine.cpp.

◆ GetIndexDown()

size_t CFDE_TextEditEngine::GetIndexDown ( size_t pos) const

Definition at line 458 of file cfde_texteditengine.cpp.

◆ GetIndexForPoint()

size_t CFDE_TextEditEngine::GetIndexForPoint ( const CFX_PointF & point)

Definition at line 906 of file cfde_texteditengine.cpp.

References Layout().

+ Here is the call graph for this function:

◆ GetIndexLeft()

size_t CFDE_TextEditEngine::GetIndexLeft ( size_t pos) const

Definition at line 398 of file cfde_texteditengine.cpp.

◆ GetIndexRight()

size_t CFDE_TextEditEngine::GetIndexRight ( size_t pos) const

Definition at line 414 of file cfde_texteditengine.cpp.

◆ GetIndexUp()

size_t CFDE_TextEditEngine::GetIndexUp ( size_t pos) const

Definition at line 429 of file cfde_texteditengine.cpp.

◆ GetLength()

size_t CFDE_TextEditEngine::GetLength ( ) const

Definition at line 885 of file cfde_texteditengine.cpp.

◆ GetLineSpace()

float CFDE_TextEditEngine::GetLineSpace ( ) const
inline

Definition at line 120 of file cfde_texteditengine.h.

◆ GetSelectedText()

WideString CFDE_TextEditEngine::GetSelectedText ( ) const

Definition at line 748 of file cfde_texteditengine.cpp.

References fxcrt::WideString::WideString().

+ Here is the call graph for this function:

◆ GetSelection()

std::pair< size_t, size_t > CFDE_TextEditEngine::GetSelection ( ) const
inline

Definition at line 154 of file cfde_texteditengine.h.

◆ GetText()

WideString CFDE_TextEditEngine::GetText ( ) const

Definition at line 874 of file cfde_texteditengine.cpp.

Referenced by Delete(), Insert(), and ReplaceSelectedText().

+ Here is the caller graph for this function:

◆ GetTextPieces()

const std::vector< FDE_TEXTEDITPIECE > & CFDE_TextEditEngine::GetTextPieces ( )
inline

Definition at line 178 of file cfde_texteditengine.h.

References Layout().

+ Here is the call graph for this function:

◆ GetWidthOfChar()

int32_t CFDE_TextEditEngine::GetWidthOfChar ( size_t idx)
overridevirtual

Implements CFGAS_TxtBreak::Engine.

Definition at line 900 of file cfde_texteditengine.cpp.

References Layout().

+ Here is the call graph for this function:

◆ HasSelection()

bool CFDE_TextEditEngine::HasSelection ( ) const
inline

Definition at line 152 of file cfde_texteditengine.h.

◆ Insert()

void CFDE_TextEditEngine::Insert ( size_t idx,
const WideString & text,
RecordOperation add_operation = RecordOperation::kInsertRecord )

Definition at line 225 of file cfde_texteditengine.cpp.

References CFDE_TextEditEngine::TextChange::cancelled, ClearSelection(), DeleteSelectedText(), GetText(), fxcrt::WideString::IsEmpty(), kInsertRecord, kSkipNotify, kSkipRecord, fxcrt::WideString::operator+=(), and fxcrt::WideString::operator=().

+ Here is the call graph for this function:

◆ Layout()

void CFDE_TextEditEngine::Layout ( )

Definition at line 565 of file cfde_texteditengine.cpp.

Referenced by GetCharacterInfo(), GetCharacterRectsInRange(), GetContentsBoundingBox(), GetIndexForPoint(), GetTextPieces(), and GetWidthOfChar().

+ Here is the caller graph for this function:

◆ LimitHorizontalScroll()

void CFDE_TextEditEngine::LimitHorizontalScroll ( bool val)

Definition at line 523 of file cfde_texteditengine.cpp.

References ClearOperationRecords().

+ Here is the call graph for this function:

◆ LimitVerticalScroll()

void CFDE_TextEditEngine::LimitVerticalScroll ( bool val)

Definition at line 528 of file cfde_texteditengine.cpp.

References ClearOperationRecords().

+ Here is the call graph for this function:

◆ Redo()

bool CFDE_TextEditEngine::Redo ( )

Definition at line 544 of file cfde_texteditengine.cpp.

References CanRedo().

+ Here is the call graph for this function:

◆ ReplaceSelectedText()

void CFDE_TextEditEngine::ReplaceSelectedText ( const WideString & str)

Definition at line 846 of file cfde_texteditengine.cpp.

References CFDE_TextEditEngine::TextChange::cancelled, DeleteSelectedText(), GetText(), and kSkipRecord.

+ Here is the call graph for this function:

◆ SelectAll()

void CFDE_TextEditEngine::SelectAll ( )

Definition at line 717 of file cfde_texteditengine.cpp.

◆ SetAliasChar()

void CFDE_TextEditEngine::SetAliasChar ( wchar_t alias)
inline

Definition at line 122 of file cfde_texteditengine.h.

◆ SetAlignment()

void CFDE_TextEditEngine::SetAlignment ( uint32_t alignment)

Definition at line 650 of file cfde_texteditengine.cpp.

◆ SetAvailableWidth()

void CFDE_TextEditEngine::SetAvailableWidth ( size_t width)

Definition at line 579 of file cfde_texteditengine.cpp.

References ClearOperationRecords().

+ Here is the call graph for this function:

◆ SetCharacterLimit()

void CFDE_TextEditEngine::SetCharacterLimit ( size_t limit)

Definition at line 606 of file cfde_texteditengine.cpp.

References ClearOperationRecords().

+ Here is the call graph for this function:

◆ SetCombText()

void CFDE_TextEditEngine::SetCombText ( bool enable)

Definition at line 692 of file cfde_texteditengine.cpp.

References CFGAS_Break::kCombText.

◆ SetDelegate()

void CFDE_TextEditEngine::SetDelegate ( Delegate * delegate)
inline

Definition at line 95 of file cfde_texteditengine.h.

◆ SetFont()

void CFDE_TextEditEngine::SetFont ( RetainPtr< CFGAS_GEFont > font)

Definition at line 619 of file cfde_texteditengine.cpp.

◆ SetFontColor()

void CFDE_TextEditEngine::SetFontColor ( FX_ARGB color)
inline

Definition at line 116 of file cfde_texteditengine.h.

◆ SetFontSize()

void CFDE_TextEditEngine::SetFontSize ( float size)

Definition at line 632 of file cfde_texteditengine.cpp.

◆ SetHasCharacterLimit()

void CFDE_TextEditEngine::SetHasCharacterLimit ( bool limit)

Definition at line 594 of file cfde_texteditengine.cpp.

◆ SetLineSpace()

void CFDE_TextEditEngine::SetLineSpace ( float space)
inline

Definition at line 121 of file cfde_texteditengine.h.

◆ SetMaxEditOperationsForTesting()

void CFDE_TextEditEngine::SetMaxEditOperationsForTesting ( size_t max)

Definition at line 146 of file cfde_texteditengine.cpp.

References ClearOperationRecords().

+ Here is the call graph for this function:

◆ SetSelection()

void CFDE_TextEditEngine::SetSelection ( size_t start_idx,
size_t count )

Definition at line 732 of file cfde_texteditengine.cpp.

References ClearSelection().

+ Here is the call graph for this function:

◆ SetTabWidth()

void CFDE_TextEditEngine::SetTabWidth ( float width)

Definition at line 641 of file cfde_texteditengine.cpp.

◆ SetVisibleLineCount()

void CFDE_TextEditEngine::SetVisibleLineCount ( size_t lines)

Definition at line 659 of file cfde_texteditengine.cpp.

◆ Undo()

bool CFDE_TextEditEngine::Undo ( )

Definition at line 554 of file cfde_texteditengine.cpp.

References CanUndo().

+ Here is the call graph for this function:

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