#ifndef HPSH
#define HPSH

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

// flags
#define HPFLAG_RETURN_MSG_ID  0x1
#define HPFLAG_IN_SERVER      0x1

#define HPPROP_AUTHOR            0       // author of the document
#define HPPROP_TITLE             1       // title of the document
#define HPPROP_PRODUCER          2       // producer of the document
#define HPPROP_SUBJECT           3       // subject of the document
#define HPPROP_KEYWORDS          4       // keywords of the document
#define HPPROP_CRE_DATE          5       // date of the document
#define HPPROP_MOD_DATE          6       // ModDate of the document
#define HPPROP_COMPRESS_TEXT     7       // True to compress text
#define HPPROP_EMBED_FONTS       8       // True to always embed fonts
#define HPPROP_BOOKMARK          9       // Create bookmarks
#define HPPROP_HYPERLINK        10       // Create hyperlinks
#define HPPROP_MAC_COMPATIBLE   11       // True to create mac compatible pdf file
#define HPPROP_PERM_FLAGS       12       // permission flags PERM_ constants
#define HPPROP_USER_PASSWORD    13       // user password
#define HPPROP_OWNER_PASSWORD   14       // ownwer password
#define HPPROP_EXACT_TEXT_PLACEMENT 15   // place characters at exact positions
#define HPPROP_ZOOM_FACTOR     16        // zoom factor (1000 is no zoom) to compress or expand the page
#define HPPROP_DOWNLOAD_DIR    17        // specify the download directory
#define HPPROP_KEEP_ROW_TOGETHER 18      // keep table row together
#define HPPROP_HI_RES            19      // create in hi res
#define HPPROP_XLATE_QUOTE       20      // translate to simple quotes
#define HPPROP_OPEN_BOOKMARK_PANE 21     // open the bookmark pane, only valie when bookmarks are also enabled
#define HPPROP_OMIT_LAST_EMPTY_PAGE 22   // do not print the last empty page
#define HPPROP_FIRST_PAGE           21   // first page (zero based) to print
#define HPPROP_LAST_PAGE            22   // last page (zero based) to print
#define HPPROP_RC4_128          23       // use RC4 128 bit security when password is specified
#define HPPROP_AES_128          24       // use AES 128 bit security when password is specified
#define HPPROP_HIDE_EMPTY_CELLS 25       // hide empty cells - true by default
#define HPPROP_USE_WEB_BROWSER  26       // use web browser control to render the contents
#define HPPROP_HTTP_HEADER      27       // http header property
#define HPPROP_CLEAR_BKND       28       // clear background before drawing
#define HPPROP_RES_FACTOR       29       // resolution factor, 1 to 10
#define HPPROP_PDFA_1B          30       // minimum compliance pdf/a-1b
#define HPPROP_PDFA             31       // minimum compliance pdf/a

#define PERM_PRINT            0x4     // these values are specified by the pdf spec - permission flags
#define PERM_MOD              0x28
#define PERM_COPY             0x10

#define PERM_ALL              (PERM_PRINT|PERM_MOD|PERM_COPY)

#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_PDF_INIT_ERROR    10
#define MSG_WEB               11
#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 HPS_HUGE
   #define _export
#else
   #define HPS_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 HPS from a C program, leave the HPS_CPLUSPLUS symbol undefined.

   When calling HPS from a C++ program, define the HPS_CPLUSPLUS as following:

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

HPS_CPLUSPLUS DWORD_PTR   WINAPI _export HpsNewSession();
HPS_CPLUSPLUS BOOL    WINAPI _export HpsEndSession(DWORD_PTR);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsConvertFile(DWORD_PTR,LPBYTE,LPBYTE);
HPS_CPLUSPLUS HGLOBAL WINAPI _export HpsConvertBuffer(DWORD_PTR,LPBYTE,int,LPINT);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsHandleToStr(LPBYTE,int,HANDLE);
HPS_CPLUSPLUS int     WINAPI _export HpsGetLastMessage(DWORD_PTR,LPBYTE,LPBYTE);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsResetLastMessage(DWORD_PTR);
HPS_CPLUSPLUS DWORD   WINAPI _export HpsSetFlags(DWORD_PTR,BOOL,int);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetTextProp(DWORD_PTR,int,LPBYTE);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetBoolProp(DWORD_PTR,int,BOOL);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetNumProp(DWORD_PTR,int,int);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetPaperSize(DWORD_PTR, int, int, int);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetPaperOrient(DWORD_PTR, int);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetPageMargin(DWORD_PTR, int, int, int, int);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetHdrFtrText(DWORD_PTR, int, int, LPBYTE);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetPageMargin2(DWORD_PTR, int, int, int, int, int, int);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsHandleToByteArray(LPBYTE,int,HANDLE);
HPS_CPLUSPLUS int     WINAPI _export HpsSetLicenseInfo(LPBYTE, LPBYTE, LPBYTE);
HPS_CPLUSPLUS int     WINAPI _export HpsSetLicenseInfo2(LPBYTE, LPBYTE, LPBYTE, LPBYTE);
HPS_CPLUSPLUS int     WINAPI _export HpsSetLicenseInfoU(LPWORD,LPWORD,LPWORD);
HPS_CPLUSPLUS BOOL    WINAPI _export HpsSetInServer(BOOL);
HPS_CPLUSPLUS int     WINAPI _export HpsGetLicenseStatus();


#endif
