OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef FPDFSDK_CPDFSDK_PAGEVIEW_H_ | 7 #ifndef FPDFSDK_CPDFSDK_PAGEVIEW_H_ |
8 #define FPDFSDK_CPDFSDK_PAGEVIEW_H_ | 8 #define FPDFSDK_CPDFSDK_PAGEVIEW_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "core/fpdfapi/page/cpdf_page.h" | 13 #include "core/fpdfapi/page/cpdf_page.h" |
14 #include "core/fxcrt/fx_system.h" | 14 #include "core/fxcrt/fx_system.h" |
15 #include "fpdfsdk/cpdfsdk_annot.h" | 15 #include "fpdfsdk/cpdfsdk_annot.h" |
16 #include "fpdfsdk/cpdfsdk_document.h" | 16 #include "fpdfsdk/cpdfsdk_document.h" |
17 | 17 |
18 class CFX_RenderDevice; | 18 class CFX_RenderDevice; |
19 class CPDF_AnnotList; | 19 class CPDF_AnnotList; |
20 class CPDF_RenderOptions; | 20 class CPDF_RenderOptions; |
21 | 21 |
22 class CPDFSDK_PageView final : public CPDF_Page::View { | 22 class CPDFSDK_PageView final : public CPDF_Page::View { |
23 public: | 23 public: |
24 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); | 24 CPDFSDK_PageView(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
| 25 UnderlyingPageType* page); |
25 ~CPDFSDK_PageView(); | 26 ~CPDFSDK_PageView(); |
26 | 27 |
27 #ifdef PDF_ENABLE_XFA | 28 #ifdef PDF_ENABLE_XFA |
28 void PageView_OnDraw(CFX_RenderDevice* pDevice, | 29 void PageView_OnDraw(CFX_RenderDevice* pDevice, |
29 CFX_Matrix* pUser2Device, | 30 CFX_Matrix* pUser2Device, |
30 CPDF_RenderOptions* pOptions, | 31 CPDF_RenderOptions* pOptions, |
31 const FX_RECT& pClip); | 32 const FX_RECT& pClip); |
32 #else // PDF_ENABLE_XFA | 33 #else // PDF_ENABLE_XFA |
33 void PageView_OnDraw(CFX_RenderDevice* pDevice, | 34 void PageView_OnDraw(CFX_RenderDevice* pDevice, |
34 CFX_Matrix* pUser2Device, | 35 CFX_Matrix* pUser2Device, |
(...skipping 16 matching lines...) Expand all Loading... |
51 #ifdef PDF_ENABLE_XFA | 52 #ifdef PDF_ENABLE_XFA |
52 FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot); | 53 FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot); |
53 CPDFSDK_Annot* AddAnnot(CXFA_FFWidget* pPDFAnnot); | 54 CPDFSDK_Annot* AddAnnot(CXFA_FFWidget* pPDFAnnot); |
54 CPDFSDK_Annot* GetAnnotByXFAWidget(CXFA_FFWidget* hWidget); | 55 CPDFSDK_Annot* GetAnnotByXFAWidget(CXFA_FFWidget* hWidget); |
55 | 56 |
56 CPDFXFA_Page* GetPDFXFAPage() { return m_page; } | 57 CPDFXFA_Page* GetPDFXFAPage() { return m_page; } |
57 #endif // PDF_ENABLE_XFA | 58 #endif // PDF_ENABLE_XFA |
58 | 59 |
59 CPDF_Page* GetPDFPage() const; | 60 CPDF_Page* GetPDFPage() const; |
60 CPDF_Document* GetPDFDocument(); | 61 CPDF_Document* GetPDFDocument(); |
61 CPDFSDK_Document* GetSDKDocument() { return m_pSDKDoc; } | 62 CPDFSDK_FormFillEnvironment* GetFormFillEnv() const { return m_pFormFillEnv; } |
62 FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); | 63 FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); |
63 FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); | 64 FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); |
64 #ifdef PDF_ENABLE_XFA | 65 #ifdef PDF_ENABLE_XFA |
65 FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); | 66 FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); |
66 FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); | 67 FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); |
67 #endif // PDF_ENABLE_XFA | 68 #endif // PDF_ENABLE_XFA |
68 FX_BOOL OnChar(int nChar, uint32_t nFlag); | 69 FX_BOOL OnChar(int nChar, uint32_t nFlag); |
69 FX_BOOL OnKeyDown(int nKeyCode, int nFlag); | 70 FX_BOOL OnKeyDown(int nKeyCode, int nFlag); |
70 FX_BOOL OnKeyUp(int nKeyCode, int nFlag); | 71 FX_BOOL OnKeyUp(int nKeyCode, int nFlag); |
71 | 72 |
(...skipping 23 matching lines...) Expand all Loading... |
95 void TakePageOwnership() { m_bOwnsPage = true; } | 96 void TakePageOwnership() { m_bOwnsPage = true; } |
96 #endif // PDF_ENABLE_XFA | 97 #endif // PDF_ENABLE_XFA |
97 | 98 |
98 private: | 99 private: |
99 int GetPageIndexForStaticPDF() const; | 100 int GetPageIndexForStaticPDF() const; |
100 | 101 |
101 CFX_Matrix m_curMatrix; | 102 CFX_Matrix m_curMatrix; |
102 UnderlyingPageType* const m_page; | 103 UnderlyingPageType* const m_page; |
103 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; | 104 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; |
104 std::vector<CPDFSDK_Annot*> m_SDKAnnotArray; | 105 std::vector<CPDFSDK_Annot*> m_SDKAnnotArray; |
105 CPDFSDK_Document* const m_pSDKDoc; | 106 CPDFSDK_FormFillEnvironment* const m_pFormFillEnv; // Not owned. |
106 CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; | 107 CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; |
107 #ifndef PDF_ENABLE_XFA | 108 #ifndef PDF_ENABLE_XFA |
108 bool m_bOwnsPage; | 109 bool m_bOwnsPage; |
109 #endif // PDF_ENABLE_XFA | 110 #endif // PDF_ENABLE_XFA |
110 FX_BOOL m_bEnterWidget; | 111 FX_BOOL m_bEnterWidget; |
111 FX_BOOL m_bExitWidget; | 112 FX_BOOL m_bExitWidget; |
112 FX_BOOL m_bOnWidget; | 113 FX_BOOL m_bOnWidget; |
113 FX_BOOL m_bValid; | 114 FX_BOOL m_bValid; |
114 FX_BOOL m_bLocked; | 115 FX_BOOL m_bLocked; |
115 bool m_bBeingDestroyed; | 116 bool m_bBeingDestroyed; |
116 }; | 117 }; |
117 | 118 |
118 #endif // FPDFSDK_CPDFSDK_PAGEVIEW_H_ | 119 #endif // FPDFSDK_CPDFSDK_PAGEVIEW_H_ |
OLD | NEW |