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.

1358 lines
52 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: ndmgrpriv.h (originally ndmgr.idl)
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "mmcobj.h"
  11. #include <string>
  12. #include <vector>
  13. #include <iterator>
  14. #ifndef __ndmgrpriv_h__
  15. #define __ndmgrpriv_h__
  16. #define MMC_INTERFACE(Interface, x) \
  17. extern "C" const IID IID_##Interface; \
  18. struct DECLSPEC_UUID(#x) __declspec(novtable) Interface
  19. // forward class declarations
  20. class CContextMenuInfo;
  21. class CResultViewType;
  22. class tstring;
  23. class CColumnInfoList;
  24. class CConsoleView;
  25. class CXMLObject;
  26. // interfaces
  27. interface INodeType;
  28. interface INodeTypesCache;
  29. interface IEnumNodeTypes;
  30. interface IFramePrivate;
  31. interface IScopeDataPrivate;
  32. interface IResultDataPrivate;
  33. interface IImageListPrivate;
  34. interface IPropertySheetNotify;
  35. interface INodeCallback;
  36. interface IScopeTreeIter;
  37. interface IScopeTree;
  38. interface IPropertySheetProviderPrivate;
  39. interface IDumpSnapins;
  40. interface IMMCListView;
  41. interface ITaskPadHost;
  42. interface IStringTablePrivate;
  43. interface ITaskCallback;
  44. interface IComCacheCleanup;
  45. interface IHeaderCtrlPrivate;
  46. interface IMMCClipboardDataObject;
  47. interface IMMCClipboardSnapinObject;
  48. typedef IFramePrivate* LPFRAMEPRIVATE;
  49. typedef IScopeDataPrivate* LPSCOPEDATAPRIVATE;
  50. typedef IResultDataPrivate* LPRESULTDATAPRIVATE;
  51. typedef IImageListPrivate* LPIMAGELISTPRIVATE;
  52. typedef IPropertySheetNotify* LPPROPERTYSHEETNOTIFY;
  53. typedef INodeCallback* LPNODECALLBACK;
  54. typedef IScopeTreeIter* LPSCOPETREEITER;
  55. typedef IScopeTree* LPSCOPETREE;
  56. typedef INodeType* LPNODETYPE;
  57. typedef INodeTypesCache* LPNODETYPESCACHE;
  58. typedef IEnumNodeTypes* LPENUMNODETYPES;
  59. typedef IDumpSnapins* LPDUMPSNAPINS;
  60. typedef IMMCListView* LPMMCLISTVIEW;
  61. typedef ITaskCallback* LPTASKCALLBACK;
  62. typedef IComCacheCleanup* LPCOMCACHECLEANUP;
  63. typedef IMMCClipboardDataObject* LPCLIPBOARDDATAOBJECT;
  64. typedef IMMCClipboardSnapinObject* LPCLIPBOARDSNAPINOBJECT;
  65. typedef LONG_PTR HBOOKMARK;
  66. typedef LONG_PTR HVIEWSETTINGS;
  67. typedef LONG_PTR HPERSISTOR;
  68. typedef IPropertySheetProviderPrivate* LPPROPERTYSHEETPROVIDERPRIVATE;
  69. typedef struct _TREEITEM * HTREEITEM;
  70. // Implements the list save feature (t-dmarm)
  71. #define IMPLEMENT_LIST_SAVE
  72. // Use to see if the MT Node is valid before referencing the saved pointer in
  73. // a property sheet.
  74. STDAPI MMCIsMTNodeValid(void* pMTNode, BOOL bReset);
  75. // Window class used to store data for property sheets
  76. #define MAINFRAME_CLASS_NAME L"MMCMainFrame"
  77. // Window class used to store data for property sheets
  78. #define DATAWINDOW_CLASS_NAME L"MMCDataWindow"
  79. #define WINDOW_DATA_SIZE (sizeof (DataWindowData *))
  80. // Slots for data stored in the data windows
  81. #define WINDOW_DATA_PTR_SLOT 0
  82. // Max length of item text in list/tree controls
  83. // (including the terminating zero)
  84. #define MAX_ITEM_TEXT_LEN 1024
  85. // MID(Menu Identifications) for context menus
  86. enum MID_LIST
  87. {
  88. MID_VIEW = 1,
  89. MID_VIEW_LARGE,
  90. MID_VIEW_SMALL,
  91. MID_VIEW_LIST,
  92. MID_VIEW_DETAIL,
  93. MID_VIEW_FILTERED,
  94. MID_VIEW_HTML,
  95. MID_ARRANGE_ICONS,
  96. MID_LINE_UP_ICONS,
  97. MID_PROPERTIES,
  98. MID_CREATE_NEW,
  99. MID_TASK,
  100. MID_EXPLORE,
  101. MID_NEW_TASKPAD_FROM_HERE,
  102. MID_OPEN,
  103. MID_CUT,
  104. MID_COPY,
  105. MID_PASTE,
  106. MID_DELETE,
  107. MID_PRINT,
  108. MID_REFRESH,
  109. MID_RENAME,
  110. MID_CONTEXTHELP,
  111. MID_ARRANGE_AUTO,
  112. MID_STD_MENUS,
  113. MID_STD_BUTTONS,
  114. MID_SNAPIN_MENUS,
  115. MID_SNAPIN_BUTTONS,
  116. MID_LISTSAVE,
  117. MID_COLUMNS,
  118. MID_CUSTOMIZE,
  119. MID_ORGANIZE_FAVORITES,
  120. MID_EDIT_TASKPAD,
  121. MID_DELETE_TASKPAD,
  122. MID_LAST, // this must be last
  123. };
  124. class CResultItem;
  125. typedef struct _CCLVSortParams
  126. {
  127. BOOL bAscending; // sort direction
  128. int nCol; // Which column to sort on.
  129. LPRESULTDATACOMPARE lpResultCompare; // Snap-in component interface
  130. LPRESULTDATACOMPAREEX lpResultCompareEx; // "
  131. LPARAM lpUserParam; // parameter user passes in
  132. BOOL bSetSortIcon; // Sort icon /*[not]*/ needed
  133. /*
  134. * Bug 414256: We need to save the sort data only if
  135. * it is user initiated sort. Is this user initiated?
  136. */
  137. BOOL bUserInitiatedSort;
  138. } CCLVSortParams;
  139. //
  140. // This structure is used by MMCPropertyChangeNotify to pass
  141. // information from a property sheet to the console. It has routing
  142. // information to notify the correct snap-in of a property changed notify.
  143. //
  144. const DWORD MMC_E_INVALID_FILE = 0x80FF0002;
  145. const DWORD MMC_E_SNAPIN_LOAD_FAIL = 0x80FF0003;
  146. typedef struct _PROPERTYNOTIFYINFO
  147. {
  148. LPCOMPONENTDATA pComponentData; // Valid if (fScopePane == TRUE)
  149. LPCOMPONENT pComponent; // Valid if (fScopePane == FALSE)
  150. BOOL fScopePane; // True if it is for a scope pane item.
  151. HWND hwnd; // HWND to console handling the message
  152. } PROPERTYNOTIFYINFO;
  153. // Context menu types
  154. typedef enum _MMC_CONTEXT_MENU_TYPES
  155. {
  156. MMC_CONTEXT_MENU_DEFAULT = 0, // Normal context menu
  157. MMC_CONTEXT_MENU_ACTION = 1, // Action menu button
  158. MMC_CONTEXT_MENU_VIEW = 2, // View menu button
  159. MMC_CONTEXT_MENU_FAVORITES = 3, // Favorites menu button
  160. MMC_CONTEXT_MENU_LAST = 4,
  161. } MMC_CONTEXT_MENU_TYPES;
  162. DECLARE_HANDLE (HMTNODE);
  163. DECLARE_HANDLE (HNODE); // A scope pane handle(lParam) within a view
  164. typedef unsigned long MTNODEID;
  165. const MTNODEID ROOTNODEID = 1;
  166. typedef PROPERTYNOTIFYINFO* LPPROPERTYNOTIFYINFO;
  167. // Special cookies (Note: Can't use -1)
  168. const LONG_PTR LVDATA_BACKGROUND = -2;
  169. const LONG_PTR LVDATA_CUSTOMOCX = -3;
  170. const LONG_PTR LVDATA_CUSTOMWEB = -4;
  171. const LONG_PTR LVDATA_MULTISELECT = -5;
  172. const LONG_PTR LVDATA_ERROR = -10;
  173. const LONG_PTR SPECIAL_LVDATA_MIN = -10;
  174. const LONG_PTR SPECIAL_LVDATA_MAX = -2;
  175. #define IS_SPECIAL_LVDATA(d) (((d) >= SPECIAL_LVDATA_MIN) && ((d) <= SPECIAL_LVDATA_MAX))
  176. typedef struct _SELECTIONINFO
  177. {
  178. BOOL m_bScope;
  179. BOOL m_bBackground;
  180. IUnknown* m_pView; // valid for scope seln (CDN_SELECT)
  181. MMC_COOKIE m_lCookie; // valid for result item (CCN_SELECT)
  182. MMC_CONSOLE_VERB m_eCmdID;
  183. BOOL m_bDueToFocusChange;
  184. BOOL m_bResultPaneIsOCX;
  185. BOOL m_bResultPaneIsWeb;
  186. } SELECTIONINFO;
  187. typedef struct _HELPDOCINFO
  188. {
  189. LPCOLESTR m_pszFileName; // File name (same as .msc file)
  190. FILETIME m_ftimeCreate; // .msc file creation time
  191. FILETIME m_ftimeModify; // .msc file modification time
  192. } HELPDOCINFO;
  193. // MMC_ILISTPAD_INFO struct: internal form has additional field for clsid
  194. typedef struct _MMC_ILISTPAD_INFO
  195. {
  196. MMC_LISTPAD_INFO info;
  197. LPOLESTR szClsid;
  198. } MMC_ILISTPAD_INFO;
  199. // *****************************************
  200. // CLASS: CTaskPadData
  201. // this class represents data set representing one TaskPad
  202. // used to request taskpad information from CNode
  203. // *****************************************
  204. class CTaskPadData
  205. {
  206. public:
  207. std::wstring strName;
  208. CLSID clsidTaskPad;
  209. };
  210. typedef std::vector<CTaskPadData> CTaskPadCollection;
  211. typedef std::insert_iterator<CTaskPadCollection> CTaskPadInsertIterator;
  212. // *****************************************
  213. // CLASS:CViewExtensionData
  214. // this class represents data set representing one ViewExtension
  215. // used to request extension information from CNode
  216. // *****************************************
  217. class CViewExtensionData
  218. {
  219. public:
  220. std::wstring strURL;
  221. std::wstring strName;
  222. std::wstring strTooltip;
  223. GUID viewID; // unique identifier for the view
  224. bool bReplacesDefaultView;
  225. };
  226. typedef std::vector<CViewExtensionData> CViewExtCollection;
  227. typedef std::insert_iterator<CViewExtCollection> CViewExtInsertIterator;
  228. // The following internal flag corresponding to public view style MMC_ENSUREFOCUSVISIBLE.
  229. // The flag is placed in the upper half of a long so it won't conflict with the LVS_*
  230. // flags that are passed in the same long to our list control's SetViewStyle method.
  231. #define MMC_LVS_ENSUREFOCUSVISIBLE 0x00010000
  232. /*
  233. NOTIFICATIONS
  234. =============
  235. Notify(dataobject, event, arg, param);
  236. For all the MMC_NOTIFY_TYPE events,
  237. dataobject = dataobject for cookie, can be NULL when dataobject is not required
  238. event = one of the CD_NOTIFY_TYPEs
  239. arg and param depend on type, see below.
  240. NCLBK_ACTIVATE
  241. arg = TRUE if gaining focus
  242. NCLBK_BTN_CLICK
  243. ....
  244. NCLBK_CLICK
  245. NCLBK_CONTEXTMENU
  246. param = CContextMenuInfo*
  247. NCLBK_DBLCLICK
  248. NCLBK_DELETE
  249. arg = TRUE if scope item FALSE if result item.
  250. param = If scope item is being deleted param is unused.
  251. If result item is being deleted param is the result items cookie.
  252. return = unused.
  253. NCLBK_EXPAND
  254. arg = TRUE => expand, FALSE => contract
  255. NCLBK_EXPANDED
  256. arg = TRUE => expanded, FALSE => contracted
  257. NCLBK_FOLDER
  258. arg = <>0 if expanding, 0 if contracting
  259. param = HSCOPEITEM of expanding/contracting item
  260. NCLBK_MINIMIZED
  261. arg = TRUE if minimized
  262. NCLBK_MULTI_SELECT
  263. arg = TRUE if due to focus change.
  264. param unused
  265. NCLBK_PROPERTIES
  266. pLParam = (CResultItem*)arg;
  267. param unused
  268. NCLBK_PROPERTY_CHANGE
  269. lpDataObject = NULL
  270. lParam = user object
  271. NCLBK_NEW_NODE_UPDATE
  272. arg = 1 => folder needs to be refreshed
  273. arg = 2 => result view needs to be refreshed
  274. arg = 3 => both needs to be refreshed
  275. NCLBK_RENAME
  276. This gets called the first time to query for rename and a
  277. second time to do the rename. For the query S_OK or S_FALSE for the
  278. return type. After the rename, we will send the new name with a LPOLESTR.
  279. MMC_COOKIE lResultItemCookie = (MMC_COOKIE)arg;
  280. pszNewName = (LPOLESTR)param; // the new name
  281. return = S_OK to allow rename and S_FALSE to disallow rename.
  282. NCLBK_SELECT
  283. arg = TRUE if the item is selected, FALSE otherwise.
  284. param = ptr to SELECTIONINFO.
  285. NCLBK_SHOW
  286. arg = <>0 if selecting, 0 if deselecting
  287. param = HSCOPEITEM of selected/deselected item
  288. NCLBK_COLUMN_CLICK
  289. param = nCol, the column that was clicked.
  290. NCLBK_FINDITEM
  291. This message is sent when a result item list with owner data wants to find
  292. an item who's name matches a string
  293. arg = ptr to RESULTFINDINFO
  294. param = ptr to returned item index
  295. NCLBK_CACHEHINT
  296. This message is sent when the result item list with owner data is about to
  297. ask for display info for a range of items.
  298. arg = index of start item
  299. param = index of end item
  300. NCLBK_GETHELPDOC
  301. This message is sent to get the path of the combined help topics document.
  302. The node manager may update the help doc info.
  303. arg = pointer to HELPDOCINFO struct
  304. param = pointer to returned path string (LPOLESTR*)
  305. NCLBK_LISTPAD
  306. This message is sent to tell the snapin that the TaskPad ListView is ready
  307. to receive items (if attaching).
  308. arg = TRUE if attaching, FALSE if detaching
  309. NCLBK_WEBCONTEXTMENU
  310. send when the user right clicks on a web page.
  311. arg = unused
  312. param = unused
  313. NCLBK_UPDATEHELPDOC
  314. send when console doc is saved to update help file name and file times
  315. arg = ptr to current help doc info (HELPDOCINFO*)
  316. param = ptr to new help doc info (HELPDOCINFO*)
  317. NCLBK_DELETEHELPDOC
  318. send when console doc is closed to delete the temp help collection file
  319. associated with the document
  320. arg - ptr to help doc info (HELPDOCINFO*)
  321. param - unused
  322. */
  323. typedef enum _NCLBK_NOTIFY_TYPE
  324. {
  325. NCLBK_NONE = 0x9000,
  326. NCLBK_ACTIVATE = 0x9001,
  327. NCLBK_CACHEHINT = 0x9002,
  328. NCLBK_CLICK = 0x9003,
  329. NCLBK_CONTEXTMENU = 0x9004,
  330. NCLBK_COPY = 0x9005,
  331. NCLBK_CUT = 0x9006,
  332. NCLBK_DBLCLICK = 0x9007,
  333. NCLBK_DELETE = 0x9008,
  334. NCLBK_EXPAND = 0x9009,
  335. NCLBK_EXPANDED = 0x900A,
  336. NCLBK_FINDITEM = 0x900B,
  337. NCLBK_FOLDER = 0x900C,
  338. NCLBK_MINIMIZED = 0x900D,
  339. NCLBK_MULTI_SELECT = 0x900E,
  340. NCLBK_NEW_NODE_UPDATE = 0x900F,
  341. NCLBK_PRINT = 0x9011,
  342. NCLBK_PROPERTIES = 0x9012,
  343. NCLBK_PROPERTY_CHANGE = 0x9013,
  344. NCLBK_REFRESH = 0x9015,
  345. NCLBK_RENAME = 0x9016,
  346. NCLBK_SELECT = 0x9017,
  347. NCLBK_SHOW = 0x9018,
  348. NCLBK_COLUMN_CLICKED = 0x9019,
  349. NCLBK_SNAPINHELP = 0x901D,
  350. NCLBK_CONTEXTHELP = 0x901E,
  351. NCLBK_INITOCX = 0x9020,
  352. NCLBK_FILTER_CHANGE = 0x9021,
  353. NCLBK_FILTERBTN_CLICK = 0x9022,
  354. NCLBK_TASKNOTIFY = 0x9024,
  355. NCLBK_GETPRIMARYTASK = 0x9025,
  356. NCLBK_GETHELPDOC = 0x9027,
  357. NCLBK_LISTPAD = 0x9029,
  358. NCLBK_GETEXPANDEDVISUALLY = 0x902B,
  359. NCLBK_SETEXPANDEDVISUALLY = 0x902C,
  360. NCLBK_NEW_TASKPAD_FROM_HERE = 0x902D,
  361. NCLBK_WEBCONTEXTMENU = 0x902E,
  362. NCLBK_UPDATEHELPDOC = 0x902F,
  363. NCLBK_EDIT_TASKPAD = 0x9030,
  364. NCLBK_DELETE_TASKPAD = 0x9031,
  365. NCLBK_DELETEHELPDOC = 0x9032
  366. } NCLBK_NOTIFY_TYPE;
  367. ///////////////////////////////////////////////////////////////////////////////
  368. // Common Console clipboard formats
  369. //
  370. // Clipboard format for the multi selected static nodes.
  371. // If there are N static nodes are selected in the result pane, the MTNodes
  372. // for these N nodes will be passed in a GloballAlloced memory. The first DWORD
  373. // contains the number of MTNodes, this will be followed by N ptrs to the MTNodes.
  374. //
  375. #define CCF_MULTI_SELECT_STATIC_DATA ( L"CCF_MULTI_SELECT_STATIC_DATA" )
  376. #define CCF_NEWNODE ( L"CCF_NEWNODE" )
  377. //const CLSID CLSID_NDMGR_SNAPIN = {0x2640211a, 0x06d0, 0x11d1, {0xa7, 0xc9, 0x00, 0xc0, 0x4f, 0xd8, 0xd5, 0x65}};
  378. extern const CLSID CLSID_NDMGR_SNAPIN;
  379. //const GUID GUID_MMC_NEWNODETYPE = {0xfd17e9cc, 0x06ce, 0x11d1, {0xa7, 0xc9, 0x00, 0xc0, 0x4f, 0xd8, 0xd5, 0x65}};
  380. extern const GUID GUID_MMC_NEWNODETYPE;
  381. ///////////////////////////////////////////////////////////////////////////
  382. ///
  383. // helpstring("Notify that the properties of an object changed"),
  384. MMC_INTERFACE(IPropertySheetNotify, d700dd8e-2646-11d0-a2a7-00c04fd909dd) : IUnknown
  385. {
  386. STDMETHOD(Notify)(/*[in]*/ LPPROPERTYNOTIFYINFO pNotify, /*[in]*/ LPARAM lParam) = 0;
  387. };
  388. // helpstring("IFramePrivate Interface"),
  389. MMC_INTERFACE(IFramePrivate, d71d1f2a-1ba2-11d0-a29b-00c04fd909dd): IConsole3
  390. {
  391. /*[helpstring("Sets IFrame Result pane")]*/
  392. STDMETHOD(SetResultView)(/*[in]*/ LPUNKNOWN pUnknown) = 0;
  393. /*[helpstring("Is the ListView set as result view")]*/
  394. STDMETHOD(IsResultViewSet)(BOOL* pbIsLVSet) = 0;
  395. /*[helpstring("Sets Task Pads list view")]*/
  396. STDMETHOD(SetTaskPadList)(/*[in]*/ LPUNKNOWN pUnknown) = 0;
  397. /*[helpstring("IComponent's component ID")]*/
  398. STDMETHOD(GetComponentID)(/*[out]*/ COMPONENTID* lpComponentID) = 0;
  399. /*[helpstring("IComponent's component ID")]*/
  400. STDMETHOD(SetComponentID)(/*[in]*/ COMPONENTID id) = 0;
  401. /*[helpstring("Node for the view.")]*/
  402. STDMETHOD(SetNode)(/*[in]*/ HMTNODE hMTNode, /*[in]*/ HNODE hNode) = 0;
  403. /*[helpstring("Cache the IComponent interface for the snapin.")]*/
  404. STDMETHOD(SetComponent)(/*[in]*/ LPCOMPONENT lpComponent) = 0;
  405. /*[helpstring("Console name space.")]*/
  406. STDMETHOD(QueryScopeTree)(/*[out]*/ IScopeTree** ppScopeTree) = 0;
  407. /*[helpstring("Set the console name space.")]*/
  408. STDMETHOD(SetScopeTree)(/*[in]*/ IScopeTree* pScopeTree) = 0;
  409. /*[helpstring("Creates image list for the scope pane.")]*/
  410. STDMETHOD(CreateScopeImageList)(/*[in]*/ REFCLSID refClsidSnapIn) = 0;
  411. /*[helpstring("bExtension is TRUE if this IFrame is used by an extension.")]*/
  412. STDMETHOD(SetUsedByExtension)(/*[in]*/ BOOL bExtension) = 0;
  413. /*[helpstring("Init view data.")]*/
  414. STDMETHOD(InitViewData)(/*[in]*/ LONG_PTR lViewData) = 0;
  415. /*[helpstring("Clean up view data.")]*/
  416. STDMETHOD(CleanupViewData)(/*[in]*/ LONG_PTR lViewData) = 0;
  417. /*[helpstring("Reset the sort parameters after a selection change.")]*/
  418. STDMETHOD(ResetSortParameters)() = 0;
  419. };
  420. // helpstring("IScopeDataPrivate Interface"),
  421. MMC_INTERFACE(IScopeDataPrivate, 60BD2FE0-F7C5-11cf-8AFD-00AA003CA9F6) : IConsoleNameSpace2
  422. {
  423. };
  424. // helpstring("IImageListPrivate Interface"),
  425. MMC_INTERFACE(IImageListPrivate, 7538C620-0083-11d0-8B00-00AA003CA9F6) : IImageList
  426. {
  427. /*[helpstring("Private tree control method used to map images on callbacks")]*/
  428. STDMETHOD(MapRsltImage)(COMPONENTID id, /*[in]*/ int nSnapinIndex, /*[out]*/ int* pnConsoleIndex) = 0;
  429. /*[helpstring("Private tree control method used to map images on callbacks")]*/
  430. STDMETHOD(UnmapRsltImage)(COMPONENTID id, /*[in]*/ int nConsoleIndex, /*[out]*/ int* pnSnapinIndex) = 0;
  431. };
  432. // helpstring("IResultDataPrivate Interface"),
  433. MMC_INTERFACE(IResultDataPrivate, 1EBA2300-0854-11d0-8B03-00AA003CA9F6) : IResultData2
  434. {
  435. /*[helpstring("Get the list view style.")]*/
  436. STDMETHOD(GetListStyle)(/*[out]*/ long * pStyle) = 0;
  437. /*[helpstring("Set the list view style.")]*/
  438. STDMETHOD(SetListStyle)(/*[in]*/ long Style) = 0;
  439. /*[helpstring("Set loading mode of list")]*/
  440. STDMETHOD(SetLoadMode)(/*[in]*/ BOOL bState) = 0;
  441. /*[helpstring("Arrange the icons in the result pane")]*/
  442. STDMETHOD(Arrange)(long style) = 0;
  443. /*[helpstring("Sort from the Listview header control")]*/
  444. STDMETHOD(InternalSort)(INT nCol, DWORD dwSortOptions, LPARAM lUserParam, BOOL bColumnClicked) = 0;
  445. /*[helpstring("Private tree control method used to reset the result view")]*/
  446. STDMETHOD(ResetResultData)() = 0;
  447. /*[helpstring("Private listview method to retrieve sort column")]*/
  448. STDMETHOD(GetSortColumn)(INT* pnCol) = 0;
  449. /*[helpstring("Private listview method to retrieve sort column")]*/
  450. STDMETHOD(GetSortDirection)(BOOL* pbAscending) = 0;
  451. };
  452. // helpstring("IHeaderCtrlPrivate Interface that adds to IHeaderCtrl methods"),
  453. MMC_INTERFACE(IHeaderCtrlPrivate, 0B384311-701B-4e8a-AEC2-DA6321E27AD2) : IHeaderCtrl2
  454. {
  455. /*[helpstring("Get the number of columns in list view.")]*/
  456. STDMETHOD(GetColumnCount)(/*[in]*/INT* pnCol) = 0;
  457. /*[helpstring("Get the current column settings from list view header.")]*/
  458. STDMETHOD(GetColumnInfoList)(/*[out]*/ CColumnInfoList *pColumnsList) = 0;
  459. /*[helpstring("Modify the columns in list view with given data.")]*/
  460. STDMETHOD(ModifyColumns)(/*[in]*/ const CColumnInfoList& columnsList) = 0;
  461. /*[helpstring("Get the column settings that snapin supplied originally")]*/
  462. STDMETHOD(GetDefaultColumnInfoList)(/*[out]*/ CColumnInfoList& columnsList) = 0;
  463. };
  464. // helpstring("Minimum master tree control methods required by node manager."),
  465. MMC_INTERFACE(IScopeTree, d8dbf067-5fb2-11d0-a986-00c04fd8d565) : IUnknown
  466. {
  467. /*[helpstring("Initialize scope tree with the document.")]*/
  468. STDMETHOD(Initialize)(/*[in]*/ HWND hFrameWindow, /*[in]*/ IStringTablePrivate* pStringTable) = 0;
  469. /*[helpstring("Query for an iterator to the master tree items.")]*/
  470. STDMETHOD(QueryIterator)(/*[out]*/IScopeTreeIter** lpIter) = 0;
  471. /*[helpstring("Query for an node callback interface to access HNODE items.")]*/
  472. STDMETHOD(QueryNodeCallback)(/*[out]*/ INodeCallback** ppNodeCallback) = 0;
  473. /*[helpstring("Create a node from the master tree node.")]*/
  474. STDMETHOD(CreateNode)(/*[in]*/ HMTNODE hMTNode, /*[in]*/ LONG_PTR lViewData,
  475. /*[in]*/ BOOL fRootNode, /*[out]*/ HNODE* phNode) = 0;
  476. /*[helpstring("Do cleanup needed prior to deleting/shutting down view.")]*/
  477. STDMETHOD(CloseView)(/*[in]*/ int nView) = 0;
  478. /*[helpstring("Delete all view data for the specified view id.")]*/
  479. STDMETHOD(DeleteView)(/*[in]*/ int nView) = 0;
  480. /*[helpstring("Create a node from the master tree node.")]*/
  481. STDMETHOD(DestroyNode)(/*[in]*/ HNODE hNode) = 0;
  482. /*[helpstring("Finds the node that matches the ID")]*/
  483. STDMETHOD(Find)(/*[in]*/ MTNODEID mID, /*[out]*/ HMTNODE* phMTNode) = 0;
  484. /*[helpstring("Create a node from the master tree node.")]*/
  485. STDMETHOD(GetImageList)(/*[out]*/ PLONG_PTR plImageList) = 0;
  486. /*[helpstring("Run snap-in manager")]*/
  487. STDMETHOD(RunSnapIn)(/*[in]*/ HWND hwndParent) = 0;
  488. /*[helpstring("Returns the version for the file rooted at the given storage.")]*/
  489. STDMETHOD(GetFileVersion)(/*[in]*/ IStorage* pstgRoot, /*[out]*/ int* pnVersion) = 0;
  490. /*[helpstring("Returns the MTNODEID for the node represented by a bookmark")]*/
  491. STDMETHOD(GetNodeIDFromBookmark)(/*[in]*/ HBOOKMARK hbm, /*[out]*/ MTNODEID* pID, /*[out]*/ bool& bExactMatchFound) = 0;
  492. /*[helpstring("Loads a bookmark from a stream and returns the MTNODEID for the node.")]*/
  493. STDMETHOD(GetNodeIDFromStream)(/*[in]*/ IStream *pStm, /*[out]*/ MTNODEID* pID) = 0;
  494. /*[helpstring("Loads a bookmark from a stream and returns the MTNODEID for the node.")]*/
  495. STDMETHOD(GetNodeFromBookmark)(/*[in]*/ HBOOKMARK hbm, /*[in]*/CConsoleView *pConsoleView, /*[out]*/ PPNODE ppNode, /*[out]*/ bool& bExactMatchFound) = 0;
  496. /*[helpstring("Returns the ID path for the given ID")]*/
  497. STDMETHOD(GetIDPath)(/*[in]*/ MTNODEID id, /*[out]*/ MTNODEID** ppIDs, /*[out]*/ long* pLength) = 0;
  498. /*[helpstring("Check to see if synchronous node expansion is required")]*/
  499. STDMETHOD(IsSynchronousExpansionRequired)() = 0;
  500. /*[helpstring("Sets whether synchronous node expansion is required")]*/
  501. STDMETHOD(RequireSynchronousExpansion)(/*[in]*/ BOOL fRequireSyncExpand) = 0;
  502. /*[helpstring("Sets the SConsoleData to use for this scope tree")]*/
  503. STDMETHOD(SetConsoleData)(/*[in]*/ LPARAM lConsoleData) = 0;
  504. /*[helpstring("Persists the tree to/from an XML document")]*/
  505. STDMETHOD(Persist)(/*[in]*/ HPERSISTOR hPersistor) = 0;
  506. /*[helpstring("Get path between two nodes as a string")]*/
  507. STDMETHOD(GetPathString)(/*[in]*/ HMTNODE hmtnRoot, /*[in]*/ HMTNODE hmtnLeaf, /*[out]*/ LPOLESTR* pPath) = 0;
  508. /*[helpstring("Get the SnapIns object")]*/
  509. STDMETHOD(QuerySnapIns)(/*[out]*/ SnapIns **ppSnapIns) = 0;
  510. /*[helpstring("Get the ScopeNamespace object")]*/
  511. STDMETHOD(QueryScopeNamespace)(/*[out]*/ ScopeNamespace **ppScopeNamespace) = 0;
  512. /*[helpstring("Create an empty Properties object")]*/
  513. STDMETHOD(CreateProperties)(/*[out]*/ Properties **ppProperties) = 0;
  514. /*[helpstring("Get scope node id for Node object")]*/
  515. STDMETHOD(GetNodeID)(/*[in]*/ PNODE pNode, /*[out]*/ MTNODEID *pID) = 0;
  516. /*[helpstring("Get HMTNODE for Node object")]*/
  517. STDMETHOD(GetHMTNode)(/*[in]*/ PNODE pNode, /*[out]*/ HMTNODE *phMTNode) = 0;
  518. /*[helpstring("Get Node object ptr for scope node")]*/
  519. STDMETHOD(GetMMCNode)(/*[in]*/ HMTNODE hMTNode, /*[out]*/ PPNODE ppNode) = 0;
  520. /*[helpstring("Get NODE object for Root Node")]*/
  521. STDMETHOD(QueryRootNode)(/*[out]*/ PPNODE ppNode) = 0;
  522. /*[helpstring("Check if snapin is used by MMC")]*/
  523. STDMETHOD(IsSnapinInUse)(/*[in]*/ REFCLSID refClsidSnapIn, /*[out]*/ PBOOL pbInUse) = 0;
  524. };
  525. // helpstring("Master tree item iterator."),
  526. MMC_INTERFACE(IScopeTreeIter, d779f8d1-6057-11d0-a986-00c04fd8d565) : IUnknown
  527. {
  528. /*[helpstring("Sets the current master tree node.")]*/
  529. STDMETHOD(SetCurrent)(/*[in]*/ HMTNODE hStartMTNode) = 0;
  530. /*[helpstring("Returns the next nRequested master node siblings.")]*/
  531. STDMETHOD(Next)(/*[in]*/ UINT nRequested, /*[out]*/ HMTNODE* rghScopeItems, /*[out]*/ UINT* pnFetched) = 0;
  532. /*[helpstring("Returns the child master node.")]*/
  533. STDMETHOD(Child)(/*[out]*/ HMTNODE* phsiChild) = 0;
  534. /*[helpstring("Returns the parent master node.")]*/
  535. STDMETHOD(Parent)(/*[out]*/ HMTNODE* phsiParent) = 0;
  536. };
  537. // helpstring("Node callback methods."),
  538. MMC_INTERFACE(INodeCallback, b241fced-5fb3-11d0-a986-00c04fd8d565) : IUnknown
  539. {
  540. /*[helpstring("Initialize with the scope tree.")]*/
  541. STDMETHOD(Initialize)(/*[in]*/ IScopeTree* pIScopeTree) = 0;
  542. /*[helpstring("Returns the images for this node.")]*/
  543. STDMETHOD(GetImages)(/*[in]*/ HNODE hNode, /*[out]*/ int* iImage, int* iSelectedImage) = 0;
  544. /*[helpstring("Returns the display name for node.")]*/
  545. STDMETHOD(GetDisplayName)(/*[in]*/ HNODE hNode, /*[out]*/ tstring& strName) = 0;
  546. /*[helpstring("Returns the custom window title for this node")]*/
  547. STDMETHOD(GetWindowTitle)(/*[in]*/ HNODE hNode, /*[out]*/ tstring& strTitle) = 0;
  548. /*[helpstring("Handles callback for result items")]*/
  549. STDMETHOD(GetDispInfo)(/*[in]*/ HNODE hNode, /*[in,out]*/ LVITEMW* plvi) = 0;
  550. /*[helpstring("Returns the UI state of master node.")]*/
  551. STDMETHOD(GetState)(/*[in]*/ HNODE hNode, /*[out]*/ UINT* pnState) = 0;
  552. /*[helpstring("Returns the result pane for the node.")]*/
  553. STDMETHOD(GetResultPane)(/*[in]*/ HNODE hNode, /*[in, out]*/ CResultViewType& rvt,
  554. /*[out]*/ GUID *pGuidTaskpadID) = 0;
  555. /*[helpstring("Asks the snapin to restore its result pane with given data")]*/
  556. STDMETHOD(RestoreResultView)(/*[in]*/HNODE hNode, /*[in]*/const CResultViewType& rvt) = 0;
  557. /*[helpstring("Returns the result pane OCX control for the node.")]*/
  558. STDMETHOD(GetControl)(/*[in]*/ HNODE hNode, /*[in]*/ CLSID clsid, /*[out]*/IUnknown **ppUnkControl) = 0;
  559. /*[helpstring("Sets the result pane OCX control for the node.")]*/
  560. STDMETHOD(SetControl)(/*[in]*/ HNODE hNode, /*[in]*/ CLSID clsid, /*[in]*/IUnknown* pUnknown) = 0;
  561. /*[helpstring("Returns the result pane OCX control for the node.")]*/
  562. STDMETHOD(GetControl)(/*[in]*/ HNODE hNode, /*[in]*/LPUNKNOWN pUnkOCX, /*[out]*/IUnknown **ppUnkControl) = 0;
  563. /*[helpstring("Sets the result pane OCX control for the node.")]*/
  564. STDMETHOD(SetControl)(/*[in]*/ HNODE hNode, /*[in]*/LPUNKNOWN pUnkOCX, /*[in]*/IUnknown* pUnknown) = 0;
  565. /*[helpstring("Sends the MMCN_INITOCX notification to the appropriate snapin")]*/
  566. STDMETHOD(InitOCX)(/*[in]*/ HNODE hNode, /*[in]*/ IUnknown* pUnknown) = 0;
  567. /*[helpstring("Set the Result Item ID")]*/
  568. //RENAME// STDMETHOD(SetItemID)(/*[in]*/ HNODE hNode, /*[in]*/ HRESULTITEM riID) = 0;
  569. STDMETHOD(SetResultItem)(/*[in]*/ HNODE hNode, /*[in]*/ HRESULTITEM hri) = 0;
  570. /*[helpstring("Get the Result Item ID")]*/
  571. //RENAME// STDMETHOD(GetItemID)(/*[in]*/ HNODE hNode, /*[out]*/ HRESULTITEM* priID) = 0;
  572. STDMETHOD(GetResultItem)(/*[in]*/ HNODE hNode, /*[out]*/ HRESULTITEM* phri) = 0;
  573. /*[helpstring("Returns the nodes unique ID")]*/
  574. //RENAME// STDMETHOD(GetID)(/*[in]*/ HNODE hNode, /*[out]*/ MTNODEID* pnID) = 0;
  575. STDMETHOD(GetMTNodeID)(/*[in]*/ HNODE hNode, /*[out]*/ MTNODEID* pnID) = 0;
  576. /*[helpstring("Determine if node is the target of another")]*/
  577. STDMETHOD(IsTargetNodeOf)(/*[in]*/ HNODE hNode, /*[in]*/ HNODE hTestNode) = 0;
  578. /*[helpstring("Returns the nodes static parents MTNODEID and the subsequent path")]*/
  579. STDMETHOD(GetPath)(/*[in]*/ HNODE hNode, /*[in]*/ HNODE hRootNode, /*[out]*/ BYTE* pbm_) = 0;
  580. /*[helpstring("Returns the static parent nodes unique ID")]*/
  581. STDMETHOD(GetStaticParentID)(/*[in]*/ HNODE hNode, /*[out]*/ MTNODEID* pnID) = 0;
  582. /*[helpstring("Notify")]*/
  583. STDMETHOD(Notify)(/*[in]*/ HNODE hNode, /*[in]*/ NCLBK_NOTIFY_TYPE event,
  584. /*[in]*/ LPARAM arg, /*[in]*/ LPARAM param) = 0;
  585. /*[helpstring("Returns the parent master node.")]*/
  586. STDMETHOD(GetMTNode)(/*[in]*/ HNODE hNode, /*[out]*/ HMTNODE* phMTNode) = 0;
  587. /*[helpstring("The HMTNODE path to the node is returned in pphMTNode")]*/
  588. STDMETHOD(GetMTNodePath)(/*[in]*/ HNODE hNode, /*[out]*/ HMTNODE** pphMTNode,
  589. /*[out]*/ long* plLength) = 0;
  590. /*[helpstring("Get node's owner ID")]*/
  591. STDMETHOD(GetNodeOwnerID)(/*[in]*/ HNODE hNode, /*[out]*/ COMPONENTID* pID) = 0;
  592. /*[helpstring("Get node's cookie")]*/
  593. STDMETHOD(GetNodeCookie)(/*[in]*/ HNODE hNode, /*[out]*/ MMC_COOKIE* lpCookie) = 0;
  594. /*[helpstring("Returns S_OK if the node can possibly be expanded, and S_FALSE otherwise.")]*/
  595. STDMETHOD(IsExpandable)(/*[in]*/ HNODE hNode) = 0;
  596. /*[helpstring("Return the dataobject for the selected item")]*/
  597. // cookie valid if bScope & bMultiSel are both FALSE.
  598. // cookie is the index\lParam for virtual\regular LV
  599. STDMETHOD(GetDragDropDataObject)(/*[in]*/ HNODE hNode, /*[in]*/ BOOL bScope, /*[in]*/ BOOL bMultiSel,
  600. /*[in]*/ LONG_PTR lvData, /*[out]*/ LPDATAOBJECT* ppDataObject,
  601. /*[out]*/ bool& bCopyAllowed, /*[out]*/ bool& bMoveAllowed) = 0;
  602. /*[helpstring("Returns the task enumerator.")]*/
  603. STDMETHOD(GetTaskEnumerator)(/*[in]*/ HNODE hNode, /*[in]*/ LPCOLESTR pszTaskGroup,
  604. /*[out]*/ IEnumTASK** ppEnumTask) = 0;
  605. /*[helpstring("UpdateWindowLayout.")]*/
  606. STDMETHOD(UpdateWindowLayout)(/*[in]*/ LONG_PTR lViewData, /*[in]*/ long lToolbarsDisplayed) = 0;
  607. /*[helpstring("AddCustomFolderImage")]*/
  608. STDMETHOD(AddCustomFolderImage)(/*[in]*/ HNODE hNode,
  609. /*[in]*/ IImageListPrivate* pImageList) = 0;
  610. /*[helpstring("preloads the node if necessary")]*/
  611. STDMETHOD(PreLoad)(/*[in]*/ HNODE hNode) = 0;
  612. /*[helpstring("Get the TaskPad ListView information")]*/
  613. STDMETHOD(GetListPadInfo)(/*[in]*/ HNODE hNode,
  614. /*[in]*/ IExtendTaskPad* pExtendTaskPad,
  615. /*[in,string]*/ LPCOLESTR szTaskGroup,
  616. /*[out]*/ MMC_ILISTPAD_INFO* pIListPadInfo) = 0;
  617. /*[helpstring("Sets Task Pads list view")]*/
  618. STDMETHOD(SetTaskPadList)(/*[in]*/ HNODE hNode, /*[in]*/ LPUNKNOWN pUnknown) = 0;
  619. /*[helpstring("Sets up a specific taskpad, given the GUID identifier.")]*/
  620. STDMETHOD(SetTaskpad)(/*[in]*/ HNODE hNodeSelected, /*[in]*/ GUID *pGuidTaskpad) = 0;
  621. /*[helpstring("Invokes the Customize View dialog")]*/
  622. STDMETHOD(OnCustomizeView)(/*[in]*/ LONG_PTR lViewData) = 0;
  623. /*[helpstring("Set the view settings for a particular node.")]*/
  624. STDMETHOD(SetViewSettings)(/*[in]*/ int nViewID, /*[in]*/ HBOOKMARK hbm, /*[in]*/ HVIEWSETTINGS hvs) = 0;
  625. /*[helpstring("Execute given verb for given scope item")]*/
  626. STDMETHOD(ExecuteScopeItemVerb)(/*[in]*/ MMC_CONSOLE_VERB verb, /*[in]*/ HNODE hNode, /*[in]*/LPOLESTR lpszNewName) = 0;
  627. /*[helpstring("Execute given verb for selected result item(s)")]*/
  628. STDMETHOD(ExecuteResultItemVerb)(/*[in]*/ MMC_CONSOLE_VERB verb, /*[in]*/ HNODE hNode, /*[in]*/LPARAM lvData, /*[in]*/LPOLESTR lpszNewName) = 0;
  629. /*[helpstring("Get the disp interface for given scope node object")]*/
  630. STDMETHOD(QueryCompDataDispatch)(/*[in]*/ PNODE pNode, /*[out]*/ PPDISPATCH ScopeNodeObject) = 0;
  631. /*[helpstring("Get the disp interface for selected resultpane objects")]*/
  632. STDMETHOD(QueryComponentDispatch)(/*[in]*/ HNODE hNode, /*[in]*/LPARAM lvData, /*[out]*/ PPDISPATCH SelectedObject) = 0;
  633. /*[helpstring("Creates a context menu for the specified node.")]*/
  634. STDMETHOD(CreateContextMenu)( PNODE pNode, HNODE hNode, PPCONTEXTMENU ppContextMenu) = 0;
  635. /*[helpstring("Creates a context menu for the current selection node.")]*/
  636. STDMETHOD(CreateSelectionContextMenu)( HNODE hNodeScope, CContextMenuInfo *pContextInfo, PPCONTEXTMENU ppContextMenu) = 0;
  637. /*[helpstring("show/hide column")]*/
  638. STDMETHOD(ShowColumn)(HNODE hNodeSelected, int iColIndex, bool bShow) = 0;
  639. /*[helpstring("to get the sort column")]*/
  640. STDMETHOD(GetSortColumn)(HNODE hNodeSelected, int *piSortCol) = 0;
  641. /*[helpstring("to set the sort column")]*/
  642. STDMETHOD(SetSortColumn)(HNODE hNodeSelected, int iSortCol, bool bAscending) = 0;
  643. /*[helpstring("Returns the data for the specified clipboard format of the specified list item")*/
  644. STDMETHOD(GetProperty)(/*[in]*/ HNODE hNodeScope, /*[in]*/ BOOL bForScopeItem, /*[in]*/ LPARAM resultItemParam, /*[in]*/ BSTR bstrPropertyName,
  645. /*[out]*/ PBSTR pbstrPropertyValue) =0;
  646. /*[helpstring("Returns the nodetype GUID identifier of the specified list item")*/
  647. STDMETHOD(GetNodetypeForListItem)(/*[in]*/ HNODE hNodeScope, /*[in]*/ BOOL bForScopeItem, /*[in]*/ LPARAM resultItemParam, /*[in]*/ PBSTR pbstrNodetype) =0;
  648. /* returns view extension by inserting them to provided iterator */
  649. STDMETHOD(GetNodeViewExtensions)(/*[in]*/ HNODE hNodeScope, /*[out]*/ CViewExtInsertIterator it) = 0;
  650. /* Inform nodemgr that the column data for given node has changed & to save the data */
  651. STDMETHOD(SaveColumnInfoList) (/*[in]*/HNODE hNode, /*[in]*/const CColumnInfoList& columnsList) = 0;
  652. /* Ask nodemgr for column-data (no sort data) to setup the headers. */
  653. STDMETHOD(GetPersistedColumnInfoList) (/*[in]*/HNODE hNode, /*[out]*/CColumnInfoList *pColumnsList) = 0;
  654. /* Inform nodemgr that the column data for given node is invalid. */
  655. STDMETHOD(DeletePersistedColumnData) (/*[in]*/HNODE hNode) = 0;
  656. /* Does about object exists for the snapin whose node is provided. */
  657. STDMETHOD(DoesAboutExist) (/*[in]*/HNODE hNode, /*[out]*/ bool *pbAboutExists) = 0;
  658. /* Show about box for given context. */
  659. STDMETHOD(ShowAboutInformation) (/*[in]*/HNODE hNode) = 0;
  660. /*Executes a shell command with the specified parameters in the specified directory with the correct window size*/
  661. STDMETHOD(ExecuteShellCommand)(/*[in]*/ HNODE hNode, /*[in]*/ BSTR Command, /*[in]*/ BSTR Directory, /*[in]*/ BSTR Parameters, /*[in]*/ BSTR WindowState) = 0;
  662. /*Given the context update the paste button.*/
  663. STDMETHOD(UpdatePasteButton)(/*[in]*/ HNODE hNode, /*[in]*/ BOOL bScope, /*[in]*/ LPARAM lCookie) = 0;
  664. /*Findout if current selection context can allow given dataobject to be pasted.*/
  665. STDMETHOD(QueryPaste)(/*[in]*/ HNODE hNode, /*[in]*/ BOOL bScope, /*[in]*/ LPARAM lCookie, /*[in]*/ IDataObject *pDataObject, /*[out]*/bool& bPasteAllowed, /*[out]*/ bool& bCopyOperatationIsDefault) = 0;
  666. /*Findout if current selection context can allow given dataobject to be pasted.*/
  667. STDMETHOD(QueryPasteFromClipboard)(/*[in]*/ HNODE hNode, /*[in]*/ BOOL bScope, /*[in]*/ LPARAM lCookie, /*[out]*/bool& bPasteAllowed) = 0;
  668. /*Given the current drop target (or paste target) context paste the given data object or the one from clipboard*/
  669. STDMETHOD(Drop) (/*[in]*/HNODE hNode, /*[in]*/BOOL bScope, /*[in]*/LPARAM lCookie, /*[in]*/IDataObject *pDataObjectToPaste, /*[in]*/BOOL bIsDragOperationMove) = 0;
  670. /*Given the current drop target (or paste target) context paste the given data object or the one from clipboard*/
  671. STDMETHOD(Paste) (/*[in]*/HNODE hNode, /*[in]*/BOOL bScope, /*[in]*/LPARAM lCookie) = 0;
  672. /*Get the IPersistStream of the CViewSettingsPersistor object for loading the settings.*/
  673. STDMETHOD(QueryViewSettingsPersistor) (/*[out]*/IPersistStream** ppStream) = 0;
  674. /*Get the IXMLObject of the CViewSettingsPersistor object for storing/loading the settings.*/
  675. STDMETHOD(QueryViewSettingsPersistor) (/*[out]*/CXMLObject** ppXMLObject) = 0;
  676. /*Inform nodemgr that the document is closing, do any cleanups.*/
  677. STDMETHOD(DocumentClosing) () = 0;
  678. // Given the node get the snapin name
  679. STDMETHOD(GetSnapinName)(/*[in]*/HNODE hNode, /*[out]*/LPOLESTR* ppszName, /*[out]*/ bool& bValidName) = 0;
  680. // Given the node see if it is dummy snapin
  681. STDMETHOD(IsDummySnapin)(/*[in]*/HNODE hNode, /*[out]*/bool& bDummySnapin) = 0;
  682. // See if the snapin supports MMC1.0 version of help (MMCN_SNAPINHELP)
  683. STDMETHOD(DoesStandardSnapinHelpExist)(/*[in]*/HNODE hNode, /*[out]*/bool& bStandardHelpExists) = 0;
  684. };
  685. // helpstring("IControlbarsCache Interface"),
  686. MMC_INTERFACE(IControlbarsCache, 2e9fcd38-b9a0-11d0-a79d-00c04fd8d565) : IUnknown
  687. {
  688. /*[helpstring("Detaches all the controlbars.")]*/
  689. STDMETHOD(DetachControlbars)() = 0;
  690. };
  691. typedef enum _EXTESION_TYPE
  692. {
  693. EXTESION_NAMESPACE = 0x1,
  694. EXTESION_CONTEXTMENU = 0x2,
  695. EXTESION_TOOLBAR = 0x3,
  696. EXTESION_PROPERTYSHEET = 0x4,
  697. } EXTESION_TYPE;
  698. // helpstring("INodeType Interface"),
  699. MMC_INTERFACE(INodeType, B08A8368-967F-11D0-A799-00C04FD8D565) : IUnknown
  700. {
  701. STDMETHOD(GetNodeTypeID)(/*[out]*/ GUID* pGUID) = 0;
  702. STDMETHOD(AddExtension)(/*[in]*/ GUID guidSnapIn,
  703. /*[in]*/ EXTESION_TYPE extnType) = 0;
  704. STDMETHOD(RemoveExtension)(/*[in]*/ GUID guidSnapIn,
  705. /*[in]*/ EXTESION_TYPE extnType) = 0;
  706. STDMETHOD(EnumExtensions)(/*[in]*/ EXTESION_TYPE extnType,
  707. /*[out]*/ IEnumGUID** ppEnumGUID) = 0;
  708. };
  709. // helpstring("INodeTypesCache Interface"),
  710. MMC_INTERFACE(INodeTypesCache, DE40436E-9671-11D0-A799-00C04FD8D565) : IUnknown
  711. {
  712. STDMETHOD(CreateNodeType)(/*[in]*/ GUID guidNodeType,
  713. /*[out]*/ INodeType** ppNodeType) = 0;
  714. STDMETHOD(DeleteNodeType)(/*[in]*/ GUID guidNodeType) = 0;
  715. STDMETHOD(EnumNodeTypes)(/*[out]*/ IEnumNodeTypes** ppEnumNodeTypes) = 0;
  716. };
  717. MMC_INTERFACE(IEnumNodeTypes, ABBD61E6-9686-11D0-A799-00C04FD8D565) : IUnknown
  718. {
  719. STDMETHOD(Next)(/*[in]*/ ULONG celt,
  720. /*[out, size_is(celt), length_is(*pceltFetched)]*/ INodeType*** rgelt,
  721. /*[out]*/ ULONG *pceltFetched) = 0;
  722. STDMETHOD(Skip)(/*[in]*/ ULONG celt) = 0;
  723. STDMETHOD(Reset)() = 0;
  724. STDMETHOD(Clone)(/*[out]*/ IEnumNodeTypes **ppenum) = 0;
  725. };
  726. class CBasicSnapinInfo
  727. {
  728. public:
  729. CBasicSnapinInfo() : m_clsid(GUID_NULL), m_nImageIndex(-1) {}
  730. public:
  731. CLSID m_clsid;
  732. std::wstring m_strName;
  733. int m_nImageIndex;
  734. };
  735. class CAvailableSnapinInfo
  736. {
  737. public:
  738. CAvailableSnapinInfo (bool f32Bit) : m_cTotalSnapins(0), m_himl(NULL), m_f32Bit(f32Bit) {}
  739. ~CAvailableSnapinInfo()
  740. {
  741. if (m_himl != NULL)
  742. ImageList_Destroy (m_himl);
  743. }
  744. public:
  745. std::vector<CBasicSnapinInfo> m_vAvailableSnapins; // snap-ins that are available in the requested memory model
  746. UINT m_cTotalSnapins; // total number of snap-ins referenced in the console file
  747. HIMAGELIST m_himl; // images for snap-ins in m_vAvailableSnapins
  748. const bool m_f32Bit; // check 32-bit (vs. 64-bit) snap-ins?
  749. };
  750. // helpstring("IDumpSnapins Interface"),
  751. MMC_INTERFACE(IDumpSnapins, A16496D0-1D2F-11d3-AEB8-00C04F8ECD78) : IUnknown
  752. {
  753. STDMETHOD(Dump)(/*[in]*/ LPCTSTR pszDumpFilePath) = 0;
  754. STDMETHOD(CheckSnapinAvailability)(/*[in/out]*/ CAvailableSnapinInfo& asi) = 0;
  755. };
  756. MMC_INTERFACE(IPropertySheetProviderPrivate, FEF554F8-A55A-11D0-A7D7-00C04FD909DD) : IPropertySheetProvider
  757. {
  758. STDMETHOD(ShowEx)(/*[in]*/ HWND hwnd, /*[in]*/ int page, /*[in]*/ BOOL bModalPage) = 0;
  759. STDMETHOD(CreatePropertySheetEx)(
  760. /*[in]*/ LPCWSTR title,
  761. /*[in]*/ boolean type,
  762. /*[in]*/ MMC_COOKIE cookie,
  763. /*[in]*/ LPDATAOBJECT pIDataObject,
  764. /*[in]*/ LONG_PTR lpMasterTreeNode,
  765. /*[in]*/ DWORD dwOptions) = 0;
  766. /*[helpstring("Collects the pages from the extension snap-in(s)")]*/
  767. STDMETHOD(AddMultiSelectionExtensionPages)(LONG_PTR lMultiSelection) = 0;
  768. /*[helpstring("Determine if the property sheet exist")]*/
  769. STDMETHOD(FindPropertySheetEx)(/*[in]*/ MMC_COOKIE cookie, /*[in]*/ LPCOMPONENT lpComponent,
  770. /*[in]*/ LPCOMPONENTDATA lpComponentData, /*[in]*/ LPDATAOBJECT lpDataObject) = 0;
  771. /*[helpstring("Set data required for property sheet tooltips")]*/
  772. STDMETHOD(SetPropertySheetData)(/*[in]*/ INT nPropSheetType, /*[in]*/ HMTNODE hMTNode) = 0;
  773. };
  774. const long CCLV_HEADERPAD = 25;
  775. // helpstring("MMC Default listview interface"),
  776. MMC_INTERFACE(IMMCListView, 1B3C1392-D68B-11CF-8C2B-00AA003CA9F6) : IUnknown
  777. {
  778. STDMETHOD(GetListStyle)( void ) = 0;
  779. STDMETHOD(SetListStyle)(
  780. /*[in]*/ long nNewValue ) = 0;
  781. STDMETHOD(GetViewMode)( void ) = 0;
  782. STDMETHOD(SetViewMode)(
  783. /*[in]*/ long nViewMode ) = 0;
  784. STDMETHOD(InsertItem)(
  785. /*[in]*/ LPOLESTR str,
  786. /*[in]*/ long iconNdx,
  787. /*[in]*/ LPARAM lParam,
  788. /*[in]*/ long state,
  789. /*[in]*/ long ownerID,
  790. /*[in]*/ long itemIndex,
  791. /*[out]*/ CResultItem*& pri) = 0;
  792. /* parameter changed to HRESULTITEM, not to use the CResultItem*
  793. pointer until we know it is not a virtual list */
  794. STDMETHOD(DeleteItem)(
  795. /*[in]*/ HRESULTITEM itemID,
  796. /*[in]*/ long nCol) = 0;
  797. STDMETHOD(FindItemByLParam)(
  798. /*[in]*/ long owner,
  799. /*[in]*/ LPARAM lParam,
  800. /*[out]*/ CResultItem*& pri) = 0;
  801. STDMETHOD(InsertColumn)(
  802. /*[in]*/ int nCol,
  803. /*[in]*/ LPCOLESTR str,
  804. /*[in]*/ long nFormat,
  805. /*[in]*/ long width) = 0;
  806. STDMETHOD(DeleteColumn)(
  807. /*[in]*/ int nCol) = 0;
  808. STDMETHOD(DeleteAllItems)(
  809. /*[in]*/ long ownerID) = 0;
  810. STDMETHOD(SetColumn)(
  811. /*[in]*/ long nCol,
  812. /*[in]*/ LPCOLESTR str,
  813. /*[in]*/ long nFormat,
  814. /*[in]*/ long width) = 0;
  815. STDMETHOD(GetColumn)(
  816. /*[in]*/ long nCol,
  817. /*[out]*/ LPOLESTR* str,
  818. /*[out]*/ long* nFormat,
  819. /*[out]*/ int* width) = 0;
  820. STDMETHOD(GetColumnCount)(
  821. /*[out]*/ int* nColCnt) = 0;
  822. STDMETHOD(SetItem)(
  823. /*[in]*/ int nIndex,
  824. /*[in]*/ CResultItem* pri,
  825. /*[in]*/ long nCol,
  826. /*[in]*/ LPOLESTR str,
  827. /*[in]*/ long nImage,
  828. /*[in]*/ LPARAM lParam,
  829. /*[in]*/ long nState,
  830. /*[in]*/ long ownerID) = 0;
  831. STDMETHOD(GetItem)(
  832. /*[in]*/ int nIndex,
  833. /*[in]*/ CResultItem*& pri,
  834. /*[in]*/ long nCol,
  835. /*[out]*/ LPOLESTR* str,
  836. /*[out]*/ int* nImage,
  837. /*[in]*/ LPARAM* lParam,
  838. /*[out]*/ unsigned int* nState,
  839. /*[out]*/ BOOL* pbScopeItem) = 0;
  840. STDMETHOD(GetNextItem)(
  841. /*[in]*/ COMPONENTID ownerID,
  842. /*[in]*/ long nIndex,
  843. /*[in]*/ UINT nState,
  844. /*[out]*/ CResultItem*& ppListItem,
  845. /*[out]*/ long& nIndexNextItem) = 0;
  846. STDMETHOD(GetLParam)(
  847. /*[in]*/ long nItem,
  848. /*[out]*/ CResultItem*& pri) = 0;
  849. STDMETHOD(ModifyItemState)(
  850. /*[in]*/ long nItem,
  851. /*[in]*/ CResultItem* pri,
  852. /*[in]*/ UINT add,
  853. /*[in]*/ UINT remove) = 0;
  854. STDMETHOD(SetIcon)(
  855. /*[in]*/ long nID,
  856. /*[in]*/ HICON hIcon,
  857. /*[in]*/ long nLoc) = 0;
  858. STDMETHOD(SetImageStrip)(
  859. /*[in]*/ long nID,
  860. /*[in]*/ HBITMAP hbmSmall,
  861. /*[in]*/ HBITMAP hbmLarge,
  862. /*[in]*/ long nStartLoc,
  863. /*[in]*/ long cMask) = 0;
  864. STDMETHOD(MapImage)(
  865. /*[in]*/ long nID,
  866. /*[in]*/ long nLoc,
  867. /*[out]*/ int* pResult) = 0;
  868. STDMETHOD(Reset)() = 0;
  869. STDMETHOD(Arrange)(/*[in]*/ long style) = 0;
  870. STDMETHOD(UpdateItem)(/*[in]*/HRESULTITEM itemID) = 0;
  871. STDMETHOD(Sort)(
  872. /*[in]*/ LPARAM lUserParam,
  873. /*[in]*/ long* pParams) = 0;
  874. STDMETHOD(SetItemCount)(
  875. /*[in]*/ int nItemCount,
  876. /*[in]*/ DWORD dwOptions) = 0;
  877. STDMETHOD(SetVirtualMode)(
  878. /*[in]*/ BOOL bVirtual) = 0;
  879. STDMETHOD(Repaint)(
  880. /*[in]*/ BOOL bErase) = 0;
  881. STDMETHOD(SetChangeTimeOut)(
  882. /*[in]*/ ULONG lTimeout) = 0;
  883. STDMETHOD(SetColumnFilter)(
  884. /*[in]*/ int nCol,
  885. /*[in]*/ DWORD dwType,
  886. /*[in]*/ MMC_FILTERDATA* pFilterData) = 0;
  887. STDMETHOD(GetColumnFilter)(
  888. /*[in]*/ int nCol,
  889. /*[in,out]*/ DWORD* dwType,
  890. /*[in,out]*/ MMC_FILTERDATA* pFilterData) = 0;
  891. STDMETHOD(SetColumnSortIcon)(
  892. /*[in]*/ int nNewCol,
  893. /*[in]*/ int nOldCol,
  894. /*[in]*/ BOOL bAscending,
  895. /*[in]*/ BOOL bSetSortIcon) = 0;
  896. STDMETHOD(SetLoadMode)(
  897. /*[in]*/ BOOL bState) = 0;
  898. /*[helpstring("Get the current list view header settings.")]*/
  899. STDMETHOD(GetColumnInfoList) (/*[out]*/CColumnInfoList *pColumnsList) = 0;
  900. /*[helpstring("Modify the list-view headers with given data.")]*/
  901. STDMETHOD(ModifyColumns) (/*[in]*/const CColumnInfoList& columnsList) = 0;
  902. /* Put the specified list item into rename mode */
  903. STDMETHOD(RenameItem) ( /*[in]*/HRESULTITEM itemID) =0;
  904. /*[helpstring("Get the column settings that snapin supplied originally")]*/
  905. STDMETHOD(GetDefaultColumnInfoList)(/*[out]*/ CColumnInfoList& columnsList) = 0;
  906. };
  907. ///////////////////////////////////////////////////////////////////////////////
  908. ///////////////////////////////////////////////////////////////////////////////
  909. ///////////////////////////////////////////////////////////////////////////////
  910. ///////////////////////////////////////////////////////////////////////////////
  911. ////
  912. //// MMC 1.1 changes
  913. ////
  914. // MMC_ITASK, internal form of MMC_TASK has additional field for classid.
  915. struct MMC_ITASK
  916. {
  917. MMC_TASK task;
  918. LPOLESTR szClsid;
  919. };
  920. // helpstring("Console <=> CIC communication conduit"),
  921. MMC_INTERFACE(ITaskPadHost, 4f7606d0-5568-11d1-9fea-00600832db4a) : IUnknown
  922. {
  923. /*[helpstring("CIC calls this when snapin's script wants to notify the snapin of something")]*/
  924. STDMETHOD(TaskNotify)(/*[in,string]*/ BSTR szClsid, /*[in]*/ VARIANT * pvArg, /*[in]*/ VARIANT * pvParam) = 0;
  925. /*[helpstring("CIC calls this when the script asks for tasks")]*/
  926. STDMETHOD(GetTaskEnumerator)(/*[in]*/ BSTR szTaskGroup, /*[out]*/ IEnumTASK** ppEnumTASK) = 0;
  927. /*[helpstring("Returns the primary snapins IExtendTaskPad")]*/
  928. STDMETHOD(GetPrimaryTask)(/*[out]*/ IExtendTaskPad** ppExtendTaskPad) = 0;
  929. /*[helpstring("Returns the primary snapin's taskpad title")]*/
  930. STDMETHOD(GetTitle)(/*[in]*/ BSTR szTaskGroup, /*[out]*/ BSTR * szTitle) = 0;
  931. /*[helpstring("Descriptive Text for the default task pad.")]*/
  932. STDMETHOD(GetDescriptiveText)(/*[in,string]*/ BSTR pszGroup, /*[out]*/ BSTR * pszDescriptiveText) = 0;
  933. /*[helpstring("Returns the primary snapin's taskpad background image.")]*/
  934. STDMETHOD(GetBackground)(/*[in]*/ BSTR szTaskGroup, /*[out]*/ MMC_TASK_DISPLAY_OBJECT * pTDO) = 0;
  935. // /*[helpstring("Returns the primary snapin's taskpad branding info.")]*/
  936. // STDMETHOD(GetBranding)(/*[in,string]*/ BSTR szGroup, /*[out]*/ MMC_TASK_DISPLAY_OBJECT * pTDO) = 0;
  937. /*[helpstring("Returns the primary snapin's listpad info")]*/
  938. STDMETHOD(GetListPadInfo)(/*[in]*/ BSTR szTaskGroup, /*[out]*/ MMC_ILISTPAD_INFO * pIListPadInfo) = 0;
  939. };
  940. // helpstring("Interface for accessing strings in a console file"),
  941. MMC_INTERFACE(IStringTablePrivate, 461A6010-0F9E-11d2-A6A1-0000F875A9CE) : IUnknown
  942. {
  943. /*[helpstring("Add a string to the snap-in's string table")]*/
  944. STDMETHOD(AddString)(
  945. /*[in]*/ LPCOLESTR pszAdd, // string to add to the string table
  946. /*[out]*/ MMC_STRING_ID* pStringID, // ID of added string
  947. /*[in]*/ const CLSID * pCLSID // CLSID of owner (NULL for MMC)
  948. ) = 0;
  949. /*[helpstring("Retrieves a string from the snap-in's string table")]*/
  950. STDMETHOD(GetString)(
  951. /*[in]*/ MMC_STRING_ID StringID, // ID of string
  952. /*[in]*/ ULONG cchBuffer, // number of characters in lpBuffer
  953. /*[out, size_is(cchBuffer)]*/
  954. LPOLESTR lpBuffer, // string corresponding to wStringID
  955. /*[out]*/ ULONG* pcchOut, // number of characters written to lpBuffer
  956. /*[in]*/ const CLSID * pCLSID // CLSID of owner (NULL for MMC)
  957. ) = 0;
  958. /*[helpstring("Retrieves the length of a string in the snap-in's string table")]*/
  959. STDMETHOD(GetStringLength)(
  960. /*[in]*/ MMC_STRING_ID StringID, // ID of string
  961. /*[out]*/ ULONG* pcchString, // number of characters in string, not including terminator
  962. /*[in]*/ const CLSID * pCLSID // CLSID of owner (NULL for MMC)
  963. ) = 0;
  964. /*[helpstring("Delete a string from the snap-in's string table")]*/
  965. STDMETHOD(DeleteString)(
  966. /*[in]*/ MMC_STRING_ID StringID, // ID of string to delete
  967. /*[in]*/ const CLSID * pCLSID // CLSID of owner (NULL for MMC)
  968. ) = 0;
  969. /*[helpstring("Delete all strings from the snap-in's string table")]*/
  970. STDMETHOD(DeleteAllStrings)(
  971. /*[in]*/ const CLSID * pCLSID // CLSID of owner (NULL for MMC)
  972. ) = 0;
  973. /*[helpstring("Find a string in the snap-in's string table")]*/
  974. STDMETHOD(FindString)(
  975. /*[in]*/ LPCOLESTR pszFind, // string to find in the string table
  976. /*[out]*/ MMC_STRING_ID* pStringID, // ID of string, if found
  977. /*[in]*/ const CLSID * pCLSID // CLSID of owner (NULL for MMC)
  978. ) = 0;
  979. /*[helpstring("Returns an enumerator into a snap-in's string table")]*/
  980. STDMETHOD(Enumerate)(
  981. /*[out]*/ IEnumString** ppEnum, // string enumerator
  982. /*[in]*/ const CLSID * pCLSID // CLSID of owner (NULL for MMC)
  983. ) = 0;
  984. };
  985. ///////////////////////////////////////////////////////////////////////////////
  986. ///////////////////////////////////////////////////////////////////////////////
  987. ///////////////////////////////////////////////////////////////////////////////
  988. ///////////////////////////////////////////////////////////////////////////////
  989. ////
  990. //// MMC 1.2 changes
  991. ////
  992. // ITaskCallback
  993. // helpstring("Task callback. Handles the drawing and selection notifications of tasks"),
  994. MMC_INTERFACE(ITaskCallback, 4b2293ba-e7ba-11d2-883c-00c04f72c717) : IUnknown
  995. {
  996. /*[helpstring("Determines whether to display "Edit" and "Delete" items for this taskpad.")]*/
  997. STDMETHOD(IsEditable)() = 0;
  998. /*[helpstring("Modifies the underlying taskpad.")]*/
  999. STDMETHOD(OnModifyTaskpad)() = 0;
  1000. /*[helpstring("Deletes the underlying taskpad.")]*/
  1001. STDMETHOD(OnDeleteTaskpad)() = 0;
  1002. /*[helpstring("Gets the GUID identifier of the underlying taskpad.")]*/
  1003. STDMETHOD(GetTaskpadID)(/*[out]*/ GUID *pGuid) = 0;
  1004. };
  1005. // helpstring("Interface for releasing Node Manager's cached com objects"),
  1006. MMC_INTERFACE(IComCacheCleanup, 35FEB982-55E9-483b-BD15-149F3F9E6C63) : IUnknown
  1007. {
  1008. /* gives a chance to release cached OLE objects prior to calling OleUninitialize */
  1009. STDMETHOD(ReleaseCachedOleObjects)() = 0;
  1010. };
  1011. #endif // __ndmgrpriv_h__