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.

70 lines
2.0 KiB

  1. // Printer.h: interface for the CPrinter class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #ifndef _PRINTER_H
  5. #define _PRINTER_H
  6. /***********************************************\
  7. * Define - ULOFFSET
  8. *
  9. * Description - This gives the offset into a data structure
  10. \***********************************************/
  11. #define ULOFFSET(type, identifier) ((ULONG_PTR)&(((type)0)->identifier))
  12. class CPrinter
  13. {
  14. public:
  15. DWORD GetWaitingTime();
  16. BOOL GetJobEtaData (DWORD &, DWORD &, DWORD &, DWORD &);
  17. LPTSTR GetPrinterWebUrl();
  18. LPTSTR GetOemUrl(LPTSTR & pszManufactureName);
  19. PPRINTER_INFO_2 GetPrinterInfo2 ();
  20. BOOL CalJobEta();
  21. BOOL Open (LPTSTR pPrinterName, LPHANDLE phPrinter = NULL);
  22. CPrinter();
  23. virtual ~CPrinter();
  24. private:
  25. enum DriverData {
  26. OEMUrlPattern = 0,
  27. HardwareID,
  28. Manufacturer,
  29. LastDriverData // This must always be the last member of the Enum.
  30. };
  31. PDRIVER_INFO_6 GetDriverInfo6 ();
  32. BOOL AllocGetPrinterInfo2();
  33. BOOL AllocGetPrinterInfo4();
  34. BOOL AllocGetDriverInfo6();
  35. DWORD GetPPM();
  36. DWORD GetWaitingMinutes(DWORD dwPPM, PJOB_INFO_2 pJobInfo, DWORD dwNumJob);
  37. BOOL GetDriverData(DriverData dwDriverData, LPTSTR &pszData);
  38. BOOL ParseUrlPattern(LPTSTR pSrc, LPTSTR pDest, DWORD &dwDestLen);
  39. HANDLE m_hPrinter;
  40. PPRINTER_INFO_2 m_pInfo2;
  41. PPRINTER_INFO_4 m_pInfo4;
  42. PDRIVER_INFO_6 m_pDriverInfo6;
  43. BOOL m_bCalcJobETA;
  44. DWORD m_dwPendingJobCount;
  45. DWORD m_dwAvgJobSize;
  46. DWORD m_dwJobCompletionMinute;
  47. DWORD m_dwAvgJobSizeUnit;
  48. LPTSTR m_pszUrlBuffer;
  49. LPTSTR m_pszOemUrl;
  50. LPTSTR m_pszManufacturer;
  51. };
  52. #else
  53. class CPrinter;
  54. #endif