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.

249 lines
9.2 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // DS Administration MMC snapin.
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1999
  7. //
  8. // File: ContextMenu.h
  9. //
  10. // Contents: ContextMenu object functions
  11. //
  12. // Classes: CContextMenuVerbs
  13. // CDSContextMenuVerbs
  14. // CDSAdminContextMenuVerbs
  15. // CSARContextMenuVerbs
  16. //
  17. // History: 28-Oct-99 JeffJon Created
  18. //
  19. //--------------------------------------------------------------------------
  20. #ifndef __CONTEXTMENU_H_
  21. #define __CONTEXTMENU_H_
  22. #include "dssnap.h"
  23. ///////////////////////////////////////////////////////////////////////////
  24. // CContextMenuVerbs
  25. //
  26. class CContextMenuVerbs
  27. {
  28. public:
  29. CContextMenuVerbs(CDSComponentData* pComponentData) : m_pComponentData(pComponentData)
  30. {}
  31. virtual ~CContextMenuVerbs() {}
  32. virtual HRESULT LoadNewMenu(IContextMenuCallback2*,
  33. IShellExtInit*,
  34. LPDATAOBJECT,
  35. CUINode*,
  36. long*) { return S_OK; }
  37. virtual HRESULT LoadTopMenu(IContextMenuCallback2*,
  38. CUINode*) { return S_OK; }
  39. virtual HRESULT LoadMainMenu(IContextMenuCallback2*,
  40. LPDATAOBJECT,
  41. CUINode*) { return S_OK; }
  42. virtual HRESULT LoadViewMenu(IContextMenuCallback2*,
  43. CUINode*) { return S_OK; }
  44. virtual HRESULT LoadTaskMenu(IContextMenuCallback2*,
  45. CUINode*) { return S_OK; }
  46. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  47. BOOL bScope,
  48. BOOL bSelect,
  49. CUINode* pUINode,
  50. LPDATAOBJECT pDataObject);
  51. virtual HRESULT LoadMenuExtensions(IContextMenuCallback2*,
  52. IShellExtInit*,
  53. LPDATAOBJECT,
  54. CUINode*) { return S_OK; }
  55. protected:
  56. HRESULT DSLoadAndAddMenuItem(IContextMenuCallback2* pIContextMenuCallback2,
  57. UINT nResourceID, // contains text and status text seperated by '\n'
  58. long lCommandID,
  59. long lInsertionPointID,
  60. long fFlags,
  61. PCWSTR pszLanguageIndependentID,
  62. long fSpecialFlags = 0);
  63. CDSComponentData* m_pComponentData;
  64. };
  65. ///////////////////////////////////////////////////////////////////////////
  66. // CSnapinRootMenuVerbs
  67. //
  68. class CSnapinRootMenuVerbs : public CContextMenuVerbs
  69. {
  70. public:
  71. CSnapinRootMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  72. {}
  73. virtual ~CSnapinRootMenuVerbs() {}
  74. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  75. CUINode* pUINode);
  76. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  77. CUINode* pUINode);
  78. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  79. CUINode* pUINode);
  80. };
  81. ///////////////////////////////////////////////////////////////////////////
  82. // CFavoritesFolderMenuVerbs
  83. //
  84. class CFavoritesFolderMenuVerbs : public CContextMenuVerbs
  85. {
  86. public:
  87. CFavoritesFolderMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  88. {}
  89. virtual ~CFavoritesFolderMenuVerbs() {}
  90. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  91. CUINode* pUINode);
  92. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  93. CUINode* pUINode);
  94. virtual HRESULT LoadNewMenu(IContextMenuCallback2* pContextMenuCallback,
  95. IShellExtInit* pShlInit,
  96. LPDATAOBJECT pDataObject,
  97. CUINode* pUINode,
  98. long *pInsertionAllowed);
  99. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  100. BOOL bScope,
  101. BOOL bSelect,
  102. CUINode* pUINode,
  103. LPDATAOBJECT pDataObject);
  104. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  105. CUINode* pUINode);
  106. };
  107. ///////////////////////////////////////////////////////////////////////////
  108. // CSavedQueryMenuVerbs
  109. //
  110. class CSavedQueryMenuVerbs : public CContextMenuVerbs
  111. {
  112. public:
  113. CSavedQueryMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  114. {}
  115. virtual ~CSavedQueryMenuVerbs() {}
  116. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  117. CUINode* pUINode);
  118. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  119. CUINode* pUINode);
  120. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  121. BOOL bScope,
  122. BOOL bSelect,
  123. CUINode* pUINode,
  124. LPDATAOBJECT pDataObject);
  125. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  126. CUINode* pUINode);
  127. };
  128. ///////////////////////////////////////////////////////////////////////////
  129. // CDSContextMenuVerbs
  130. //
  131. // This class is used to handle common behavior for DS objects
  132. //
  133. class CDSContextMenuVerbs : public CContextMenuVerbs
  134. {
  135. public:
  136. CDSContextMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  137. {}
  138. virtual ~CDSContextMenuVerbs() {}
  139. virtual HRESULT LoadNewMenu(IContextMenuCallback2* pContextMenuCallback,
  140. IShellExtInit* pShlInit,
  141. LPDATAOBJECT pDataObject,
  142. CUINode* pUINode,
  143. long *pInsertionAllowed);
  144. virtual HRESULT LoadViewMenu(IContextMenuCallback2* pContextMenuCallback,
  145. CUINode* pUINode);
  146. virtual HRESULT LoadMenuExtensions(IContextMenuCallback2* pContextMenuCallback,
  147. IShellExtInit* pShlInit,
  148. LPDATAOBJECT pDataObject,
  149. CUINode* pUINode);
  150. protected:
  151. int InsertAtTopContextMenu(LPCWSTR pwszParentClass, LPCWSTR pwszChildClass);
  152. };
  153. ///////////////////////////////////////////////////////////////////////////
  154. // CDSAdminContextMenuVerbs
  155. //
  156. // This class is used to handle specific behavior for DSAdmin
  157. //
  158. class CDSAdminContextMenuVerbs : public CDSContextMenuVerbs
  159. {
  160. public:
  161. CDSAdminContextMenuVerbs(CDSComponentData* pComponentData) : CDSContextMenuVerbs(pComponentData)
  162. {}
  163. virtual ~CDSAdminContextMenuVerbs() {}
  164. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  165. CUINode* pUINode);
  166. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  167. CUINode* pUINode);
  168. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  169. CUINode* pUINode);
  170. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  171. BOOL bScope,
  172. BOOL bSelect,
  173. CUINode* pUINode,
  174. LPDATAOBJECT pDataObject);
  175. // virtual HRESULT LoadNewMenu() {}
  176. // virtual HRESULT LoadMainMenu();
  177. // virtual HRESULT LoadMenuExtensions() {}
  178. protected:
  179. HRESULT LoadTopTaskHelper(IContextMenuCallback2* pContextMenuCallback,
  180. CUINode* pUINode,
  181. int insertionPoint);
  182. };
  183. ///////////////////////////////////////////////////////////////////////////
  184. // CSARContextMenuVerbs
  185. //
  186. // This class is used to handle specific behavior for Sites and Repl
  187. //
  188. class CSARContextMenuVerbs : public CDSContextMenuVerbs
  189. {
  190. public:
  191. CSARContextMenuVerbs(CDSComponentData* pComponentData) : CDSContextMenuVerbs(pComponentData)
  192. {}
  193. virtual ~CSARContextMenuVerbs() {}
  194. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback, CUINode* pUINode);
  195. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback, CUINode* pUINode);
  196. virtual HRESULT LoadViewMenu(IContextMenuCallback2* pContextMenuCallback, CUINode* pUINode);
  197. virtual HRESULT LoadMainMenu(IContextMenuCallback2* pContextMenuCallback,
  198. LPDATAOBJECT pDataObject,
  199. CUINode* pUINode);
  200. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  201. BOOL bScope,
  202. BOOL bSelect,
  203. CUINode* pUINode,
  204. LPDATAOBJECT pDataObject);
  205. // virtual HRESULT LoadNewMenu() {}
  206. // virtual HRESULT LoadMainMenu();
  207. // virtual HRESULT LoadStandardVerbs() {}
  208. // virtual HRESULT LoadMenuExtensions() {}
  209. protected:
  210. HRESULT LoadTopTaskHelper(IContextMenuCallback2* pContextMenuCallback,
  211. CUINode* pUINode,
  212. int insertionPoint);
  213. };
  214. #endif // __CONTEXTMENU_H_