Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.6 KiB

  1. #ifndef __PRNDLG_H_
  2. #define __PRNDLG_H_
  3. /*++
  4. Copyright (C) 1997-1999 Microsoft Corporation
  5. Module Name:
  6. prndlg.h
  7. Abstract:
  8. header file for prndlg.cpp
  9. Author:
  10. William Hsieh (williamh) created
  11. Revision History:
  12. --*/
  13. //
  14. // help topic ids
  15. //
  16. #define idh_devmgr_print_system 207325
  17. #define idh_devmgr_print_device 207326
  18. #define idh_devmgr_print_both 207265
  19. #define idh_devmgr_print_report 207324
  20. //
  21. // Report type mask
  22. //
  23. #define REPORT_TYPE_MASK_NONE 0x00
  24. #define REPORT_TYPE_MASK_SUMMARY 0x01
  25. #define REPORT_TYPE_MASK_CLASSDEVICE 0x02
  26. #define REPORT_TYPE_MASK_SUMMARY_CLASSDEVICE 0x04
  27. #define REPORT_TYPE_MASK_ALL 0x07
  28. typedef enum tagReportType
  29. {
  30. REPORT_TYPE_SUMMARY = 0,
  31. REPORT_TYPE_CLASSDEVICE,
  32. REPORT_TYPE_SUMMARY_CLASSDEVICE,
  33. REPORT_TYPE_UNKNOWN
  34. } REPORT_TYPE, *PREPORT_TYPE;
  35. class CPrintDialog
  36. {
  37. public:
  38. CPrintDialog()
  39. : m_hDlg(NULL), m_ReportType(REPORT_TYPE_UNKNOWN)
  40. {
  41. memset(&m_PrintDlg, 0, sizeof(m_PrintDlg));
  42. }
  43. ~CPrintDialog()
  44. {
  45. if (m_PrintDlg.hDevNames)
  46. GlobalFree(m_PrintDlg.hDevNames);
  47. if (m_PrintDlg.hDevMode)
  48. GlobalFree(m_PrintDlg.hDevMode);
  49. }
  50. BOOL PrintDlg(HWND hwndOwner, DWORD TypeEnableMask);
  51. HDC HDC()
  52. {
  53. return m_PrintDlg.hDC;
  54. }
  55. REPORT_TYPE ReportType()
  56. {
  57. return m_ReportType;
  58. }
  59. void SetReportType(REPORT_TYPE ReportType)
  60. {
  61. m_ReportType = ReportType;
  62. }
  63. DWORD GetTypeEnableMask()
  64. {
  65. return m_TypeEnableMask;
  66. }
  67. HWND m_hDlg;
  68. PRINTDLGEX m_PrintDlg;
  69. private:
  70. DWORD m_TypeEnableMask;
  71. REPORT_TYPE m_ReportType;
  72. };
  73. class CDevMgrPrintDialogCallback : public IPrintDialogCallback
  74. {
  75. public:
  76. CDevMgrPrintDialogCallback() :m_Ref(0), m_pPrintDialog(NULL)
  77. {}
  78. // IUNKNOWN interface
  79. STDMETHOD_(ULONG, AddRef)();
  80. STDMETHOD_(ULONG, Release)();
  81. STDMETHOD(QueryInterface)(REFIID riid, void** ppv);
  82. // IPrintDialogCallback interface
  83. STDMETHOD(InitDone) (THIS);
  84. STDMETHOD(SelectionChange) (THIS);
  85. STDMETHOD(HandleMessage) (THIS_ HWND hDlg, UINT uMsg, WPARAM wParam,
  86. LPARAM lParam, LRESULT *pResult);
  87. CPrintDialog *m_pPrintDialog;
  88. private:
  89. BOOL OnInitDialog(HWND hWnd);
  90. UINT_PTR OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
  91. BOOL OnHelp(LPHELPINFO pHelpInfo);
  92. BOOL OnContextMenu(HWND hWnd, WORD xPos, WORD yPos, WPARAM wParam);
  93. ULONG m_Ref;
  94. };
  95. #endif