#ifndef RISH
#define RISH

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

// flags
#define RIFLAG_RETURN_MSG_ID  0x1

#define RIPROP_DOWNLOAD_DIR    1        // specify the download directory
#define RIPROP_IMAGE_TYPE      2
#define RIPROP_IMAGE_RES       3
#define RIPROP_META_RES        4
#define RIPROP_SIZE_PERCENT    5
#define RIPROP_SHRINK_TO_FIT   6
#define RIPROP_AUTO_WIDTH      7
#define RIPROP_DONT_UPDATE_TOC 8
#define RIPROP_BITS_PER_PIXEL  9
#define RIPROP_ADJUST_TEXT_COLOR 10

 #define RIPICT_DEF              0       // determine picture type from the file extension
 #define RIPICT_BMP              1
 #define RIPICT_TIF              2
 #define RIPICT_JPG              3
 #define RIPICT_PNG              4
 #define RIPICT_GIF              5
 #define RIPICT_ICO              6
 #define RIPICT_EXF              7
 #define RIPICT_EMF              8
 #define RIPICT_WMF              9


#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_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 RIS_HUGE
   #define _export
#else
   #define RIS_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 RIS from a C program, leave the RIS_CPLUSPLUS symbol undefined.

   When calling RIS from a C++ program, define the RIS_CPLUSPLUS as following:

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

RIS_CPLUSPLUS DWORD_PTR   WINAPI _export RisNewSession();
RIS_CPLUSPLUS BOOL    WINAPI _export RisEndSession(DWORD_PTR);
RIS_CPLUSPLUS int     WINAPI _export RisLoadFile(DWORD_PTR, LPSTR);
RIS_CPLUSPLUS int     WINAPI _export RisLoadBuffer(DWORD_PTR, LPSTR,int);
RIS_CPLUSPLUS BOOL    WINAPI _export RisHandleToStr(LPSTR,int,HANDLE);
RIS_CPLUSPLUS int     WINAPI _export RisGetLastMessage(DWORD_PTR,LPSTR,LPSTR);
RIS_CPLUSPLUS BOOL    WINAPI _export RisResetLastMessage(DWORD_PTR);
RIS_CPLUSPLUS DWORD   WINAPI _export RisSetFlags(DWORD_PTR,BOOL,int);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetTextProp(DWORD_PTR,int,LPSTR);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetBoolProp(DWORD_PTR,int,BOOL);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetNumProp(DWORD_PTR,int,int);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetPaperSize(DWORD_PTR, int, int, int);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetPaperOrient(DWORD_PTR, int);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetPageMargin(DWORD_PTR, int, int, int, int);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetHdrFtrText(DWORD_PTR, int, int, LPSTR);
RIS_CPLUSPLUS int     WINAPI _export RisGetImageType(DWORD_PTR,LPSTR);
RIS_CPLUSPLUS int     WINAPI _export RisGetImageTypeU(DWORD_PTR,LPWSTR);
RIS_CPLUSPLUS BOOL    WINAPI _export RisImageToFile(DWORD_PTR, LPSTR, int);
RIS_CPLUSPLUS HANDLE  WINAPI _export RisGetPageImage(DWORD_PTR, int);
RIS_CPLUSPLUS HGLOBAL WINAPI _export RisImageToBuffer(DWORD_PTR, LPINT, int);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetImageSize(DWORD_PTR, int, int);
RIS_CPLUSPLUS int     WINAPI _export RisSetLicenseInfo(LPSTR, LPSTR, LPSTR);
RIS_CPLUSPLUS int     WINAPI _export RisSetLicenseInfoU(LPWORD,LPWORD,LPWORD);
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetInServer(BOOL);
RIS_CPLUSPLUS int     WINAPI _export RisGetLicenseStatus();
RIS_CPLUSPLUS BOOL    WINAPI _export RisSetDefPrinter(DWORD_PTR,LPSTR,LPSTR,LPSTR);
RIS_CPLUSPLUS BOOL    WINAPI _export RisIsEmptyFile(DWORD_PTR);
RIS_CPLUSPLUS int     WINAPI _export RisLoadFileU(DWORD_PTR id, LPWSTR pInFile);
RIS_CPLUSPLUS BOOL    WINAPI _export RisImageToFileU(DWORD_PTR, LPWSTR, int);



#endif
