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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); | 178 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); |
179 ~CPDFSDK_InterForm() override; | 179 ~CPDFSDK_InterForm() override; |
180 | 180 |
181 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } | 181 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } |
182 CPDFSDK_Document* GetDocument() const { return m_pDocument; } | 182 CPDFSDK_Document* GetDocument() const { return m_pDocument; } |
183 | 183 |
184 FX_BOOL HighlightWidgets(); | 184 FX_BOOL HighlightWidgets(); |
185 | 185 |
186 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; | 186 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; |
187 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; | 187 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; |
188 void GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets); | 188 void GetWidgets(const CFX_WideString& sFieldName, |
189 void GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets); | 189 std::vector<CPDFSDK_Widget*>* widgets) const; |
| 190 void GetWidgets(CPDF_FormField* pField, |
| 191 std::vector<CPDFSDK_Widget*>* widgets) const; |
190 | 192 |
191 void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); | 193 void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); |
192 void RemoveMap(CPDF_FormControl* pControl); | 194 void RemoveMap(CPDF_FormControl* pControl); |
193 | 195 |
194 void EnableCalculate(FX_BOOL bEnabled); | 196 void EnableCalculate(FX_BOOL bEnabled); |
195 FX_BOOL IsCalculateEnabled() const; | 197 FX_BOOL IsCalculateEnabled() const; |
196 | 198 |
197 #ifdef _WIN32 | 199 #ifdef _WIN32 |
198 CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile); | 200 CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile); |
199 #endif | 201 #endif |
(...skipping 10 matching lines...) Expand all Loading... |
210 void ResetFieldAppearance(CPDF_FormField* pFormField, | 212 void ResetFieldAppearance(CPDF_FormField* pFormField, |
211 const FX_WCHAR* sValue, | 213 const FX_WCHAR* sValue, |
212 FX_BOOL bValueChanged); | 214 FX_BOOL bValueChanged); |
213 void UpdateField(CPDF_FormField* pFormField); | 215 void UpdateField(CPDF_FormField* pFormField); |
214 | 216 |
215 FX_BOOL DoAction_Hide(const CPDF_Action& action); | 217 FX_BOOL DoAction_Hide(const CPDF_Action& action); |
216 FX_BOOL DoAction_SubmitForm(const CPDF_Action& action); | 218 FX_BOOL DoAction_SubmitForm(const CPDF_Action& action); |
217 FX_BOOL DoAction_ResetForm(const CPDF_Action& action); | 219 FX_BOOL DoAction_ResetForm(const CPDF_Action& action); |
218 FX_BOOL DoAction_ImportData(const CPDF_Action& action); | 220 FX_BOOL DoAction_ImportData(const CPDF_Action& action); |
219 | 221 |
220 void GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields); | 222 std::vector<CPDF_FormField*> GetFieldFromObjects( |
| 223 const std::vector<CPDF_Object*>& objects) const; |
221 FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict); | 224 FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict); |
222 FX_BOOL SubmitFields(const CFX_WideString& csDestination, | 225 FX_BOOL SubmitFields(const CFX_WideString& csDestination, |
223 const CFX_PtrArray& fields, | 226 const std::vector<CPDF_FormField*>& fields, |
224 FX_BOOL bIncludeOrExclude, | 227 FX_BOOL bIncludeOrExclude, |
225 FX_BOOL bUrlEncoded); | 228 FX_BOOL bUrlEncoded); |
226 FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); | 229 FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); |
227 FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); | 230 FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); |
228 FX_BOOL ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields, | 231 FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, |
229 FX_BOOL bIncludeOrExclude, | 232 FX_BOOL bIncludeOrExclude, |
230 CFX_ByteTextBuf& textBuf); | 233 CFX_ByteTextBuf& textBuf); |
231 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); | 234 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); |
232 | 235 |
233 private: | 236 private: |
234 // CPDF_FormNotify | 237 // CPDF_FormNotify |
235 int BeforeValueChange(const CPDF_FormField* pField, | 238 int BeforeValueChange(const CPDF_FormField* pField, |
236 CFX_WideString& csValue) override; | 239 CFX_WideString& csValue) override; |
237 int AfterValueChange(const CPDF_FormField* pField) override; | 240 int AfterValueChange(const CPDF_FormField* pField) override; |
238 int BeforeSelectionChange(const CPDF_FormField* pField, | 241 int BeforeSelectionChange(const CPDF_FormField* pField, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); | 301 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); |
299 | 302 |
300 CPDFSDK_PageView* m_pPageView; | 303 CPDFSDK_PageView* m_pPageView; |
301 CFX_ByteString m_sType; | 304 CFX_ByteString m_sType; |
302 CFX_ByteString m_sSubType; | 305 CFX_ByteString m_sSubType; |
303 int m_nTabs; | 306 int m_nTabs; |
304 CPDFSDK_Annots m_Annots; | 307 CPDFSDK_Annots m_Annots; |
305 }; | 308 }; |
306 | 309 |
307 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 310 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
OLD | NEW |