#ifndef _FS_SEARCHREPLACE_C_H_
#define _FS_SEARCHREPLACE_C_H_

#ifdef __cplusplus
extern "C" {
#endif


typedef struct _FSFindOption {
  FS_BOOL is_whole_word;
  FS_BOOL is_case_sensitive;
}FSFindOption;

typedef struct _FSReplaceCallback {
  void* user_data;
  FS_BOOL (*NeedToReplace)(void* user_data, const wchar_t*search_text, const wchar_t*replace_text, int current_page_index, FSRectF* text_rect_array,  FS_UINT32 array_length_rect_array);
  void (*Release)(void* user_data);
  
}FSReplaceCallback;

FSErrorCode FSDK_TextSearchReplace_Create(const FS_PDFDOC_HANDLE doc, FS_TEXTSEARCHREPLACE_HANDLE* textsearchreplace_return_value);
FSErrorCode FSDK_TextSearchReplace_Release(FS_TEXTSEARCHREPLACE_HANDLE textsearchreplace_handle);
FSErrorCode FSDK_TextSearchReplace_IsEmpty(FS_TEXTSEARCHREPLACE_HANDLE textsearchreplace_handle, FS_BOOL* return_value);
FSErrorCode FSDK_TextSearchReplace_SetPattern(FS_TEXTSEARCHREPLACE_HANDLE textsearchreplace_handle, const wchar_t* keywords, int page_index, const FSFindOption find_option);
FSErrorCode FSDK_TextSearchReplace_SetReplaceCallback(FS_TEXTSEARCHREPLACE_HANDLE textsearchreplace_handle, FSReplaceCallback* replace_callback);
FSErrorCode FSDK_TextSearchReplace_ReplacePrev(FS_TEXTSEARCHREPLACE_HANDLE textsearchreplace_handle, const wchar_t* replace_text, FS_BOOL* return_value);
FSErrorCode FSDK_TextSearchReplace_ReplaceNext(FS_TEXTSEARCHREPLACE_HANDLE textsearchreplace_handle, const wchar_t* replace_text, FS_BOOL* return_value);
#ifdef __cplusplus
}
#endif
#endif
