home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WPRTDLG.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  6KB  |  184 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. #ifndef _WPRTDLG_HPP_INCLUDED
  12. #define _WPRTDLG_HPP_INCLUDED
  13.  
  14. #ifndef _WNO_PRAGMA_PUSH
  15. #pragma pack(push,8);
  16. #pragma enum int;
  17. #endif
  18.  
  19. #ifndef _WCANVAS_HPP_INCLUDED
  20. #  include "wcanvas.hpp"
  21. #endif
  22. #ifndef _WCOMDLG_HPP_INCLUDED
  23. #  include "wcomdlg.hpp"
  24. #endif
  25. #ifndef _WPRTDATA_HPP_INCLUDED
  26. #  include "wprtdata.hpp"
  27. #endif
  28.  
  29. #undef GetPrinterData
  30. #undef SetPrinterData
  31. #if defined( _UNICODE )
  32. #define GetPrinterData GetPrinterDataW
  33. #define SetPrinterData SetPrinterDataW
  34. #else
  35. #define GetPrinterData GetPrinterDataA
  36. #define SetPrinterData SetPrinterDataA
  37. #endif
  38.  
  39. //
  40. // PrintDialog Styles
  41. //
  42.  
  43. typedef WULong WPrintDStyle;
  44.  
  45. #define WPrintDSAllPages                    ((WPrintDStyle)0x00000000L)
  46. #define WPrintDSSelection                   ((WPrintDStyle)0x00000001L)
  47. #define WPrintDSPageNums                    ((WPrintDStyle)0x00000002L)
  48. #define WPrintDSNoSelection                 ((WPrintDStyle)0x00000004L)
  49. #define WPrintDSNoPageNums                  ((WPrintDStyle)0x00000008L)
  50. #define WPrintDSCollate                     ((WPrintDStyle)0x00000010L)
  51. #define WPrintDSPrintToFile                 ((WPrintDStyle)0x00000020L)
  52. #define WPrintDSPrintSetup                  ((WPrintDStyle)0x00000040L)
  53. #define WPrintDSNoWarning                   ((WPrintDStyle)0x00000080L)
  54. #define WPrintDSReturnDC                    ((WPrintDStyle)0x00000100L)
  55. #define WPrintDSReturnIC                    ((WPrintDStyle)0x00000200L)
  56. #define WPrintDSReturnDefault               ((WPrintDStyle)0x00000400L)
  57. #define WPrintDSShowHelp                    ((WPrintDStyle)0x00000800L)
  58. #define WPrintDSEnablePrintHook             ((WPrintDStyle)0x00001000L)
  59. #define WPrintDSEnablePrintTemplate         ((WPrintDStyle)0x00004000L)
  60. #define WPrintDSUseDevModeCopies            ((WPrintDStyle)0x00040000L)
  61. #define WPrintDSUseDevModeCopiesAndCollate  ((WPrintDStyle)0x00040000L)
  62. #define WPrintDSDisablePrintToFile          ((WPrintDStyle)0x00080000L)
  63. #define WPrintDSHidePrintToFile             ((WPrintDStyle)0x00100000L)
  64. #define WPrintDSNoNetworkButton             ((WPrintDStyle)0x00200000L)
  65.  
  66. //
  67. // WPrintDialog
  68. //
  69. //    Used to display color dialog.
  70.  
  71. class WCMCLASS WPrintDialog : public WCommonDialog {
  72.     WDeclareSubclass( WPrintDialog, WCommonDialog );
  73.  
  74.     public:
  75.         WPrintDialog();
  76.  
  77.         ~WPrintDialog();
  78.  
  79.         /*******************************************************
  80.          * Properties
  81.          *******************************************************/
  82.  
  83.         // Copies
  84.  
  85.         WUShort GetCopies() const;
  86.         WBool   SetCopies( WUShort numCopies );
  87.  
  88.         // Collate
  89.         //
  90.         //
  91.         void    SetCollate(WBool bCollate = FALSE);
  92.  
  93.         // FirstPage
  94.  
  95.         WUShort GetFirstPage() const;
  96.         WBool   SetFirstPage( WUShort firstPage );
  97.  
  98.         // FromPage
  99.  
  100.         WUShort GetFromPage() const;
  101.         WBool   SetFromPage( WUShort fromPage );
  102.  
  103.         // InfoCanvas
  104.  
  105.         WInfoCanvas GetInfoCanvas() const;
  106.  
  107.         // LastPage
  108.  
  109.         WUShort GetLastPage() const;
  110.         WBool   SetLastPage( WUShort lastPage );
  111.  
  112.         // PrinterData
  113.         //
  114.         //    The data that defines which printer is chosen and
  115.         //    its currennt settings (landscape, etc.).  A copy is made
  116.         //    when setting.
  117.  
  118.         WPrinterData GetPrinterData() const;
  119.         WBool        SetPrinterData( const WPrinterData & pd );
  120.  
  121.         // PrinterCanvas
  122.  
  123.         WPrinterCanvas GetPrinterCanvas() const;
  124.  
  125.         // Style
  126.         //
  127.         //    Set the styles used by the print dialog.  Note that
  128.         //    the WPrintDSEnableHook style will ALWAYS be enabled.
  129.  
  130.         WPrintDStyle GetStyle() const;
  131.         WBool        SetStyle( WPrintDStyle style );
  132.  
  133.         // ToPage
  134.  
  135.         WUShort GetToPage() const;
  136.         WBool   SetToPage( WUShort toPage );
  137.  
  138.         /*******************************************************
  139.          * Methods
  140.          *******************************************************/
  141.  
  142.         // ChangeStyle
  143.         //
  144.         //    Use to turn a specific style on or off.
  145.  
  146.         WBool ChangeStyle( WPrintDStyle style, WBool on );
  147.  
  148.         // Prompt
  149.         //
  150.         //    Display the dialog and wait for it to be dismissed.
  151.         //    The first form uses the current settings.  The second
  152.         //    is a convenience function.
  153.  
  154.         WBool Prompt();
  155.  
  156.         WBool Prompt( WWindow *owner, const WChar *title );
  157.  
  158.         /************************************************************
  159.          * Notifications
  160.          ************************************************************/
  161.  
  162.         void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
  163.  
  164.     private:
  165.  
  166.         void  *PackPD();
  167.         WBool  UnpackPD( WBool ok );
  168.  
  169.     private:
  170.  
  171.         void           *_pd;
  172.         WPrinterCanvas  _printerCanvas;
  173.         WInfoCanvas     _infoCanvas;
  174.         WPrinterData    _printerData;
  175. };
  176.  
  177.  
  178. #ifndef _WNO_PRAGMA_PUSH
  179. #pragma enum pop;
  180. #pragma pack(pop);
  181. #endif
  182.  
  183. #endif // _WPRTDLG_HPP_INCLUDED
  184.