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
cfwl_eventtextwillchange.h
Go to the documentation of this file.
1// Copyright 2016 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef XFA_FWL_CFWL_EVENTTEXTWILLCHANGE_H_
8#define XFA_FWL_CFWL_EVENTTEXTWILLCHANGE_H_
9
10#include "core/fxcrt/widestring.h"
11#include "xfa/fwl/cfwl_event.h"
12
13class CFWL_EventTextWillChange final : public CFWL_Event {
14 public:
16 const WideString& change_text,
17 const WideString& previous_text,
18 size_t selection_start,
19 size_t selection_end);
21
22 WideString GetChangeText() const { return change_text_; }
23 WideString GetPreviousText() const { return previous_text_; }
24 size_t GetSelectionStart() const { return selection_start_; }
25 size_t GetSelectionEnd() const { return selection_end_; }
26 bool GetCancelled() const { return cancelled_; }
27
28 void SetChangeText(const WideString& change_text) {
29 change_text_ = change_text;
30 }
31 void SetPreviousText(const WideString& previous_text) {
32 previous_text_ = previous_text;
33 }
34 void SetSelectionStart(size_t selection_start) {
35 selection_start_ = selection_start;
36 }
37 void SetSelectionEnd(size_t selection_end) { selection_end_ = selection_end; }
38 void SetCancelled(bool cancelled) { cancelled_ = cancelled; }
39
40 protected:
41 WideString change_text_;
42 WideString previous_text_;
45 bool cancelled_ = false;
46};
47
48#endif // XFA_FWL_CFWL_EVENTTEXTWILLCHANGE_H_
@ CFX_TxtLineAlignment_Justified
@ CFX_TxtLineAlignment_Right
@ CFX_TxtLineAlignment_Center
@ CFX_TxtLineAlignment_Left
#define FWL_STYLEEXT_EDT_MultiLine
Definition cfwl_edit.h:20
#define FWL_STYLEEXT_EDT_HFar
Definition cfwl_edit.h:30
#define FWL_STYLEEXT_EDT_VAlignMask
Definition cfwl_edit.h:36
#define FWL_STYLEEXT_EDT_HAlignModeMask
Definition cfwl_edit.h:37
#define FWL_STYLEEXT_EDT_HAlignMask
Definition cfwl_edit.h:35
#define FWL_STYLEEXT_EDT_ShowScrollbarFocus
Definition cfwl_edit.h:38
#define FWL_STYLEEXT_EDT_WantReturn
Definition cfwl_edit.h:21
#define FWL_STYLEEXT_EDT_VCenter
Definition cfwl_edit.h:32
#define FWL_STYLEEXT_EDT_OuterScrollbar
Definition cfwl_edit.h:39
#define FWL_STYLEEXT_EDT_AutoHScroll
Definition cfwl_edit.h:22
#define FWL_STYLEEXT_EDT_ReadOnly
Definition cfwl_edit.h:19
#define FWL_STYLEEXT_EDT_VFar
Definition cfwl_edit.h:33
#define FWL_STYLEEXT_EDT_AutoVScroll
Definition cfwl_edit.h:23
#define FWL_STYLEEXT_EDT_Validate
Definition cfwl_edit.h:24
#define FWL_STYLEEXT_EDT_HNear
Definition cfwl_edit.h:28
#define FWL_STYLEEXT_EDT_Password
Definition cfwl_edit.h:25
#define FWL_STYLEEXT_EDT_Justified
Definition cfwl_edit.h:34
#define FWL_STYLEEXT_EDT_CombText
Definition cfwl_edit.h:27
#define FWL_STYLEEXT_EDT_HCenter
Definition cfwl_edit.h:29
#define FWL_STYLEEXT_SCB_Vert
#define FWL_STATE_WGT_Invisible
Definition cfwl_widget.h:43
#define FWL_STYLE_WGT_VScroll
Definition cfwl_widget.h:37
FWL_Type
Definition cfwl_widget.h:46
@ DateTimePicker
#define FWL_STATE_WGT_Focused
Definition cfwl_widget.h:42
#define FWL_STATE_WGT_Disabled
Definition cfwl_widget.h:41
StateRestorer(CFGAS_GEGraphics *graphics)
CFX_RenderDevice * GetRenderDevice()
void SetClipRect(const CFX_RectF &rect)
void AddLine(const CFX_PointF &p1, const CFX_PointF &p2)
bool CanUndo()
CFX_RectF GetAutosizedWidgetRect() override
Definition cfwl_edit.cpp:89
void OnTextChanged() override
CFX_RectF GetWidgetRect() override
Definition cfwl_edit.cpp:77
virtual void SetText(const WideString &wsText)
void SetLimit(int32_t nLimit)
void OnProcessMessage(CFWL_Message *pMessage) override
bool Redo()
void ClearSelection()
void OnCaretChanged() override
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
size_t GetTextLength() const
void Trace(cppgc::Visitor *visitor) const override
Definition cfwl_edit.cpp:67
void SetScrollOffset(float fScrollOffset) override
CFWL_Edit(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
Definition cfwl_edit.cpp:50
void Update() override
~CFWL_Edit() override
int32_t GetLimit() const
FWL_WidgetHit HitTest(const CFX_PointF &point) override
bool OnValidate(const WideString &wsText) override
void SetAliasChar(wchar_t wAlias)
bool Undo()
bool Paste(const WideString &wsPaste)
void OnTextWillChange(CFDE_TextEditEngine::TextChange *change) override
absl::optional< WideString > Cut()
WideString GetText() const
FWL_Type GetClassID() const override
Definition cfwl_edit.cpp:73
void PreFinalize() override
Definition cfwl_edit.cpp:60
bool CanRedo()
void SelectAll()
void ShowCaret(CFX_RectF *pRect)
void OnProcessEvent(CFWL_Event *pEvent) override
absl::optional< WideString > Copy()
void ClearText()
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void SetStates(uint32_t dwStates) override
void HideCaret(CFX_RectF *pRect)
bool HasSelection() const
void OnSelChanged() override
void NotifyTextFull() override
std::pair< size_t, size_t > GetSelection() const
virtual void SetTextSkipNotify(const WideString &wsText)
float GetPos() const
Code GetScrollCode() const
~CFWL_EventTextWillChange() override
void SetSelectionEnd(size_t selection_end)
void SetPreviousText(const WideString &previous_text)
void SetChangeText(const WideString &change_text)
CFWL_EventTextWillChange(CFWL_Widget *pSrcTarget, const WideString &change_text, const WideString &previous_text, size_t selection_start, size_t selection_end)
void SetSelectionStart(size_t selection_start)
Type GetType() const
Definition cfwl_event.h:39
CFWL_Widget * GetSrcTarget() const
Definition cfwl_event.h:40
const KeyCommand m_dwCmd
const uint32_t m_dwKeyCodeOrChar
const MouseCommand m_dwCmd
Type GetType() const
CFWL_Widget * GetDstTarget() const
float GetPos() const
float GetStepSize() const
void GetRange(float *fMin, float *fMax) const
void SetPos(float fPos)
float GetPageSize() const
void SetTrackPos(float fTrackPos)
void SetPath(const CFGAS_GEPath *pPath)
CFX_Matrix m_matrix
virtual void DisplayCaret(bool bVisible, const CFX_RectF *pRtAnchor)=0
virtual CFX_Matrix GetRotateMatrix()=0
void InflateWidgetRect(CFX_RectF &rect)
CFWL_Widget(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
virtual void SetStates(uint32_t dwStates)
Properties m_Properties
CFWL_Widget * GetOuter() const
void OnProcessMessage(CFWL_Message *pMessage) override
AdapterIface * GetAdapterIface() const
bool HasBorder() const
CFX_RectF m_WidgetRect
void DrawBorder(CFGAS_GEGraphics *pGraphics, CFWL_ThemePart::Part iPartBorder, const CFX_Matrix &pMatrix)
void RepaintRect(const CFX_RectF &pRect)
virtual CFX_RectF GetWidgetRect()
IFWL_ThemeProvider * GetThemeProvider() const
void SetGrab(bool bSet)
virtual CFX_RectF GetClientRect()
void DispatchEvent(CFWL_Event *pEvent)
bool IsLocked() const
virtual void PreFinalize()
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
CFX_RectF TransformRect(const CFX_RectF &rect) const
CFX_Matrix GetInverse() const
void Concat(const CFX_Matrix &right)
void Offset(float dx, float dy)
constexpr CFX_RectF()=default
bool IsEmpty() const
bool Contains(const CFX_RectF &rt) const
void Intersect(const CFX_RectF &rt)
FX_RECT GetOuterRect() const
void Deflate(float off_left, float off_top, float off_right, float off_bottom)
CFX_RectF & operator=(const CFX_RectF &other)=default
float bottom() const
bool Contains(const PointType &p) const
float right() const
constexpr CFX_RectF(float dst_left, float dst_top, float dst_width, float dst_height)
void Union(const CFX_RectF &rt)
bool SetClip_Rect(const FX_RECT &pRect)
int GetHeight() const
virtual float GetFontSize(const CFWL_ThemePart &pThemePart) const =0
virtual CFX_RectF GetUIMargin(const CFWL_ThemePart &pThemePart) const =0
virtual float GetScrollBarWidth() const =0
XFA_FWL_KeyFlag
@ XFA_FWL_VKEY_Delete
@ XFA_FWL_VKEY_Insert
@ XFA_FWL_VKEY_Tab
@ XFA_FWL_VKEY_F2
FWL_WidgetHit