home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / PRINTERS.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  6.3 KB  |  160 lines

  1. //----------------------------------------------------------------------------
  2. // Printers.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: Printers.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef PrintersHPP
  6. #define PrintersHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef FormsHPP
  9. #include <Forms.hpp>
  10. #endif
  11.  
  12. #ifndef GraphicsHPP
  13. #include <Graphics.hpp>
  14. #endif
  15.  
  16. #ifndef ClassesHPP
  17. #include <Classes.hpp>
  18. #endif
  19.  
  20. #ifndef SysUtilsHPP
  21. #include <SysUtils.hpp>
  22. #endif
  23.  
  24. #ifndef WinSpoolHPP
  25. #include <WinSpool.hpp>
  26. #endif
  27.  
  28. #ifndef WindowsHPP
  29. #include <Windows.hpp>
  30. #endif
  31.  
  32. #ifndef SystemHPP
  33. #include <System.hpp>
  34. #endif
  35.  
  36. namespace Printers
  37. {
  38. //-- type declarations -------------------------------------------------------
  39. class __declspec(delphiclass) EPrinter;
  40. class __declspec(pascalimplementation) EPrinter : public Sysutils::Exception
  41. {
  42.     typedef EPrinter ThisClass;
  43.     typedef Sysutils::Exception inherited;
  44.     
  45. public:
  46.     /* !! Exception.Create */ __fastcall EPrinter(const System::AnsiString Msg) : Sysutils::Exception(Msg
  47.         ) { }
  48.     /* !! Exception.CreateFmt */ __fastcall EPrinter(const System::AnsiString Msg, const TVarRec *Args, 
  49.         const System::Integer Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  50.     /* !! Exception.CreateRes */ __fastcall EPrinter(System::Integer Ident) : Sysutils::Exception(Ident
  51.         ) { }
  52.     /* !! Exception.CreateResFmt */ __fastcall EPrinter(System::Integer Ident, const TVarRec *Args, const 
  53.         System::Integer Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  54.     /* !! Exception.CreateHelp */ __fastcall EPrinter(const System::AnsiString Msg, System::Integer AHelpContext
  55.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  56.     /* !! Exception.CreateFmtHelp */ __fastcall EPrinter(const System::AnsiString Msg, const TVarRec *Args
  57.         , const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Msg, Args, 
  58.         Args_Size, AHelpContext) { }
  59.     /* !! Exception.CreateResHelp */ __fastcall EPrinter(System::Integer Ident, System::Integer AHelpContext
  60.         ) : Sysutils::Exception(Ident, AHelpContext) { }
  61.     /* !! Exception.CreateResFmtHelp */ __fastcall EPrinter(System::Integer Ident, const TVarRec *Args, 
  62.         const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Ident, Args, 
  63.         Args_Size, AHelpContext) { }
  64.     
  65. public:
  66.     /* !! TObject.Destroy */ __fastcall virtual ~EPrinter(void) { }
  67.     
  68. };
  69.  
  70. enum TPrinterState { psNoHandle, psHandleIC, psHandleDC };
  71.  
  72. enum TPrinterOrientation { poPortrait, poLandscape };
  73.  
  74. enum TPrinterCapability { pcCopies, pcOrientation, pcCollation };
  75.  
  76. typedef Set<TPrinterCapability, pcCopies, pcCollation>  TPrinterCapabilities;
  77.  
  78. class __declspec(delphiclass) TPrinter;
  79. class __declspec(pascalimplementation) TPrinter : public System::TObject
  80. {
  81.     typedef TPrinter ThisClass;
  82.     typedef System::TObject inherited;
  83.     
  84. private:
  85.     Graphics::TCanvas *FCanvas;
  86.     Classes::TStrings *FFonts;
  87.     System::Integer FPageNumber;
  88.     Classes::TStrings *FPrinters;
  89.     System::Integer FPrinterIndex;
  90.     System::AnsiString FTitle;
  91.     System::Boolean FPrinting;
  92.     System::Boolean FAborted;
  93.     TPrinterCapabilities FCapabilities;
  94.     TPrinterState State;
  95.     System::Integer DC;
  96.     Windows::TDeviceModeA *DevMode;
  97.     System::Integer DeviceMode;
  98.     System::Integer FPrinterHandle;
  99.     void __fastcall SetState(TPrinterState Value);
  100.     Graphics::TCanvas *__fastcall GetCanvas(void);
  101.     System::Integer __fastcall GetNumCopies(void);
  102.     Classes::TStrings *__fastcall GetFonts(void);
  103.     System::Integer __fastcall GetHandle(void);
  104.     TPrinterOrientation __fastcall GetOrientation(void);
  105.     System::Integer __fastcall GetPageHeight(void);
  106.     System::Integer __fastcall GetPageWidth(void);
  107.     System::Integer __fastcall GetPrinterIndex(void);
  108.     void __fastcall SetPrinterCapabilities(System::Integer Value);
  109.     void __fastcall SetPrinterIndex(System::Integer Value);
  110.     Classes::TStrings *__fastcall GetPrinters(void);
  111.     void __fastcall SetNumCopies(System::Integer Value);
  112.     void __fastcall SetOrientation(TPrinterOrientation Value);
  113.     void __fastcall SetToDefaultPrinter(void);
  114.     void __fastcall CheckPrinting(System::Boolean Value);
  115.     void __fastcall FreePrinters(void);
  116.     void __fastcall FreeFonts(void);
  117.     
  118. public:
  119.     __fastcall TPrinter(void);
  120.     __fastcall virtual ~TPrinter(void);
  121.     void __fastcall Abort(void);
  122.     void __fastcall BeginDoc(void);
  123.     void __fastcall EndDoc(void);
  124.     void __fastcall NewPage(void);
  125.     void __fastcall GetPrinter(System::PChar ADevice, System::PChar ADriver, System::PChar APort, System::Integer 
  126.         &ADeviceMode);
  127.     void __fastcall SetPrinter(System::PChar ADevice, System::PChar ADriver, System::PChar APort, System::Integer 
  128.         ADeviceMode);
  129.     __property System::Boolean Aborted = {read=FAborted, nodefault};
  130.     __property Graphics::TCanvas * Canvas = {read=GetCanvas, nodefault};
  131.     __property TPrinterCapabilities Capabilities = {read=FCapabilities, nodefault};
  132.     __property System::Integer Copies = {read=GetNumCopies, write=SetNumCopies, nodefault};
  133.     __property Classes::TStrings * Fonts = {read=GetFonts, nodefault};
  134.     __property System::Integer Handle = {read=GetHandle, nodefault};
  135.     __property TPrinterOrientation Orientation = {read=GetOrientation, write=SetOrientation, nodefault}
  136.         ;
  137.     __property System::Integer PageHeight = {read=GetPageHeight, nodefault};
  138.     __property System::Integer PageWidth = {read=GetPageWidth, nodefault};
  139.     __property System::Integer PageNumber = {read=FPageNumber, nodefault};
  140.     __property System::Integer PrinterIndex = {read=GetPrinterIndex, write=SetPrinterIndex, nodefault};
  141.         
  142.     __property System::Boolean Printing = {read=FPrinting, nodefault};
  143.     __property Classes::TStrings * Printers = {read=GetPrinters, nodefault};
  144.     __property System::AnsiString Title = {read=FTitle, write=FTitle, nodefault};
  145. };
  146.  
  147. //-- var, const, procedure ---------------------------------------------------
  148. extern void __fastcall AssignPrn(System::TextFile &F);
  149. extern TPrinter *__fastcall Printer(void);
  150. extern TPrinter *__fastcall SetPrinter(TPrinter *NewPrinter);
  151. //-- template instantiations -------------------------------------------------
  152. template class TPrinterCapabilities ;
  153.  
  154. }    /* namespace Printers */
  155. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  156. using namespace Printers;
  157. #endif
  158. //-- end unit ----------------------------------------------------------------
  159. #endif    // Printers
  160.