OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 CORE_FPDFDOC_CPDF_INTERFORM_H_ | 7 #ifndef CORE_FPDFDOC_CPDF_INTERFORM_H_ |
8 #define CORE_FPDFDOC_CPDF_INTERFORM_H_ | 8 #define CORE_FPDFDOC_CPDF_INTERFORM_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 CPDF_FormField* GetField(uint32_t index, | 53 CPDF_FormField* GetField(uint32_t index, |
54 const CFX_WideString& csFieldName) const; | 54 const CFX_WideString& csFieldName) const; |
55 CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; | 55 CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; |
56 | 56 |
57 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, | 57 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, |
58 FX_FLOAT pdf_x, | 58 FX_FLOAT pdf_x, |
59 FX_FLOAT pdf_y, | 59 FX_FLOAT pdf_y, |
60 int* z_order) const; | 60 int* z_order) const; |
61 CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; | 61 CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; |
62 | 62 |
63 FX_BOOL NeedConstructAP() const; | 63 bool NeedConstructAP() const; |
64 int CountFieldsInCalculationOrder(); | 64 int CountFieldsInCalculationOrder(); |
65 CPDF_FormField* GetFieldInCalculationOrder(int index); | 65 CPDF_FormField* GetFieldInCalculationOrder(int index); |
66 int FindFieldInCalculationOrder(const CPDF_FormField* pField); | 66 int FindFieldInCalculationOrder(const CPDF_FormField* pField); |
67 | 67 |
68 CPDF_Font* GetFormFont(CFX_ByteString csNameTag); | 68 CPDF_Font* GetFormFont(CFX_ByteString csNameTag); |
69 CPDF_DefaultAppearance GetDefaultAppearance() const; | 69 CPDF_DefaultAppearance GetDefaultAppearance() const; |
70 int GetFormAlignment() const; | 70 int GetFormAlignment() const; |
71 | 71 |
72 CPDF_FormField* CheckRequiredFields( | 72 CPDF_FormField* CheckRequiredFields( |
73 const std::vector<CPDF_FormField*>* fields, | 73 const std::vector<CPDF_FormField*>* fields, |
74 bool bIncludeOrExclude) const; | 74 bool bIncludeOrExclude) const; |
75 | 75 |
76 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, | 76 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
77 bool bSimpleFileSpec) const; | 77 bool bSimpleFileSpec) const; |
78 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, | 78 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
79 const std::vector<CPDF_FormField*>& fields, | 79 const std::vector<CPDF_FormField*>& fields, |
80 bool bIncludeOrExclude, | 80 bool bIncludeOrExclude, |
81 bool bSimpleFileSpec) const; | 81 bool bSimpleFileSpec) const; |
82 | 82 |
83 bool ResetForm(const std::vector<CPDF_FormField*>& fields, | 83 bool ResetForm(const std::vector<CPDF_FormField*>& fields, |
84 bool bIncludeOrExclude, | 84 bool bIncludeOrExclude, |
85 bool bNotify); | 85 bool bNotify); |
86 bool ResetForm(bool bNotify); | 86 bool ResetForm(bool bNotify); |
87 | 87 |
88 void SetFormNotify(IPDF_FormNotify* pNotify); | 88 void SetFormNotify(IPDF_FormNotify* pNotify); |
89 FX_BOOL HasXFAForm() const; | 89 bool HasXFAForm() const; |
90 void FixPageFields(const CPDF_Page* pPage); | 90 void FixPageFields(const CPDF_Page* pPage); |
91 | 91 |
92 private: | 92 private: |
93 friend class CPDF_FormControl; | 93 friend class CPDF_FormControl; |
94 friend class CPDF_FormField; | 94 friend class CPDF_FormField; |
95 | 95 |
96 void LoadField(CPDF_Dictionary* pFieldDict, int nLevel); | 96 void LoadField(CPDF_Dictionary* pFieldDict, int nLevel); |
97 CPDF_FormField* AddTerminalField(CPDF_Dictionary* pFieldDict); | 97 CPDF_FormField* AddTerminalField(CPDF_Dictionary* pFieldDict); |
98 CPDF_FormControl* AddControl(CPDF_FormField* pField, | 98 CPDF_FormControl* AddControl(CPDF_FormField* pField, |
99 CPDF_Dictionary* pWidgetDict); | 99 CPDF_Dictionary* pWidgetDict); |
100 void FDF_ImportField(CPDF_Dictionary* pField, | 100 void FDF_ImportField(CPDF_Dictionary* pField, |
101 const CFX_WideString& parent_name, | 101 const CFX_WideString& parent_name, |
102 FX_BOOL bNotify = FALSE, | 102 bool bNotify = false, |
103 int nLevel = 0); | 103 int nLevel = 0); |
104 bool ValidateFieldName(CFX_WideString& csNewFieldName, | 104 bool ValidateFieldName(CFX_WideString& csNewFieldName, |
105 int iType, | 105 int iType, |
106 const CPDF_FormField* pExcludedField, | 106 const CPDF_FormField* pExcludedField, |
107 const CPDF_FormControl* pExcludedControl) const; | 107 const CPDF_FormControl* pExcludedControl) const; |
108 | 108 |
109 static bool s_bUpdateAP; | 109 static bool s_bUpdateAP; |
110 | 110 |
111 CPDF_Document* const m_pDocument; | 111 CPDF_Document* const m_pDocument; |
112 CPDF_Dictionary* m_pFormDict; | 112 CPDF_Dictionary* m_pFormDict; |
113 std::map<const CPDF_Dictionary*, CPDF_FormControl*> m_ControlMap; | 113 std::map<const CPDF_Dictionary*, CPDF_FormControl*> m_ControlMap; |
114 std::unique_ptr<CFieldTree> m_pFieldTree; | 114 std::unique_ptr<CFieldTree> m_pFieldTree; |
115 CFX_ByteString m_bsEncoding; | 115 CFX_ByteString m_bsEncoding; |
116 IPDF_FormNotify* m_pFormNotify; | 116 IPDF_FormNotify* m_pFormNotify; |
117 }; | 117 }; |
118 | 118 |
119 #endif // CORE_FPDFDOC_CPDF_INTERFORM_H_ | 119 #endif // CORE_FPDFDOC_CPDF_INTERFORM_H_ |
OLD | NEW |