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 #include "fpdfsdk/include/fx_systemhandler.h" | 19 #include "fpdfsdk/include/fx_systemhandler.h" |
20 | 20 |
21 class CPDFSDK_PageView; | 21 class CPDFSDK_PageView; |
22 class CPDF_Annot; | 22 class CPDF_Annot; |
23 class CPDF_Page; | 23 class CPDF_Page; |
24 class CPDF_Rect; | 24 class CPDF_Rect; |
25 class CPDF_Matrix; | 25 class CFX_Matrix; |
26 class CPDF_RenderOptions; | 26 class CPDF_RenderOptions; |
27 class CFX_RenderDevice; | 27 class CFX_RenderDevice; |
28 | 28 |
29 #define CFX_IntArray CFX_ArrayTemplate<int> | 29 #define CFX_IntArray CFX_ArrayTemplate<int> |
30 | 30 |
31 class CPDFSDK_DateTime { | 31 class CPDFSDK_DateTime { |
32 public: | 32 public: |
33 CPDFSDK_DateTime(); | 33 CPDFSDK_DateTime(); |
34 CPDFSDK_DateTime(const CFX_ByteString& dtStr); | 34 CPDFSDK_DateTime(const CFX_ByteString& dtStr); |
35 CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime); | 35 CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 virtual IXFA_Widget* GetXFAWidget() const { return nullptr; } | 87 virtual IXFA_Widget* GetXFAWidget() const { return nullptr; } |
88 #endif // PDF_ENABLE_XFA | 88 #endif // PDF_ENABLE_XFA |
89 | 89 |
90 virtual CFX_ByteString GetType() const { return ""; } | 90 virtual CFX_ByteString GetType() const { return ""; } |
91 virtual CFX_ByteString GetSubType() const { return ""; } | 91 virtual CFX_ByteString GetSubType() const { return ""; } |
92 | 92 |
93 virtual void SetRect(const CPDF_Rect& rect) {} | 93 virtual void SetRect(const CPDF_Rect& rect) {} |
94 virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } | 94 virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } |
95 | 95 |
96 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, | 96 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, |
97 CPDF_Matrix* pUser2Device, | 97 CFX_Matrix* pUser2Device, |
98 CPDF_RenderOptions* pOptions) {} | 98 CPDF_RenderOptions* pOptions) {} |
99 | 99 |
100 UnderlyingPageType* GetUnderlyingPage(); | 100 UnderlyingPageType* GetUnderlyingPage(); |
101 CPDF_Page* GetPDFPage(); | 101 CPDF_Page* GetPDFPage(); |
102 #ifdef PDF_ENABLE_XFA | 102 #ifdef PDF_ENABLE_XFA |
103 CPDFXFA_Page* GetPDFXFAPage(); | 103 CPDFXFA_Page* GetPDFXFAPage(); |
104 #endif // PDF_ENABLE_XFA | 104 #endif // PDF_ENABLE_XFA |
105 | 105 |
106 void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } | 106 void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } |
107 CPDFSDK_PageView* GetPageView() const { return m_pPageView; } | 107 CPDFSDK_PageView* GetPageView() const { return m_pPageView; } |
(...skipping 20 matching lines...) Expand all Loading... |
128 #ifdef PDF_ENABLE_XFA | 128 #ifdef PDF_ENABLE_XFA |
129 FX_BOOL IsXFAField() override; | 129 FX_BOOL IsXFAField() override; |
130 #endif // PDF_ENABLE_XFA | 130 #endif // PDF_ENABLE_XFA |
131 | 131 |
132 CFX_ByteString GetType() const override; | 132 CFX_ByteString GetType() const override; |
133 CFX_ByteString GetSubType() const override; | 133 CFX_ByteString GetSubType() const override; |
134 void SetRect(const CPDF_Rect& rect) override; | 134 void SetRect(const CPDF_Rect& rect) override; |
135 CPDF_Rect GetRect() const override; | 135 CPDF_Rect GetRect() const override; |
136 CPDF_Annot* GetPDFAnnot() const override; | 136 CPDF_Annot* GetPDFAnnot() const override; |
137 void Annot_OnDraw(CFX_RenderDevice* pDevice, | 137 void Annot_OnDraw(CFX_RenderDevice* pDevice, |
138 CPDF_Matrix* pUser2Device, | 138 CFX_Matrix* pUser2Device, |
139 CPDF_RenderOptions* pOptions) override; | 139 CPDF_RenderOptions* pOptions) override; |
140 | 140 |
141 CPDF_Dictionary* GetAnnotDict() const; | 141 CPDF_Dictionary* GetAnnotDict() const; |
142 | 142 |
143 void SetContents(const CFX_WideString& sContents); | 143 void SetContents(const CFX_WideString& sContents); |
144 CFX_WideString GetContents() const; | 144 CFX_WideString GetContents() const; |
145 | 145 |
146 void SetAnnotName(const CFX_WideString& sName); | 146 void SetAnnotName(const CFX_WideString& sName); |
147 CFX_WideString GetAnnotName() const; | 147 CFX_WideString GetAnnotName() const; |
148 | 148 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 CPDF_AAction GetAAction() const; | 192 CPDF_AAction GetAAction() const; |
193 void SetAAction(const CPDF_AAction& aa); | 193 void SetAAction(const CPDF_AAction& aa); |
194 void RemoveAAction(); | 194 void RemoveAAction(); |
195 | 195 |
196 virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); | 196 virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); |
197 | 197 |
198 virtual FX_BOOL IsAppearanceValid(); | 198 virtual FX_BOOL IsAppearanceValid(); |
199 virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); | 199 virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); |
200 virtual void DrawAppearance(CFX_RenderDevice* pDevice, | 200 virtual void DrawAppearance(CFX_RenderDevice* pDevice, |
201 const CPDF_Matrix* pUser2Device, | 201 const CFX_Matrix* pUser2Device, |
202 CPDF_Annot::AppearanceMode mode, | 202 CPDF_Annot::AppearanceMode mode, |
203 const CPDF_RenderOptions* pOptions); | 203 const CPDF_RenderOptions* pOptions); |
204 void DrawBorder(CFX_RenderDevice* pDevice, | 204 void DrawBorder(CFX_RenderDevice* pDevice, |
205 const CPDF_Matrix* pUser2Device, | 205 const CFX_Matrix* pUser2Device, |
206 const CPDF_RenderOptions* pOptions); | 206 const CPDF_RenderOptions* pOptions); |
207 | 207 |
208 void ClearCachedAP(); | 208 void ClearCachedAP(); |
209 | 209 |
210 void WriteAppearance(const CFX_ByteString& sAPType, | 210 void WriteAppearance(const CFX_ByteString& sAPType, |
211 const CPDF_Rect& rcBBox, | 211 const CPDF_Rect& rcBBox, |
212 const CPDF_Matrix& matrix, | 212 const CFX_Matrix& matrix, |
213 const CFX_ByteString& sContents, | 213 const CFX_ByteString& sContents, |
214 const CFX_ByteString& sAPState = ""); | 214 const CFX_ByteString& sAPState = ""); |
215 | 215 |
216 protected: | 216 protected: |
217 CPDF_Annot* m_pAnnot; | 217 CPDF_Annot* m_pAnnot; |
218 | 218 |
219 private: | 219 private: |
220 FX_BOOL CreateFormFiller(); | 220 FX_BOOL CreateFormFiller(); |
221 }; | 221 }; |
222 | 222 |
223 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ | 223 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ |
OLD | NEW |