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
cpdfxfa_widget.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 FPDFSDK_FPDFXFA_CPDFXFA_WIDGET_H_
8#define FPDFSDK_FPDFXFA_CPDFXFA_WIDGET_H_
9
10#include "core/fxcrt/fx_coordinates.h"
11#include "fpdfsdk/cpdfsdk_annot.h"
12#include "v8/include/cppgc/persistent.h"
13#include "xfa/fxfa/cxfa_ffwidget.h"
14
15class CPDFSDK_PageView;
16class CXFA_FFDocView;
17class CXFA_FFWidgetHandler;
18
19class CPDFXFA_Widget final : public CPDFSDK_Annot,
21 public:
22 CPDFXFA_Widget(CXFA_FFWidget* pXFAFFWidget, CPDFSDK_PageView* pPageView);
23 ~CPDFXFA_Widget() override;
24
25 // CPDFSDK_Annot:
26 CPDFXFA_Widget* AsXFAWidget() override;
28 CPDF_Annot::Subtype GetAnnotSubtype() const override;
29 CFX_FloatRect GetRect() const override;
30 void OnDraw(CFX_RenderDevice* pDevice,
31 const CFX_Matrix& mtUser2Device,
32 bool bDrawAnnots) override;
33 bool DoHitTest(const CFX_PointF& point) override;
34 CFX_FloatRect GetViewBBox() override;
35 bool CanUndo() override;
36 bool CanRedo() override;
37 bool Undo() override;
38 bool Redo() override;
39 WideString GetText() override;
40 WideString GetSelectedText() override;
41 void ReplaceAndKeepSelection(const WideString& text) override;
42 void ReplaceSelection(const WideString& text) override;
43 bool SelectAllText() override;
44 bool SetIndexSelected(int index, bool selected) override;
45 bool IsIndexSelected(int index) override;
46
47 CXFA_FFWidget* GetXFAFFWidget() const { return m_pXFAFFWidget.Get(); }
48
49 bool OnChangedFocus();
50
51 private:
52 // CPDFSDK_Annot::UnsafeInputHandlers:
53 void OnMouseEnter(Mask<FWL_EVENTFLAG> nFlags) override;
54 void OnMouseExit(Mask<FWL_EVENTFLAG> nFlags) override;
55 bool OnLButtonDown(Mask<FWL_EVENTFLAG> nFlags,
56 const CFX_PointF& point) override;
57 bool OnLButtonUp(Mask<FWL_EVENTFLAG> nFlags,
58 const CFX_PointF& point) override;
59 bool OnLButtonDblClk(Mask<FWL_EVENTFLAG> nFlags,
60 const CFX_PointF& point) override;
61 bool OnMouseMove(Mask<FWL_EVENTFLAG> nFlags,
62 const CFX_PointF& point) override;
63 bool OnMouseWheel(Mask<FWL_EVENTFLAG> nFlags,
64 const CFX_PointF& point,
65 const CFX_Vector& delta) override;
66 bool OnRButtonDown(Mask<FWL_EVENTFLAG> nFlags,
67 const CFX_PointF& point) override;
68 bool OnRButtonUp(Mask<FWL_EVENTFLAG> nFlags,
69 const CFX_PointF& point) override;
70 bool OnChar(uint32_t nChar, Mask<FWL_EVENTFLAG> nFlags) override;
71 bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask<FWL_EVENTFLAG> nFlags) override;
72 bool OnSetFocus(Mask<FWL_EVENTFLAG> nFlags) override;
73 bool OnKillFocus(Mask<FWL_EVENTFLAG> nFlags) override;
74
75 CXFA_FFDocView* GetDocView();
76 CXFA_FFWidgetHandler* GetWidgetHandler();
77
78 cppgc::Persistent<CXFA_FFWidget> const m_pXFAFFWidget;
79};
80
81#endif // FPDFSDK_FPDFXFA_CPDFXFA_WIDGET_H_
CFGAS_GEGraphics(CFX_RenderDevice *renderDevice)
void SetClipRect(const CFX_RectF &rect)
bool Contains(const CFX_PointF &point) const
void Inflate(float x, float y)
CFX_PointF Transform(const CFX_PointF &point) const
CFX_Matrix GetInverse() const
CFX_Matrix()=default
CFX_FloatRect ToFloatRect() const
bool IntersectWith(const CFX_RectF &rt) const
CFX_RectF(const FX_RECT &that)
CPDFSDK_PageView * GetPageView() const
absl::optional< CFX_PointF > PageToDevice(const FX_RECT &rect, int rotate, const CFX_PointF &page_point) const override
CXFA_FFPageView * GetXFAPageView() const
CPDF_Document * GetDocument() const override
CFX_Matrix GetDisplayMatrix(const FX_RECT &rect, int iRotate) const override
CPDFXFA_Page * AsXFAPage() override
CPDF_Page * AsPDFPage() override
float GetPageWidth() const override
~CPDFXFA_Page() override
CPDFSDK_Annot * GetLastXFAAnnot(CPDFSDK_PageView *page_view) const
CPDFSDK_Annot * GetPrevXFAAnnot(CPDFSDK_Annot *pSDKAnnot) const
CPDFSDK_Annot * GetFirstXFAAnnot(CPDFSDK_PageView *page_view) const
CPDFSDK_Annot * GetNextXFAAnnot(CPDFSDK_Annot *pSDKAnnot) const
absl::optional< CFX_PointF > DeviceToPage(const FX_RECT &rect, int rotate, const CFX_PointF &device_point) const override
void DrawFocusAnnot(CFX_RenderDevice *pDevice, CPDFSDK_Annot *pAnnot, const CFX_Matrix &mtUser2Device, const FX_RECT &rtClip)
int HasFormFieldAtPoint(const CFX_PointF &point) const
float GetPageHeight() const override
void LoadPDFPageFromDict(RetainPtr< CPDF_Dictionary > pPageDict)
CXFA_FFWidget * GetXFAFFWidget() const
bool DoHitTest(const CFX_PointF &point) override
void ReplaceSelection(const WideString &text) override
~CPDFXFA_Widget() override
bool Redo() override
WideString GetSelectedText() override
void OnMouseEnter(Mask< FWL_EVENTFLAG > nFlags) override
bool Undo() override
bool OnSetFocus(Mask< FWL_EVENTFLAG > nFlags) override
bool SetIndexSelected(int index, bool selected) override
bool SelectAllText() override
bool OnMouseMove(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
CFX_FloatRect GetViewBBox() override
bool CanUndo() override
bool OnKillFocus(Mask< FWL_EVENTFLAG > nFlags) override
bool IsIndexSelected(int index) override
bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlags) override
bool OnRButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
bool OnMouseWheel(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point, const CFX_Vector &delta) override
CPDF_Annot::Subtype GetAnnotSubtype() const override
bool OnRButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
CPDFSDK_Annot::UnsafeInputHandlers * GetUnsafeInputHandlers() override
WideString GetText() override
CPDFXFA_Widget(CXFA_FFWidget *pXFAFFWidget, CPDFSDK_PageView *pPageView)
CPDFXFA_Widget * AsXFAWidget() override
void OnMouseExit(Mask< FWL_EVENTFLAG > nFlags) override
bool CanRedo() override
bool OnLButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
CFX_FloatRect GetRect() const override
bool OnLButtonDblClk(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point) override
bool OnChar(uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags) override
void OnDraw(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, bool bDrawAnnots) override
void ReplaceAndKeepSelection(const WideString &text) override
CXFA_FFWidgetHandler * GetWidgetHandler()
CXFA_FFPageView * GetPageView(int32_t nIndex) const
CXFA_FFDocView * GetDocView() const
CFX_Matrix GetDisplayMatrix(const FX_RECT &rtDisp, int32_t iRotate) const
CXFA_FFWidget::IteratorIface * CreateGCedTraverseWidgetIterator(Mask< XFA_WidgetStatus > dwWidgetFilter)
CFX_RectF GetPageViewRect() const
CXFA_FFWidget * MoveToNext() override
void RenderWidget(CXFA_FFWidget *hWidget, CFGAS_GEGraphics *pGS, const CFX_Matrix &matrix, bool bHighlight)
virtual CXFA_FFWidget * MoveToLast()=0
virtual CXFA_FFWidget * MoveToFirst()=0
virtual CXFA_FFWidget * MoveToPrevious()=0
virtual CXFA_FFWidget * GetCurrentWidget()=0
virtual CXFA_FFWidget * MoveToNext()=0
virtual bool SetCurrentWidget(CXFA_FFWidget *hWidget)=0
const CFX_RectF & GetWidgetRect() const
virtual void RenderWidget(CFGAS_GEGraphics *pGS, const CFX_Matrix &matrix, HighlightOption highlight)
virtual FormFieldType GetFormFieldType()
virtual CFX_RectF GetBBox(FocusOption focus)
CPDFXFA_Widget * ToXFAWidget(CPDFSDK_Annot *pAnnot)
XFA_WidgetStatus
Definition fxfa.h:61
FormType
Definition fxfa.h:38
@ kXFAForeground