7#ifndef FPDFSDK_CPDFSDK_PAGEVIEW_H_
8#define FPDFSDK_CPDFSDK_PAGEVIEW_H_
15#include "core/fpdfapi/page/cpdf_page.h"
16#include "core/fxcrt/mask.h"
17#include "core/fxcrt/unowned_ptr.h"
18#include "fpdfsdk/cpdfsdk_annot.h"
23class CPDFSDK_FormFillEnvironment;
24class CPDFSDK_InteractiveForm;
31class CPDFSDK_PageView
final :
public CPDF_Page::
View {
37 void ClearPage(CPDF_Page* pPage)
override;
57 CPDFSDK_Annot* AddAnnotForFFWidget(CXFA_FFWidget* pWidget);
58 void DeleteAnnotForFFWidget(CXFA_FFWidget* pWidget);
59 CPDFSDK_Annot* GetAnnotForFFWidget(CXFA_FFWidget* pWidget);
60 IPDF_Page* GetXFAPage();
65 CPDFSDK_FormFillEnvironment*
GetFormFillEnv()
const {
return m_pFormFillEnv; }
78 bool OnFocus(
Mask<FWL_EVENTFLAG> nFlags,
const CFX_PointF& point);
84 bool OnChar(uint32_t nChar,
Mask<FWL_EVENTFLAG> nFlags);
85 bool OnKeyDown(FWL_VKEYCODE nKeyCode,
Mask<FWL_EVENTFLAG> nFlags);
88 const CFX_PointF& point,
89 const CFX_Vector& delta);
95 void UpdateRects(
const std::vector<CFX_FloatRect>& rects);
108 CPDFXFA_Page* XFAPageIfNotBackedByPDFPage();
111 std::unique_ptr<CPDFSDK_Annot> NewAnnot(
CPDF_Annot* annot);
113 CPDFSDK_InteractiveForm* GetInteractiveForm()
const;
117 int GetPageIndexForStaticPDF()
const;
120 Mask<FWL_EVENTFLAG> nFlags);
121 void ExitWidget(
bool callExitCallback,
Mask<FWL_EVENTFLAG> nFlags);
125 std::unique_ptr<CPDF_AnnotList> m_pAnnotList;
126 std::vector<std::unique_ptr<CPDFSDK_Annot>> m_SDKAnnotArray;
127 UnownedPtr<CPDFSDK_FormFillEnvironment>
const m_pFormFillEnv;
129 bool m_bOnWidget =
false;
130 bool m_bValid =
false;
131 bool m_bLocked =
false;
132 bool m_bBeingDestroyed =
false;
virtual bool SetIndexSelected(int index, bool selected)=0
virtual bool IsIndexSelected(int index)=0
static bool OnRButtonUp(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
static bool OnKeyDown(ObservedPtr< CPDFSDK_Annot > &pAnnot, FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlags)
virtual void ReplaceSelection(const WideString &text)=0
static bool OnRButtonDown(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
virtual WideString GetText()=0
virtual int GetLayoutOrder() const
static bool OnMouseMove(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
virtual CFX_FloatRect GetViewBBox()=0
static bool OnKillFocus(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags)
virtual CPDF_Annot::Subtype GetAnnotSubtype() const =0
virtual CFX_FloatRect GetRect() const =0
static bool OnLButtonUp(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
CPDFSDK_Annot(CPDFSDK_PageView *pPageView)
static bool OnMouseWheel(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point, const CFX_Vector &delta)
virtual WideString GetSelectedText()=0
virtual CPDFSDK_BAAnnot * AsBAAnnot()
static void OnMouseEnter(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags)
virtual bool DoHitTest(const CFX_PointF &point)=0
CPDFSDK_PageView * GetPageView() const
virtual bool SelectAllText()=0
static bool OnChar(ObservedPtr< CPDFSDK_Annot > &pAnnot, uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags)
static bool OnSetFocus(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags)
virtual void OnDraw(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, bool bDrawAnnots)=0
virtual void ReplaceAndKeepSelection(const WideString &text)=0
static bool OnLButtonDblClk(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
virtual CPDF_Annot * GetPDFAnnot() const
virtual CPDFXFA_Widget * AsXFAWidget()
virtual UnsafeInputHandlers * GetUnsafeInputHandlers()=0
static void OnMouseExit(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags)
static bool OnLButtonDown(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
CPDFSDK_Annot * GetFocusAnnot()
bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlags)
CPDF_Document * GetPDFDocument()
std::vector< CPDFSDK_Annot * > GetAnnotList() const
bool OnMouseMove(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
CPDFSDK_Annot * GetNextAnnot(CPDFSDK_Annot *pAnnot)
CPDFSDK_Annot * GetPrevAnnot(CPDFSDK_Annot *pAnnot)
void SetValid(bool bValid)
void ReplaceSelection(const WideString &text)
bool OnFocus(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
CPDFSDK_Annot * GetLastFocusableAnnot()
bool IsValidSDKAnnot(const CPDFSDK_Annot *p) const
bool IsBeingDestroyed() const
CPDFSDK_PageView(CPDFSDK_FormFillEnvironment *pFormFillEnv, IPDF_Page *page)
void PageView_OnDraw(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device, CPDF_RenderOptions *pOptions, const FX_RECT &pClip)
bool OnRButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
void ClearPage(CPDF_Page *pPage) override
bool OnLButtonDblClk(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
CPDFSDK_FormFillEnvironment * GetFormFillEnv() const
void UpdateRects(const std::vector< CFX_FloatRect > &rects)
CPDF_Page * GetPDFPage() const
const CFX_Matrix & GetCurrentMatrix() const
void UpdateView(CPDFSDK_Annot *pAnnot)
bool OnRButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
WideString GetFocusedFormText()
CPDFSDK_Annot * GetAnnotByDict(const CPDF_Dictionary *pDict)
WideString GetSelectedText()
void ReplaceAndKeepSelection(const WideString &text)
bool OnLButtonDown(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point)
bool IsIndexSelected(int index)
bool OnMouseWheel(Mask< FWL_EVENTFLAG > nFlags, const CFX_PointF &point, const CFX_Vector &delta)
bool IsValidAnnot(const CPDF_Annot *p) const
bool SetIndexSelected(int index, bool selected)
CPDFSDK_Annot * GetFirstFocusableAnnot()
bool OnChar(uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags)
CPDFXFA_Widget * ToXFAWidget(CPDFSDK_Annot *pAnnot)
@ FWL_EVENTFLAG_RightButtonDown
@ FWL_EVENTFLAG_LeftButtonDown
@ FWL_EVENTFLAG_AutoRepeat
@ FWL_EVENTFLAG_MiddleButtonDown
@ FWL_EVENTFLAG_ControlKey
@ FWL_VKEY_MEDIA_LAUNCH_APP1
@ FWL_VKEY_BROWSER_Forward
@ FWL_VKEY_MEDIA_LAUNCH_Mail
@ FWL_VKEY_MEDIA_PREV_Track
@ FWL_VKEY_MEDIA_PLAY_Pause
@ FWL_VKEY_MEDIA_NEXT_Track
@ FWL_VKEY_MEDIA_LAUNCH_APP2
@ FWL_VKEY_BROWSER_Favorites
@ FWL_VKEY_BROWSER_Search
@ FWL_VKEY_BROWSER_Refresh
@ FWL_VKEY_MEDIA_LAUNCH_MEDIA_Select