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 "fx_systemhandler.h" | 19 #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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; } | 80 virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; } |
81 | 81 |
82 virtual CFX_ByteString GetType() const { return ""; } | 82 virtual CFX_ByteString GetType() const { return ""; } |
83 virtual CFX_ByteString GetSubType() const { return ""; } | 83 virtual CFX_ByteString GetSubType() const { return ""; } |
84 | 84 |
85 virtual void SetRect(const CPDF_Rect& rect) {} | 85 virtual void SetRect(const CPDF_Rect& rect) {} |
86 virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } | 86 virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } |
87 | 87 |
88 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, | 88 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, |
89 CPDF_Matrix* pUser2Device, | 89 CFX_Matrix* pUser2Device, |
90 CPDF_RenderOptions* pOptions) {} | 90 CPDF_RenderOptions* pOptions) {} |
91 | 91 |
92 UnderlyingPageType* GetUnderlyingPage(); | 92 UnderlyingPageType* GetUnderlyingPage(); |
93 CPDF_Page* GetPDFPage(); | 93 CPDF_Page* GetPDFPage(); |
94 | 94 |
95 void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } | 95 void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } |
96 CPDFSDK_PageView* GetPageView() const { return m_pPageView; } | 96 CPDFSDK_PageView* GetPageView() const { return m_pPageView; } |
97 | 97 |
98 // Tab Order | 98 // Tab Order |
99 int GetTabOrder(); | 99 int GetTabOrder(); |
(...skipping 13 matching lines...) Expand all Loading... |
113 public: | 113 public: |
114 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); | 114 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); |
115 ~CPDFSDK_BAAnnot() override {} | 115 ~CPDFSDK_BAAnnot() override {} |
116 | 116 |
117 CFX_ByteString GetType() const override; | 117 CFX_ByteString GetType() const override; |
118 CFX_ByteString GetSubType() const override; | 118 CFX_ByteString GetSubType() const override; |
119 void SetRect(const CPDF_Rect& rect) override; | 119 void SetRect(const CPDF_Rect& rect) override; |
120 CPDF_Rect GetRect() const override; | 120 CPDF_Rect GetRect() const override; |
121 CPDF_Annot* GetPDFAnnot() const override; | 121 CPDF_Annot* GetPDFAnnot() const override; |
122 void Annot_OnDraw(CFX_RenderDevice* pDevice, | 122 void Annot_OnDraw(CFX_RenderDevice* pDevice, |
123 CPDF_Matrix* pUser2Device, | 123 CFX_Matrix* pUser2Device, |
124 CPDF_RenderOptions* pOptions) override; | 124 CPDF_RenderOptions* pOptions) override; |
125 | 125 |
126 CPDF_Dictionary* GetAnnotDict() const; | 126 CPDF_Dictionary* GetAnnotDict() const; |
127 | 127 |
128 void SetContents(const CFX_WideString& sContents); | 128 void SetContents(const CFX_WideString& sContents); |
129 CFX_WideString GetContents() const; | 129 CFX_WideString GetContents() const; |
130 | 130 |
131 void SetAnnotName(const CFX_WideString& sName); | 131 void SetAnnotName(const CFX_WideString& sName); |
132 CFX_WideString GetAnnotName() const; | 132 CFX_WideString GetAnnotName() const; |
133 | 133 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 CPDF_AAction GetAAction() const; | 177 CPDF_AAction GetAAction() const; |
178 void SetAAction(const CPDF_AAction& aa); | 178 void SetAAction(const CPDF_AAction& aa); |
179 void RemoveAAction(); | 179 void RemoveAAction(); |
180 | 180 |
181 virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); | 181 virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); |
182 | 182 |
183 virtual FX_BOOL IsAppearanceValid(); | 183 virtual FX_BOOL IsAppearanceValid(); |
184 virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); | 184 virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); |
185 virtual void DrawAppearance(CFX_RenderDevice* pDevice, | 185 virtual void DrawAppearance(CFX_RenderDevice* pDevice, |
186 const CPDF_Matrix* pUser2Device, | 186 const CFX_Matrix* pUser2Device, |
187 CPDF_Annot::AppearanceMode mode, | 187 CPDF_Annot::AppearanceMode mode, |
188 const CPDF_RenderOptions* pOptions); | 188 const CPDF_RenderOptions* pOptions); |
189 void DrawBorder(CFX_RenderDevice* pDevice, | 189 void DrawBorder(CFX_RenderDevice* pDevice, |
190 const CPDF_Matrix* pUser2Device, | 190 const CFX_Matrix* pUser2Device, |
191 const CPDF_RenderOptions* pOptions); | 191 const CPDF_RenderOptions* pOptions); |
192 | 192 |
193 void ClearCachedAP(); | 193 void ClearCachedAP(); |
194 | 194 |
195 void WriteAppearance(const CFX_ByteString& sAPType, | 195 void WriteAppearance(const CFX_ByteString& sAPType, |
196 const CPDF_Rect& rcBBox, | 196 const CPDF_Rect& rcBBox, |
197 const CPDF_Matrix& matrix, | 197 const CFX_Matrix& matrix, |
198 const CFX_ByteString& sContents, | 198 const CFX_ByteString& sContents, |
199 const CFX_ByteString& sAPState = ""); | 199 const CFX_ByteString& sAPState = ""); |
200 | 200 |
201 protected: | 201 protected: |
202 CPDF_Annot* m_pAnnot; | 202 CPDF_Annot* m_pAnnot; |
203 | 203 |
204 private: | 204 private: |
205 FX_BOOL CreateFormFiller(); | 205 FX_BOOL CreateFormFiller(); |
206 }; | 206 }; |
207 | 207 |
208 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ | 208 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ |
OLD | NEW |