#ifndef DRSH
#define DRSH

/******************************************************************************
               DRS Constants
*******************************************************************************/
#if defined (_WIN32)
   #if !defined(WIN32)
     #define WIN32
   #endif
#endif

// flags
#define DRFLAG_RETURN_MSG_ID 0x1
#define DRFLAG_SEGMENT_ONLY  0x2
#define DRFLAG_EMBED_PICTURE 0x4
#define DRFLAG_NO_LINK_IN_RTF 0x20     // ignore links when converting from docx to rtf
#define DRFLAG_WORDPAD_COMPATIBLE_PICT 0x40     // create WordPad compatible pictures in the rtf output

#define HF_FIRST_HDR         0
#define HF_FIRST_FTR         1
#define HF_HDR               2
#define HF_FTR               3

#define HFTYPE_TEXT          0
#define HFTYPE_RTF           1
#define HFTYPE_HTML          2

// Error messages
#define MSG_FILE_NOT_FOUND     1
#define MSG_NO_EDITOR_INSTANCE 2
#define MSG_READ_ERROR         3
#define MSG_WRITE_ERROR        4
#define MSG_MEMORY_LOCK        5
#define MSG_NO_FILE_SIGNATURE  6
#define MSG_BAD_DOCX_FILE       7
#define MSG_BAD_HTML_FILE      8
#define MSG_EXPIRED            9
#define MSG_TXML_NOT_LOADED   10
#define MSG_LICENSE_EXCEEDED   15
#define MSG_BAD_LICENSE_NUMBER 16
#define MSG_BAD_LICENSE_KEY    17
#define MSG_INVALID_SERVER_LICENSE 18
#define MSG_LICENSE_EXPIRED        19

#define MSG_OTHER             99

/******************************************************************************
    WIN32 specific defines
*******************************************************************************/
#if defined (WIN32)
   #define DRS_HUGE
   #define _export
#else
   #define DRS_HUGE huge
#endif


/****************************************************************************
   Instructions for packing the following structure
*****************************************************************************/
#ifndef RC_INVOKED
   #pragma pack(1)
#endif

/****************************************************************************
   Instructions to resume the default structure packing.
*****************************************************************************/
#ifndef RC_INVOKED
   #pragma pack()
#endif


/******************************************************************************
                     Editor Function Prototype
   When calling DRS from a C program, leave the DRS_CPLUSPLUS symbol undefined.

   When calling DRS from a C++ program, define the DRS_CPLUSPLUS as following:

   #define DRS_CPLUSPLUS extern "C"
   #include "ter.h"
*******************************************************************************/
#ifndef DRS_CPLUSPLUS
   #if defined(__cplusplus)
      #define DRS_CPLUSPLUS extern "C"
   #else
      #define DRS_CPLUSPLUS
   #endif
#endif

DRS_CPLUSPLUS DWORD_PTR   WINAPI _export DrsNewSession();
DRS_CPLUSPLUS BOOL    WINAPI _export DrsEndSession(DWORD_PTR);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsConvertFile(DWORD_PTR,LPBYTE,LPBYTE);
DRS_CPLUSPLUS HGLOBAL WINAPI _export DrsConvertBuffer(DWORD_PTR,LPBYTE,int,LPINT);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsHandleToStr(LPBYTE,int,HANDLE);
DRS_CPLUSPLUS int     WINAPI _export DrsGetLastMessage(DWORD_PTR,LPBYTE,LPBYTE);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsResetLastMessage(DWORD_PTR);
DRS_CPLUSPLUS DWORD   WINAPI _export DrsSetFlags(DWORD_PTR,BOOL,int);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsSetPaperSize(DWORD_PTR, int, int, int);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsSetPaperOrient(DWORD_PTR, int);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsSetPageMargin(DWORD_PTR, int, int, int, int);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsSetDownloadDir(DWORD_PTR, LPBYTE);
DRS_CPLUSPLUS int     WINAPI _export DrsSetLicenseInfo(LPBYTE, LPBYTE, LPBYTE);
DRS_CPLUSPLUS int     WINAPI _export DrsSetLicenseInfoU(LPWORD,LPWORD,LPWORD);
DRS_CPLUSPLUS BOOL    WINAPI _export DrsSetInServer(BOOL);
DRS_CPLUSPLUS int     WINAPI _export DrsGetLicenseStatus();
DRS_CPLUSPLUS BOOL    WINAPI _export DrsConvertFileU(DWORD_PTR, LPWORD,LPWORD);


#endif
