home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 October / PCWorld_2002-10_cd.bin / Software / Topware / fprint / fpdk400.exe / include / Fpdefs.h < prev   
C/C++ Source or Header  |  2000-09-20  |  9KB  |  272 lines

  1. //
  2. //    fpdefs.h
  3. //
  4. //        Copyright (c) 1999-2000 FinePrint Software
  5. //        All Rights Reserved.
  6. //
  7. #ifndef inc_fpdefs
  8. #define inc_fpdefs
  9.  
  10. // layout types (1-up, 2-up, etc.)
  11. enum eLayoutType {
  12.         eLayoutNil = -1,        // sentinel value
  13.         eLayoutBypass,            // passthrough to destination printer
  14.         eLayout1,                // 1-up
  15.         eLayout2,                // 2-up
  16.         eLayout4,                // 4-up
  17.         eLayout8,                // 8-up
  18.         eLayoutBooklet,            // booklet
  19.         eLayoutMax,                // sentinel value
  20. };
  21.  
  22. // border types
  23. enum eBorderType {
  24.         eBordersNil = -1,        // sentinel value
  25.         eBordersOff,            // off
  26.         eBordersOn,                // on
  27.         eBordersSmart,            // smart
  28.         eBordersMax,            // sentinel value
  29. };
  30.  
  31. // margin types
  32. enum eMarginType {
  33.         eMarginNil = -1,        // sentinel value
  34.         eMarginNone,            // none
  35.         eMarginSmall,            // small
  36.         eMarginMedium,            // medium
  37.         eMarginLarge,            // large
  38.         eMarginOrig,            // original
  39.         eMarginMax,                // sentinel value
  40. };
  41.  
  42. // gutter types
  43. enum eGutterType {
  44.         eGutterNil = -1,        // sentinel value
  45.         eGutterNone,            // none
  46.         eGutterLong,            // gutter on long side of sheet
  47.         eGutterShort,            // gutter on short side of sheet
  48.         eGutterMax,                // sentinel value
  49. };
  50.  
  51. // dest printer duplex support
  52. enum eDuplexSupportType {
  53.         eDuplexSuppNil = -1,    // sentinel value
  54.         eDuplexSuppUnknown,        // unknown (NOT USED)
  55.         eDuplexSuppFaceUp,        // manual, face up (NOT USED)
  56.         eDuplexSuppFaceDown,    // manual, face down (NOT USED)
  57.         eDuplexSuppHardware,    // hardware duplex
  58.         eDuplexSuppManual,        // manual duplex
  59.         eDuplexSuppMax,            // sentinel value
  60. };
  61.  
  62. // dest printer hardware duplex corrections
  63. #define dupcorrLandscape    0x00000001    // landscape duplex correction
  64. #define dupcorrPortrait        0x00000002    // portrait duplex correction
  65.  
  66. // dest printer manual duplex type
  67. #define pmdFlipShort    0x00000001    // requires a short side flip to
  68.                                     // print duplex
  69. #define pmdRotate        0x00000002    // requires a 180 degree rotation
  70.                                     // for short side duplex
  71.  
  72. // dest printer duplex settings
  73. enum eDuplexType {
  74.         eDuplexNil = -1,        // sentinel value
  75.         eDuplexNone,            // 1-sided printing
  76.         eDuplexLong,            // 2-sided, bind on long side
  77.         eDuplexShort,            // 2-sided, bind on short side
  78.         eDuplexDflt,            // current printer setting
  79.         eDuplexMax,                // sentinel value
  80. };
  81.  
  82. // dest printer orientation
  83. #define DMORIENT_AUTOMATIC 3    // automatic orientation based on N-up and
  84.                                 // source document orientation
  85.  
  86. // when to display the UI dialog
  87. enum eShowDlgType {
  88.         ShowDlg_Nil = -1,        // sentinel value
  89.         ShowDlg_Early,            // show UI before spooling
  90.         ShowDlg_Late,            // show UI after spooling
  91.         ShowDlg_Never,            // do not show UI
  92.         ShowDlg_Max,            // sentinel value
  93. };
  94.  
  95. // different ways to draw colored text
  96. enum eColTextType {
  97.         eColTextNil = -1,        // sentinel value
  98.         eColTextNormal,            // draw normally
  99.         eColTextPath,            // draw as a filled path
  100.         eColTextBlack,            // convert to black and draw normally
  101.         eColTextMax,            // sentinel value
  102. };
  103.  
  104. // stationery items
  105. enum eStatItem {
  106.         esiNil = -1,            // sentinel value
  107.         esiHeader,                // header
  108.         esiFooter,                // footer
  109.         esiWatermark,            // watermark
  110.         esiApplyToEachPage,        // apply to each page (NOT YET IMPLEMENTED)
  111.         esiMax,                    // sentinel value
  112. };
  113.  
  114. // stationery item attributes
  115. enum eStatItemAttr {
  116.         esiaNil = -1,            // sentinel value
  117.         esiaText,                // text of item (LPTSTR)
  118.         esiaFont,                // font of item (LOGFONT)
  119.         esiaColor,                // text color of item (COLORREF)
  120.         esiaMax,                // sentinel value
  121. };
  122.  
  123. // layout items
  124. enum eLayoutItem {
  125.         eliNil = -1,            // sentinel value
  126.         eliLayout,                // N-up
  127.         eliBorders,                // borders
  128.         eliOrder,                // page ordering (4-up and 8-up only)
  129.         eliStationery,            // stationery
  130.         eliForm,                // form
  131.         eliDestPrinter,            // destination printer
  132.         eliMargins,                // margins
  133.         eliDuplex,                // double-sided
  134.         eliCopies,                // number of copies
  135.         eliSeparateJobs,        // job separation (NOT YET IMPLEMENTED)
  136.         eliGutter,                // gutter (NOT YET IMPLEMENTED)
  137.         eliEnableRTL,            // enable RTL support (NOT YET IMPLEMENTED)
  138.         eliRTL,                    // RTL page ordering (NOT YET IMPLEMENTED)
  139.         eliAlignText,            // text column alignment (NOT YET IMPLEMENTED)
  140.         eliSkipBitmaps,            // skip bitmap output (NOT YET IMPLEMENTED)
  141.         eliMax,                    // sentinel value
  142. };
  143.  
  144. // dest printer page rotation
  145. enum ePageRotation {
  146.         eprNil = -1,            // sentinel value
  147.         eprEntire,                // rotate entire page
  148.         eprBanded,                // rotate page in bands
  149.         eprNone,                // do not rotate
  150.         eprMax,                    // sentinel value
  151. };
  152.  
  153. // job separation
  154. enum eJobSeparation {
  155.         ejsNil = -1,            // sentinel value
  156.         ejsNone,                // no separation
  157.         ejsSide,                // each job on new side
  158.         ejsSheet,                // each job on new sheet
  159.         ejsMax,                    // sentinel value
  160. };
  161.  
  162. // dest printer text capabilities
  163. #define ptcRotateNormal            0x00000001    // rotated colored text works
  164.                                             // normally
  165. #define ptcRotateCorrection        0x00000002    // rotated colored text works
  166.                                             // with color correction
  167. #define ptcRotateConvert        0x00000004    // rotated colored text works
  168.                                             // when converted to black
  169. #define ptcAll                    0xffffffff    // everything works correctly
  170.  
  171. // special return values from the FinePrint UI
  172. #define IDDEFER        0xaaaa        // Defer button was pressed
  173. #define IDDEFERALL    0xaaab        // Defer All button was pressed
  174.  
  175. // registry key names for dest printer settings
  176. #define stDestCollate            TEXT ("Collate")
  177. #define stDestColoredText        TEXT ("ColoredText")
  178. #define stDestDuplex            TEXT ("Duplex")
  179. #define stDestDuplexCorrection    TEXT ("DuplexCorrection")
  180. #define stDestDuplexSupport        TEXT ("DuplexSupport")
  181. #define stDestDuplexType        TEXT ("DuplexType")
  182. #define stDestExtraMargin        TEXT ("AddMargin")
  183. #define stDestManualDuplex        TEXT ("ManualDuplex")
  184. #define stDestOrientation        TEXT ("Orientation")
  185. #define stDestPageRotation        TEXT ("PageRotation")
  186. #define stDestPdfFontCorr        TEXT ("EmbFontGraphics")
  187. #define stDestReverse            TEXT ("Reverse")
  188. #define stDestTextCaps            TEXT ("TextCaps")
  189.  
  190. // old names, left in for compatibility
  191. #define stDestLandDupCorr        TEXT ("DuplexCorrection")
  192.  
  193. // FinePrint error codes
  194. enum FpError {
  195.         eFpeNil = -1,            // sentinel value
  196.         eFpeOK,                    // no error
  197.         eFpeNotImplemented,        // functionality is not implemented
  198.         eFpeBadParam,            // invalid parameter
  199.         eFpeNoMem,                // out of memory
  200.         eFpeBadVersion,            // incompatible FinePrint version
  201.         eFpeNotFound,            // item was not found
  202.         eFpeNoDispatcher,        // could not locate the dispatcher
  203.         eFpeDispatcherErr,        // an error occurred in the dispatcher
  204.         eFpeNoUi,                // could not locate the UI
  205.         eFpeUiErr,                // an error occurred in the UI
  206.         eFpeTimeout,            // a timeout expired
  207.         eFpePrinter,            // error on the dest printer
  208.         eFpeIo,                    // file I/O error
  209.         eFpeMax,                // sentinel value
  210. };
  211.  
  212. // structure passed to StartDoc/EndDoc callback functions
  213. struct FpDocCallbackA {
  214.     DWORD    idJob;                    // print job ID
  215.     DWORD    dwShowDlg;                // dialog mode (eShowDlgType)
  216.     char    szFinePrinter[260];        // FinePrinter name
  217.     char    szJobName[260];            // print job name
  218.     char    szFpFile[260];            // FP file name
  219. };
  220. struct FpDocCallbackW {
  221.     DWORD    idJob;                    // print job ID
  222.     DWORD    dwShowDlg;                // dialog mode (eShowDlgType)
  223.     WCHAR    szFinePrinter[260];        // FinePrinter name
  224.     WCHAR    szJobName[260];            // print job name
  225.     WCHAR    szFpFile[260];            // FP file name
  226. };
  227.  
  228. // StartDoc/EndDoc callback entry points
  229. typedef DWORD (WINAPI *FpDocCallbackProcA) (FpDocCallbackA *pDoc);
  230. typedef DWORD (WINAPI *FpDocCallbackProcW) (FpDocCallbackW *pDoc);
  231.  
  232. // old names for compatibility
  233. typedef FpDocCallbackProcA CallbackProcA;
  234. typedef FpDocCallbackProcW CallbackProcW;
  235. typedef FpDocCallbackA FpJobCallbackA;
  236. typedef FpDocCallbackW FpJobCallbackW;
  237.  
  238. // PageCount structure
  239. struct PageCount {
  240.     DWORD    cDocPages;            // number of source document pages
  241.     DWORD    cPaperSides;        // number of sides of paper
  242.     DWORD    cPaperSheets;        // number of sheets of paper
  243. };
  244.  
  245. // structure passed to PrePrint/OnPrint callback functions
  246. struct FpPrintCallbackA {
  247.     PageCount    pc;                    // number of pages printed
  248.     char        szFinePrinter[260];    // FinePrinter name
  249. };
  250. struct FpPrintCallbackW {
  251.     PageCount    pc;                    // number of pages printed
  252.     WCHAR        szFinePrinter[260];    // FinePrinter name
  253. };
  254.  
  255. // PrePrint/OnPrint callback entry points
  256. typedef DWORD (WINAPI *FpPrintCallbackProcA) (FpPrintCallbackA *pPrint);
  257. typedef DWORD (WINAPI *FpPrintCallbackProcW) (FpPrintCallbackW *pPrint);
  258.  
  259. #ifdef UNICODE
  260. #define FpDocCallback        FpDocCallbackW
  261. #define FpDocCallbackProc    FpDocCallbackProcW
  262. #define FpPrintCallback        FpPrintCallbackW
  263. #define FpPrintCallbackProc    FpPrintCallbackProcW
  264. #else
  265. #define FpDocCallback        FpDocCallbackA
  266. #define FpDocCallbackProc    FpDocCallbackProcA
  267. #define FpPrintCallback        FpPrintCallbackA
  268. #define FpPrintCallbackProc    FpPrintCallbackProcA
  269. #endif
  270.  
  271. #endif
  272.