#ifndef HISH
#define HISH

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

// flags
#define HIFLAG_RETURN_MSG_ID  0x1

#define HIPROP_DOWNLOAD_DIR    1        // specify the download directory
#define HIPROP_IMAGE_TYPE      2
#define HIPROP_IMAGE_RES       3
#define HIPROP_META_RES        4
#define HIPROP_SIZE_PERCENT    5
#define HIPROP_SHRINK_TO_FIT   6
#define HIPROP_USE_WEB_BROWSER 7       // use web browser control to render the contents

#define HIPICT_DEF              0       // determine picture type from the file extension
#define HIPICT_BMP              1
#define HIPICT_TIF              2
#define HIPICT_JPG              3
#define HIPICT_PNG              4
#define HIPICT_GIF              5
#define HIPICT_ICO              6
#define HIPICT_EXF              7
#define HIPICT_EMF              8


#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_RTF_FILE       7
#define MSG_BAD_HTML_FILE      8
#define MSG_EXPIRED            9
#define MSG_WEB               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 HIS_HUGE
   #define _export
#else
   #define HIS_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 HIS from a C program, leave the HIS_CPLUSPLUS symbol undefined.

   When calling HIS from a C++ program, define the HIS_CPLUSPLUS as following:

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

HIS_CPLUSPLUS DWORD   WINAPI _export HisNewSession();
HIS_CPLUSPLUS BOOL    WINAPI _export HisEndSession(DWORD);
HIS_CPLUSPLUS int     WINAPI _export HisLoadFile(DWORD, LPSTR);
HIS_CPLUSPLUS int     WINAPI _export HisLoadBuffer(DWORD, LPSTR,int);
HIS_CPLUSPLUS BOOL    WINAPI _export HisHandleToStr(LPSTR,int,HANDLE);
HIS_CPLUSPLUS int     WINAPI _export HisGetLastMessage(DWORD,LPSTR,LPSTR);
HIS_CPLUSPLUS BOOL    WINAPI _export HisResetLastMessage(DWORD);
HIS_CPLUSPLUS DWORD   WINAPI _export HisSetFlags(DWORD,BOOL,int);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetTextProp(DWORD,int,LPSTR);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetBoolProp(DWORD,int,BOOL);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetNumProp(DWORD,int,int);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetPaperSize(DWORD, int, int, int);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetPaperOrient(DWORD, int);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetPageMargin(DWORD, int, int, int, int);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetHdrFtrText(DWORD, int, int, LPSTR);
HIS_CPLUSPLUS int     WINAPI _export HisGetImageType(DWORD,LPSTR);
HIS_CPLUSPLUS BOOL    WINAPI _export HisImageToFile(DWORD, LPSTR, int);
HIS_CPLUSPLUS HANDLE  WINAPI _export HisGetPageImage(DWORD, int);
HIS_CPLUSPLUS HGLOBAL WINAPI _export HisImageToBuffer(DWORD, LPINT, int);
HIS_CPLUSPLUS int     WINAPI _export HisSetLicenseInfo(LPSTR, LPSTR, LPSTR);
HIS_CPLUSPLUS int     WINAPI _export HisSetLicenseInfoU(LPWORD,LPWORD,LPWORD);
HIS_CPLUSPLUS BOOL    WINAPI _export HisSetInServer(BOOL);
HIS_CPLUSPLUS int     WINAPI _export HisGetLicenseStatus();


#endif
