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.

97 lines
2.0 KiB

  1. #ifndef __PRINTER_H_
  2. #define __PRINTER_H_
  3. /*++
  4. Copyright (C) 1997-1999 Microsoft Corporation
  5. Module Name:
  6. printer.h
  7. Abstract:
  8. header file for printer.cpp
  9. Author:
  10. William Hsieh (williamh) created
  11. Revision History:
  12. --*/
  13. class CPrintCancelDialog : public CDialog
  14. {
  15. public:
  16. CPrintCancelDialog() : CDialog(IDD_PRINT_CANCEL)
  17. {}
  18. virtual void OnCommand(WPARAM wParam, LPARAM lParam);
  19. };
  20. static BOOL CALLBACK AbortPrintProc(HDC hDC, int Code);
  21. class CPrinter
  22. {
  23. public:
  24. CPrinter(HWND hwndOwner, HDC hDC);
  25. CPrinter() : m_hDC(NULL), m_hwndOwner(NULL),
  26. m_hLogFile(INVALID_HANDLE_VALUE)
  27. {}
  28. ~CPrinter()
  29. {
  30. if (m_hDC)
  31. DeleteDC(m_hDC);
  32. if (INVALID_HANDLE_VALUE != m_hLogFile)
  33. CloseHandle(m_hLogFile);
  34. }
  35. int StartDoc(LPCTSTR DocTitle);
  36. int EndDoc();
  37. int AbortDoc();
  38. int PrintLine(LPCTSTR Text);
  39. int FlushPage();
  40. void Indent()
  41. {
  42. m_Indent++;
  43. }
  44. void UnIndent()
  45. {
  46. if (m_Indent)
  47. m_Indent--;
  48. }
  49. void SetPageTitle(int TitleId)
  50. {
  51. m_strPageTitle.LoadString(g_hInstance, TitleId);
  52. }
  53. void LineFeed();
  54. int PrintAll(CMachine& Machine);
  55. int PrintSystemSummary(CMachine& Machine);
  56. int PrintResourceSummary(CMachine& Machine);
  57. int PrintAllClassAndDevice(CMachine* pMachine);
  58. int PrintClass(CClass* pClass, BOOL PrintBanner = TRUE);
  59. int PrintDevice(CDevice* pDevice, BOOL PrintBanner = TRUE);
  60. int PrintDeviceDriver(CDevice* pDevice);
  61. int PrintDeviceResource(CDevice* pDevice);
  62. int PrintResourceSubtree(CResource* pRes);
  63. static BOOL s_UserAborted;
  64. static HWND s_hCancelDlg;
  65. private:
  66. HDC m_hDC;
  67. HWND m_hwndOwner;
  68. HANDLE m_hLogFile;
  69. DWORD m_xChar;
  70. DWORD m_yChar;
  71. DWORD m_xMargin;
  72. DWORD m_yTopMargin;
  73. DWORD m_yBottomMargin;
  74. DWORD m_CurLine;
  75. DWORD m_CurPage;
  76. int m_Indent;
  77. String m_strPageTitle;
  78. int m_Status;
  79. CPrintCancelDialog m_CancelDlg;
  80. };
  81. #endif