#ifndef __XPRINT_H__
#define __XPRINT_H__

/*===========================================================================*/
/* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
/*===========================================================================*/
/*                              class: XPrinterDevice                        */
/*                       derived from: XGraphicDevice                        */
/*                        last update: 1/97                                  */
/*		 based on the code of the MAVERIK CLASS LIBRARY by Fabrizio AVERSA	  */
/*                          ported by: Stefan von Brauk                      */
/*===========================================================================*/

#include "xobject.h"
#include "xgraphdv.h"
#include "xsize.h"

typedef struct _PRINTERSETUP 
{   
   LONG           lWorldCoordinates; 
   HAB            hab;               
   CHAR           szPreferredQueue[ 64 ];  
   PDRIVDATA      pDriverData;             
   HDC            hdcPrinterInfo;    
   HPS            hpsPrinterInfo;    
   LONG           lDCType;           
   PDEVOPENDATA   pDevOpenData;      
   DEVOPENSTRUC   devopenstruc;      
   LONG           cQueues;           
   PPRQINFO3      pQueueInfo;        
   BOOL           fToFile;           
   CHAR           szFileName[ CCHMAXPATH ];     
} PRINTERSETUP;
typedef PRINTERSETUP *PPRINTERSETUP;


class _export_ XPrinterDevice: public XGraphicDevice
{  
   private:
	   PPRINTERSETUP pSetup;
	   //SIZEL sizPage;
	   PPRQINFO3 FindQueue( PPRINTERSETUP );
   public:   
	   XPrinterDevice(XFrameWindow*, LONG mode = PU_LOMETRIC);
	   ~XPrinterDevice();   
		virtual void Draw(void);
		void GetPageSize( XSize * s) { s->SetWidth(width); s->SetHeight(height);}
		//PDEVOPENDATA GetDevOpenData(void) {return pSetup->pDevOpenData;}
		//PDRIVDATA GetDrivData(void) {return pSetup->pDriverData;}
	   void CleanupPrinter(void);
	   void ClosePrinterJob(void);
		void KillPrinterJob(void);
	   BOOL NewPage(void);
	   BOOL OpenPrinterJob(char *);
		virtual void SetColor( LONG c) { return; }
		virtual void SetFont( XFont * font) { EnableFont(font, font->fontSize); }
	   BOOL SetupPrinter(char *, XFrameWindow *, XString*, XString*);	   
};

#endif
