#ifndef _FS_PDFFORM_C_H_
#define _FS_PDFFORM_C_H_

#ifdef __cplusplus
extern "C" {
#endif



typedef enum _FSFieldType {
e_FSFieldTypeTypeUnknown = 0,
e_FSTypePushButton = 1,
e_FSTypeCheckBox = 2,
e_FSTypeRadioButton = 3,
e_FSTypeComboBox = 4,
e_FSTypeListBox = 5,
e_FSTypeTextField = 6,
e_FSTypeSignature = 7,
}FSFieldType;



typedef enum _FSFieldFlags {
e_FSFieldFlagsFlagReadOnly = 0x01,
e_FSFieldFlagsFlagRequired = 0x02,
e_FSFieldFlagsFlagNoExport = 0x04,
e_FSFieldFlagsFlagButtonNoToggleToOff = 0x100,
e_FSFieldFlagsFlagButtonRadiosInUnison = 0x200,
e_FSFieldFlagsFlagTextMultiline = 0x100,
e_FSFieldFlagsFlagTextPassword = 0x200,
e_FSFieldFlagsFlagTextFileSelect = 0x400,
e_FSFieldFlagsFlagTextNoSpellCheck = 0x800,
e_FSFieldFlagsFlagTextDoNotScroll = 0x1000,
e_FSFieldFlagsFlagTextComb = 0x2000,
e_FSFieldFlagsFlagComboEdit = 0x100,
e_FSFieldFlagsFlagChoiceMultiSelect = 0x100,
e_FSFieldFlagsFlagTextRichText = 0x4000,
e_FSFieldFlagsFlagChoiceSort = 0x200,
e_FSFieldFlagsFlagChoiceCommitOnSelChange = 0x400,
}FSFieldFlags;


typedef struct _FSChoiceOption {
  FS_WSTR option_value;
  FS_WSTR option_label;
  FS_BOOL selected;
  FS_BOOL default_selected;
}FSChoiceOption;

FSErrorCode FSDK_Field_Create(const FS_PDFDOC_HANDLE document, FS_PDFDICTIONARY_HANDLE field_dict, FS_FIELD_HANDLE* field_return_value);
FSErrorCode FSDK_Field_Release(FS_FIELD_HANDLE field_handle);
FSErrorCode FSDK_Field_IsEmpty(FS_FIELD_HANDLE field_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Field_GetType(FS_FIELD_HANDLE field_handle, FSFieldType* return_value);
FSErrorCode FSDK_Field_GetFlags(FS_FIELD_HANDLE field_handle, FS_UINT32* return_value);
FSErrorCode FSDK_Field_SetFlags(FS_FIELD_HANDLE field_handle, FS_UINT32 flags);
FSErrorCode FSDK_Field_GetName(FS_FIELD_HANDLE field_handle, FS_WSTR* return_value);
FSErrorCode FSDK_Field_GetDefaultValue(FS_FIELD_HANDLE field_handle, FS_WSTR* return_value);
FSErrorCode FSDK_Field_SetDefaultValue(FS_FIELD_HANDLE field_handle, const wchar_t* value);
FSErrorCode FSDK_Field_GetValue(FS_FIELD_HANDLE field_handle, FS_WSTR* return_value);
FSErrorCode FSDK_Field_SetValue(FS_FIELD_HANDLE field_handle, const wchar_t* value);
FSErrorCode FSDK_Field_GetAlignment(FS_FIELD_HANDLE field_handle, FSAlignment* return_value);
FSErrorCode FSDK_Field_SetAlignment(FS_FIELD_HANDLE field_handle,  FSAlignment alignment);
FSErrorCode FSDK_Field_GetAlternateName(FS_FIELD_HANDLE field_handle, FS_WSTR* return_value);
FSErrorCode FSDK_Field_SetAlternateName(FS_FIELD_HANDLE field_handle, const wchar_t* alternate_name);
FSErrorCode FSDK_Field_GetDefaultAppearance(FS_FIELD_HANDLE field_handle, FSDefaultAppearance* return_value);
FSErrorCode FSDK_Field_SetDefaultAppearance(FS_FIELD_HANDLE field_handle, const FSDefaultAppearance default_ap);
FSErrorCode FSDK_Field_GetMappingName(FS_FIELD_HANDLE field_handle, FS_WSTR* return_value);
FSErrorCode FSDK_Field_SetMappingName(FS_FIELD_HANDLE field_handle, const wchar_t* name);
FSErrorCode FSDK_Field_GetMaxLength(FS_FIELD_HANDLE field_handle, int* return_value);
FSErrorCode FSDK_Field_SetMaxLength(FS_FIELD_HANDLE field_handle, int max_length);
FSErrorCode FSDK_Field_GetOptions(FS_FIELD_HANDLE field_handle, FSChoiceOption* return_choice_option_array, FS_UINT32* return_array_length);
FSErrorCode FSDK_Field_SetOptions(FS_FIELD_HANDLE field_handle, const FSChoiceOption* choice_option_array, FS_UINT32 array_length_option_array);
FSErrorCode FSDK_Field_GetTopVisibleIndex(FS_FIELD_HANDLE field_handle, int* return_value);
FSErrorCode FSDK_Field_SetTopVisibleIndex(FS_FIELD_HANDLE field_handle, int index);
FSErrorCode FSDK_Field_GetControlCount(FS_FIELD_HANDLE field_handle, int* return_value);
FSErrorCode FSDK_Field_GetControl(FS_FIELD_HANDLE field_handle, int index, FS_CONTROL_HANDLE* return_value);
FSErrorCode FSDK_Field_GetControlCount0(FS_FIELD_HANDLE field_handle, const FS_PDFPAGE_HANDLE page, int* return_value);
FSErrorCode FSDK_Field_GetControl0(FS_FIELD_HANDLE field_handle, const FS_PDFPAGE_HANDLE page, int index, FS_CONTROL_HANDLE* return_value);
FSErrorCode FSDK_Field_Reset(FS_FIELD_HANDLE field_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Field_GetDict(FS_FIELD_HANDLE field_handle, FS_PDFDICTIONARY_HANDLE* return_value);
FSErrorCode FSDK_Field_GetValueObj(FS_FIELD_HANDLE field_handle, FS_PDFOBJECT_HANDLE* return_value);
FSErrorCode FSDK_Field_GetDefaultValueObj(FS_FIELD_HANDLE field_handle, FS_PDFOBJECT_HANDLE* return_value);
FSErrorCode FSDK_Field_GetInheritedAttribute(FS_FIELD_HANDLE field_handle, const char* attribute_name, FS_PDFOBJECT_HANDLE* return_value);
FSErrorCode FSDK_Form_Create(const FS_PDFDOC_HANDLE document, FS_FORM_HANDLE* form_return_value);
FSErrorCode FSDK_Form_Release(FS_FORM_HANDLE form_handle);
FSErrorCode FSDK_Form_IsEmpty(FS_FORM_HANDLE form_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Form_GetAlignment(FS_FORM_HANDLE form_handle, FSAlignment* return_value);
FSErrorCode FSDK_Form_SetAlignment(FS_FORM_HANDLE form_handle,  FSAlignment alignment);
FSErrorCode FSDK_Form_NeedConstructAppearances(FS_FORM_HANDLE form_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Form_SetConstructAppearances(FS_FORM_HANDLE form_handle, FS_BOOL need_construct);
FSErrorCode FSDK_Form_GetControlAtDevicePoint(FS_FORM_HANDLE form_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, float tolerance, FSFieldType type,
                                  const FSMatrix* matrix, FS_CONTROL_HANDLE* return_value);
FSErrorCode FSDK_Form_GetControlAtPoint(FS_FORM_HANDLE form_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, float tolerance, FSFieldType type, FS_CONTROL_HANDLE* return_value);
FSErrorCode FSDK_Form_GetDefaultAppearance(FS_FORM_HANDLE form_handle, FSDefaultAppearance* return_value);
FSErrorCode FSDK_Form_SetDefaultAppearance(FS_FORM_HANDLE form_handle, const FSDefaultAppearance default_ap);
FSErrorCode FSDK_Form_GetDocument(FS_FORM_HANDLE form_handle, FS_PDFDOC_HANDLE* return_value);
FSErrorCode FSDK_Form_GetFieldsInCalculationOrder(FS_FORM_HANDLE form_handle, FS_FIELD_HANDLE* return_field_array, FS_UINT32* return_array_length);
FSErrorCode FSDK_Form_SetFieldsInCalculationOrder(FS_FORM_HANDLE form_handle, const FS_FIELD_HANDLE* fields_array, FS_UINT32 array_length_field_array);
FSErrorCode FSDK_Form_ValidateFieldName(FS_FORM_HANDLE form_handle,  FSFieldType type, const wchar_t* field_name, FS_BOOL* return_value);
FSErrorCode FSDK_Form_RenameField(FS_FORM_HANDLE form_handle, FS_FIELD_HANDLE field, const wchar_t* new_field_name, FS_BOOL* return_value);
FSErrorCode FSDK_Form_AddControl(FS_FORM_HANDLE form_handle, const FS_PDFPAGE_HANDLE page, const wchar_t* field_name, FSFieldType field_type, const FSRectF rect, FS_CONTROL_HANDLE* return_value);
FSErrorCode FSDK_Form_MoveControl(FS_FORM_HANDLE form_handle, FS_CONTROL_HANDLE control, const wchar_t* field_name, FS_BOOL* return_value);
FSErrorCode FSDK_Form_RemoveField(FS_FORM_HANDLE form_handle, FS_FIELD_HANDLE field);
FSErrorCode FSDK_Form_RemoveControl(FS_FORM_HANDLE form_handle, FS_CONTROL_HANDLE control);
FSErrorCode FSDK_Form_GetFieldCount(FS_FORM_HANDLE form_handle, const wchar_t* filter, int* return_value);
FSErrorCode FSDK_Form_GetField(FS_FORM_HANDLE form_handle, int index, const wchar_t* filter, FS_FIELD_HANDLE* return_value);
FSErrorCode FSDK_Form_GetControlCount(FS_FORM_HANDLE form_handle, const FS_PDFPAGE_HANDLE page, int* return_value);
FSErrorCode FSDK_Form_GetControl(FS_FORM_HANDLE form_handle, const FS_PDFPAGE_HANDLE page, int index, FS_CONTROL_HANDLE* return_value);
FSErrorCode FSDK_Form_GetFormFiller(FS_FORM_HANDLE form_handle, FS_FILLER_HANDLE* return_value);
FSErrorCode FSDK_Form_Reset(FS_FORM_HANDLE form_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToXML(FS_FORM_HANDLE form_handle, const char* file_path, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToXML0(FS_FORM_HANDLE form_handle, const wchar_t* file_path, const FS_FIELD_HANDLE* fields_array, FS_UINT32 array_length_field_array, FS_BOOL is_include, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToXML1(FS_FORM_HANDLE form_handle,  FSWriterCallback* xml_file, const FS_FIELD_HANDLE* fields_array, FS_UINT32 array_length_field_array, FS_BOOL is_include, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ImportFromXML(FS_FORM_HANDLE form_handle, const char* file_path, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToCSV(FS_FORM_HANDLE form_handle, const wchar_t* csv_file_path, const wchar_t* pdf_file_name, FS_BOOL is_append, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToCSV0(FS_FORM_HANDLE form_handle,  FSStreamCallback* csv_file, const wchar_t* pdf_file_name, FS_BOOL is_append, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToHTML(FS_FORM_HANDLE form_handle, const wchar_t* html_file_path, const FS_FIELD_HANDLE* fields_array, FS_UINT32 array_length_field_array, FS_BOOL is_include, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToHTML0(FS_FORM_HANDLE form_handle,  FSWriterCallback* html_file, const FS_FIELD_HANDLE* fields_array, FS_UINT32 array_length_field_array, FS_BOOL is_include, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToTXT(FS_FORM_HANDLE form_handle, const wchar_t* txt_file_path, const FS_FIELD_HANDLE* fields_array, FS_UINT32 array_length_field_array, FS_BOOL is_include, FS_BOOL* return_value);
FSErrorCode FSDK_Form_ExportToTXT0(FS_FORM_HANDLE form_handle,  FSWriterCallback* txt_file, const FS_FIELD_HANDLE* fields_array, FS_UINT32 array_length_field_array, FS_BOOL is_include, FS_BOOL* return_value);
FSErrorCode FSDK_Form_GetDict(FS_FORM_HANDLE form_handle, FS_PDFDICTIONARY_HANDLE* return_value);
FSErrorCode FSDK_Form_FixPageFields(FS_FORM_HANDLE form_handle, int page_index);
FSErrorCode FSDK_Control_Release(FS_CONTROL_HANDLE control_handle);
FSErrorCode FSDK_Control_IsEmpty(FS_CONTROL_HANDLE control_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Control_GetField(FS_CONTROL_HANDLE control_handle, FS_FIELD_HANDLE* return_value);
FSErrorCode FSDK_Control_GetWidgetDict(FS_CONTROL_HANDLE control_handle, FS_PDFDICTIONARY_HANDLE* return_value);
FSErrorCode FSDK_Control_GetWidget(FS_CONTROL_HANDLE control_handle, FS_WIDGETANNOT_HANDLE* return_value);
FSErrorCode FSDK_Control_GetIndex(FS_CONTROL_HANDLE control_handle, int* return_value);
FSErrorCode FSDK_Control_GetExportValue(FS_CONTROL_HANDLE control_handle, FS_WSTR* return_value);
FSErrorCode FSDK_Control_SetExportValue(FS_CONTROL_HANDLE control_handle, const wchar_t* value);
FSErrorCode FSDK_Control_IsChecked(FS_CONTROL_HANDLE control_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Control_SetChecked(FS_CONTROL_HANDLE control_handle, FS_BOOL checked_status);
FSErrorCode FSDK_Control_IsDefaultChecked(FS_CONTROL_HANDLE control_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Control_SetDefaultChecked(FS_CONTROL_HANDLE control_handle, FS_BOOL checked_status);
FSErrorCode FSDK_Control_GetDefaultAppearance(FS_CONTROL_HANDLE control_handle, FSDefaultAppearance* return_value);
FSErrorCode FSDK_Control_SetDefaultAppearance(FS_CONTROL_HANDLE control_handle, const FSDefaultAppearance default_ap);
FSErrorCode FSDK_Control_GetAlignment(FS_CONTROL_HANDLE control_handle, FSAlignment* return_value);
FSErrorCode FSDK_Control_SetAlignment(FS_CONTROL_HANDLE control_handle,  FSAlignment alignment);
#ifdef __cplusplus
}
#endif
#endif
