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.

232 lines
8.3 KiB

  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright 2001 - 2003 Microsoft Corporation. All Rights Reserved.
  7. //
  8. // FILE: Helper.h
  9. //
  10. //
  11. // PURPOSE: Defines wrapper class for Driver UI Helper Interface.
  12. //
  13. //
  14. // PLATFORMS:
  15. // Windows 2000, Windows XP, Windows Server 2003
  16. //
  17. //
  18. #ifndef _HELPER_H
  19. #define _HELPER_H
  20. #include "precomp.h"
  21. class CUIHelper
  22. {
  23. private:
  24. IUnknown *m_pUIHelper; // pointer to Driver UI's Helper interface
  25. IID m_iidUIHelper; // Driver UI's Helper interface IID
  26. public:
  27. CUIHelper();
  28. CUIHelper(const IID &HelperIID, PVOID pHelper);
  29. virtual ~CUIHelper();
  30. inline BOOL IsValid() {return NULL != m_pUIHelper;}
  31. void Assign(const IID &HelperIID, PVOID pHelper);
  32. ULONG Release();
  33. //
  34. // IPrintOemDriverUI methods
  35. //
  36. //
  37. // Helper function to get driver settings. This function is only supported
  38. // for UI plugins that do not fully replace core driver's standard UI.
  39. //
  40. STDMETHOD(DrvGetDriverSetting) (THIS_
  41. PVOID pci,
  42. PCSTR Feature,
  43. PVOID pOutput,
  44. DWORD cbSize,
  45. PDWORD pcbNeeded,
  46. PDWORD pdwOptionsReturned
  47. );
  48. //
  49. // Helper function to allow OEM plugins upgrade private registry
  50. // settings. This function is supported for any UI plugins and should be
  51. // called only by OEM's UpgradePrinter.
  52. //
  53. STDMETHOD(DrvUpgradeRegistrySetting) (THIS_
  54. HANDLE hPrinter,
  55. PCSTR pFeature,
  56. PCSTR pOption
  57. );
  58. //
  59. // Helper function to allow OEM plugins to update the driver UI settings.
  60. // This function is only supported for UI plugins that do not fully replace
  61. // core driver's standard UI. It should be called only when the UI is present.
  62. //
  63. STDMETHOD(DrvUpdateUISetting) (THIS_
  64. PVOID pci,
  65. PVOID pOptItem,
  66. DWORD dwPreviousSelection,
  67. DWORD dwMode
  68. );
  69. //
  70. // IPrintCoreUI2 new methods
  71. //
  72. //
  73. // Following four helper functions are only supported for UI plugins that fully
  74. // replace core driver's standard UI. They should only be called by the UI plugin's
  75. // DocumentPropertySheets, DevicePropertySheets and their property sheet callback
  76. // functions.
  77. //
  78. // Helper function to retrieve driver's current setting as a list of
  79. // feature/option keyword pairs.
  80. //
  81. STDMETHOD(GetOptions) (THIS_
  82. IN POEMUIOBJ poemuiobj,
  83. IN DWORD dwFlags,
  84. IN PCSTR pmszFeaturesRequested,
  85. IN DWORD cbIn,
  86. OUT PSTR pmszFeatureOptionBuf,
  87. IN DWORD cbSize,
  88. OUT PDWORD pcbNeeded);
  89. //
  90. // Helper function to change driver's setting using a list of feature/option
  91. // keyword pairs.
  92. //
  93. STDMETHOD(SetOptions) (THIS_
  94. IN POEMUIOBJ poemuiobj,
  95. IN DWORD dwFlags,
  96. IN PCSTR pmszFeatureOptionBuf,
  97. IN DWORD cbIn,
  98. OUT PDWORD pdwResult);
  99. //
  100. // Helper function to retrieve the option(s) of a given feature that are
  101. // constrained in driver's current setting.
  102. //
  103. STDMETHOD(EnumConstrainedOptions) (THIS_
  104. IN POEMUIOBJ poemuiobj,
  105. IN DWORD dwFlags,
  106. IN PCSTR pszFeatureKeyword,
  107. OUT PSTR pmszConstrainedOptionList,
  108. IN DWORD cbSize,
  109. OUT PDWORD pcbNeeded);
  110. //
  111. // Helper function to retrieve a list of feature/option keyword pairs from
  112. // driver's current setting that conflict with the given feature/option pair.
  113. //
  114. STDMETHOD(WhyConstrained) (THIS_
  115. IN POEMUIOBJ poemuiobj,
  116. IN DWORD dwFlags,
  117. IN PCSTR pszFeatureKeyword,
  118. IN PCSTR pszOptionKeyword,
  119. OUT PSTR pmszReasonList,
  120. IN DWORD cbSize,
  121. OUT PDWORD pcbNeeded);
  122. //
  123. // Following five helper functions are supported for any UI plugins.
  124. //
  125. // Helper function to retrieve global attribute.
  126. //
  127. STDMETHOD(GetGlobalAttribute) (THIS_
  128. IN POEMUIOBJ poemuiobj,
  129. IN DWORD dwFlags,
  130. IN PCSTR pszAttribute,
  131. OUT PDWORD pdwDataType,
  132. OUT PBYTE pbData,
  133. IN DWORD cbSize,
  134. OUT PDWORD pcbNeeded);
  135. //
  136. // Helper function to retrieve attribute of a given feature.
  137. //
  138. STDMETHOD(GetFeatureAttribute) (THIS_
  139. IN POEMUIOBJ poemuiobj,
  140. IN DWORD dwFlags,
  141. IN PCSTR pszFeatureKeyword,
  142. IN PCSTR pszAttribute,
  143. OUT PDWORD pdwDataType,
  144. OUT PBYTE pbData,
  145. IN DWORD cbSize,
  146. OUT PDWORD pcbNeeded);
  147. //
  148. // Helper function to retrieve attribute of a given feature/option selection.
  149. //
  150. STDMETHOD(GetOptionAttribute) (THIS_
  151. IN POEMUIOBJ poemuiobj,
  152. IN DWORD dwFlags,
  153. IN PCSTR pszFeatureKeyword,
  154. IN PCSTR pszOptionKeyword,
  155. IN PCSTR pszAttribute,
  156. OUT PDWORD pdwDataType,
  157. OUT PBYTE pbData,
  158. IN DWORD cbSize,
  159. OUT PDWORD pcbNeeded);
  160. //
  161. // Helper function to retrieve the list of feature keyword.
  162. //
  163. STDMETHOD(EnumFeatures) (THIS_
  164. IN POEMUIOBJ poemuiobj,
  165. IN DWORD dwFlags,
  166. OUT PSTR pmszFeatureList,
  167. IN DWORD cbSize,
  168. OUT PDWORD pcbNeeded);
  169. //
  170. // Helper function to retrieve the list of options keyword of a given feature.
  171. //
  172. STDMETHOD(EnumOptions) (THIS_
  173. IN POEMUIOBJ poemuiobj,
  174. IN DWORD dwFlags,
  175. IN PCSTR pszFeatureKeyword,
  176. OUT PSTR pmszOptionList,
  177. IN DWORD cbSize,
  178. OUT PDWORD pcbNeeded);
  179. //
  180. // Helper function to query system simulation support
  181. //
  182. STDMETHOD(QuerySimulationSupport) (THIS_
  183. IN HANDLE hPrinter,
  184. IN DWORD dwLevel,
  185. OUT PBYTE pCaps,
  186. IN DWORD cbSize,
  187. OUT PDWORD pcbNeeded);
  188. private:
  189. void Clear();
  190. };
  191. #endif