Leaked source code of windows server 2003
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.

95 lines
1.9 KiB

  1. #ifndef __PRINTER_H_
  2. #define __PRINTER_H_
  3. /*++
  4. Copyright (C) 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. {}
  27. ~CPrinter()
  28. {
  29. if (m_hDC) {
  30. DeleteDC(m_hDC);
  31. }
  32. }
  33. int StartDoc(LPCTSTR DocTitle);
  34. int EndDoc();
  35. int AbortDoc();
  36. int PrintLine(LPCTSTR Text);
  37. int FlushPage();
  38. void Indent()
  39. {
  40. m_Indent++;
  41. }
  42. void UnIndent()
  43. {
  44. if (m_Indent) {
  45. m_Indent--;
  46. }
  47. }
  48. void SetPageTitle(int TitleId)
  49. {
  50. m_strPageTitle.LoadString(g_hInstance, TitleId);
  51. }
  52. void LineFeed();
  53. int PrintAll(CMachine& Machine);
  54. int PrintSystemSummary();
  55. int PrintResourceSummary(CMachine& Machine);
  56. int PrintAllClassAndDevice(CMachine* pMachine);
  57. int PrintClass(CClass* pClass, BOOL PrintBanner = TRUE);
  58. int PrintDevice(CDevice* pDevice, BOOL PrintBanner = TRUE);
  59. int PrintDeviceDriver(CDevice* pDevice);
  60. int PrintDeviceResource(CDevice* pDevice);
  61. int PrintResourceSubtree(CResource* pRes);
  62. static BOOL s_UserAborted;
  63. static HWND s_hCancelDlg;
  64. private:
  65. HDC m_hDC;
  66. HWND m_hwndOwner;
  67. DWORD m_xChar;
  68. DWORD m_yChar;
  69. DWORD m_xMargin;
  70. DWORD m_yTopMargin;
  71. DWORD m_yBottomMargin;
  72. DWORD m_CurLine;
  73. DWORD m_CurPage;
  74. int m_Indent;
  75. String m_strPageTitle;
  76. int m_Status;
  77. CPrintCancelDialog m_CancelDlg;
  78. };
  79. #endif