home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / OWLINC.PAK / PRINTDIA.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  2.8 KB  |  90 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1992, 1993 by Borland International
  3. //   include\owl\printdia.cpp
  4. //   Implementation of Print and PrintSetup common Dialogs
  5. //   classes
  6. //----------------------------------------------------------------------------
  7. #if !defined(__OWL_PRINTDIA_H)
  8. #define __OWL_PRINTDIA_H
  9.  
  10. #if !defined(__COMMDIAL_H)
  11.   #include <owl\commdial.h>
  12. #endif
  13. #if !defined(__DC_H)
  14.   #include <owl\dc.h>
  15. #endif
  16.  
  17. class _OWLCLASS TPrintDialog : public TCommonDialog {
  18.   public:
  19.     class _OWLCLASS TData {
  20.       public:
  21.         DWORD           Flags;
  22.         DWORD           Error;
  23.         int             FromPage;
  24.         int             ToPage;
  25.         int             MinPage;
  26.         int             MaxPage;
  27.         int             Copies;
  28.  
  29.         TData();
  30.        ~TData();
  31.         void                Lock();
  32.         void                Unlock();
  33.         void                ClearDevMode();
  34.         const DEVMODE far*  GetDevMode() const {return DevMode;}
  35.         void                SetDevMode(const DEVMODE far* devMode);
  36.         void                ClearDevNames();
  37.         const DEVNAMES far* GetDevNames() const {return DevNames;}
  38.         const char far*     GetDriverName() const;
  39.         const char far*     GetDeviceName() const;
  40.         const char far*     GetOutputName() const;
  41.         void                SetDevNames(const char far* driver,
  42.                                         const char far* device,
  43.                                         const char far* output);
  44.         TPrintDC*           TransferDC();
  45.         
  46.         void*               Read(ipstream& is, uint32 version);
  47.         void                Write(opstream& os);
  48.  
  49.       private:
  50.         HGLOBAL       hDevMode;
  51.         HGLOBAL       hDevNames;
  52.         HDC           hDC;
  53.  
  54.         DEVMODE far*  DevMode;
  55.         DEVNAMES far* DevNames;
  56.  
  57.       friend class TPrintDialog;
  58.     };
  59.  
  60.     TPrintDialog(TWindow*        parent,
  61.                  TData&          data,
  62.                  const char far* printTemplateName = 0,
  63.                  const char far* setupTemplateName = 0,
  64.                  const char far* title = 0,
  65.                  TModule*        module = 0);
  66.                
  67.     BOOL       GetDefaultPrinter();
  68.  
  69.     int        DoExecute();
  70.  
  71.   protected:
  72.     PRINTDLG   pd;
  73.     TData&     Data;
  74.  
  75.     BOOL    DialogFunction(UINT message, WPARAM, LPARAM);
  76.  
  77.     // Default behavior inline for message response functions
  78.     //
  79.     void       CmSetup() {DefaultProcessing();} //EV_COMMAND(psh1, 
  80.  
  81.   private:
  82.     TPrintDialog(const TPrintDialog&);
  83.     TPrintDialog& operator=(const TPrintDialog&);
  84.  
  85.   DECLARE_RESPONSE_TABLE(TPrintDialog);
  86.   DECLARE_CASTABLE;
  87. };
  88.  
  89. #endif  // __OWL_PRINTDIA_H
  90.