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.

284 lines
5.6 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1996 - 1999
  3. All rights reserved.
  4. Module Name:
  5. drvsetup.hxx
  6. Abstract:
  7. Printer driver setup class header.
  8. Author:
  9. Steve Kiraly (SteveKi) 13-Dec-1996
  10. Revision History:
  11. --*/
  12. #ifndef _DRVSETUP_HXX
  13. #define _DRVSETUP_HXX
  14. /********************************************************************
  15. Printer Driver installation class.
  16. ********************************************************************/
  17. class TPrinterDriverInstallation {
  18. public:
  19. enum {
  20. kDefault = -1,
  21. };
  22. enum EStatusCode {
  23. kSuccess,
  24. kCancel,
  25. kError,
  26. };
  27. typedef BOOL ( *pfDownloadIsInternetAvailable )( VOID );
  28. TPrinterDriverInstallation::
  29. TPrinterDriverInstallation(
  30. IN LPCTSTR pszServerName = NULL,
  31. IN HWND hwnd = NULL
  32. );
  33. TPrinterDriverInstallation::
  34. ~TPrinterDriverInstallation(
  35. VOID
  36. );
  37. BOOL
  38. TPrinterDriverInstallation::
  39. bValid(
  40. VOID
  41. ) const;
  42. EStatusCode
  43. TPrinterDriverInstallation::
  44. ePromptForDriverSelection(
  45. VOID
  46. );
  47. BOOL
  48. TPrinterDriverInstallation::
  49. bSetDriverName(
  50. IN const TString &strDriverName
  51. );
  52. BOOL
  53. TPrinterDriverInstallation::
  54. bGetDriverName(
  55. IN TString &strDriverName
  56. ) const;
  57. BOOL
  58. TPrinterDriverInstallation::
  59. bSetSourcePath(
  60. IN const LPCTSTR pszSourcePath,
  61. IN const BOOL bClearSourcePath = FALSE
  62. );
  63. BOOL
  64. TPrinterDriverInstallation::
  65. bIsDriverInstalled(
  66. IN const DWORD dwDriverVersion = kDefault,
  67. IN const BOOL bKernelModeCompatible = FALSE
  68. ) const;
  69. INT
  70. TPrinterDriverInstallation::
  71. IsDriverInstalledForInf(
  72. IN const DWORD dwDriverVersion = kDefault,
  73. IN const BOOL bKernelModeCompatible = FALSE
  74. ) const;
  75. BOOL
  76. TPrinterDriverInstallation::
  77. bInstallDriver(
  78. OUT TString *pstrNewDriverName,
  79. IN BOOL bOfferReplacement,
  80. IN const BOOL bInstallFromWeb = kDefault,
  81. IN const HWND hDlg = NULL,
  82. IN const DWORD dwDriverVersion = kDefault,
  83. IN const DWORD dwAddDrvFlags = kDefault,
  84. IN const BOOL bUpdateDriver = kDefault,
  85. IN const BOOL bIgnoreSelectDriverFailure = kDefault
  86. );
  87. VOID
  88. TPrinterDriverInstallation::
  89. vPrinterAdded(
  90. IN const TString &strFullPrinterName
  91. );
  92. BOOL
  93. TPrinterDriverInstallation::
  94. bGetDriverSetupPage(
  95. IN OUT HPROPSHEETPAGE *pPage,
  96. IN LPCTSTR pszTitle = NULL,
  97. IN LPCTSTR pszSubTitle = NULL,
  98. IN LPCTSTR pszInstrn = NULL
  99. );
  100. BOOL
  101. TPrinterDriverInstallation::
  102. bSetWebMode(
  103. IN BOOL bWebButtonOn
  104. );
  105. BOOL
  106. TPrinterDriverInstallation::
  107. bGetSelectedDriver(
  108. const BOOL bForceReselection = FALSE
  109. );
  110. BOOL
  111. TPrinterDriverInstallation::
  112. bSelectDriverFromInf(
  113. IN LPCTSTR pszInfName,
  114. IN BOOL bBuildFromPath = TRUE
  115. );
  116. static
  117. BOOL
  118. TPrinterDriverInstallation::
  119. bIsCodeDownLoadAvailable(
  120. VOID
  121. );
  122. BOOL
  123. TPrinterDriverInstallation::
  124. bGetPrintProcessor(
  125. IN TString &strPrintProcessor
  126. ) const;
  127. BOOL
  128. TPrinterDriverInstallation::
  129. bGetCurrentDriverEncode(
  130. IN DWORD *pdwEncode
  131. ) const;
  132. DWORD
  133. TPrinterDriverInstallation::
  134. dwGetCurrentDriverVersion(
  135. ) const;
  136. BOOL
  137. TPrinterDriverInstallation::
  138. bGetSelectedInfName(
  139. IN TString &strInfName
  140. ) const;
  141. BOOL
  142. TPrinterDriverInstallation::
  143. bIsOemDriver(
  144. VOID
  145. ) const;
  146. BOOL
  147. TPrinterDriverInstallation::
  148. bShowOem(
  149. IN BOOL bShowOem
  150. );
  151. BOOL
  152. TPrinterDriverInstallation::
  153. bRefreshDriverList(
  154. VOID
  155. );
  156. HWND
  157. TPrinterDriverInstallation::
  158. hGetHwnd(
  159. VOID
  160. ) const;
  161. VOID
  162. TPrinterDriverInstallation::
  163. SetInstallFlags(
  164. DWORD dwInstallFlags
  165. );
  166. DWORD
  167. TPrinterDriverInstallation::
  168. GetInstallFlags(
  169. VOID
  170. ) const;
  171. BOOL
  172. TPrinterDriverInstallation::
  173. bSetDriverSetupPageTitle(
  174. IN LPCTSTR pszTitle,
  175. IN LPCTSTR pszSubTitle,
  176. IN LPCTSTR pszInstrn
  177. );
  178. private:
  179. //
  180. // Copying and assignment are not defined.
  181. //
  182. TPrinterDriverInstallation::
  183. TPrinterDriverInstallation(
  184. const TPrinterDriverInstallation &rhs
  185. );
  186. TPrinterDriverInstallation &
  187. TPrinterDriverInstallation::
  188. operator =(
  189. TPrinterDriverInstallation &rhs
  190. );
  191. BOOL
  192. TPrinterDriverInstallation::
  193. bSelectDriver(
  194. IN BOOL bFromName = FALSE
  195. );
  196. BOOL
  197. TPrinterDriverInstallation::
  198. bIsDriverSelected(
  199. VOID
  200. ) const;
  201. VOID
  202. TPrinterDriverInstallation::
  203. vReleaseSelectedDriver(
  204. VOID
  205. );
  206. BOOL
  207. TPrinterDriverInstallation::
  208. bValidateSourcePath(
  209. IN LPCTSTR pszSourcePath
  210. ) const;
  211. OSVERSIONINFO *
  212. pGetOsVersionInfo(
  213. VOID
  214. );
  215. TString _strServerName;
  216. TString _strDriverName;
  217. HWND _hwnd;
  218. BOOL _bValid;
  219. DWORD _dwDriverVersion;
  220. LPTSTR _pszServerName;
  221. HDEVINFO _hSetupDrvSetupParams;
  222. HANDLE _hSelectedDrvInfo;
  223. TPSetup _PSetup;
  224. TString _strSourcePath;
  225. OSVERSIONINFO _OsVersionInfo;
  226. DWORD _dwInstallFlags;
  227. };
  228. #endif