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.

402 lines
9.2 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. All rights reserved.
  4. Module Name:
  5. shellext.hxx
  6. Abstract:
  7. Printer shell extension header.
  8. Author:
  9. Steve Kiraly (SteveKi) 02-Feb-1997
  10. Revision History:
  11. --*/
  12. #ifndef _SHELLEXT_HXX
  13. #define _SHELLEXT_HXX
  14. /********************************************************************
  15. TClassFactory defines a shell extension class factory object.
  16. ********************************************************************/
  17. QITABLE_DECLARE(TClassFactory)
  18. class TClassFactory: public CUnknownMT<QITABLE_GET(TClassFactory)>, // MT impl. of IUnknown
  19. public IClassFactory
  20. {
  21. public:
  22. TClassFactory(
  23. VOID
  24. );
  25. ~TClassFactory(
  26. VOID
  27. );
  28. //
  29. // IUnknown methods
  30. //
  31. IMPLEMENT_IUNKNOWN()
  32. //
  33. // IClassFactory methods
  34. //
  35. STDMETHODIMP
  36. CreateInstance(
  37. LPUNKNOWN,
  38. REFIID,
  39. LPVOID *
  40. );
  41. STDMETHODIMP
  42. LockServer(
  43. BOOL
  44. );
  45. };
  46. /********************************************************************
  47. TShellExtension defines the context menu shell extension object.
  48. ********************************************************************/
  49. QITABLE_DECLARE(TShellExtension)
  50. class TShellExtension: public CUnknownMT<QITABLE_GET(TShellExtension)>, // MT impl. of IUnknown
  51. public IShellExtInit,
  52. public IContextMenu,
  53. public IShellPropSheetExt,
  54. public IDsFolderProperties,
  55. public IDsPrinterProperties,
  56. public IFindPrinter,
  57. public IPhysicalLocation,
  58. public IPrnStream,
  59. public IStream,
  60. public IPrintUIServices
  61. {
  62. public:
  63. TShellExtension(
  64. VOID
  65. );
  66. ~TShellExtension(
  67. VOID
  68. );
  69. //
  70. // IUnknown methods
  71. //
  72. IMPLEMENT_IUNKNOWN()
  73. protected:
  74. LPDATAOBJECT _lpdobj;
  75. public:
  76. /********************************************************************
  77. IShellExtInit member functions.
  78. ********************************************************************/
  79. STDMETHODIMP
  80. Initialize(
  81. LPCITEMIDLIST pidlFolder,
  82. LPDATAOBJECT lpdobj,
  83. HKEY hKeyProgID
  84. );
  85. public:
  86. /********************************************************************
  87. IShellPropSheetExt member functions.
  88. ********************************************************************/
  89. STDMETHODIMP
  90. AddPages(
  91. LPFNADDPROPSHEETPAGE lpfnAddPage,
  92. LPARAM lParam
  93. );
  94. STDMETHODIMP
  95. ReplacePage(
  96. UINT uPageID,
  97. LPFNADDPROPSHEETPAGE lpfnReplaceWith,
  98. LPARAM lParam
  99. );
  100. private:
  101. TLocationPropertySheetFrontEnd *_pLocationPropertySheet;
  102. /********************************************************************
  103. IContextMenu member functions.
  104. ********************************************************************/
  105. public:
  106. STDMETHODIMP
  107. QueryContextMenu(
  108. HMENU hMenu,
  109. UINT indexMenu,
  110. UINT idCmdFirst,
  111. UINT idCmdLast,
  112. UINT uFlags
  113. );
  114. STDMETHODIMP
  115. InvokeCommand(
  116. LPCMINVOKECOMMANDINFO lpcmi
  117. );
  118. STDMETHODIMP
  119. GetCommandString(
  120. UINT_PTR idCmd,
  121. UINT uFlags,
  122. UINT *reserved,
  123. LPSTR pszName,
  124. UINT cchMax
  125. );
  126. public:
  127. /********************************************************************
  128. IDsFolderProperties member functions.
  129. ********************************************************************/
  130. STDMETHODIMP
  131. ShowProperties(
  132. IN HWND hwndParent,
  133. IN IDataObject *pDataObject
  134. );
  135. /********************************************************************
  136. IDsPrinterProperties member functions.
  137. ********************************************************************/
  138. STDMETHODIMP
  139. ShowProperties(
  140. IN HWND hwndParent,
  141. IN LPCTSTR pszDsPath,
  142. IN OUT PBOOL pbDisplayed
  143. );
  144. /********************************************************************
  145. IFindPrinter member functions.
  146. ********************************************************************/
  147. STDMETHODIMP
  148. FindPrinter(
  149. IN HWND hwnd,
  150. IN OUT LPTSTR pszBuffer,
  151. IN UINT *puSize
  152. );
  153. /********************************************************************
  154. IPhysicalLocation member functions.
  155. ********************************************************************/
  156. STDMETHODIMP
  157. DiscoverPhysicalLocation(
  158. VOID
  159. );
  160. STDMETHODIMP
  161. GetExactPhysicalLocation(
  162. IN OUT BSTR *pbsLocation
  163. );
  164. STDMETHODIMP
  165. GetSearchPhysicalLocation(
  166. IN OUT BSTR *pbsLocation
  167. );
  168. STDMETHODIMP
  169. GetUserPhysicalLocation(
  170. IN OUT BSTR *pbsLocation
  171. );
  172. STDMETHODIMP
  173. GetMachinePhysicalLocation(
  174. IN OUT BSTR *pbsLocation
  175. );
  176. STDMETHODIMP
  177. GetSubnetPhysicalLocation(
  178. IN OUT BSTR *pbsLocation
  179. );
  180. STDMETHODIMP
  181. GetSitePhysicalLocation(
  182. IN OUT BSTR *pbsLocation
  183. );
  184. STDMETHODIMP
  185. BrowseForLocation(
  186. IN HWND hParent,
  187. IN BSTR bsDefault,
  188. IN OUT BSTR *pbsLocation
  189. );
  190. STDMETHODIMP
  191. ShowPhysicalLocationUI(
  192. VOID
  193. );
  194. private:
  195. TPhysicalLocation *_pPhysicalLocation;
  196. TFindLocDlg *_pLocationDlg;
  197. CRefPtrCOM<IPrnStream> m_spPrnStream;
  198. CRefPtrCOM<IStream> m_spStream;
  199. HRESULT
  200. CheckToCreateStreams(
  201. VOID
  202. );
  203. /********************************************************************
  204. IPrnStream member functions.
  205. ********************************************************************/
  206. public:
  207. STDMETHODIMP
  208. BindPrinterAndFile(
  209. IN LPCTSTR pszPrinter,
  210. LPCTSTR pszFile
  211. );
  212. STDMETHODIMP
  213. StorePrinterInfo(
  214. IN DWORD Flag
  215. );
  216. STDMETHODIMP
  217. RestorePrinterInfo(
  218. IN DWORD Flag
  219. );
  220. STDMETHODIMP
  221. QueryPrinterInfo(
  222. IN PrinterPersistentQueryFlag Flag,
  223. OUT PersistentInfo *pPrstInfo
  224. );
  225. /********************************************************************
  226. IStream member functions.
  227. ********************************************************************/
  228. public:
  229. HRESULT STDMETHODCALLTYPE
  230. Read( // IMPLEMENTED
  231. VOID * pv,
  232. ULONG cb,
  233. ULONG * pcbRead
  234. );
  235. HRESULT STDMETHODCALLTYPE
  236. Write( //IMPLEMENTED
  237. VOID const* pv,
  238. ULONG cb,
  239. ULONG * pcbWritten
  240. );
  241. HRESULT STDMETHODCALLTYPE
  242. Seek( //IMPLEMENTED
  243. LARGE_INTEGER dlibMove,
  244. DWORD dwOrigin,
  245. ULARGE_INTEGER * plibNewPosition
  246. );
  247. HRESULT STDMETHODCALLTYPE
  248. SetSize(
  249. ULARGE_INTEGER nSize
  250. );
  251. HRESULT STDMETHODCALLTYPE
  252. CopyTo( //NOT_IMPLEMENTED
  253. LPSTREAM pStrm,
  254. ULARGE_INTEGER cb,
  255. ULARGE_INTEGER * pcbRead,
  256. ULARGE_INTEGER * pcbWritten
  257. );
  258. HRESULT STDMETHODCALLTYPE
  259. Commit( //NOT_IMPLEMENTED
  260. IN DWORD dwFlags
  261. );
  262. HRESULT STDMETHODCALLTYPE
  263. Revert( //NOT_IMPLEMENTED
  264. VOID
  265. );
  266. HRESULT STDMETHODCALLTYPE
  267. LockRegion( //NOT_IMPLEMENTED
  268. ULARGE_INTEGER cbOffset,
  269. ULARGE_INTEGER cbLength,
  270. DWORD dwFlags
  271. );
  272. HRESULT STDMETHODCALLTYPE
  273. UnlockRegion( //NOT_IMPLEMENTED
  274. ULARGE_INTEGER cbOffset,
  275. ULARGE_INTEGER cbLength,
  276. DWORD dwFlags
  277. );
  278. HRESULT STDMETHODCALLTYPE
  279. Stat( //NOT_IMPLEMENTED
  280. STATSTG * pStatStg,
  281. DWORD dwFlags
  282. );
  283. HRESULT STDMETHODCALLTYPE
  284. Clone( //NOT_IMPLEMENTED
  285. OUT LPSTREAM * ppStrm
  286. );
  287. /********************************************************************
  288. IPrintUIServices member functions.
  289. ********************************************************************/
  290. STDMETHODIMP
  291. GenerateShareName(
  292. LPCTSTR lpszServer,
  293. LPCTSTR lpszBaseName,
  294. LPTSTR lpszOut,
  295. int cchMaxChars
  296. );
  297. };
  298. #endif