#ifndef _FS_PDF3D_C_H_
#define _FS_PDF3D_C_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "fs_basictypes_c.h"
#include "fs_common_c.h"
#include "fs_pdfdoc_c.h"
#include "fs_pdfpage_c.h"
#include "fs_annot_c.h"

typedef struct _FSPDF3DAnnotViewData {
  FS_WSTR display_name;
  FS_WSTR name;
}FSPDF3DAnnotViewData;


typedef enum _FSPDF3DController {
e_FSControllerRotate = 0,
e_FSControllerSpin = 1,
e_FSControllerPan = 2,
e_FSControllerZoom = 3,
e_FSControllerWalk = 4,
e_FSControllerFly	= 5,
}FSPDF3DController;



typedef enum _FSPDF3DRenderMode {
e_FSRenderModeSolid = 1,
e_FSRenderModeSolidWireframe = 2,
e_FSRenderModeSolidOutline = 3,
e_FSRenderModeTransparent = 4,
e_FSRenderModeTransparentWireframe = 5,
e_FSRenderModeBoundingBox = 6,
e_FSRenderModeTransparentBoundingBox = 7,
e_FSRenderModeTransparentBoundingBoxOutline = 8,
e_FSRenderModeWireframe = 9,
e_FSRenderModeShadedWireframe = 10,
e_FSRenderModeHiddenWireframe = 11,
e_FSRenderModeIllustration = 12,
e_FSRenderModeShadedIllustration = 13,
e_FSRenderModeVertices = 14,
e_FSRenderModeShadedVertices = 15,
}FSPDF3DRenderMode;



typedef enum _FSPDF3DModelNodeType {
e_FSTypeModelRoot = 0,
e_FSTypeGroup = 1,
e_FSTypeMesh = 2,
e_FSTypeSprite = 3,
e_FSTypeMarkup = 4,
e_FSTypePunctualLight = 5,
e_FSTypeAmbientLight = 6,
e_FSTypeViewCamera = 7,
e_FSTypeClippingPlane = 8,
e_FSTypeProcedural = 9,
e_FSTypeBone = 10,
e_FSTypeDummy = 11,
}FSPDF3DModelNodeType;


FSErrorCode FSDK_ModelNode_Create(FS_MODELNODE_HANDLE* modelnode_return_value);
FSErrorCode FSDK_ModelNode_Release(FS_MODELNODE_HANDLE modelnode_handle);
FSErrorCode FSDK_ModelNode_IsEmpty(FS_MODELNODE_HANDLE modelnode_handle, FS_BOOL* return_value);
FSErrorCode FSDK_ModelNode_GetNodeType(FS_MODELNODE_HANDLE modelnode_handle, FSPDF3DModelNodeType* return_value);
FSErrorCode FSDK_ModelNode_GetFirstChildNode(FS_MODELNODE_HANDLE modelnode_handle, FS_MODELNODE_HANDLE* return_value);
FSErrorCode FSDK_ModelNode_GetNextSiblingNode(FS_MODELNODE_HANDLE modelnode_handle, FS_MODELNODE_HANDLE* return_value);
FSErrorCode FSDK_ModelNode_GetParentNode(FS_MODELNODE_HANDLE modelnode_handle, FS_MODELNODE_HANDLE* return_value);
FSErrorCode FSDK_ModelNode_GetName(FS_MODELNODE_HANDLE modelnode_handle, FS_WSTR* return_value);
FSErrorCode FSDK_ModelNode_SetVisible(FS_MODELNODE_HANDLE modelnode_handle, FS_BOOL is_visible);
FSErrorCode FSDK_ModelNode_IsVisible(FS_MODELNODE_HANDLE modelnode_handle, FS_BOOL* return_value);
FSErrorCode FSDK_PDF3DAnnotInstance_Create(FS_PDF3DANNOTINSTANCE_HANDLE* pdf3dannotinstance_return_value);
FSErrorCode FSDK_PDF3DAnnotInstance_Release(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle);
FSErrorCode FSDK_PDF3DAnnotInstance_IsEmpty(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, FS_BOOL* return_value);
FSErrorCode FSDK_PDF3DAnnotInstance_SetController(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, FSPDF3DController tool_tag);
FSErrorCode FSDK_PDF3DAnnotInstance_SetRenderMode(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, FSPDF3DRenderMode render_mode);
FSErrorCode FSDK_PDF3DAnnotInstance_ActivateCanvas(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, FS_HWND_ screen_canvas_parent, FS_HWND_* return_value);
FSErrorCode FSDK_PDF3DAnnotInstance_UpdateCanvas(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, FSRectI rect);
FSErrorCode FSDK_PDF3DAnnotInstance_OnLButtonDown(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, int flag, FSPointF point);
FSErrorCode FSDK_PDF3DAnnotInstance_OnLButtonUp(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, int flag, FSPointF point);
FSErrorCode FSDK_PDF3DAnnotInstance_OnMouseMove(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, int flag, FSPointF point);
FSErrorCode FSDK_PDF3DAnnotInstance_OnMouseWheel(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, int flag, int delta, FSPointF point);
FSErrorCode FSDK_PDF3DAnnotInstance_OnRButtonDown(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, int flag, FSPointF point);
FSErrorCode FSDK_PDF3DAnnotInstance_OnRButtonUp(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, int flag, FSPointF point);
FSErrorCode FSDK_PDF3DAnnotInstance_ResetDefaultView(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle);
FSErrorCode FSDK_PDF3DAnnotInstance_GetPresetViewList(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, FSPDF3DAnnotViewData* return_annot_view_data_array, FS_UINT32* return_array_length);
FSErrorCode FSDK_PDF3DAnnotInstance_ApplyPresetView(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, const FSPDF3DAnnotViewData view_data);
FSErrorCode FSDK_PDF3DAnnotInstance_GetRootNode(FS_PDF3DANNOTINSTANCE_HANDLE pdf3dannotinstance_handle, FS_MODELNODE_HANDLE* return_value);

typedef enum _FSPDF3DType {
e_FS3DTypeArtwork = 0,
e_FS3DTypeRichMedia = 1,
}FSPDF3DType;


FSErrorCode FSDK_PDF3DAnnot_Release(FS_PDF3DANNOT_HANDLE pdf3dannot_handle);
FSErrorCode FSDK_PDF3DAnnot_IsEmpty(FS_PDF3DANNOT_HANDLE pdf3dannot_handle, FS_BOOL* return_value);
FSErrorCode FSDK_PDF3DAnnot_GetAnnotIndex(FS_PDF3DANNOT_HANDLE pdf3dannot_handle, int* return_value);
FSErrorCode FSDK_PDF3DAnnot_GetAnnot(FS_PDF3DANNOT_HANDLE pdf3dannot_handle, FS_ANNOT_HANDLE* return_value);
FSErrorCode FSDK_PDF3DAnnot_Get3DAnnotType(FS_PDF3DANNOT_HANDLE pdf3dannot_handle, FSPDF3DType* return_value);
FSErrorCode FSDK_PDF3DAnnot_Get3DArtworkInstance(FS_PDF3DANNOT_HANDLE pdf3dannot_handle, FS_PDF3DANNOTINSTANCE_HANDLE* return_value);
FSErrorCode FSDK_PDF3DAnnot_GetRichMediaInstances(FS_PDF3DANNOT_HANDLE pdf3dannot_handle, FS_PDF3DANNOTINSTANCE_HANDLE* return_annot_instance_array, FS_UINT32* return_array_length);

typedef enum _FSPDF3DActivationEnableSetting {
e_FS3DActivationEnableSettingContentClicked = 0,
e_FS3DActivationEnableSettingPageOpened = 1,
e_FS3DActivationEnableSettingPageVisible = 2,
}FSPDF3DActivationEnableSetting;



typedef enum _FSPDF3DActivationDisableSetting {
e_FS3DActivationDisableSettingContextMenuSelected = 0,
e_FS3DActivationDisableSettingPageClosed = 1,
e_FS3DActivationDisableSettingPageInvisible = 2,
}FSPDF3DActivationDisableSetting;



typedef enum _FSPDF3DActivationPlaybackStyleSetting {
e_FS3DActivationPlaybackStyleOnPage = 0,
e_FS3DActivationPlaybackStyleInFloatingWindow = 1,
}FSPDF3DActivationPlaybackStyleSetting;



typedef enum _FSPDF3DAppearanceSettingBorderWidth {
e_FS3DAppearanceSettingBorderWidthNone = 0,
e_FS3DAppearanceSettingBorderWidthThin = 1,
e_FS3DAppearanceSettingBorderWidthMedium = 2,
e_FS3DAppearanceSettingBorderWidthThick = 3,
}FSPDF3DAppearanceSettingBorderWidth;



typedef enum _FSPDF3DPosterImageSetting {
e_FS3DPosterImageKeepCurrent = 0,
e_FS3DPosterImageRetrieveFromDefaultView = 1,
e_FS3DPosterImageCreateFromFile = 2,
}FSPDF3DPosterImageSetting;


typedef struct _FSPDF3DLaunchSetting {
  FSPDF3DActivationEnableSetting activation_enable;
  FSPDF3DActivationDisableSetting activation_disable;
  FSPDF3DActivationPlaybackStyleSetting activation_playback;
  int window_width;
  int window_height;
  FSPDF3DAppearanceSettingBorderWidth border_width;
  FS_BOOL is_transparent_background;
  FSPDF3DPosterImageSetting poster_image;
  FS_WSTR poster_file_path;
}FSPDF3DLaunchSetting;


typedef enum _FSPDF3DLightingScheme {
e_FS3DLightingSchemeNone = 0,
e_FS3DLightingSchemeFromFile = 1,
e_FS3DLightingSchemeNoLights = 2,
e_FS3DLightingSchemeWhiteLights = 3,
e_FS3DLightingSchemeDayLights = 4,
e_FS3DLightingSchemeHardLights = 5,
e_FS3DLightingSchemePrimaryLights = 6,
e_FS3DLightingSchemeNightLights = 7,
e_FS3DLightingSchemeBlueLights = 8,
e_FS3DLightingSchemeRedLights = 9,
e_FS3DLightingSchemeCubeLights = 10,
e_FS3DLightingSchemeCADLights= 11,
e_FS3DLightingSchemeHeadlamp= 12,
}FSPDF3DLightingScheme;



typedef enum _FSPDF3DRenderingStyle {
e_FS3DRenderingStyleNone = 0,
e_FS3DRenderingStyleBoundingBox = 1,
e_FS3DRenderingStyleTransparentBoundingBox = 2,
e_FS3DRenderingStyleTransparentBoundingBoxOutline = 3,
e_FS3DRenderingStyleVertices = 4,
e_FS3DRenderingStyleShadedVertices = 5,
e_FS3DRenderingStyleWireframe = 6,
e_FS3DRenderingStyleShadedWireframe = 7,
e_FS3DRenderingStyleSolid = 8,
e_FS3DRenderingStyleTransparent = 9,
e_FS3DRenderingStyleSolidWireframe = 10,
e_FS3DRenderingStyleTransparentWireframe = 11,
e_FS3DRenderingStyleIllustration = 12,
e_FS3DRenderingStyleSolidOutline = 13,
e_FS3DRenderingStyleShadedIllustration = 14,
e_FS3DRenderingStyleHiddenWireframe = 15,
}FSPDF3DRenderingStyle;



typedef enum _FSPDF3DAnimationStyle {
e_FS3DAnimationStyleNone = 0,
e_FS3DAnimationStyleLoop = 1,
e_FS3DAnimationStyleBounce = 2,
}FSPDF3DAnimationStyle;



typedef enum _FSPDF3DDefaultViews {
e_FS3DDefaultViewsNoViews = 0,
e_FS3DDefaultViewsLeftTopFrontIsoAllOrtho = 1,
e_FS3DDefaultViewsLeftTopFrontIsoAllPerspective = 2,
e_FS3DDefaultViewsLeftTopFrontOrthoIsoPerspective = 3,
e_FS3DDefaultViewsLeftTopFrontPerspectiveIsoOrtho = 4,
e_FS3DDefaultViewsLeftTopFrontRightBottomBackAllOrtho = 5,
e_FS3DDefaultViewsFromFile = 6,
}FSPDF3DDefaultViews;


typedef struct _FSPDF3DAdvancedSetting {
  FS_RGB background_color;
  FSPDF3DLightingScheme lighting_scheme;
  FSPDF3DRenderingStyle rendering_style;
  FSPDF3DAnimationStyle animation_style;
  FSPDF3DDefaultViews default_views;
  FS_BOOL is_add_default_views;
  FS_BOOL is_retain_views_and_comments;
  FS_BOOL is_show_tool_bar;
  FS_BOOL is_open_model_tree;
  FS_WSTR script_file_path;
}FSPDF3DAdvancedSetting;

FSErrorCode FSDK_PDF3DContext_Create(const FS_PDFDOC_HANDLE doc, FS_PDF3DCONTEXT_HANDLE* pdf3dcontext_return_value);
FSErrorCode FSDK_PDF3DContext_Release(FS_PDF3DCONTEXT_HANDLE pdf3dcontext_handle);
FSErrorCode FSDK_PDF3DContext_IsEmpty(FS_PDF3DCONTEXT_HANDLE pdf3dcontext_handle, FS_BOOL* return_value);
FSErrorCode FSDK_PDF3DContext_GetPage3DAnnotArray(FS_PDF3DCONTEXT_HANDLE pdf3dcontext_handle, int page_index, FS_PDF3DANNOT_HANDLE* return_annot_array, FS_UINT32* return_array_length);
FSErrorCode FSDK_PDF3DContext_Invalidate(FS_PDF3DCONTEXT_HANDLE pdf3dcontext_handle);
FSErrorCode FSDK_PDF3DContext_Add3DAnnot(FS_PDF3DCONTEXT_HANDLE pdf3dcontext_handle, const wchar_t* threeD_file_path, int page_index, FSRectF rectf, void* screen_canvas_parent,
      FSPDF3DLaunchSetting launch_setting, FSPDF3DAdvancedSetting advanced_setting, FS_PDF3DANNOT_HANDLE* return_value);
FSErrorCode FSDK_PDF3DContext_Add3DAnnot0(FS_PDF3DCONTEXT_HANDLE pdf3dcontext_handle,  FSReaderCallback* threeD_file_read, int page_index, FSRectF rectf, void* screen_canvas_parent, FSPDF3DLaunchSetting launch_setting, FSPDF3DAdvancedSetting advanced_setting, FS_PDF3DANNOT_HANDLE* return_value);
#ifdef __cplusplus
}
#endif
#endif
