| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_FSDK_BASEANNOT_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ |
| 8 #define FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ |
| 9 | 9 |
| 10 #if _FX_OS_ == _FX_ANDROID_ | 10 #if _FX_OS_ == _FX_ANDROID_ |
| 11 #include "time.h" | 11 #include "time.h" |
| 12 #else | 12 #else |
| 13 #include <ctime> | 13 #include <ctime> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "core/include/fpdfdoc/fpdf_doc.h" | 16 #include "core/include/fpdfdoc/fpdf_doc.h" |
| 17 #include "core/include/fxcrt/fx_basic.h" | 17 #include "core/include/fxcrt/fx_basic.h" |
| 18 #include "fpdfsdk/include/fsdk_define.h" | 18 #include "fpdfsdk/include/fsdk_define.h" |
| 19 #ifndef PDF_ENABLE_XFA |
| 19 #include "fx_systemhandler.h" | 20 #include "fx_systemhandler.h" |
| 21 #else |
| 22 #include "fpdfsdk/include/fx_systemhandler.h" |
| 23 #endif |
| 20 | 24 |
| 21 class CPDFSDK_PageView; | 25 class CPDFSDK_PageView; |
| 22 class CPDF_Annot; | 26 class CPDF_Annot; |
| 23 class CPDF_Page; | 27 class CPDF_Page; |
| 24 class CPDF_Rect; | 28 class CPDF_Rect; |
| 25 class CPDF_Matrix; | 29 class CPDF_Matrix; |
| 26 class CPDF_RenderOptions; | 30 class CPDF_RenderOptions; |
| 27 class CFX_RenderDevice; | 31 class CFX_RenderDevice; |
| 28 | 32 |
| 29 #define CFX_IntArray CFX_ArrayTemplate<int> | 33 #define CFX_IntArray CFX_ArrayTemplate<int> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 int8_t tzHour; | 69 int8_t tzHour; |
| 66 uint8_t tzMinute; | 70 uint8_t tzMinute; |
| 67 } dt; | 71 } dt; |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 class CPDFSDK_Annot { | 74 class CPDFSDK_Annot { |
| 71 public: | 75 public: |
| 72 explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView); | 76 explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView); |
| 73 virtual ~CPDFSDK_Annot() {} | 77 virtual ~CPDFSDK_Annot() {} |
| 74 | 78 |
| 79 #ifdef PDF_ENABLE_XFA |
| 80 virtual FX_BOOL IsXFAField() { return FALSE; } |
| 81 |
| 82 #endif |
| 75 virtual FX_FLOAT GetMinWidth() const; | 83 virtual FX_FLOAT GetMinWidth() const; |
| 76 virtual FX_FLOAT GetMinHeight() const; | 84 virtual FX_FLOAT GetMinHeight() const; |
| 77 // define layout order to 5. | 85 // define layout order to 5. |
| 78 virtual int GetLayoutOrder() const { return 5; } | 86 virtual int GetLayoutOrder() const { return 5; } |
| 79 | 87 |
| 80 virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; } | 88 virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; } |
| 89 #ifdef PDF_ENABLE_XFA |
| 90 virtual IXFA_Widget* GetXFAWidget() const { return nullptr; } |
| 91 #endif |
| 81 | 92 |
| 82 virtual CFX_ByteString GetType() const { return ""; } | 93 virtual CFX_ByteString GetType() const { return ""; } |
| 83 virtual CFX_ByteString GetSubType() const { return ""; } | 94 virtual CFX_ByteString GetSubType() const { return ""; } |
| 84 | 95 |
| 85 virtual void SetRect(const CPDF_Rect& rect) {} | 96 virtual void SetRect(const CPDF_Rect& rect) {} |
| 86 virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } | 97 virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } |
| 87 | 98 |
| 88 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, | 99 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, |
| 89 CPDF_Matrix* pUser2Device, | 100 CPDF_Matrix* pUser2Device, |
| 90 CPDF_RenderOptions* pOptions) {} | 101 CPDF_RenderOptions* pOptions) {} |
| 91 | 102 |
| 92 UnderlyingPageType* GetUnderlyingPage(); | 103 UnderlyingPageType* GetUnderlyingPage(); |
| 93 CPDF_Page* GetPDFPage(); | 104 CPDF_Page* GetPDFPage(); |
| 105 #ifdef PDF_ENABLE_XFA |
| 106 CPDFXFA_Page* GetPDFXFAPage(); |
| 107 #endif |
| 94 | 108 |
| 95 void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } | 109 void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } |
| 96 CPDFSDK_PageView* GetPageView() const { return m_pPageView; } | 110 CPDFSDK_PageView* GetPageView() const { return m_pPageView; } |
| 97 | 111 |
| 98 // Tab Order | 112 // Tab Order |
| 99 int GetTabOrder(); | 113 int GetTabOrder(); |
| 100 void SetTabOrder(int iTabOrder); | 114 void SetTabOrder(int iTabOrder); |
| 101 | 115 |
| 102 // Selection | 116 // Selection |
| 103 FX_BOOL IsSelected(); | 117 FX_BOOL IsSelected(); |
| 104 void SetSelected(FX_BOOL bSelected); | 118 void SetSelected(FX_BOOL bSelected); |
| 105 | 119 |
| 106 protected: | 120 protected: |
| 107 CPDFSDK_PageView* m_pPageView; | 121 CPDFSDK_PageView* m_pPageView; |
| 108 FX_BOOL m_bSelected; | 122 FX_BOOL m_bSelected; |
| 109 int m_nTabOrder; | 123 int m_nTabOrder; |
| 110 }; | 124 }; |
| 111 | 125 |
| 112 class CPDFSDK_BAAnnot : public CPDFSDK_Annot { | 126 class CPDFSDK_BAAnnot : public CPDFSDK_Annot { |
| 113 public: | 127 public: |
| 114 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); | 128 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); |
| 115 ~CPDFSDK_BAAnnot() override {} | 129 ~CPDFSDK_BAAnnot() override {} |
| 116 | 130 |
| 131 #ifdef PDF_ENABLE_XFA |
| 132 FX_BOOL IsXFAField() override; |
| 133 #endif |
| 117 CFX_ByteString GetType() const override; | 134 CFX_ByteString GetType() const override; |
| 118 CFX_ByteString GetSubType() const override; | 135 CFX_ByteString GetSubType() const override; |
| 119 void SetRect(const CPDF_Rect& rect) override; | 136 void SetRect(const CPDF_Rect& rect) override; |
| 120 CPDF_Rect GetRect() const override; | 137 CPDF_Rect GetRect() const override; |
| 121 CPDF_Annot* GetPDFAnnot() const override; | 138 CPDF_Annot* GetPDFAnnot() const override; |
| 122 void Annot_OnDraw(CFX_RenderDevice* pDevice, | 139 void Annot_OnDraw(CFX_RenderDevice* pDevice, |
| 123 CPDF_Matrix* pUser2Device, | 140 CPDF_Matrix* pUser2Device, |
| 124 CPDF_RenderOptions* pOptions) override; | 141 CPDF_RenderOptions* pOptions) override; |
| 125 | 142 |
| 126 CPDF_Dictionary* GetAnnotDict() const; | 143 CPDF_Dictionary* GetAnnotDict() const; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 const CFX_ByteString& sAPState = ""); | 216 const CFX_ByteString& sAPState = ""); |
| 200 | 217 |
| 201 protected: | 218 protected: |
| 202 CPDF_Annot* m_pAnnot; | 219 CPDF_Annot* m_pAnnot; |
| 203 | 220 |
| 204 private: | 221 private: |
| 205 FX_BOOL CreateFormFiller(); | 222 FX_BOOL CreateFormFiller(); |
| 206 }; | 223 }; |
| 207 | 224 |
| 208 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ | 225 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ |
| OLD | NEW |