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_BASEFORM_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
9 | 9 |
10 #if _FX_OS_ == _FX_ANDROID_ | 10 #if _FX_OS_ == _FX_ANDROID_ |
(...skipping 13 matching lines...) Expand all Loading... |
24 class CFFL_FormFiller; | 24 class CFFL_FormFiller; |
25 class CPDFSDK_Annot; | 25 class CPDFSDK_Annot; |
26 class CPDFSDK_DateTime; | 26 class CPDFSDK_DateTime; |
27 class CPDFSDK_Document; | 27 class CPDFSDK_Document; |
28 class CPDFSDK_InterForm; | 28 class CPDFSDK_InterForm; |
29 class CPDFSDK_PageView; | 29 class CPDFSDK_PageView; |
30 class CPDF_Action; | 30 class CPDF_Action; |
31 class CPDF_FormField; | 31 class CPDF_FormField; |
32 struct CPWL_Color; | 32 struct CPWL_Color; |
33 | 33 |
| 34 #ifdef PDF_ENABLE_XFA |
34 typedef enum _PDFSDK_XFAAActionType { | 35 typedef enum _PDFSDK_XFAAActionType { |
35 PDFSDK_XFA_Click = 0, | 36 PDFSDK_XFA_Click = 0, |
36 PDFSDK_XFA_Full, | 37 PDFSDK_XFA_Full, |
37 PDFSDK_XFA_PreOpen, | 38 PDFSDK_XFA_PreOpen, |
38 PDFSDK_XFA_PostOpen | 39 PDFSDK_XFA_PostOpen |
39 } PDFSDK_XFAAActionType; | 40 } PDFSDK_XFAAActionType; |
40 | 41 |
| 42 #endif |
41 typedef struct _PDFSDK_FieldAction { | 43 typedef struct _PDFSDK_FieldAction { |
42 _PDFSDK_FieldAction() { | 44 _PDFSDK_FieldAction() { |
43 bModifier = FALSE; | 45 bModifier = FALSE; |
44 bShift = FALSE; | 46 bShift = FALSE; |
45 nCommitKey = 0; | 47 nCommitKey = 0; |
46 bKeyDown = FALSE; | 48 bKeyDown = FALSE; |
47 nSelEnd = nSelStart = 0; | 49 nSelEnd = nSelStart = 0; |
48 bWillCommit = FALSE; | 50 bWillCommit = FALSE; |
49 bFieldFull = FALSE; | 51 bFieldFull = FALSE; |
50 bRC = TRUE; | 52 bRC = TRUE; |
51 } | 53 } |
52 | 54 |
53 FX_BOOL bModifier; // in | 55 FX_BOOL bModifier; // in |
54 FX_BOOL bShift; // in | 56 FX_BOOL bShift; // in |
55 int nCommitKey; // in | 57 int nCommitKey; // in |
56 CFX_WideString sChange; // in[out] | 58 CFX_WideString sChange; // in[out] |
57 CFX_WideString sChangeEx; // in | 59 CFX_WideString sChangeEx; // in |
58 FX_BOOL bKeyDown; // in | 60 FX_BOOL bKeyDown; // in |
59 int nSelEnd; // in[out] | 61 int nSelEnd; // in[out] |
60 int nSelStart; // in[out] | 62 int nSelStart; // in[out] |
61 CFX_WideString sValue; // in[out] | 63 CFX_WideString sValue; // in[out] |
62 FX_BOOL bWillCommit; // in | 64 FX_BOOL bWillCommit; // in |
63 FX_BOOL bFieldFull; // in | 65 FX_BOOL bFieldFull; // in |
64 FX_BOOL bRC; // in[out] | 66 FX_BOOL bRC; // in[out] |
65 } PDFSDK_FieldAction; | 67 } PDFSDK_FieldAction; |
66 | 68 |
67 class CPDFSDK_Widget : public CPDFSDK_BAAnnot { | 69 class CPDFSDK_Widget : public CPDFSDK_BAAnnot { |
68 public: | 70 public: |
| 71 #ifdef PDF_ENABLE_XFA |
69 IXFA_Widget* GetMixXFAWidget() const; | 72 IXFA_Widget* GetMixXFAWidget() const; |
70 IXFA_Widget* GetGroupMixXFAWidget(); | 73 IXFA_Widget* GetGroupMixXFAWidget(); |
71 IXFA_WidgetHandler* GetXFAWidgetHandler() const; | 74 IXFA_WidgetHandler* GetXFAWidgetHandler() const; |
72 | 75 |
73 FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT); | 76 FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT); |
74 FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, | 77 FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, |
75 PDFSDK_FieldAction& data, | 78 PDFSDK_FieldAction& data, |
76 CPDFSDK_PageView* pPageView); | 79 CPDFSDK_PageView* pPageView); |
77 | 80 |
78 void Synchronize(FX_BOOL bSynchronizeElse); | 81 void Synchronize(FX_BOOL bSynchronizeElse); |
79 void SynchronizeXFAValue(); | 82 void SynchronizeXFAValue(); |
80 void SynchronizeXFAItems(); | 83 void SynchronizeXFAItems(); |
81 | 84 |
82 static void SynchronizeXFAValue(IXFA_DocView* pXFADocView, | 85 static void SynchronizeXFAValue(IXFA_DocView* pXFADocView, |
83 IXFA_Widget* hWidget, | 86 IXFA_Widget* hWidget, |
84 CPDF_FormField* pFormField, | 87 CPDF_FormField* pFormField, |
85 CPDF_FormControl* pFormControl); | 88 CPDF_FormControl* pFormControl); |
86 static void SynchronizeXFAItems(IXFA_DocView* pXFADocView, | 89 static void SynchronizeXFAItems(IXFA_DocView* pXFADocView, |
87 IXFA_Widget* hWidget, | 90 IXFA_Widget* hWidget, |
88 CPDF_FormField* pFormField, | 91 CPDF_FormField* pFormField, |
89 CPDF_FormControl* pFormControl); | 92 CPDF_FormControl* pFormControl); |
90 | 93 |
| 94 #endif |
91 CPDFSDK_Widget(CPDF_Annot* pAnnot, | 95 CPDFSDK_Widget(CPDF_Annot* pAnnot, |
92 CPDFSDK_PageView* pPageView, | 96 CPDFSDK_PageView* pPageView, |
93 CPDFSDK_InterForm* pInterForm); | 97 CPDFSDK_InterForm* pInterForm); |
94 ~CPDFSDK_Widget() override; | 98 ~CPDFSDK_Widget() override; |
95 | 99 |
96 // CPDFSDK_Annot | 100 // CPDFSDK_Annot |
97 CFX_ByteString GetSubType() const override; | 101 CFX_ByteString GetSubType() const override; |
98 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; | 102 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; |
99 FX_BOOL IsAppearanceValid() override; | 103 FX_BOOL IsAppearanceValid() override; |
100 | 104 |
101 int GetLayoutOrder() const override { return 2; } | 105 int GetLayoutOrder() const override { return 2; } |
102 | 106 |
103 int GetFieldType() const; | 107 int GetFieldType() const; |
104 | 108 |
105 // Possible values from PDF 32000-1:2008, table 221. | 109 // Possible values from PDF 32000-1:2008, table 221. |
106 // FIELDFLAG_READONLY | 110 // FIELDFLAG_READONLY |
107 // FIELDFLAG_REQUIRED | 111 // FIELDFLAG_REQUIRED |
108 // FIELDFLAG_NOEXPORT | 112 // FIELDFLAG_NOEXPORT |
109 int GetFieldFlags() const; | 113 int GetFieldFlags() const; |
110 int GetRotate() const; | 114 int GetRotate() const; |
111 | 115 |
112 FX_BOOL GetFillColor(FX_COLORREF& color) const; | 116 FX_BOOL GetFillColor(FX_COLORREF& color) const; |
113 FX_BOOL GetBorderColor(FX_COLORREF& color) const; | 117 FX_BOOL GetBorderColor(FX_COLORREF& color) const; |
114 FX_BOOL GetTextColor(FX_COLORREF& color) const; | 118 FX_BOOL GetTextColor(FX_COLORREF& color) const; |
115 FX_FLOAT GetFontSize() const; | 119 FX_FLOAT GetFontSize() const; |
116 | 120 |
117 int GetSelectedIndex(int nIndex) const; | 121 int GetSelectedIndex(int nIndex) const; |
| 122 #ifndef PDF_ENABLE_XFA |
| 123 CFX_WideString GetValue() const; |
| 124 #else |
118 CFX_WideString GetValue(FX_BOOL bDisplay = TRUE) const; | 125 CFX_WideString GetValue(FX_BOOL bDisplay = TRUE) const; |
| 126 #endif |
119 CFX_WideString GetDefaultValue() const; | 127 CFX_WideString GetDefaultValue() const; |
120 CFX_WideString GetOptionLabel(int nIndex) const; | 128 CFX_WideString GetOptionLabel(int nIndex) const; |
121 int CountOptions() const; | 129 int CountOptions() const; |
122 FX_BOOL IsOptionSelected(int nIndex) const; | 130 FX_BOOL IsOptionSelected(int nIndex) const; |
123 int GetTopVisibleIndex() const; | 131 int GetTopVisibleIndex() const; |
124 FX_BOOL IsChecked() const; | 132 FX_BOOL IsChecked() const; |
125 /* | 133 /* |
126 BF_ALIGN_LEFT | 134 BF_ALIGN_LEFT |
127 BF_ALIGN_MIDDL | 135 BF_ALIGN_MIDDL |
128 BF_ALIGN_RIGHT | 136 BF_ALIGN_RIGHT |
129 */ | 137 */ |
130 int GetAlignment() const; | 138 int GetAlignment() const; |
131 int GetMaxLen() const; | 139 int GetMaxLen() const; |
| 140 #ifdef PDF_ENABLE_XFA |
132 CFX_WideString GetName() const; | 141 CFX_WideString GetName() const; |
| 142 #endif |
133 CFX_WideString GetAlternateName() const; | 143 CFX_WideString GetAlternateName() const; |
134 | 144 |
135 // Set Properties. | 145 // Set Properties. |
136 void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify); | 146 void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify); |
137 void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify); | 147 void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify); |
138 void SetDefaultValue(const CFX_WideString& sValue); | 148 void SetDefaultValue(const CFX_WideString& sValue); |
139 void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify); | 149 void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify); |
140 void ClearSelection(FX_BOOL bNotify); | 150 void ClearSelection(FX_BOOL bNotify); |
141 void SetTopVisibleIndex(int index); | 151 void SetTopVisibleIndex(int index); |
142 | 152 |
| 153 #ifdef PDF_ENABLE_XFA |
143 void ResetAppearance(FX_BOOL bValueChanged); | 154 void ResetAppearance(FX_BOOL bValueChanged); |
| 155 #endif |
144 void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged); | 156 void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged); |
145 void ResetFieldAppearance(FX_BOOL bValueChanged); | 157 void ResetFieldAppearance(FX_BOOL bValueChanged); |
146 void UpdateField(); | 158 void UpdateField(); |
147 CFX_WideString OnFormat(FX_BOOL& bFormated); | 159 CFX_WideString OnFormat(FX_BOOL& bFormated); |
148 | 160 |
149 // Message. | 161 // Message. |
150 FX_BOOL OnAAction(CPDF_AAction::AActionType type, | 162 FX_BOOL OnAAction(CPDF_AAction::AActionType type, |
151 PDFSDK_FieldAction& data, | 163 PDFSDK_FieldAction& data, |
152 CPDFSDK_PageView* pPageView); | 164 CPDFSDK_PageView* pPageView); |
153 | 165 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 202 |
191 public: | 203 public: |
192 FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); | 204 FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); |
193 void DrawAppearance(CFX_RenderDevice* pDevice, | 205 void DrawAppearance(CFX_RenderDevice* pDevice, |
194 const CPDF_Matrix* pUser2Device, | 206 const CPDF_Matrix* pUser2Device, |
195 CPDF_Annot::AppearanceMode mode, | 207 CPDF_Annot::AppearanceMode mode, |
196 const CPDF_RenderOptions* pOptions) override; | 208 const CPDF_RenderOptions* pOptions) override; |
197 | 209 |
198 FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); | 210 FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); |
199 | 211 |
| 212 #ifndef PDF_ENABLE_XFA |
| 213 private: |
| 214 #endif |
200 CPDFSDK_InterForm* m_pInterForm; | 215 CPDFSDK_InterForm* m_pInterForm; |
201 FX_BOOL m_bAppModified; | 216 FX_BOOL m_bAppModified; |
202 int32_t m_nAppAge; | 217 int32_t m_nAppAge; |
203 int32_t m_nValueAge; | 218 int32_t m_nValueAge; |
| 219 #ifdef PDF_ENABLE_XFA |
204 | 220 |
205 mutable IXFA_Widget* m_hMixXFAWidget; | 221 mutable IXFA_Widget* m_hMixXFAWidget; |
206 mutable IXFA_WidgetHandler* m_pWidgetHandler; | 222 mutable IXFA_WidgetHandler* m_pWidgetHandler; |
| 223 #endif |
207 }; | 224 }; |
208 | 225 |
| 226 #ifdef PDF_ENABLE_XFA |
209 class CPDFSDK_XFAWidget : public CPDFSDK_Annot { | 227 class CPDFSDK_XFAWidget : public CPDFSDK_Annot { |
210 public: | 228 public: |
211 CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, | 229 CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, |
212 CPDFSDK_PageView* pPageView, | 230 CPDFSDK_PageView* pPageView, |
213 CPDFSDK_InterForm* pInterForm); | 231 CPDFSDK_InterForm* pInterForm); |
214 ~CPDFSDK_XFAWidget() override {} | 232 ~CPDFSDK_XFAWidget() override {} |
215 | 233 |
216 FX_BOOL IsXFAField() override; | 234 FX_BOOL IsXFAField() override; |
217 IXFA_Widget* GetXFAWidget() const override { return m_hXFAWidget; } | 235 IXFA_Widget* GetXFAWidget() const override { return m_hXFAWidget; } |
218 CFX_ByteString GetType() const override; | 236 CFX_ByteString GetType() const override; |
219 CFX_ByteString GetSubType() const override { return ""; } | 237 CFX_ByteString GetSubType() const override { return ""; } |
220 CFX_FloatRect GetRect() const override; | 238 CFX_FloatRect GetRect() const override; |
221 | 239 |
222 CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; } | 240 CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; } |
223 | 241 |
224 private: | 242 private: |
225 CPDFSDK_InterForm* m_pInterForm; | 243 CPDFSDK_InterForm* m_pInterForm; |
226 IXFA_Widget* m_hXFAWidget; | 244 IXFA_Widget* m_hXFAWidget; |
227 }; | 245 }; |
228 | 246 |
229 #define CPDFSDK_XFAWidgetMap \ | 247 #define CPDFSDK_XFAWidgetMap \ |
230 CFX_MapPtrTemplate<IXFA_Widget*, CPDFSDK_XFAWidget*> | 248 CFX_MapPtrTemplate<IXFA_Widget*, CPDFSDK_XFAWidget*> |
231 #define CPDFSDK_FieldSynchronizeMap CFX_MapPtrTemplate<CPDF_FormField*, int> | 249 #define CPDFSDK_FieldSynchronizeMap CFX_MapPtrTemplate<CPDF_FormField*, int> |
232 | 250 |
| 251 #endif |
233 class CPDFSDK_InterForm : public CPDF_FormNotify { | 252 class CPDFSDK_InterForm : public CPDF_FormNotify { |
234 public: | 253 public: |
235 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); | 254 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); |
236 ~CPDFSDK_InterForm() override; | 255 ~CPDFSDK_InterForm() override; |
237 | 256 |
238 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } | 257 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } |
239 CPDFSDK_Document* GetDocument() const { return m_pDocument; } | 258 CPDFSDK_Document* GetDocument() const { return m_pDocument; } |
240 | 259 |
241 FX_BOOL HighlightWidgets(); | 260 FX_BOOL HighlightWidgets(); |
242 | 261 |
243 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; | 262 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; |
244 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; | 263 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; |
245 void GetWidgets(const CFX_WideString& sFieldName, | 264 void GetWidgets(const CFX_WideString& sFieldName, |
246 std::vector<CPDFSDK_Widget*>* widgets) const; | 265 std::vector<CPDFSDK_Widget*>* widgets) const; |
247 void GetWidgets(CPDF_FormField* pField, | 266 void GetWidgets(CPDF_FormField* pField, |
248 std::vector<CPDFSDK_Widget*>* widgets) const; | 267 std::vector<CPDFSDK_Widget*>* widgets) const; |
249 | 268 |
250 void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); | 269 void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); |
251 void RemoveMap(CPDF_FormControl* pControl); | 270 void RemoveMap(CPDF_FormControl* pControl); |
252 | 271 |
| 272 #ifdef PDF_ENABLE_XFA |
253 void AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget); | 273 void AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget); |
254 void RemoveXFAMap(IXFA_Widget* hWidget); | 274 void RemoveXFAMap(IXFA_Widget* hWidget); |
255 CPDFSDK_XFAWidget* GetXFAWidget(IXFA_Widget* hWidget); | 275 CPDFSDK_XFAWidget* GetXFAWidget(IXFA_Widget* hWidget); |
256 | 276 |
| 277 #endif |
257 void EnableCalculate(FX_BOOL bEnabled); | 278 void EnableCalculate(FX_BOOL bEnabled); |
258 FX_BOOL IsCalculateEnabled() const; | 279 FX_BOOL IsCalculateEnabled() const; |
259 | 280 |
| 281 #ifdef PDF_ENABLE_XFA |
260 void XfaEnableCalculate(FX_BOOL bEnabled); | 282 void XfaEnableCalculate(FX_BOOL bEnabled); |
261 FX_BOOL IsXfaCalculateEnabled() const; | 283 FX_BOOL IsXfaCalculateEnabled() const; |
262 | 284 |
263 FX_BOOL IsXfaValidationsEnabled(); | 285 FX_BOOL IsXfaValidationsEnabled(); |
264 void XfaSetValidationsEnabled(FX_BOOL bEnabled); | 286 void XfaSetValidationsEnabled(FX_BOOL bEnabled); |
265 | 287 |
| 288 #endif |
266 #ifdef _WIN32 | 289 #ifdef _WIN32 |
267 CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile); | 290 CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile); |
268 #endif | 291 #endif |
269 | 292 |
270 void OnKeyStrokeCommit(CPDF_FormField* pFormField, | 293 void OnKeyStrokeCommit(CPDF_FormField* pFormField, |
271 CFX_WideString& csValue, | 294 CFX_WideString& csValue, |
272 FX_BOOL& bRC); | 295 FX_BOOL& bRC); |
273 void OnValidate(CPDF_FormField* pFormField, | 296 void OnValidate(CPDF_FormField* pFormField, |
274 CFX_WideString& csValue, | 297 CFX_WideString& csValue, |
275 FX_BOOL& bRC); | 298 FX_BOOL& bRC); |
(...skipping 17 matching lines...) Expand all Loading... |
293 const std::vector<CPDF_FormField*>& fields, | 316 const std::vector<CPDF_FormField*>& fields, |
294 FX_BOOL bIncludeOrExclude, | 317 FX_BOOL bIncludeOrExclude, |
295 FX_BOOL bUrlEncoded); | 318 FX_BOOL bUrlEncoded); |
296 FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); | 319 FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); |
297 FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); | 320 FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); |
298 FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, | 321 FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, |
299 FX_BOOL bIncludeOrExclude, | 322 FX_BOOL bIncludeOrExclude, |
300 CFX_ByteTextBuf& textBuf); | 323 CFX_ByteTextBuf& textBuf); |
301 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); | 324 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); |
302 | 325 |
| 326 #ifdef PDF_ENABLE_XFA |
303 void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse); | 327 void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse); |
304 | 328 |
| 329 #endif |
305 private: | 330 private: |
306 // CPDF_FormNotify | 331 // CPDF_FormNotify |
307 int BeforeValueChange(const CPDF_FormField* pField, | 332 int BeforeValueChange(const CPDF_FormField* pField, |
308 CFX_WideString& csValue) override; | 333 CFX_WideString& csValue) override; |
309 int AfterValueChange(const CPDF_FormField* pField) override; | 334 int AfterValueChange(const CPDF_FormField* pField) override; |
310 int BeforeSelectionChange(const CPDF_FormField* pField, | 335 int BeforeSelectionChange(const CPDF_FormField* pField, |
311 CFX_WideString& csValue) override; | 336 CFX_WideString& csValue) override; |
312 int AfterSelectionChange(const CPDF_FormField* pField) override; | 337 int AfterSelectionChange(const CPDF_FormField* pField) override; |
313 int AfterCheckedStatusChange(const CPDF_FormField* pField, | 338 int AfterCheckedStatusChange(const CPDF_FormField* pField, |
314 const CFX_ByteArray& statusArray) override; | 339 const CFX_ByteArray& statusArray) override; |
315 int BeforeFormReset(const CPDF_InterForm* pForm) override; | 340 int BeforeFormReset(const CPDF_InterForm* pForm) override; |
316 int AfterFormReset(const CPDF_InterForm* pForm) override; | 341 int AfterFormReset(const CPDF_InterForm* pForm) override; |
317 int BeforeFormImportData(const CPDF_InterForm* pForm) override; | 342 int BeforeFormImportData(const CPDF_InterForm* pForm) override; |
318 int AfterFormImportData(const CPDF_InterForm* pForm) override; | 343 int AfterFormImportData(const CPDF_InterForm* pForm) override; |
319 | 344 |
320 FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, | 345 FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, |
321 CFX_WideString csTxtFile); | 346 CFX_WideString csTxtFile); |
322 FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); | 347 FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); |
323 int GetPageIndexByAnnotDict(CPDF_Document* pDocument, | 348 int GetPageIndexByAnnotDict(CPDF_Document* pDocument, |
324 CPDF_Dictionary* pAnnotDict) const; | 349 CPDF_Dictionary* pAnnotDict) const; |
325 | 350 |
326 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; | 351 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; |
327 | 352 |
328 CPDFSDK_Document* m_pDocument; | 353 CPDFSDK_Document* m_pDocument; |
329 CPDF_InterForm* m_pInterForm; | 354 CPDF_InterForm* m_pInterForm; |
330 CPDFSDK_WidgetMap m_Map; | 355 CPDFSDK_WidgetMap m_Map; |
| 356 #ifdef PDF_ENABLE_XFA |
331 CPDFSDK_XFAWidgetMap m_XFAMap; | 357 CPDFSDK_XFAWidgetMap m_XFAMap; |
332 CPDFSDK_FieldSynchronizeMap m_FieldSynchronizeMap; | 358 CPDFSDK_FieldSynchronizeMap m_FieldSynchronizeMap; |
| 359 #endif |
333 FX_BOOL m_bCalculate; | 360 FX_BOOL m_bCalculate; |
| 361 #ifdef PDF_ENABLE_XFA |
334 FX_BOOL m_bXfaCalculate; | 362 FX_BOOL m_bXfaCalculate; |
335 FX_BOOL m_bXfaValidationsEnabled; | 363 FX_BOOL m_bXfaValidationsEnabled; |
| 364 #endif |
336 FX_BOOL m_bBusy; | 365 FX_BOOL m_bBusy; |
337 | 366 |
338 public: | 367 public: |
339 FX_BOOL IsNeedHighLight(int nFieldType); | 368 FX_BOOL IsNeedHighLight(int nFieldType); |
340 void RemoveAllHighLight(); | 369 void RemoveAllHighLight(); |
341 void SetHighlightAlpha(uint8_t alpha) { m_iHighlightAlpha = alpha; } | 370 void SetHighlightAlpha(uint8_t alpha) { m_iHighlightAlpha = alpha; } |
342 uint8_t GetHighlightAlpha() { return m_iHighlightAlpha; } | 371 uint8_t GetHighlightAlpha() { return m_iHighlightAlpha; } |
343 void SetHighlightColor(FX_COLORREF clr, int nFieldType); | 372 void SetHighlightColor(FX_COLORREF clr, int nFieldType); |
344 FX_COLORREF GetHighlightColor(int nFieldType); | 373 FX_COLORREF GetHighlightColor(int nFieldType); |
345 | 374 |
346 private: | 375 private: |
| 376 #ifndef PDF_ENABLE_XFA |
| 377 static const int kNumFieldTypes = 6; |
| 378 #else |
347 static const int kNumFieldTypes = 7; | 379 static const int kNumFieldTypes = 7; |
| 380 #endif |
348 FX_COLORREF m_aHighlightColor[kNumFieldTypes]; | 381 FX_COLORREF m_aHighlightColor[kNumFieldTypes]; |
349 uint8_t m_iHighlightAlpha; | 382 uint8_t m_iHighlightAlpha; |
350 FX_BOOL m_bNeedHightlight[kNumFieldTypes]; | 383 FX_BOOL m_bNeedHightlight[kNumFieldTypes]; |
351 }; | 384 }; |
352 | 385 |
353 #define BAI_STRUCTURE 0 | 386 #define BAI_STRUCTURE 0 |
354 #define BAI_ROW 1 | 387 #define BAI_ROW 1 |
355 #define BAI_COLUMN 2 | 388 #define BAI_COLUMN 2 |
356 | 389 |
357 #define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*> | 390 #define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*> |
(...skipping 17 matching lines...) Expand all Loading... |
375 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); | 408 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); |
376 | 409 |
377 CPDFSDK_PageView* m_pPageView; | 410 CPDFSDK_PageView* m_pPageView; |
378 CFX_ByteString m_sType; | 411 CFX_ByteString m_sType; |
379 CFX_ByteString m_sSubType; | 412 CFX_ByteString m_sSubType; |
380 int m_nTabs; | 413 int m_nTabs; |
381 CPDFSDK_Annots m_Annots; | 414 CPDFSDK_Annots m_Annots; |
382 }; | 415 }; |
383 | 416 |
384 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 417 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
OLD | NEW |