home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xprint.h < prev    next >
C/C++ Source or Header  |  1998-04-06  |  2KB  |  62 lines

  1. #ifndef __XPRINT_H__
  2. #define __XPRINT_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XPrinterDevice                        */
  8. /*                       derived from: XGraphicDevice                        */
  9. /*                        last update: 1/97                                  */
  10. /*       based on the code of the MAVERIK CLASS LIBRARY by Fabrizio AVERSA     */
  11. /*                          ported by: Stefan von Brauk                      */
  12. /*===========================================================================*/
  13.  
  14. #include "xobject.h"
  15. #include "xgraphdv.h"
  16. #include "xsize.h"
  17. #include "xfont.h"
  18.  
  19. typedef struct _PRINTERSETUP
  20. {
  21.    LONG           lWorldCoordinates;
  22.    HAB            hab;
  23.    CHAR           szPreferredQueue[ 64 ];
  24.    PDRIVDATA      pDriverData;
  25.    HDC            hdcPrinterInfo;
  26.    HPS            hpsPrinterInfo;
  27.    LONG           lDCType;
  28.    PDEVOPENDATA   pDevOpenData;
  29.    DEVOPENSTRUC   devopenstruc;
  30.    LONG           cQueues;
  31.    PPRQINFO3      pQueueInfo;
  32.    BOOL           fToFile;
  33.    CHAR           szFileName[ CCHMAXPATH ];
  34. } PRINTERSETUP;
  35. typedef PRINTERSETUP *PPRINTERSETUP;
  36.  
  37.  
  38. class _export_ XPrinterDevice: public XGraphicDevice
  39. {
  40.    private:
  41.       PPRINTERSETUP pSetup;
  42.       //SIZEL sizPage;
  43.       PPRQINFO3 FindQueue( PPRINTERSETUP );
  44.    public:
  45.       XPrinterDevice(const XFrameWindow*, const LONG res = PU_LOMETRIC);
  46.       ~XPrinterDevice();
  47. //      virtual void Draw(void);
  48.       void GetPageSize( XSize * s) const { s->SetWidth(width); s->SetHeight(height);}
  49.       //PDEVOPENDATA GetDevOpenData(void) {return pSetup->pDevOpenData;}
  50.       //PDRIVDATA GetDrivData(void) {return pSetup->pDriverData;}
  51.       void CleanupPrinter(void);
  52.       void ClosePrinterJob(void);
  53.       void KillPrinterJob(void);
  54.       BOOL NewPage(void) const;
  55.       BOOL OpenPrinterJob(const char *);
  56.       virtual void SetColor( const LONG c) { return; }
  57.       virtual void SetFont( XFont * font) { EnableFont(font, font->fontSize); }
  58.       BOOL SetupPrinter(const char *, const XFrameWindow *, XString*, XString*);
  59. };
  60.  
  61. #endif
  62.