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> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 CPDFSDK_Annot* GetFocusAnnot(); | 42 CPDFSDK_Annot* GetFocusAnnot(); |
43 bool IsValidAnnot(const CPDF_Annot* p) const; | 43 bool IsValidAnnot(const CPDF_Annot* p) const; |
44 bool IsValidSDKAnnot(const CPDFSDK_Annot* p) const; | 44 bool IsValidSDKAnnot(const CPDFSDK_Annot* p) const; |
45 | 45 |
46 const std::vector<CPDFSDK_Annot*>& GetAnnotList() const { | 46 const std::vector<CPDFSDK_Annot*>& GetAnnotList() const { |
47 return m_SDKAnnotArray; | 47 return m_SDKAnnotArray; |
48 } | 48 } |
49 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary* pDict); | 49 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary* pDict); |
50 | 50 |
51 #ifdef PDF_ENABLE_XFA | 51 #ifdef PDF_ENABLE_XFA |
52 FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot); | 52 bool DeleteAnnot(CPDFSDK_Annot* pAnnot); |
53 CPDFSDK_Annot* AddAnnot(CXFA_FFWidget* pPDFAnnot); | 53 CPDFSDK_Annot* AddAnnot(CXFA_FFWidget* pPDFAnnot); |
54 CPDFSDK_Annot* GetAnnotByXFAWidget(CXFA_FFWidget* hWidget); | 54 CPDFSDK_Annot* GetAnnotByXFAWidget(CXFA_FFWidget* hWidget); |
55 | 55 |
56 CPDFXFA_Page* GetPDFXFAPage() { return m_page; } | 56 CPDFXFA_Page* GetPDFXFAPage() { return m_page; } |
57 #endif // PDF_ENABLE_XFA | 57 #endif // PDF_ENABLE_XFA |
58 | 58 |
59 CPDF_Page* GetPDFPage() const; | 59 CPDF_Page* GetPDFPage() const; |
60 CPDF_Document* GetPDFDocument(); | 60 CPDF_Document* GetPDFDocument(); |
61 CPDFSDK_FormFillEnvironment* GetFormFillEnv() const { return m_pFormFillEnv; } | 61 CPDFSDK_FormFillEnvironment* GetFormFillEnv() const { return m_pFormFillEnv; } |
62 FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); | 62 bool OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); |
63 FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); | 63 bool OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); |
64 #ifdef PDF_ENABLE_XFA | 64 #ifdef PDF_ENABLE_XFA |
65 FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); | 65 bool OnRButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); |
66 FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); | 66 bool OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); |
67 #endif // PDF_ENABLE_XFA | 67 #endif // PDF_ENABLE_XFA |
68 FX_BOOL OnChar(int nChar, uint32_t nFlag); | 68 bool OnChar(int nChar, uint32_t nFlag); |
69 FX_BOOL OnKeyDown(int nKeyCode, int nFlag); | 69 bool OnKeyDown(int nKeyCode, int nFlag); |
70 FX_BOOL OnKeyUp(int nKeyCode, int nFlag); | 70 bool OnKeyUp(int nKeyCode, int nFlag); |
71 | 71 |
72 FX_BOOL OnMouseMove(const CFX_FloatPoint& point, int nFlag); | 72 bool OnMouseMove(const CFX_FloatPoint& point, int nFlag); |
73 FX_BOOL OnMouseWheel(double deltaX, | 73 bool OnMouseWheel(double deltaX, |
74 double deltaY, | 74 double deltaY, |
75 const CFX_FloatPoint& point, | 75 const CFX_FloatPoint& point, |
76 int nFlag); | 76 int nFlag); |
77 | 77 |
78 void GetCurrentMatrix(CFX_Matrix& matrix) { matrix = m_curMatrix; } | 78 void GetCurrentMatrix(CFX_Matrix& matrix) { matrix = m_curMatrix; } |
79 void UpdateRects(const std::vector<CFX_FloatRect>& rects); | 79 void UpdateRects(const std::vector<CFX_FloatRect>& rects); |
80 void UpdateView(CPDFSDK_Annot* pAnnot); | 80 void UpdateView(CPDFSDK_Annot* pAnnot); |
81 | 81 |
82 int GetPageIndex() const; | 82 int GetPageIndex() const; |
83 | 83 |
84 void SetValid(FX_BOOL bValid) { m_bValid = bValid; } | 84 void SetValid(bool bValid) { m_bValid = bValid; } |
85 FX_BOOL IsValid() { return m_bValid; } | 85 bool IsValid() { return m_bValid; } |
86 | 86 |
87 void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; } | 87 void SetLock(bool bLocked) { m_bLocked = bLocked; } |
88 FX_BOOL IsLocked() { return m_bLocked; } | 88 bool IsLocked() { return m_bLocked; } |
89 | 89 |
90 void SetBeingDestroyed() { m_bBeingDestroyed = true; } | 90 void SetBeingDestroyed() { m_bBeingDestroyed = true; } |
91 bool IsBeingDestroyed() const { return m_bBeingDestroyed; } | 91 bool IsBeingDestroyed() const { return m_bBeingDestroyed; } |
92 | 92 |
93 #ifndef PDF_ENABLE_XFA | 93 #ifndef PDF_ENABLE_XFA |
94 bool OwnsPage() const { return m_bOwnsPage; } | 94 bool OwnsPage() const { return m_bOwnsPage; } |
95 void TakePageOwnership() { m_bOwnsPage = true; } | 95 void TakePageOwnership() { m_bOwnsPage = true; } |
96 #endif // PDF_ENABLE_XFA | 96 #endif // PDF_ENABLE_XFA |
97 | 97 |
98 private: | 98 private: |
99 int GetPageIndexForStaticPDF() const; | 99 int GetPageIndexForStaticPDF() const; |
100 | 100 |
101 CFX_Matrix m_curMatrix; | 101 CFX_Matrix m_curMatrix; |
102 UnderlyingPageType* const m_page; | 102 UnderlyingPageType* const m_page; |
103 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; | 103 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; |
104 std::vector<CPDFSDK_Annot*> m_SDKAnnotArray; | 104 std::vector<CPDFSDK_Annot*> m_SDKAnnotArray; |
105 CPDFSDK_FormFillEnvironment* const m_pFormFillEnv; // Not owned. | 105 CPDFSDK_FormFillEnvironment* const m_pFormFillEnv; // Not owned. |
106 CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; | 106 CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; |
107 #ifndef PDF_ENABLE_XFA | 107 #ifndef PDF_ENABLE_XFA |
108 bool m_bOwnsPage; | 108 bool m_bOwnsPage; |
109 #endif // PDF_ENABLE_XFA | 109 #endif // PDF_ENABLE_XFA |
110 FX_BOOL m_bEnterWidget; | 110 bool m_bEnterWidget; |
111 FX_BOOL m_bExitWidget; | 111 bool m_bExitWidget; |
112 FX_BOOL m_bOnWidget; | 112 bool m_bOnWidget; |
113 FX_BOOL m_bValid; | 113 bool m_bValid; |
114 FX_BOOL m_bLocked; | 114 bool m_bLocked; |
115 bool m_bBeingDestroyed; | 115 bool m_bBeingDestroyed; |
116 }; | 116 }; |
117 | 117 |
118 #endif // FPDFSDK_CPDFSDK_PAGEVIEW_H_ | 118 #endif // FPDFSDK_CPDFSDK_PAGEVIEW_H_ |
OLD | NEW |