#ifndef _FS_SPLITPDFDOC_C_H_
#define _FS_SPLITPDFDOC_C_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "fs_basictypes_c.h"
#include "fs_common_c.h"


typedef enum _FSSplitFileState {
e_FSSplitFileSuccess = 0,
e_FSSplitFileErrSizeTooSmall = 1,
e_FSSplitFileErrFileExist = 2,
e_FSSplitFileErrAccessDeny = 3,
}FSSplitFileState;


typedef struct _FSSplitOutputSettingData {
  FS_WSTR output_folder_path;
  FS_BOOL add_before_or_after_orginal_name;
  FS_WSTR custom_name;
  FS_WSTR separator;
  FS_BOOL is_overwrite;
}FSSplitOutputSettingData;

FSErrorCode FSDK_SplitDocumentInfo_Create(const wchar_t* file_path, const wchar_t* password, FS_SPLITDOCUMENTINFO_HANDLE* splitdocumentinfo_return_value);
FSErrorCode FSDK_SplitDocumentInfo_Create0( FSReaderCallback* file_reader, const wchar_t* password, const wchar_t* file_name, FS_SPLITDOCUMENTINFO_HANDLE* splitdocumentinfo_return_value);
FSErrorCode FSDK_SplitDocumentInfo_Create1(const FS_PDFDOC_HANDLE doc, const wchar_t* file_name, FS_SPLITDOCUMENTINFO_HANDLE* splitdocumentinfo_return_value);
FSErrorCode FSDK_SplitDocumentInfo_Release(FS_SPLITDOCUMENTINFO_HANDLE splitdocumentinfo_handle);
FSErrorCode FSDK_SplitDocumentInfo_IsEmpty(FS_SPLITDOCUMENTINFO_HANDLE splitdocumentinfo_handle, FS_BOOL* return_value);
typedef struct _FSSplitFileResult {
  FS_WSTR before_splitting_file_name;
  FS_WSTR* after_split_files_paths;
  FS_UINT32 after_split_files_paths_length;
  FSSplitFileState split_file_state;
}FSSplitFileResult;

typedef struct _FSSplitPDFDocCallback {
  void* user_data;
  FS_BOOL (*NeedToPause)(void* user_data);
  void (*ProgressNotify)(void* user_data, const wchar_t* before_splitting_file_name, const wchar_t* after_split_file_path, int split_page_count, int total_page_count);
  void (*ResultNotify)(void* user_data, const FSSplitFileResult* result_array, FS_UINT32 array_length_);
}FSSplitPDFDocCallback;

FSErrorCode FSDK_SplitPDFDoc_StartSplitByFileSize(float max_file_size, const FSSplitOutputSettingData setting_data, const FS_SPLITDOCUMENTINFO_HANDLE* split_doc_array, FS_UINT32 array_length_, FSSplitPDFDocCallback* split_callback, FS_PROGRESSIVE_HANDLE* return_value);
#ifdef __cplusplus
}
#endif
#endif
