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_ |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 uint8_t hour; | 61 uint8_t hour; |
62 uint8_t minute; | 62 uint8_t minute; |
63 uint8_t second; | 63 uint8_t second; |
64 int8_t tzHour; | 64 int8_t tzHour; |
65 uint8_t tzMinute; | 65 uint8_t tzMinute; |
66 } dt; | 66 } dt; |
67 }; | 67 }; |
68 | 68 |
69 class CPDFSDK_Annot { | 69 class CPDFSDK_Annot { |
70 public: | 70 public: |
71 CPDFSDK_Annot(CPDFSDK_PageView* pPageView); | 71 explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView); |
72 virtual ~CPDFSDK_Annot(){}; | 72 virtual ~CPDFSDK_Annot() {} |
73 | 73 |
74 virtual FX_BOOL IsXFAField() { return FALSE; } | 74 virtual FX_BOOL IsXFAField() { return FALSE; } |
75 | 75 |
76 virtual FX_FLOAT GetMinWidth() const; | 76 virtual FX_FLOAT GetMinWidth() const; |
77 virtual FX_FLOAT GetMinHeight() const; | 77 virtual FX_FLOAT GetMinHeight() const; |
78 // define layout order to 5. | 78 // define layout order to 5. |
79 virtual int GetLayoutOrder() const { return 5; } | 79 virtual int GetLayoutOrder() const { return 5; } |
80 | 80 |
81 virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; } | 81 virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; } |
82 virtual IXFA_Widget* GetXFAWidget() const { return nullptr; } | 82 virtual IXFA_Widget* GetXFAWidget() const { return nullptr; } |
(...skipping 16 matching lines...) Expand all Loading... |
99 | 99 |
100 // Tab Order | 100 // Tab Order |
101 int GetTabOrder(); | 101 int GetTabOrder(); |
102 void SetTabOrder(int iTabOrder); | 102 void SetTabOrder(int iTabOrder); |
103 | 103 |
104 // Selection | 104 // Selection |
105 FX_BOOL IsSelected(); | 105 FX_BOOL IsSelected(); |
106 void SetSelected(FX_BOOL bSelected); | 106 void SetSelected(FX_BOOL bSelected); |
107 | 107 |
108 protected: | 108 protected: |
109 CPDF_Annot* m_pAnnot; | |
110 CPDFSDK_PageView* m_pPageView; | 109 CPDFSDK_PageView* m_pPageView; |
111 FX_BOOL m_bSelected; | 110 FX_BOOL m_bSelected; |
112 int m_nTabOrder; | 111 int m_nTabOrder; |
113 }; | 112 }; |
114 | 113 |
115 class CPDFSDK_BAAnnot : public CPDFSDK_Annot { | 114 class CPDFSDK_BAAnnot : public CPDFSDK_Annot { |
116 public: | 115 public: |
117 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); | 116 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); |
118 virtual ~CPDFSDK_BAAnnot(); | 117 virtual ~CPDFSDK_BAAnnot() {} |
119 | 118 |
120 public: | |
121 virtual FX_BOOL IsXFAField(); | 119 virtual FX_BOOL IsXFAField(); |
122 | 120 |
123 virtual CFX_ByteString GetType() const; | 121 virtual CFX_ByteString GetType() const; |
124 virtual CFX_ByteString GetSubType() const; | 122 virtual CFX_ByteString GetSubType() const; |
125 | 123 |
126 virtual void SetRect(const CPDF_Rect& rect); | 124 virtual void SetRect(const CPDF_Rect& rect); |
127 virtual CPDF_Rect GetRect() const; | 125 virtual CPDF_Rect GetRect() const; |
128 | 126 |
129 virtual CPDF_Annot* GetPDFAnnot() const; | 127 virtual CPDF_Annot* GetPDFAnnot() const; |
130 | 128 |
131 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, | 129 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, |
132 CPDF_Matrix* pUser2Device, | 130 CPDF_Matrix* pUser2Device, |
133 CPDF_RenderOptions* pOptions); | 131 CPDF_RenderOptions* pOptions); |
134 | 132 |
135 public: | |
136 CPDF_Dictionary* GetAnnotDict() const; | 133 CPDF_Dictionary* GetAnnotDict() const; |
137 | 134 |
138 void SetContents(const CFX_WideString& sContents); | 135 void SetContents(const CFX_WideString& sContents); |
139 CFX_WideString GetContents() const; | 136 CFX_WideString GetContents() const; |
140 | 137 |
141 void SetAnnotName(const CFX_WideString& sName); | 138 void SetAnnotName(const CFX_WideString& sName); |
142 CFX_WideString GetAnnotName() const; | 139 CFX_WideString GetAnnotName() const; |
143 | 140 |
144 void SetModifiedDate(const FX_SYSTEMTIME& st); | 141 void SetModifiedDate(const FX_SYSTEMTIME& st); |
145 FX_SYSTEMTIME GetModifiedDate() const; | 142 FX_SYSTEMTIME GetModifiedDate() const; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 CPDF_Action GetAction() const; | 180 CPDF_Action GetAction() const; |
184 void SetAction(const CPDF_Action& a); | 181 void SetAction(const CPDF_Action& a); |
185 void RemoveAction(); | 182 void RemoveAction(); |
186 | 183 |
187 CPDF_AAction GetAAction() const; | 184 CPDF_AAction GetAAction() const; |
188 void SetAAction(const CPDF_AAction& aa); | 185 void SetAAction(const CPDF_AAction& aa); |
189 void RemoveAAction(); | 186 void RemoveAAction(); |
190 | 187 |
191 virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); | 188 virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); |
192 | 189 |
193 public: | |
194 virtual FX_BOOL IsAppearanceValid(); | 190 virtual FX_BOOL IsAppearanceValid(); |
195 virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); | 191 virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); |
196 virtual void DrawAppearance(CFX_RenderDevice* pDevice, | 192 virtual void DrawAppearance(CFX_RenderDevice* pDevice, |
197 const CPDF_Matrix* pUser2Device, | 193 const CPDF_Matrix* pUser2Device, |
198 CPDF_Annot::AppearanceMode mode, | 194 CPDF_Annot::AppearanceMode mode, |
199 const CPDF_RenderOptions* pOptions); | 195 const CPDF_RenderOptions* pOptions); |
200 void DrawBorder(CFX_RenderDevice* pDevice, | 196 void DrawBorder(CFX_RenderDevice* pDevice, |
201 const CPDF_Matrix* pUser2Device, | 197 const CPDF_Matrix* pUser2Device, |
202 const CPDF_RenderOptions* pOptions); | 198 const CPDF_RenderOptions* pOptions); |
203 | 199 |
204 void ClearCachedAP(); | 200 void ClearCachedAP(); |
205 | 201 |
206 void WriteAppearance(const CFX_ByteString& sAPType, | 202 void WriteAppearance(const CFX_ByteString& sAPType, |
207 const CPDF_Rect& rcBBox, | 203 const CPDF_Rect& rcBBox, |
208 const CPDF_Matrix& matrix, | 204 const CPDF_Matrix& matrix, |
209 const CFX_ByteString& sContents, | 205 const CFX_ByteString& sContents, |
210 const CFX_ByteString& sAPState = ""); | 206 const CFX_ByteString& sAPState = ""); |
211 | 207 |
| 208 protected: |
| 209 CPDF_Annot* m_pAnnot; |
| 210 |
212 private: | 211 private: |
213 FX_BOOL CreateFormFiller(); | 212 FX_BOOL CreateFormFiller(); |
214 | |
215 protected: | |
216 CPDF_Annot* m_pAnnot; | |
217 }; | 213 }; |
218 | 214 |
219 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ | 215 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ |
OLD | NEW |