home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / ui / printjob.h < prev    next >
C/C++ Source or Header  |  1995-04-09  |  3KB  |  100 lines

  1.  
  2. #ifndef _printjob_h_ /* Wed Jan 18 21:09:15 1995 */
  3. #define _printjob_h_
  4.  
  5.  
  6.  
  7. /*
  8.  *
  9.  *          Copyright (C) 1994, M. A. Sridhar
  10.  *  
  11.  *
  12.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  13.  *     to copy, modify or distribute this software  as you see fit,
  14.  *     and to use  it  for  any  purpose, provided   this copyright
  15.  *     notice and the following   disclaimer are included  with all
  16.  *     copies.
  17.  *
  18.  *                        DISCLAIMER
  19.  *
  20.  *     The author makes no warranties, either expressed or implied,
  21.  *     with respect  to  this  software, its  quality, performance,
  22.  *     merchantability, or fitness for any particular purpose. This
  23.  *     software is distributed  AS IS.  The  user of this  software
  24.  *     assumes all risks  as to its quality  and performance. In no
  25.  *     event shall the author be liable for any direct, indirect or
  26.  *     consequential damages, even if the  author has been  advised
  27.  *     as to the possibility of such damages.
  28.  *
  29.  */
  30.  
  31. // Author: M. A. Sridhar
  32. // Date: Jan 19, 1995
  33.  
  34. // A PrintJob is a DrawingSurface whose commands draw on pages to be sent to
  35. // the system printer. Each PrintJob is made up of one or more pages; any of
  36. // the drawing operations can be invoked on it to draw on the current page.
  37. // The {\tt StartNewPage} method terminates the 
  38. // current page  and starts a new page. When the PrintJob object is destroyed,
  39. // it is spooled to the system's printer.
  40. //
  41. // THIS IMPLEMENTATION IS CURRENTLY AVAILABLE ONLY UNDER MICROSOFT WINDOWS.
  42.  
  43.  
  44.  
  45. #if defined(__GNUC__)
  46. #pragma interface
  47. #endif
  48.  
  49.  
  50. #include "ui/dwgsurf.h"
  51.  
  52. class CL_EXPORT UI_PrintJob: public UI_DrawingSurface {
  53.  
  54. public:
  55.     UI_PrintJob (const char* jobName = "");
  56.     // Start a new job with the given name.
  57.     
  58.     ~UI_PrintJob ();
  59.     // Finish the job.
  60.  
  61.     bool StartNewPage ();
  62.     // Start a new page.
  63.  
  64.     // 
  65.     // Query:
  66.     //     
  67.  
  68.     double HorzPixelsPerMM () const;
  69.     // Return the number of pixels per millimeter in the horizontal direction.
  70.  
  71.     double VertPixelsPerMM () const;
  72.     // Return the number of pixels per millimeter in the vertical direction.
  73.  
  74.     UI_Rectangle DrawingArea() const;
  75.     // Returns the rectangle enclosing the print page, in pixels. The
  76.     // origin is (0, 0).
  77.  
  78.     UI_Rectangle DrawingAreaInMM () const;
  79.     // Returns the drawing area, in millimeters. The origin is (0, 0).
  80.  
  81.     bool SupportsColor () const;
  82.     // Override inherited method.
  83.     
  84.     bool DrawBitmap (const UI_Bitmap& b, const UI_Point& topLeft);
  85.     // Draw the given bitmap on this surface.
  86.  
  87.  
  88. protected:
  89.     double           _horzPPM;
  90.     double           _vertPPM;
  91.  
  92. #if defined(__OS2__)
  93.     HDC              _printDC;
  94.     SIZEL            _drawingArea;
  95. #endif
  96. };
  97.  
  98.  
  99. #endif /* _printjob_h_ */
  100.