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_INCLUDE_CPDFSDK_PAGEVIEW_H_ | 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ |
8 #define FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ | 8 #define FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 13 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
14 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
| 15 #include "fpdfsdk/include/cpdfsdk_annot.h" |
15 #include "fpdfsdk/include/cpdfsdk_document.h" | 16 #include "fpdfsdk/include/cpdfsdk_document.h" |
16 | 17 |
17 class CFX_RenderDevice; | 18 class CFX_RenderDevice; |
18 class CPDF_AnnotList; | 19 class CPDF_AnnotList; |
19 class CPDF_RenderOptions; | 20 class CPDF_RenderOptions; |
20 | 21 |
21 class CPDFSDK_PageView final : public CPDF_Page::View { | 22 class CPDFSDK_PageView final : public CPDF_Page::View { |
22 public: | 23 public: |
23 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); | 24 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); |
24 ~CPDFSDK_PageView(); | 25 ~CPDFSDK_PageView(); |
25 | 26 |
26 #ifdef PDF_ENABLE_XFA | 27 #ifdef PDF_ENABLE_XFA |
27 void PageView_OnDraw(CFX_RenderDevice* pDevice, | 28 void PageView_OnDraw(CFX_RenderDevice* pDevice, |
28 CFX_Matrix* pUser2Device, | 29 CFX_Matrix* pUser2Device, |
29 CPDF_RenderOptions* pOptions, | 30 CPDF_RenderOptions* pOptions, |
30 const FX_RECT& pClip); | 31 const FX_RECT& pClip); |
31 #else // PDF_ENABLE_XFA | 32 #else // PDF_ENABLE_XFA |
32 void PageView_OnDraw(CFX_RenderDevice* pDevice, | 33 void PageView_OnDraw(CFX_RenderDevice* pDevice, |
33 CFX_Matrix* pUser2Device, | 34 CFX_Matrix* pUser2Device, |
34 CPDF_RenderOptions* pOptions); | 35 CPDF_RenderOptions* pOptions); |
35 #endif // PDF_ENABLE_XFA | 36 #endif // PDF_ENABLE_XFA |
36 | 37 |
37 const CPDF_Annot* GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 38 const CPDF_Annot* GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
38 CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 39 CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
39 const CPDF_Annot* GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 40 const CPDF_Annot* GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
40 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 41 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
41 CPDFSDK_Annot* GetFocusAnnot(); | 42 CPDFSDK_Annot* GetFocusAnnot(); |
42 void SetFocusAnnot(CPDFSDK_Annot* pSDKAnnot, uint32_t nFlag = 0) { | 43 void SetFocusAnnot(CPDFSDK_Annot::ObservedPtr* pSDKAnnot, |
| 44 uint32_t nFlag = 0) { |
43 m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag); | 45 m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag); |
44 } | 46 } |
45 FX_BOOL KillFocusAnnot(uint32_t nFlag = 0) { | 47 FX_BOOL KillFocusAnnot(uint32_t nFlag = 0) { |
46 return m_pSDKDoc->KillFocusAnnot(nFlag); | 48 return m_pSDKDoc->KillFocusAnnot(nFlag); |
47 } | 49 } |
48 void KillFocusAnnotIfNeeded(); | 50 void KillFocusAnnotIfNeeded(); |
49 | 51 |
50 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary* pDict); | 52 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary* pDict); |
51 CPDFSDK_Annot* AddAnnot(const FX_CHAR* lpSubType, CPDF_Dictionary* pDict); | 53 CPDFSDK_Annot* AddAnnot(const FX_CHAR* lpSubType, CPDF_Dictionary* pDict); |
52 CPDFSDK_Annot* AddAnnot(CPDF_Annot* pPDFAnnot); | 54 CPDFSDK_Annot* AddAnnot(CPDF_Annot* pPDFAnnot); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #endif // PDF_ENABLE_XFA | 103 #endif // PDF_ENABLE_XFA |
102 | 104 |
103 private: | 105 private: |
104 int GetPageIndexForStaticPDF() const; | 106 int GetPageIndexForStaticPDF() const; |
105 | 107 |
106 CFX_Matrix m_curMatrix; | 108 CFX_Matrix m_curMatrix; |
107 UnderlyingPageType* const m_page; | 109 UnderlyingPageType* const m_page; |
108 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; | 110 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; |
109 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; | 111 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; |
110 CPDFSDK_Document* const m_pSDKDoc; | 112 CPDFSDK_Document* const m_pSDKDoc; |
111 CPDFSDK_Annot* m_CaptureWidget; | 113 CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; |
112 #ifndef PDF_ENABLE_XFA | 114 #ifndef PDF_ENABLE_XFA |
113 bool m_bOwnsPage; | 115 bool m_bOwnsPage; |
114 #endif // PDF_ENABLE_XFA | 116 #endif // PDF_ENABLE_XFA |
115 FX_BOOL m_bEnterWidget; | 117 FX_BOOL m_bEnterWidget; |
116 FX_BOOL m_bExitWidget; | 118 FX_BOOL m_bExitWidget; |
117 FX_BOOL m_bOnWidget; | 119 FX_BOOL m_bOnWidget; |
118 FX_BOOL m_bValid; | 120 FX_BOOL m_bValid; |
119 FX_BOOL m_bLocked; | 121 FX_BOOL m_bLocked; |
120 }; | 122 }; |
121 | 123 |
122 #endif // FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ | 124 #endif // FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ |
OLD | NEW |