#ifndef _FS_TABLEGENERATOR_C_H_
#define _FS_TABLEGENERATOR_C_H_

#ifdef __cplusplus
extern "C" {
#endif


typedef struct _FSTableCellIndex {

  int x;

  int y;

}FSTableCellIndex;


typedef enum _FSTableBorderStyle {
e_FSTableBorderStyleSolid      = 0,
e_FSTableBorderStyleDashed = 1,
}FSTableBorderStyle;


typedef struct _FSTableBorderInfo {
  FSTableBorderStyle table_border_style;
  float line_width;
  FSDK_ARGB color;
  float dash_phase;
  float* dash_array;
  FS_UINT32 array_length_dashes;
}FSTableBorderInfo;

typedef struct _FSTableCellData {
  FSRichTextStyle cell_text_style;
  FSDK_ARGB cell_fill_color;
  FS_WSTR cell_text;
  FS_IMAGE_HANDLE cell_image;
  FSRectF cell_margin;
}FSTableCellData;

typedef struct _FSTableData {
  FSRectF rect;
  int row_count;
  int col_count;
  FSTableBorderInfo outside_border_left;
  FSTableBorderInfo outside_border_right;
  FSTableBorderInfo outside_border_top;
  FSTableBorderInfo outside_border_bottom;
  FSTableBorderInfo inside_border_row;
  FSTableBorderInfo inside_border_col;
  FSTableCellIndex* merge_cells;
  FS_UINT32 merge_cells_length;
  float* row_height_array;
  FS_UINT32 array_length_row_height;
  float* col_width_array;
  FS_UINT32 array_length_col_width;
}FSTableData;

typedef struct _FSTableGeneratorCallback {
  void* user_data;
  void (*Release)(void* user_data);
  float (*GetTableTopMarginToPage)(void* user_data, int page_index);
  FSPageBasicInfo (*GetNewPageBasicInfo)(void* user_data, int page_index, float rest_table_height, float table_width);
}FSTableGeneratorCallback;

FSErrorCode FSDK_TableGenerator_AddTableToPage(const FS_PDFPAGE_HANDLE page, const FSTableData data, const FSTableCellData* cell_array, FS_UINT32 first_array_length_cell_array, FS_UINT32 second_array_length_cell_array, FS_BOOL* return_value);
FSErrorCode FSDK_TableGenerator_InsertTablePagesToDocument(const FS_PDFDOC_HANDLE doc, int dest_page_index, float page_width, float page_height, const FSTableData data, const FSTableCellData* cell_array, FS_UINT32 first_array_length_cell_array, FS_UINT32 second_array_length_cell_array, FS_BOOL allow_to_cross_page, FSTableGeneratorCallback* tablegenerator_callback, FS_BOOL* return_value);
#ifdef __cplusplus
}
#endif
#endif
