7#ifndef XFA_FWL_CFWL_EDIT_H_
8#define XFA_FWL_CFWL_EDIT_H_
13#include "xfa/fde/cfde_texteditengine.h"
14#include "xfa/fgas/graphics/cfgas_gepath.h"
15#include "xfa/fwl/cfwl_event.h"
16#include "xfa/fwl/cfwl_scrollbar.h"
17#include "xfa/fwl/cfwl_widget.h"
23#define FWL_STYLEEXT_EDT_ReadOnly (1L
<< 0
)
24#define FWL_STYLEEXT_EDT_MultiLine (1L
<< 1
)
25#define FWL_STYLEEXT_EDT_WantReturn (1L
<< 2
)
26#define FWL_STYLEEXT_EDT_AutoHScroll (1L
<< 4
)
27#define FWL_STYLEEXT_EDT_AutoVScroll (1L
<< 5
)
28#define FWL_STYLEEXT_EDT_Validate (1L
<< 7
)
29#define FWL_STYLEEXT_EDT_Password (1L
<< 8
)
30#define FWL_STYLEEXT_EDT_Number (1L
<< 9
)
31#define FWL_STYLEEXT_EDT_CombText (1L
<< 17
)
32#define FWL_STYLEEXT_EDT_HNear 0
33#define FWL_STYLEEXT_EDT_HCenter (1L
<< 18
)
34#define FWL_STYLEEXT_EDT_HFar (2L
<< 18
)
35#define FWL_STYLEEXT_EDT_VNear 0
36#define FWL_STYLEEXT_EDT_VCenter (1L
<< 20
)
37#define FWL_STYLEEXT_EDT_VFar (2L
<< 20
)
38#define FWL_STYLEEXT_EDT_Justified (1L
<< 22
)
39#define FWL_STYLEEXT_EDT_HAlignMask (3L
<< 18
)
40#define FWL_STYLEEXT_EDT_VAlignMask (3L
<< 20
)
41#define FWL_STYLEEXT_EDT_HAlignModeMask (3L
<< 22
)
42#define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L
<< 25
)
43#define FWL_STYLEEXT_EDT_OuterScrollbar (1L
<< 26
)
46class CFWL_MessageMouse;
56 void Trace(cppgc::Visitor* visitor)
const override;
62 void SetStates(uint32_t dwStates)
override;
119 void UpdateEditEngine();
120 void UpdateEditParams();
121 void UpdateEditLayout();
123 bool UpdateOffset(CFWL_ScrollBar* pScrollBar,
float fPosChanged);
124 void UpdateVAlignment();
126 CFWL_ScrollBar* UpdateScroll();
128 void LayoutScrollBar();
130 void InitVerticalScrollBar();
133 bool IsShowVertScrollBar()
const;
134 bool IsContentHeightOverflow()
const;
135 void SetCursorPosition(size_t position);
136 void UpdateCursorRect();
138 void DoRButtonDown(CFWL_MessageMouse* pMsg);
139 void OnFocusGained();
141 void OnLButtonDown(CFWL_MessageMouse* pMsg);
142 void OnLButtonUp(CFWL_MessageMouse* pMsg);
143 void OnButtonDoubleClick(CFWL_MessageMouse* pMsg);
144 void OnMouseMove(CFWL_MessageMouse* pMsg);
145 void OnKeyDown(CFWL_MessageKey* pMsg);
146 void OnChar(CFWL_MessageKey* pMsg);
147 bool OnScroll(CFWL_ScrollBar* pScrollBar,
148 CFWL_EventScroll::
Code dwCode,
155 bool m_bLButtonDown =
false;
156 int32_t m_nLimit = -1;
157 float m_fVAlignOffset = 0.0f;
158 float m_fScrollOffsetX = 0.0f;
159 float m_fScrollOffsetY = 0.0f;
160 float m_fFontSize = 0.0f;
161 size_t m_CursorPosition = 0;
162 std::unique_ptr<CFDE_TextEditEngine>
const m_pEditEngine;
163 cppgc::Member<CFWL_ScrollBar> m_pVertScrollBar;
164 cppgc::Member<CFWL_Caret> m_pCaret;
void Concat(const CFX_Matrix &right)
void SetModuleWidth(int32_t width)
void SetModuleHeight(int32_t height)
void SetType(BC_TYPE type)
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void SetCalChecksum(bool calChecksum)
void SetErrorCorrectionLevel(int32_t ecLevel)
void OnProcessEvent(CFWL_Event *pEvent) override
void SetWideNarrowRatio(int8_t ratio)
void SetEndChar(char endChar)
void SetDataLength(int32_t dataLength)
void SetStartChar(char startChar)
void SetTextSkipNotify(const WideString &wsText) override
FWL_Type GetClassID() const override
void SetPrintChecksum(bool printChecksum)
void SetText(const WideString &wsText) override
bool IsProtectedType() const
void SetTextLocation(BC_TEXT_LOC location)
void OnProcessMessage(CFWL_Message *pMessage) override
void SetAliasChar(wchar_t wAlias)
void SetScrollOffset(float fScrollOffset) override
void OnTextWillChange(CFDE_TextEditEngine::TextChange *change) override
FWL_WidgetHit HitTest(const CFX_PointF &point) override
WideString GetText() const
CFDE_TextEditEngine * GetTxtEdtEngine()
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
CFX_RectF GetWidgetRect() override
virtual void SetTextSkipNotify(const WideString &wsText)
bool OnValidate(const WideString &wsText) override
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
std::pair< size_t, size_t > GetSelection() const
void Trace(cppgc::Visitor *visitor) const override
bool Paste(const WideString &wsPaste)
void NotifyTextFull() override
void OnTextChanged() override
CFWL_Edit(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
void OnSelChanged() override
const CFX_RectF & GetRTClient() const
std::optional< WideString > Copy()
size_t GetTextLength() const
bool HasSelection() const
std::optional< WideString > Cut()
void SetStates(uint32_t dwStates) override
FWL_Type GetClassID() const override
void SetLimit(int32_t nLimit)
CFX_RectF GetAutosizedWidgetRect() override
void ShowCaret(CFX_RectF *pRect)
void HideCaret(CFX_RectF *pRect)
void PreFinalize() override
virtual void SetText(const WideString &wsText)
void OnCaretChanged() override
void OnProcessEvent(CFWL_Event *pEvent) override
CFX_PTemplate< float > CFX_PointF
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
fxcrt::WideString WideString