7#ifndef FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_
8#define FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_
14#include "core/fxcrt/cfx_timer.h"
15#include "core/fxcrt/mask.h"
16#include "core/fxcrt/observed_ptr.h"
17#include "core/fxcrt/unowned_ptr.h"
18#include "fpdfsdk/cpdfsdk_annot.h"
19#include "fpdfsdk/pwl/ipwl_fillernotify.h"
20#include "public/fpdf_fwlevent.h"
23class CPDFSDK_PageView;
57 bool Annot_HitTest(
const CPDFSDK_Widget* pWidget,
const CFX_PointF& point);
59 CPDFSDK_Widget* pWidget);
61 void OnDraw(CPDFSDK_PageView* pPageView,
62 CPDFSDK_Widget* pWidget,
65 void OnDelete(CPDFSDK_Widget* pWidget);
68 ObservedPtr<CPDFSDK_Widget>& pWidget,
69 Mask<FWL_EVENTFLAG> nFlag);
71 ObservedPtr<CPDFSDK_Widget>& pWidget,
72 Mask<FWL_EVENTFLAG> nFlag);
74 ObservedPtr<CPDFSDK_Widget>& pWidget,
75 Mask<FWL_EVENTFLAG> nFlags,
76 const CFX_PointF& point);
78 ObservedPtr<CPDFSDK_Widget>& pWidget,
79 Mask<FWL_EVENTFLAG> nFlags,
80 const CFX_PointF& point);
82 ObservedPtr<CPDFSDK_Widget>& pWidget,
83 Mask<FWL_EVENTFLAG> nFlags,
84 const CFX_PointF& point);
86 ObservedPtr<CPDFSDK_Widget>& pWidget,
87 Mask<FWL_EVENTFLAG> nFlags,
88 const CFX_PointF& point);
90 ObservedPtr<CPDFSDK_Widget>& pWidget,
91 Mask<FWL_EVENTFLAG> nFlags,
92 const CFX_PointF& point,
93 const CFX_Vector& delta);
95 ObservedPtr<CPDFSDK_Widget>& pWidget,
96 Mask<FWL_EVENTFLAG> nFlags,
97 const CFX_PointF& point);
99 ObservedPtr<CPDFSDK_Widget>& pWidget,
100 Mask<FWL_EVENTFLAG> nFlags,
101 const CFX_PointF& point);
104 FWL_VKEYCODE nKeyCode,
105 Mask<FWL_EVENTFLAG> nFlags);
106 bool OnChar(CPDFSDK_Widget* pWidget,
108 Mask<FWL_EVENTFLAG> nFlags);
110 bool OnSetFocus(ObservedPtr<CPDFSDK_Widget>& pWidget,
111 Mask<FWL_EVENTFLAG> nFlag);
112 bool OnKillFocus(ObservedPtr<CPDFSDK_Widget>& pWidget,
113 Mask<FWL_EVENTFLAG> nFlag);
124 return GetFormField(pAnnot);
127 WideString
GetText(CPDFSDK_Widget* pWidget);
133 bool CanUndo(CPDFSDK_Widget* pWidget);
134 bool CanRedo(CPDFSDK_Widget* pWidget);
135 bool Undo(CPDFSDK_Widget* pWidget);
136 bool Redo(CPDFSDK_Widget* pWidget);
138 static bool IsVisible(CPDFSDK_Widget* pWidget);
139 static bool IsReadOnly(CPDFSDK_Widget* pWidget);
140 static bool IsValidAnnot(
const CPDFSDK_PageView* pPageView,
141 CPDFSDK_Widget* pWidget);
144 const CPDFSDK_PageView* pPageView,
145 Mask<FWL_EVENTFLAG> nFlag);
146 bool OnValidate(ObservedPtr<CPDFSDK_Widget>& pWidget,
147 const CPDFSDK_PageView* pPageView,
148 Mask<FWL_EVENTFLAG> nFlag);
149 void OnCalculate(ObservedPtr<CPDFSDK_Widget>& pWidget);
150 void OnFormat(ObservedPtr<CPDFSDK_Widget>& pWidget);
151 bool OnButtonUp(ObservedPtr<CPDFSDK_Widget>& pWidget,
152 const CPDFSDK_PageView* pPageView,
153 Mask<FWL_EVENTFLAG> nFlag);
161 using WidgetToFormFillerMap =
162 std::map<CPDFSDK_Widget*, std::unique_ptr<CFFL_FormField>>;
175 float* fPopupRet)
override;
177 WideString& strChange,
178 const WideString& strChangeEx,
182 Mask<FWL_EVENTFLAG> nFlag)
override;
184 Mask<FWL_EVENTFLAG> nFlag)
override;
186 Mask<FWL_EVENTFLAG> nFlag)
override;
189 void SetFocusAnnotTab(CPDFSDK_Widget* pWidget,
bool bSameField,
bool bNext);
190 bool OnClick(ObservedPtr<CPDFSDK_Widget>& pWidget,
191 const CPDFSDK_PageView* pPageView,
192 Mask<FWL_EVENTFLAG> nFlag);
193 bool OnFull(ObservedPtr<CPDFSDK_Widget>& pAnnot,
194 const CPDFSDK_PageView* pPageView,
195 Mask<FWL_EVENTFLAG> nFlag);
196 bool OnPreOpen(ObservedPtr<CPDFSDK_Widget>& pWidget,
197 const CPDFSDK_PageView* pPageView,
198 Mask<FWL_EVENTFLAG> nFlag);
199 bool OnPostOpen(ObservedPtr<CPDFSDK_Widget>& pWidget,
200 const CPDFSDK_PageView* pPageView,
201 Mask<FWL_EVENTFLAG> nFlag);
204 bool IsFillingAllowed(CPDFSDK_Widget* pWidget)
const;
207 void UnregisterFormField(CPDFSDK_Widget* pWidget);
210 WidgetToFormFillerMap m_Map;
211 bool m_bNotifying =
false;
constexpr CFX_FloatRect(float l, float b, float r, float t)
CPDFSDK_Annot * GetFirstAnnot()
CPDFSDK_Annot * GetLastAnnot()
CPDFSDK_Annot * GetNextAnnot(CPDFSDK_Annot *pAnnot)
CPDFSDK_Annot * GetPrevAnnot(CPDFSDK_Annot *pAnnot)
virtual CFX_FloatRect GetRect() const =0
TEST_F(CPDFSDK_AnnotIteratorTest, CPDFSDK_AnnotIterator)