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 #include <map> | 10 #include <map> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 public: | 205 public: |
206 FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); | 206 FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); |
207 void DrawAppearance(CFX_RenderDevice* pDevice, | 207 void DrawAppearance(CFX_RenderDevice* pDevice, |
208 const CFX_Matrix* pUser2Device, | 208 const CFX_Matrix* pUser2Device, |
209 CPDF_Annot::AppearanceMode mode, | 209 CPDF_Annot::AppearanceMode mode, |
210 const CPDF_RenderOptions* pOptions) override; | 210 const CPDF_RenderOptions* pOptions) override; |
211 | 211 |
212 FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); | 212 FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); |
213 | 213 |
214 private: | 214 private: |
215 CPDFSDK_InterForm* m_pInterForm; | 215 CPDFSDK_InterForm* const m_pInterForm; |
216 FX_BOOL m_bAppModified; | 216 FX_BOOL m_bAppModified; |
217 int32_t m_nAppAge; | 217 int32_t m_nAppAge; |
218 int32_t m_nValueAge; | 218 int32_t m_nValueAge; |
219 | 219 |
220 #ifdef PDF_ENABLE_XFA | 220 #ifdef PDF_ENABLE_XFA |
221 mutable CXFA_FFWidget* m_hMixXFAWidget; | 221 mutable CXFA_FFWidget* m_hMixXFAWidget; |
222 mutable CXFA_FFWidgetHandler* m_pWidgetHandler; | 222 mutable CXFA_FFWidgetHandler* m_pWidgetHandler; |
223 #endif // PDF_ENABLE_XFA | 223 #endif // PDF_ENABLE_XFA |
224 }; | 224 }; |
225 | 225 |
(...skipping 12 matching lines...) Expand all Loading... |
238 CFX_FloatRect GetRect() const override; | 238 CFX_FloatRect GetRect() const override; |
239 | 239 |
240 CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; } | 240 CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; } |
241 | 241 |
242 private: | 242 private: |
243 CPDFSDK_InterForm* m_pInterForm; | 243 CPDFSDK_InterForm* m_pInterForm; |
244 CXFA_FFWidget* m_hXFAWidget; | 244 CXFA_FFWidget* m_hXFAWidget; |
245 }; | 245 }; |
246 #endif // PDF_ENABLE_XFA | 246 #endif // PDF_ENABLE_XFA |
247 | 247 |
248 class CPDFSDK_InterForm : public CPDF_FormNotify { | 248 class CPDFSDK_InterForm : public IPDF_FormNotify { |
249 public: | 249 public: |
250 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); | 250 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); |
251 ~CPDFSDK_InterForm() override; | 251 ~CPDFSDK_InterForm() override; |
252 | 252 |
253 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } | 253 CPDF_InterForm* GetInterForm() const { return m_pInterForm.get(); } |
254 CPDFSDK_Document* GetDocument() const { return m_pDocument; } | 254 CPDFSDK_Document* GetDocument() const { return m_pDocument; } |
255 | 255 |
256 FX_BOOL HighlightWidgets(); | 256 FX_BOOL HighlightWidgets(); |
257 | 257 |
258 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; | 258 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; |
259 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; | 259 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; |
260 void GetWidgets(const CFX_WideString& sFieldName, | 260 void GetWidgets(const CFX_WideString& sFieldName, |
261 std::vector<CPDFSDK_Widget*>* widgets) const; | 261 std::vector<CPDFSDK_Widget*>* widgets) const; |
262 void GetWidgets(CPDF_FormField* pField, | 262 void GetWidgets(CPDF_FormField* pField, |
263 std::vector<CPDFSDK_Widget*>* widgets) const; | 263 std::vector<CPDFSDK_Widget*>* widgets) const; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, | 306 FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, |
307 bool bIncludeOrExclude, | 307 bool bIncludeOrExclude, |
308 CFX_ByteTextBuf& textBuf); | 308 CFX_ByteTextBuf& textBuf); |
309 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); | 309 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); |
310 | 310 |
311 #ifdef PDF_ENABLE_XFA | 311 #ifdef PDF_ENABLE_XFA |
312 void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse); | 312 void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse); |
313 #endif // PDF_ENABLE_XFA | 313 #endif // PDF_ENABLE_XFA |
314 | 314 |
315 private: | 315 private: |
316 // CPDF_FormNotify: | 316 // IPDF_FormNotify: |
317 int BeforeValueChange(CPDF_FormField* pField, | 317 int BeforeValueChange(CPDF_FormField* pField, |
318 const CFX_WideString& csValue) override; | 318 const CFX_WideString& csValue) override; |
319 void AfterValueChange(CPDF_FormField* pField) override; | 319 void AfterValueChange(CPDF_FormField* pField) override; |
320 int BeforeSelectionChange(CPDF_FormField* pField, | 320 int BeforeSelectionChange(CPDF_FormField* pField, |
321 const CFX_WideString& csValue) override; | 321 const CFX_WideString& csValue) override; |
322 void AfterSelectionChange(CPDF_FormField* pField) override; | 322 void AfterSelectionChange(CPDF_FormField* pField) override; |
323 void AfterCheckedStatusChange(CPDF_FormField* pField) override; | 323 void AfterCheckedStatusChange(CPDF_FormField* pField) override; |
324 int BeforeFormReset(CPDF_InterForm* pForm) override; | 324 int BeforeFormReset(CPDF_InterForm* pForm) override; |
325 void AfterFormReset(CPDF_InterForm* pForm) override; | 325 void AfterFormReset(CPDF_InterForm* pForm) override; |
326 int BeforeFormImportData(CPDF_InterForm* pForm) override; | 326 int BeforeFormImportData(CPDF_InterForm* pForm) override; |
327 void AfterFormImportData(CPDF_InterForm* pForm) override; | 327 void AfterFormImportData(CPDF_InterForm* pForm) override; |
328 | 328 |
329 FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, | 329 FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, |
330 CFX_WideString csTxtFile); | 330 CFX_WideString csTxtFile); |
331 FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); | 331 FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); |
332 int GetPageIndexByAnnotDict(CPDF_Document* pDocument, | 332 int GetPageIndexByAnnotDict(CPDF_Document* pDocument, |
333 CPDF_Dictionary* pAnnotDict) const; | 333 CPDF_Dictionary* pAnnotDict) const; |
334 | 334 |
335 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; | 335 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; |
336 | 336 |
337 CPDFSDK_Document* m_pDocument; | 337 CPDFSDK_Document* m_pDocument; |
338 CPDF_InterForm* m_pInterForm; | 338 std::unique_ptr<CPDF_InterForm> m_pInterForm; |
339 CPDFSDK_WidgetMap m_Map; | 339 CPDFSDK_WidgetMap m_Map; |
340 #ifdef PDF_ENABLE_XFA | 340 #ifdef PDF_ENABLE_XFA |
341 std::map<CXFA_FFWidget*, CPDFSDK_XFAWidget*> m_XFAMap; | 341 std::map<CXFA_FFWidget*, CPDFSDK_XFAWidget*> m_XFAMap; |
342 FX_BOOL m_bXfaCalculate; | 342 FX_BOOL m_bXfaCalculate; |
343 FX_BOOL m_bXfaValidationsEnabled; | 343 FX_BOOL m_bXfaValidationsEnabled; |
344 #endif // PDF_ENABLE_XFA | 344 #endif // PDF_ENABLE_XFA |
345 FX_BOOL m_bCalculate; | 345 FX_BOOL m_bCalculate; |
346 FX_BOOL m_bBusy; | 346 FX_BOOL m_bBusy; |
347 | 347 |
348 public: | 348 public: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 const CPDFSDK_Annot* p2); | 390 const CPDFSDK_Annot* p2); |
391 | 391 |
392 TabOrder m_eTabOrder; | 392 TabOrder m_eTabOrder; |
393 CPDFSDK_PageView* m_pPageView; | 393 CPDFSDK_PageView* m_pPageView; |
394 CFX_ByteString m_sType; | 394 CFX_ByteString m_sType; |
395 CFX_ByteString m_sSubType; | 395 CFX_ByteString m_sSubType; |
396 std::vector<CPDFSDK_Annot*> m_Annots; | 396 std::vector<CPDFSDK_Annot*> m_Annots; |
397 }; | 397 }; |
398 | 398 |
399 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 399 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
OLD | NEW |