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
cffl_formfield.cpp
Go to the documentation of this file.
1// Copyright 2014 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#include "fpdfsdk/formfiller/cffl_formfield.h"
8
9#include <utility>
10
11#include "constants/form_flags.h"
12#include "core/fpdfapi/page/cpdf_page.h"
13#include "core/fxge/cfx_renderdevice.h"
14#include "fpdfsdk/cpdfsdk_pageview.h"
15#include "fpdfsdk/cpdfsdk_widget.h"
16#include "fpdfsdk/formfiller/cffl_perwindowdata.h"
17#include "third_party/base/check.h"
18
19CFFL_FormField::CFFL_FormField(CFFL_InteractiveFormFiller* pFormFiller,
20 CPDFSDK_Widget* pWidget)
22 DCHECK(m_pFormFiller);
23}
24
28
30 while (!m_Maps.empty()) {
31 auto it = m_Maps.begin();
32 std::unique_ptr<CPWL_Wnd> pWnd = std::move(it->second);
33 m_Maps.erase(it);
34 pWnd->InvalidateProvider(this);
35 pWnd->Destroy();
36 }
37}
38
39FX_RECT CFFL_FormField::GetViewBBox(const CPDFSDK_PageView* pPageView) {
40 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
41 CFX_FloatRect rcAnnot =
42 pWnd ? PWLtoFFL(pWnd->GetWindowRect()) : m_pWidget->GetRect();
43 CFX_FloatRect rcFocus = GetFocusBox(pPageView);
44
45 CFX_FloatRect rcWin = rcAnnot;
46 if (!rcFocus.IsEmpty())
47 rcWin.Union(rcFocus);
48 if (!rcWin.IsEmpty()) {
49 rcWin.Inflate(1, 1);
50 rcWin.Normalize();
51 }
52
53 return rcWin.GetOuterRect();
54}
55
56void CFFL_FormField::OnDraw(CPDFSDK_PageView* pPageView,
57 CPDFSDK_Widget* pWidget,
58 CFX_RenderDevice* pDevice,
59 const CFX_Matrix& mtUser2Device) {
60 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
61 if (pWnd) {
62 pWnd->DrawAppearance(pDevice, GetCurMatrix() * mtUser2Device);
63 return;
64 }
65 if (!CFFL_InteractiveFormFiller::IsVisible(pWidget))
66 return;
67
68 pWidget->DrawAppearance(pDevice, mtUser2Device,
70}
71
72void CFFL_FormField::OnDrawDeactive(CPDFSDK_PageView* pPageView,
73 CPDFSDK_Widget* pWidget,
74 CFX_RenderDevice* pDevice,
75 const CFX_Matrix& mtUser2Device) {
76 pWidget->DrawAppearance(pDevice, mtUser2Device,
78}
79
80void CFFL_FormField::OnMouseEnter(CPDFSDK_PageView* pPageView) {}
81
82void CFFL_FormField::OnMouseExit(CPDFSDK_PageView* pPageView) {
83 m_pTimer.reset();
84 DCHECK(m_pWidget);
85}
86
87bool CFFL_FormField::OnLButtonDown(CPDFSDK_PageView* pPageView,
88 CPDFSDK_Widget* pWidget,
89 Mask<FWL_EVENTFLAG> nFlags,
90 const CFX_PointF& point) {
91 CPWL_Wnd* pWnd = CreateOrUpdatePWLWindow(pPageView);
92 if (!pWnd)
93 return false;
94
95 m_bValid = true;
96 FX_RECT rect = GetViewBBox(pPageView);
98 if (!rect.Contains(static_cast<int>(point.x), static_cast<int>(point.y)))
99 return false;
100 return pWnd->OnLButtonDown(nFlags, FFLtoPWL(point));
101}
102
103bool CFFL_FormField::OnLButtonUp(CPDFSDK_PageView* pPageView,
104 CPDFSDK_Widget* pWidget,
105 Mask<FWL_EVENTFLAG> nFlags,
106 const CFX_PointF& point) {
107 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
108 if (!pWnd)
109 return false;
110
112 pWnd->OnLButtonUp(nFlags, FFLtoPWL(point));
113 return true;
114}
115
116bool CFFL_FormField::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
117 Mask<FWL_EVENTFLAG> nFlags,
118 const CFX_PointF& point) {
119 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
120 if (!pWnd)
121 return false;
122
123 pWnd->OnLButtonDblClk(nFlags, FFLtoPWL(point));
124 return true;
125}
126
127bool CFFL_FormField::OnMouseMove(CPDFSDK_PageView* pPageView,
128 Mask<FWL_EVENTFLAG> nFlags,
129 const CFX_PointF& point) {
130 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
131 if (!pWnd)
132 return false;
133
134 pWnd->OnMouseMove(nFlags, FFLtoPWL(point));
135 return true;
136}
137
138bool CFFL_FormField::OnMouseWheel(CPDFSDK_PageView* pPageView,
139 Mask<FWL_EVENTFLAG> nFlags,
140 const CFX_PointF& point,
141 const CFX_Vector& delta) {
142 if (!IsValid())
143 return false;
144
145 CPWL_Wnd* pWnd = CreateOrUpdatePWLWindow(pPageView);
146 return pWnd && pWnd->OnMouseWheel(nFlags, FFLtoPWL(point), delta);
147}
148
149bool CFFL_FormField::OnRButtonDown(CPDFSDK_PageView* pPageView,
150 Mask<FWL_EVENTFLAG> nFlags,
151 const CFX_PointF& point) {
152 CPWL_Wnd* pWnd = CreateOrUpdatePWLWindow(pPageView);
153 return pWnd && pWnd->OnRButtonDown(nFlags, FFLtoPWL(point));
154}
155
156bool CFFL_FormField::OnRButtonUp(CPDFSDK_PageView* pPageView,
157 Mask<FWL_EVENTFLAG> nFlags,
158 const CFX_PointF& point) {
159 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
160 return pWnd && pWnd->OnRButtonUp(nFlags, FFLtoPWL(point));
161}
162
163bool CFFL_FormField::OnKeyDown(FWL_VKEYCODE nKeyCode,
164 Mask<FWL_EVENTFLAG> nFlags) {
165 if (!IsValid())
166 return false;
167
169 return pWnd && pWnd->OnKeyDown(nKeyCode, nFlags);
170}
171
172bool CFFL_FormField::OnChar(CPDFSDK_Widget* pWidget,
173 uint32_t nChar,
174 Mask<FWL_EVENTFLAG> nFlags) {
175 if (!IsValid())
176 return false;
177
179 return pWnd && pWnd->OnChar(nChar, nFlags);
180}
181
182bool CFFL_FormField::SetIndexSelected(int index, bool selected) {
183 return false;
184}
185
187 return false;
188}
189
190WideString CFFL_FormField::GetText() {
191 if (!IsValid())
192 return WideString();
193
195 return pWnd ? pWnd->GetText() : WideString();
196}
197
199 if (!IsValid())
200 return WideString();
201
203 return pWnd ? pWnd->GetSelectedText() : WideString();
204}
205
206void CFFL_FormField::ReplaceAndKeepSelection(const WideString& text) {
207 if (!IsValid())
208 return;
209
211 if (!pWnd)
212 return;
213
215}
216
217void CFFL_FormField::ReplaceSelection(const WideString& text) {
218 if (!IsValid())
219 return;
220
222 if (!pWnd)
223 return;
224
225 pWnd->ReplaceSelection(text);
226}
227
229 if (!IsValid())
230 return false;
231
233 return pWnd && pWnd->SelectAllText();
234}
235
237 if (!IsValid())
238 return false;
239
241 return pWnd && pWnd->CanUndo();
242}
243
245 if (!IsValid())
246 return false;
247
249 return pWnd && pWnd->CanRedo();
250}
251
253 if (!IsValid())
254 return false;
255
257 return pWnd && pWnd->Undo();
258}
259
261 if (!IsValid())
262 return false;
263
265 return pWnd && pWnd->Redo();
266}
267
268void CFFL_FormField::SetFocusForAnnot(CPDFSDK_Widget* pWidget,
269 Mask<FWL_EVENTFLAG> nFlag) {
270 CPDFSDK_PageView* pPageView =
271 m_pFormFiller->GetOrCreatePageView(pWidget->GetPage());
272 CPWL_Wnd* pWnd = CreateOrUpdatePWLWindow(pPageView);
273 if (pWnd)
274 pWnd->SetFocus();
275
276 m_bValid = true;
278}
279
280void CFFL_FormField::KillFocusForAnnot(Mask<FWL_EVENTFLAG> nFlag) {
281 if (!IsValid())
282 return;
283
284 CPDFSDK_PageView* pPageView =
285 m_pFormFiller->GetPageView(m_pWidget->GetPage());
286 if (!pPageView || !CommitData(pPageView, nFlag))
287 return;
288 if (CPWL_Wnd* pWnd = GetPWLWindow(pPageView))
289 pWnd->KillFocus();
290
291 bool bDestroyPWLWindow;
292 switch (m_pWidget->GetFieldType()) {
293 case FormFieldType::kPushButton:
294 case FormFieldType::kCheckBox:
295 case FormFieldType::kRadioButton:
296 bDestroyPWLWindow = true;
297 break;
298 default:
299 bDestroyPWLWindow = false;
300 break;
301 }
302 EscapeFiller(pPageView, bDestroyPWLWindow);
303}
304
305bool CFFL_FormField::IsValid() const {
306 return m_bValid;
307}
308
310 CPWL_Wnd::CreateParams cp(m_pFormFiller->GetTimerHandler(), m_pFormFiller,
311 this);
312
314
315 uint32_t dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE;
316 uint32_t dwFieldFlag = m_pWidget->GetFieldFlags();
317 if (dwFieldFlag & pdfium::form_flags::kReadOnly)
318 dwCreateFlags |= PWS_READONLY;
319
320 absl::optional<FX_COLORREF> color = m_pWidget->GetFillColor();
321 if (color.has_value())
322 cp.sBackgroundColor = CFX_Color(color.value());
323 color = m_pWidget->GetBorderColor();
324 if (color.has_value())
325 cp.sBorderColor = CFX_Color(color.value());
326
328
329 color = m_pWidget->GetTextColor();
330 if (color.has_value())
331 cp.sTextColor = CFX_Color(color.value());
332
333 cp.fFontSize = m_pWidget->GetFontSize();
334 cp.dwBorderWidth = m_pWidget->GetBorderWidth();
335
336 cp.nBorderStyle = m_pWidget->GetBorderStyle();
337 switch (cp.nBorderStyle) {
339 cp.sDash = CPWL_Dash(3, 3, 0);
340 break;
343 cp.dwBorderWidth *= 2;
344 break;
345 default:
346 break;
347 }
348
349 if (cp.fFontSize <= 0)
350 dwCreateFlags |= PWS_AUTOFONTSIZE;
351
352 cp.dwFlags = dwCreateFlags;
353 return cp;
354}
355
357 const CPDFSDK_PageView* pPageView) const {
358 DCHECK(pPageView);
359 auto it = m_Maps.find(pPageView);
360 return it != m_Maps.end() ? it->second.get() : nullptr;
361}
362
364 const CPDFSDK_PageView* pPageView) {
365 DCHECK(pPageView);
366 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
367 if (!pWnd) {
369 // TODO(tsepez): maybe pass widget's value age as 4th arg.
370 auto pPrivateData = std::make_unique<CFFL_PerWindowData>(
371 m_pWidget, pPageView, m_pWidget->GetAppearanceAge(), 0);
372 m_Maps[pPageView] = NewPWLWindow(cp, std::move(pPrivateData));
373 return m_Maps[pPageView].get();
374 }
375 const auto* pPrivateData =
376 static_cast<const CFFL_PerWindowData*>(pWnd->GetAttachedData());
377 if (pPrivateData->AppearanceAgeEquals(m_pWidget->GetAppearanceAge()))
378 return pWnd;
379
380 return ResetPWLWindowForValueAgeInternal(pPageView, m_pWidget,
381 pPrivateData->GetValueAge());
382}
383
384void CFFL_FormField::DestroyPWLWindow(const CPDFSDK_PageView* pPageView) {
385 auto it = m_Maps.find(pPageView);
386 if (it == m_Maps.end())
387 return;
388
389 std::unique_ptr<CPWL_Wnd> pWnd = std::move(it->second);
390 m_Maps.erase(it);
391 pWnd->Destroy();
392}
393
395 const IPWL_FillerNotify::PerWindowData* pAttached) {
396 const auto* pPrivateData = static_cast<const CFFL_PerWindowData*>(pAttached);
397 if (!pPrivateData)
398 return CFX_Matrix();
399
400 const CPDFSDK_PageView* pPageView = pPrivateData->GetPageView();
401 if (!pPageView)
402 return CFX_Matrix();
403
404 return GetCurMatrix() * pPageView->GetCurrentMatrix();
405}
406
407void CFFL_FormField::OnSetFocusForEdit(CPWL_Edit* pEdit) {
408 // Only sub-classes might have a subordinate edit to focus.
409}
410
412 CFX_Matrix mt;
413 CFX_FloatRect rcDA = m_pWidget->GetPDFAnnot()->GetRect();
414 switch (m_pWidget->GetRotate()) {
415 case 90:
416 mt = CFX_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0);
417 break;
418 case 180:
419 mt = CFX_Matrix(-1, 0, 0, -1, rcDA.right - rcDA.left,
420 rcDA.top - rcDA.bottom);
421 break;
422 case 270:
423 mt = CFX_Matrix(0, -1, 1, 0, 0, rcDA.top - rcDA.bottom);
424 break;
425 case 0:
426 default:
427 break;
428 }
429 mt.e += rcDA.left;
430 mt.f += rcDA.bottom;
431
432 return mt;
433}
434
436 CFX_FloatRect rectAnnot = m_pWidget->GetPDFAnnot()->GetRect();
437 float fWidth = rectAnnot.Width();
438 float fHeight = rectAnnot.Height();
439 if ((m_pWidget->GetRotate() / 90) & 0x01)
440 std::swap(fWidth, fHeight);
441 return CFX_FloatRect(0, 0, fWidth, fHeight);
442}
443
444CPDFSDK_PageView* CFFL_FormField::GetCurPageView() {
445 return m_pFormFiller->GetOrCreatePageView(m_pWidget->GetPage());
446}
447
448CFX_FloatRect CFFL_FormField::GetFocusBox(const CPDFSDK_PageView* pPageView) {
449 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
450 if (!pWnd)
451 return CFX_FloatRect();
452
454 return pPageView->GetPDFPage()->GetBBox().Contains(rcFocus) ? rcFocus
456}
457
461
465
466CFX_PointF CFFL_FormField::FFLtoPWL(const CFX_PointF& point) {
468}
469
470CFX_PointF CFFL_FormField::PWLtoFFL(const CFX_PointF& point) {
471 return GetCurMatrix().Transform(point);
472}
473
474bool CFFL_FormField::CommitData(const CPDFSDK_PageView* pPageView,
475 Mask<FWL_EVENTFLAG> nFlag) {
476 if (!IsDataChanged(pPageView))
477 return true;
478
479 ObservedPtr<CPDFSDK_Widget> pObserved(m_pWidget);
480 if (!m_pFormFiller->OnKeyStrokeCommit(pObserved, pPageView, nFlag)) {
481 if (!pObserved)
482 return false;
483 ResetPWLWindow(pPageView);
484 return true;
485 }
486 if (!pObserved)
487 return false;
488
489 if (!m_pFormFiller->OnValidate(pObserved, pPageView, nFlag)) {
490 if (!pObserved)
491 return false;
492 ResetPWLWindow(pPageView);
493 return true;
494 }
495 if (!pObserved)
496 return false;
497
498 SaveData(pPageView); // may invoking JS to delete this widget.
499 if (!pObserved)
500 return false;
501
502 m_pFormFiller->OnCalculate(pObserved);
503 if (!pObserved)
504 return false;
505
506 m_pFormFiller->OnFormat(pObserved);
507 if (!pObserved)
508 return false;
509
510 return true;
511}
512
513bool CFFL_FormField::IsDataChanged(const CPDFSDK_PageView* pPageView) {
514 return false;
515}
516
517void CFFL_FormField::SaveData(const CPDFSDK_PageView* pPageView) {}
518
519#ifdef PDF_ENABLE_XFA
520bool CFFL_FormField::IsFieldFull(const CPDFSDK_PageView* pPageView) {
521 return false;
522}
523#endif // PDF_ENABLE_XFA
524
526 m_pFormFiller->OnChange();
527}
528
529void CFFL_FormField::GetActionData(const CPDFSDK_PageView* pPageView,
531 CFFL_FieldAction& fa) {
532 fa.sValue = m_pWidget->GetValue();
533}
534
535void CFFL_FormField::SetActionData(const CPDFSDK_PageView* pPageView,
537 const CFFL_FieldAction& fa) {}
538
539void CFFL_FormField::SavePWLWindowState(const CPDFSDK_PageView* pPageView) {}
540
542 const CPDFSDK_PageView* pPageView) {}
543
545 const CPDFSDK_PageView* pPageView) {
546 CPWL_Wnd* pWnd = GetPWLWindow(pPageView);
547 if (!pWnd)
548 return nullptr;
549
550 return static_cast<CFFL_PerWindowData*>(pWnd->GetAttachedData());
551}
552
554 const CPDFSDK_PageView* pPageView,
555 CPDFSDK_Widget* pWidget,
556 uint32_t nValueAge) {
557 // Don't leak PWL_Wnd result to public callers.
558 ResetPWLWindowForValueAgeInternal(pPageView, pWidget, nValueAge);
559}
560
562 const CPDFSDK_PageView* pPageView,
563 CPDFSDK_Widget* pWidget,
564 uint32_t nValueAge) {
565 return nValueAge == pWidget->GetValueAge() ? RestorePWLWindow(pPageView)
566 : ResetPWLWindow(pPageView);
567}
568
569CPWL_Wnd* CFFL_FormField::ResetPWLWindow(const CPDFSDK_PageView* pPageView) {
570 return GetPWLWindow(pPageView);
571}
572
573CPWL_Wnd* CFFL_FormField::RestorePWLWindow(const CPDFSDK_PageView* pPageView) {
574 return GetPWLWindow(pPageView);
575}
576
578
579void CFFL_FormField::EscapeFiller(CPDFSDK_PageView* pPageView,
580 bool bDestroyPWLWindow) {
581 m_bValid = false;
582
584 if (bDestroyPWLWindow)
585 DestroyPWLWindow(pPageView);
586}
587
589 m_pFormFiller->Invalidate(m_pWidget->GetPage(), rect);
590}
BorderStyle
CFX_PointF FFLtoPWL(const CFX_PointF &point)
virtual void RecreatePWLWindowFromSavedState(const CPDFSDK_PageView *pPageView)
CPWL_Wnd * ResetPWLWindowForValueAgeInternal(const CPDFSDK_PageView *pPageView, CPDFSDK_Widget *pWidget, uint32_t nValueAge)
CFX_FloatRect PWLtoFFL(const CFX_FloatRect &rect)
CFX_FloatRect GetFocusBox(const CPDFSDK_PageView *pPageView)
virtual bool OnChar(CPDFSDK_Widget *pAnnot, uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags)
void InvalidateRect(const FX_RECT &rect)
WideString GetSelectedText()
CPWL_Wnd * GetPWLWindow(const CPDFSDK_PageView *pPageView) const
virtual bool OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Widget *pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
CFX_FloatRect FFLtoPWL(const CFX_FloatRect &rect)
CPWL_Wnd * CreateOrUpdatePWLWindow(const CPDFSDK_PageView *pPageView)
void EscapeFiller(CPDFSDK_PageView *pPageView, bool bDestroyPWLWindow)
void OnSetFocusForEdit(CPWL_Edit *pEdit) override
virtual CPWL_Wnd::CreateParams GetCreateParam()
void ReplaceSelection(const WideString &text)
virtual bool SetIndexSelected(int index, bool selected)
CPDFSDK_PageView * GetCurPageView()
virtual bool OnLButtonDblClk(CPDFSDK_PageView *pPageView, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
bool CommitData(const CPDFSDK_PageView *pPageView, Mask< FWL_EVENTFLAG > nFlag)
CFX_Matrix GetCurMatrix()
virtual bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlags)
CFX_FloatRect GetPDFAnnotRect() const
void SetFocusForAnnot(CPDFSDK_Widget *pWidget, Mask< FWL_EVENTFLAG > nFlag)
virtual void GetActionData(const CPDFSDK_PageView *pPageView, CPDF_AAction::AActionType type, CFFL_FieldAction &fa)
~CFFL_FormField() override
virtual bool OnMouseMove(CPDFSDK_PageView *pPageView, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
CFFL_FormField(CFFL_InteractiveFormFiller *pFormFiller, CPDFSDK_Widget *pWidget)
void OnTimerFired() override
virtual bool IsIndexSelected(int index)
virtual bool OnMouseWheel(CPDFSDK_PageView *pPageView, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point, const CFX_Vector &delta)
virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, CPDFSDK_Widget *pWidget, CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device)
CFFL_PerWindowData * GetPerPWLWindowData(const CPDFSDK_PageView *pPageView)
virtual bool OnRButtonUp(CPDFSDK_PageView *pPageView, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
void ReplaceAndKeepSelection(const WideString &text)
virtual void SetActionData(const CPDFSDK_PageView *pPageView, CPDF_AAction::AActionType type, const CFFL_FieldAction &fa)
CFX_Matrix GetWindowMatrix(const IPWL_FillerNotify::PerWindowData *pAttached) override
void KillFocusForAnnot(Mask< FWL_EVENTFLAG > nFlag)
virtual void OnMouseExit(CPDFSDK_PageView *pPageView)
virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Widget *pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
virtual CPWL_Wnd * RestorePWLWindow(const CPDFSDK_PageView *pPageView)
virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Widget *pWidget, CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device)
virtual void OnMouseEnter(CPDFSDK_PageView *pPageView)
virtual bool IsDataChanged(const CPDFSDK_PageView *pPageView)
FX_RECT GetViewBBox(const CPDFSDK_PageView *pPageView)
virtual CPWL_Wnd * ResetPWLWindow(const CPDFSDK_PageView *pPageView)
virtual void SavePWLWindowState(const CPDFSDK_PageView *pPageView)
virtual bool OnRButtonDown(CPDFSDK_PageView *pPageView, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
void ResetPWLWindowForValueAge(const CPDFSDK_PageView *pPageView, CPDFSDK_Widget *pWidget, uint32_t nValueAge)
virtual void SaveData(const CPDFSDK_PageView *pPageView)
CFX_PointF PWLtoFFL(const CFX_PointF &point)
void DestroyPWLWindow(const CPDFSDK_PageView *pPageView)
bool IsValid() const
WideString GetText()
static bool IsVisible(CPDFSDK_Widget *pWidget)
const CPDFSDK_PageView * GetPageView() const
constexpr CFX_FloatRect(float l, float b, float r, float t)
constexpr CFX_FloatRect()=default
float Width() const
bool IsEmpty() const
void Inflate(float x, float y)
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
float Height() const
FX_RECT GetOuterRect() const
void Union(const CFX_FloatRect &other_rect)
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
CFX_Matrix operator*(const CFX_Matrix &right) const
CFX_PointF Transform(const CFX_PointF &point) const
CFX_Matrix GetInverse() const
CFX_Matrix()=default
CPDF_Page * GetPDFPage() const
const CFX_Matrix & GetCurrentMatrix() const
uint32_t GetValueAge() const
void DrawAppearance(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, CPDF_Annot::AppearanceMode mode) override
const CFX_FloatRect & GetBBox() const
CFX_FloatRect rcRectWnd
Definition cpwl_wnd.h:105
BorderStyle nBorderStyle
Definition cpwl_wnd.h:114
virtual void KillFocus()
Definition cpwl_wnd.cpp:542
virtual bool OnMouseWheel(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point, const CFX_Vector &delta)
Definition cpwl_wnd.cpp:393
virtual bool SelectAllText()
Definition cpwl_wnd.cpp:373
virtual bool OnRButtonDown(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point)
Definition cpwl_wnd.cpp:352
virtual bool OnChar(uint16_t nChar, Mask< FWL_EVENTFLAG > nFlag)
Definition cpwl_wnd.cpp:309
virtual void ReplaceAndKeepSelection(const WideString &text)
Definition cpwl_wnd.cpp:369
virtual bool Redo()
Definition cpwl_wnd.cpp:389
virtual WideString GetSelectedText()
Definition cpwl_wnd.cpp:365
virtual bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point)
virtual bool OnMouseMove(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point)
virtual bool OnRButtonUp(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point)
Definition cpwl_wnd.cpp:357
virtual bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlag)
Definition cpwl_wnd.cpp:297
virtual void SetFocus()
Definition cpwl_wnd.cpp:533
virtual CFX_FloatRect GetFocusRect() const
Definition cpwl_wnd.cpp:689
virtual void ReplaceSelection(const WideString &text)
Definition cpwl_wnd.cpp:371
IPWL_FillerNotify::PerWindowData * GetAttachedData() const
Definition cpwl_wnd.h:209
virtual bool CanUndo()
Definition cpwl_wnd.cpp:377
virtual bool CanRedo()
Definition cpwl_wnd.cpp:381
virtual bool Undo()
Definition cpwl_wnd.cpp:385
virtual bool OnLButtonDblClk(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point)
virtual bool OnLButtonDown(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point)
void DrawAppearance(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device)
Definition cpwl_wnd.cpp:242
virtual WideString GetText()
Definition cpwl_wnd.cpp:361
#define PWS_READONLY
Definition cpwl_wnd.h:34
#define PWS_BACKGROUND
Definition cpwl_wnd.h:31
#define PWS_VISIBLE
Definition cpwl_wnd.h:33
#define PWS_BORDER
Definition cpwl_wnd.h:30
#define PWS_AUTOFONTSIZE
Definition cpwl_wnd.h:35
constexpr uint32_t kReadOnly
Definition form_flags.h:13
CFX_Color & operator=(const CFX_Color &that)=default
constexpr CFX_Color(Type type=CFX_Color::Type::kTransparent, float color1=0.0f, float color2=0.0f, float color3=0.0f, float color4=0.0f)
Definition cfx_color.h:27
CPWL_Dash(int32_t dash, int32_t gap, int32_t phase)
Definition cpwl_wnd.h:63
bool Contains(int x, int y) const