#if !defined(__HR_Loader_H__)
#define __HR_Loader_H__

// Application developers may need to change the paths below or modify project settings
#include "../../HR_Lib/interface/HR_Types.h"
#include "../../HR_Lib/interface/HR_Lib.h"
#include "HR_Lib_Signatures.h"

#ifdef __cplusplus
extern "C" {
#endif


////////////////////////////////////////////////////////////////////////////
//
// HR_FunctionPtrs is the struct with the pointers to the library functions
//
////////////////////////////////////////////////////////////////////////////
typedef struct
{
    // NEVER, NEVER change the order of function pointers already in here
    // Add new functions AFTER existing ones

    // The application should never touch WindowsModuleHandle
	HMODULE                 WindowsModuleHandle;

    // Function Pointers
	HR_OpenLibraryPtr		OpenLibrary;
	HR_CloseLibraryPtr		CloseLibrary;
    HR_OpenCameraPtr        OpenCamera;
    HR_CloseCameraPtr       CloseCamera;
    HR_GetCameraListPtr     GetCameraList;
    HR_TriggerCameraPtr     TriggerCamera;
    HR_OpenImagePtr         OpenImage;
    HR_CloseImagePtr        CloseImage;
    HR_DeleteImagePtr       DeleteImage;
    HR_GetImageListPtr      GetImageList;
    HR_GetParamInfoPtr      GetParamInfo;
    HR_GetParamPtr          GetParam;
    HR_SetParamPtr          SetParam;
    HR_PollPtr              Poll;
//    HR_RegisterCallbackPtr  RegisterCallback;
    HR_GetErrorStringPtr    GetErrorString;
    // NEVER, change the order of function pointers already in here
    // Add new functions AFTER existing ones

} HR_FunctionPtrs;


HR_StatusType HR_LoaderLoadLib(const char* inFilePath, HR_FunctionPtrs* outHRFunctions);

HR_StatusType HR_LoaderUnloadLib(HR_FunctionPtrs* inHRFunctions);

///
/// Enum of Errors that the HR_Loader might return if it fails to load properly.
///
typedef enum {
    HR_LOADER_OK = 0,

    HR_LOADER_ERR_FUNCTION_NOT_FOUND = 13000,
    HR_LOADER_ERR = 13001,
    HR_LOADER_ERR_PATH_NULL     = 13002,
    HR_LOADER_ERR_FUNCS_NULL    = 13003,
    HR_LOADER_ERR_OPENLIBRARY   = 13004,
    HR_LOADER_ERR_CLOSELIBRARY  = 13005,
    HR_LOADER_ERR_OPENCAMERA    = 13006,
    HR_LOADER_ERR_CLOSECAMERA   = 13007,
    HR_LOADER_ERR_GETCAMERALIST = 13008,
    HR_LOADER_ERR_TRIGGERCAMERA = 13009,
    HR_LOADER_ERR_OPENIMAGE     = 13010,
    HR_LOADER_ERR_CLOSEIMAGE    = 13011,
    HR_LOADER_ERR_DELETEIMAGE   = 13012,
    HR_LOADER_ERR_GETIMAGELIST  = 13013,
    HR_LOADER_ERR_GETPARAMINFO  = 13014,
    HR_LOADER_ERR_GETPARAM      = 13015,
    HR_LOADER_ERR_SETPARAM      = 13016,
    HR_LOADER_ERR_POLL          = 13017,
    HR_LOADER_ERR_REGISTERCALLBACK  = 13018,
    HR_LOADER_ERR_GETERRORSTRING  = 13019,

    // make this always last
    HR_LOADER_ERR_END
} HR_LoaderErrorEnumType;


#ifdef __cplusplus
}
#endif

#endif	//__HR_Loader_H__
