#ifndef _FS_FORMFILLER_C_H_
#define _FS_FORMFILLER_C_H_

#ifdef __cplusplus
extern "C" {
#endif


typedef struct _FSTimerCallback {
  void* user_data;
  void (*OnTimer)(void* user_data, int timer);
}FSTimerCallback;


typedef enum _FSPopupMenuItem {
e_FSPopupMenuItemNone = 0,
e_FSPopupMenuItemCut  = 1,
e_FSPopupMenuItemCopy = 2,
e_FSPopupMenuItemPaste = 3,
e_FSPopupMenuItemDelete = 4,
e_FSPopupMenuItemSelectAll = 5,
}FSPopupMenuItem;


typedef struct _FSFillerAssistCallback {
  void* user_data;
  void (*Release)(void* user_data);
  int (*GetVersion)(void* user_data);
  void (*Refresh)(void* user_data, const FS_PDFPAGE_HANDLE page, const FSRectF* rect);
  FS_BOOL (*SetTimerCallback)(void* user_data, int elapse, FSTimerCallback* timer, int* out_timer_id);
  FS_BOOL (*KillTimer)(void* user_data, int timer_id);
  void (*FocusGotOnControl)(void* user_data, const FS_CONTROL_HANDLE control, const char* value);
  void (*FocusLostFromControl)(void* user_data, const FS_CONTROL_HANDLE control, const char* value);
  void* (*CreatePopupMenu)(void* user_data);
  FS_BOOL (*AppendPopupMenuItem)(void* user_data, const void* h_popup_menu, FSPopupMenuItem popup_menu_item, const wchar_t* default_string);
  FS_BOOL (*EnablePopupMenuItem)(void* user_data, const void* h_popup_menu, FSPopupMenuItem popup_menu_item, FS_BOOL is_enabled);
  FS_BOOL (*ShowPopupMenu)(void* user_data, const void* h_popup_menu, const FSPointF point);
  void (*DestroyPopupMenu)(void* user_data, const void* h_popup_menu);
  void (*SetClipboardText)(void* user_data, const wchar_t* text);
  FS_WSTR (*GetClipboardText)(void* user_data);
  void (*ReportInvalidValue)(void* user_data, const wchar_t* form_field_name, const wchar_t* invalid_value);
}FSFillerAssistCallback;


typedef enum _FSVirtualKeyCode {
e_FSVirtualKeyCodeVkeyUnknown  = 0x00,
e_FSVkeyBack = 0x08,
e_FSVkeyTab = 0x09,
e_FSVkeyReturn = 0x0D,
e_FSVkeyShift = 0x10,
e_FSVkeyControl = 0x11,
e_FSVkeyMenu = 0x12,
e_FSVkeyPause = 0x13,
e_FSVkeyEscape = 0x1B,
e_FSVkeySpace = 0x20,
e_FSVkeyPrior = 0x21,
e_FSVkeyNext = 0x22,
e_FSVkeyEnd =   0x23,
e_FSVkeyHome = 0x24,
e_FSVkeyLeft = 0x25,
e_FSVkeyUp =   0x26,
e_FSVkeyRight = 0x27,
e_FSVkeyDown = 0x28,
e_FSVkeyPrint = 0x2A,
e_FSVkeySnapshot = 0x2C,
e_FSVkeyInsert = 0x2D,
e_FSVkeyDelete = 0x2E,
e_FSVkeyHelp = 0x2F,
e_FSVkey0 = 0x30,
e_FSVkey1 = 0x31,
e_FSVkey2 = 0x32,
e_FSVkey3 = 0x33,
e_FSVkey4 = 0x34,
e_FSVkey5 = 0x35,
e_FSVkey6 = 0x36,
e_FSVkey7 = 0x37,
e_FSVkey8 = 0x38,
e_FSVkey9 = 0x39,
e_FSVkeyA = 0x41,
e_FSVkeyB = 0x42,
e_FSVkeyC = 0x43,
e_FSVkeyD = 0x44,
e_FSVkeyE = 0x45,
e_FSVkeyF = 0x46,
e_FSVkeyG = 0x47,
e_FSVkeyH = 0x48,
e_FSVkeyI = 0x49,
e_FSVkeyJ = 0x4A,
e_FSVkeyK = 0x4B,
e_FSVkeyL = 0x4C,
e_FSVkeyM = 0x4D,
e_FSVkeyN = 0x4E,
e_FSVkeyO = 0x4F,
e_FSVkeyP = 0x50,
e_FSVkeyQ = 0x51,
e_FSVkeyR = 0x52,
e_FSVkeyS = 0x53,
e_FSVkeyT = 0x54,
e_FSVkeyU = 0x55,
e_FSVkeyV = 0x56,
e_FSVkeyW = 0x57,
e_FSVkeyX = 0x58,
e_FSVkeyY = 0x59,
e_FSVkeyZ = 0x5A,
e_FSVkeyNumpad0 = 0x60,
e_FSVkeyNumpad1 = 0x61,
e_FSVkeyNumpad2 = 0x62,
e_FSVkeyNumpad3 = 0x63,
e_FSVkeyNumpad4 = 0x64,
e_FSVkeyNumpad5 = 0x65,
e_FSVkeyNumpad6 = 0x66,
e_FSVkeyNumpad7 = 0x67,
e_FSVkeyNumpad8 = 0x68,
e_FSVkeyNumpad9 = 0x69,
e_FSVkeyMultiply = 0x6A,
e_FSVkeyAdd = 0x6B,
e_FSVkeySeparator =  0x6C,
e_FSVkeySubtract =  0x6D,
e_FSVkeyDecimal = 0x6E,
e_FSVkeyDivide = 0x6F,
e_FSVkeyF1 = 0x70,
e_FSVkeyF2 = 0x71,
e_FSVkeyF3 = 0x72,
e_FSVkeyF4 = 0x73,
e_FSVkeyF5 = 0x74,
e_FSVkeyF6 = 0x75,
e_FSVkeyF7 = 0x76,
e_FSVkeyF8 = 0x77,
e_FSVkeyF9 = 0x78,
e_FSVkeyF10 = 0x79,
e_FSVkeyF11 = 0x7A,
e_FSVkeyF12 = 0x7B,
}FSVirtualKeyCode;



typedef enum _FSEventFlags {
e_FSEventFlagShiftKey =  0x0001,
e_FSEventFlagControlKey  = 0x0002,
e_FSEventFlagAltKey  = 0x0004,
e_FSEventFlagMetaKey = 0x0008,
e_FSEventFlagKeyPad = 0x0010,
e_FSEventFlagAutoRepeat = 0x0020,
e_FSEventFlagLeftButtonDown = 0x0040,
e_FSEventFlagMiddleButtonDown = 0x0080,
e_FSEventFlagRightButtonDown = 0x0100,
e_FSEventFlagCommand = 0x0200,
}FSEventFlags;


FSErrorCode FSDK_Filler_Create(const FS_FORM_HANDLE form, FSFillerAssistCallback* assist, FS_FILLER_HANDLE* filler_return_value);
FSErrorCode FSDK_Filler_Release(FS_FILLER_HANDLE filler_handle);
FSErrorCode FSDK_Filler_IsEmpty(FS_FILLER_HANDLE filler_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_Render(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSMatrix matrix,const FS_RENDERER_HANDLE renderer);
FSErrorCode FSDK_Filler_OnLButtonDown(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnLButtonUp(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnLButtonDoubleClick(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnMouseMove(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnMouseEnter(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnMouseHover(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnMouseLeave(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnMouseWheel(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_INT32 delta, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnRButtonDown(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnRButtonUp(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnRButtonDoubleClick(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnWheelButtonDown(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnWheelButtonUp(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnWheelButtonDoubleClick(FS_FILLER_HANDLE filler_handle, const FS_PDFPAGE_HANDLE page, const FSPointF point, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnKeyDown(FS_FILLER_HANDLE filler_handle, FS_UINT32 key_code, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnKeyUp(FS_FILLER_HANDLE filler_handle, FS_UINT32 key_code, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnChar(FS_FILLER_HANDLE filler_handle, FS_UINT32 char_code, FS_UINT32 flags, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_SetFocus(FS_FILLER_HANDLE filler_handle, const FS_CONTROL_HANDLE control, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_KillFocus(FS_FILLER_HANDLE filler_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_HighlightFormFields(FS_FILLER_HANDLE filler_handle, FS_BOOL is_highlight);
FSErrorCode FSDK_Filler_HighlightFormFields0(FS_FILLER_HANDLE filler_handle, FS_BOOL is_highlight, FS_BOOL is_sign_highlight);
FSErrorCode FSDK_Filler_SetHighlightColor(FS_FILLER_HANDLE filler_handle, FSDK_ARGB color);
FSErrorCode FSDK_Filler_ShowOverflowIndicator(FS_FILLER_HANDLE filler_handle, FS_BOOL is_show_overflow_indicator);
FSErrorCode FSDK_Filler_OnCut(FS_FILLER_HANDLE filler_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnCopy(FS_FILLER_HANDLE filler_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnPaste(FS_FILLER_HANDLE filler_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnSelectAll(FS_FILLER_HANDLE filler_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_OnDelete(FS_FILLER_HANDLE filler_handle, FS_BOOL* return_value);
FSErrorCode FSDK_Filler_GetEditingTextCaretPosition(FS_FILLER_HANDLE filler_handle, FSMatrix matrix, FSPointF* return_value);
#ifdef __cplusplus
}
#endif
#endif
