#ifndef RPSH
#define RPSH

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

// flags
#define RPFLAG_RETURN_MSG_ID  0x1

#define RPPROP_AUTHOR            0       // author of the document
#define RPPROP_TITLE             1       // title of the document
#define RPPROP_PRODUCER          2       // producer of the document
#define RPPROP_SUBJECT           3       // subject of the document
#define RPPROP_KEYWORDS          4       // keywords of the document
#define RPPROP_CRE_DATE          5       // date of the document
#define RPPROP_MOD_DATE          6       // ModDate of the document
#define RPPROP_COMPRESS_TEXT     7       // True to compress text
#define RPPROP_EMBED_FONTS       8       // True to always embed fonts
#define RPPROP_BOOKMARK          9       // Create bookmarks
#define RPPROP_HYPERLINK        10       // Create hyperlinks
#define RPPROP_MAC_COMPATIBLE   11       // True to create mac compatible pdf file
#define RPPROP_PERM_FLAGS       12       // permission flags PERM_ constants
#define RPPROP_USER_PASSWORD    13       // user password
#define RPPROP_OWNER_PASSWORD   14       // ownwer password
#define RPPROP_EXACT_TEXT_PLACEMENT 15   // place characters at exact positions
#define RPPROP_BATCH            16       // faster processing for smaller files when multiple conversions done in the same session
#define RPPROP_NO_CACHING       17       // disable caaching when writing to disk
#define RPPROP_DO_XPARENT       18       // support transparency
#define RPPROP_NO_PAGE_BM       19       // do not use page bitmap. A page bitmap is needed to support RPPROP_DO_XPARENT flag
#define RPPROP_ZOOM_FACTOR      20       // zoom factor - default 1000
#define RPPROP_ENABLE_GDIPLUS   21       // enable gdiplus - ssgp.dll file must be available for this flag to be effective
#define RPPROP_RC4_128          22       // use RC4 128 bit security when password is specified
#define RPPROP_AES_128          23       // use AES 128 bit security when password is specified
#define RPPROP_EXPAND_WIDTH     24       // expand pdf width to fit the widest table
#define RPPROP_HIDE_TRACKING    25       // TRUE to hide the tracking codes
#define RPPROP_OMIT_LAST_EMPTY_PAGE 26   // do not print the last empty page
#define RPPROP_KEEP_OPEN        27       // don't close the pdf file so the next conversion can be added to the previous pdf file
#define RPPROP_HI_RES           28       // hi res
#define RPPROP_PDFA_1B          29       // minimum compliance pdf/a-1b
#define RPPROP_PDFA             30       // minimum compliance pdf/a
#define RPPROP_NO_TOC_UPDATE    31       // don't update the table of contents
#define RPPROP_PICT_QUALITY     32       // picture quality, 1=lowest, 5=highest, 3=default
#define RPPROP_USE_ORIG_JPG     33       // use original jpeg data to create pdf
#define RPPROP_NO_PAGE_SCALING  34       // set the page scaling document property to None
#define RPPROP_DUPLEX_SHORT     35       // enable the short-edge duplex printing by default
#define RPPROP_DUPLEX_LONG      36       // enable the long-edge duplex printing by default
#define RPPROP_LEGACY_SECTIONS  37       // restore section properties interpretation to pre 20140116
#define RPPROP_SHRINK_IMAGES_TO_FIT  38  // shrink rtf images to fit the page/table
#define RPPROP_PDFUA            39       // Generate PDF/UA (user accessiblity) compliant PDF
#define RPPROP_BOOKMARK_TO_PDF  40       // transfer RTF bookmark to PDF bookmark-outlines pane
#define RPPROP_PDFA3            41       // minimum compliance pdf/a3
#define RPPROP_PRINT_EMF_AS_BMP 42       // print emf as bmp to handle dual bmp, 20190206
#define RPPROP_EMF_SCALE_PCT    43       // percent by to increase the scaling of emf when printing emf as bmp, default 0
#define RPPROP_PDFA_2B          44       // minimum compliance pdf/a-2b
#define RPPROP_BREAK_ON_HYPHEN  45       // word-wrap on hyphen, 20201201
#define RPPROP_TAGGED_PDF       46       // product tagged pdf


#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 RPREP_TOP            0x1       // print report information on the top of the page
#define RPREP_BOT            0x2       // print report informatio non the bottom of the page
#define RPREP_CENTER         0x4       // center align the info
#define RPREP_RIGHT          0x8       // right align the info
#define RPREP_NO_PAGE        0x10      // don't print the page number

#define BRDRTYPE_SINGLE           0
#define BRDRTYPE_DBL              1
#define BRDRTYPE_TRIPLE           2
#define BRDRTYPE_SHADOW           3
#define BRDRTYPE_THICK_THIN       4
#define BRDRTYPE_THICK_THIN_THICK 5
#define BRDRTYPE_THIN_THICK       6
#define BRDRTYPE_THIN_THICK_THIN  7
#define BRDRTYPE_NONE             8

// 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_PDF_OUTPUT        11
#define MSG_OPEN_ERROR        12
#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 RPS_HUGE
   #define _export
#else
   #define RPS_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 RPS from a C program, leave the RPS_CPLUSPLUS symbol undefined.

   When calling RPS from a C++ program, define the RPS_CPLUSPLUS as following:

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

RPS_CPLUSPLUS DWORD_PTR   WINAPI _export RpsNewSession();
RPS_CPLUSPLUS BOOL    WINAPI _export RpsEndSession(DWORD_PTR);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsConvertFile(DWORD_PTR,LPBYTE,LPBYTE);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsConvertFileU(DWORD_PTR,LPWORD,LPWORD);
RPS_CPLUSPLUS HGLOBAL WINAPI _export RpsConvertBuffer(DWORD_PTR,LPBYTE,int,LPINT);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsHandleToStr(LPBYTE,int,HANDLE);
RPS_CPLUSPLUS int     WINAPI _export RpsGetLastMessage(DWORD_PTR,LPBYTE,LPBYTE);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsResetLastMessage(DWORD_PTR);
RPS_CPLUSPLUS DWORD   WINAPI _export RpsSetFlags(DWORD_PTR,BOOL,int);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetTextProp(DWORD_PTR,int,LPBYTE);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetBoolProp(DWORD_PTR,int,BOOL);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetNumProp(DWORD_PTR,int,int);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsWriteToFile(DWORD_PTR,LPBYTE, HGLOBAL, int);
RPS_CPLUSPLUS int     WINAPI _export RpsSetLicenseInfo(LPBYTE, LPBYTE, LPBYTE);
RPS_CPLUSPLUS int     WINAPI _export RpsSetLicenseInfoU(LPWORD,LPWORD,LPWORD);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetInServer(BOOL);
RPS_CPLUSPLUS int     WINAPI _export RpsGetLicenseStatus();

// undocumented functions - please contact Sub Systems before using these functions
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetPaperSize(DWORD_PTR, int, int, int);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetPaperOrient(DWORD_PTR, int);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetPageMargin(DWORD_PTR, int, int, int, int);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetPageBorder(DWORD_PTR, int, int, int, COLORREF);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetRepInfo(DWORD_PTR,LPBYTE,LPBYTE,LPBYTE,int, int);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsEmbedFile(DWORD_PTR, LPBYTE, LPBYTE, int, LPBYTE);
RPS_CPLUSPLUS BOOL    WINAPI _export RpsSetCallbackPageCount(DWORD_PTR id, LPVOID callback, LPVOID param);



#endif
