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.

261 lines
10 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. CInternalFormatCracker& ifc,
  51. LPDATAOBJECT pDataObject);
  52. virtual HRESULT LoadMenuExtensions(IContextMenuCallback2*,
  53. IShellExtInit*,
  54. LPDATAOBJECT,
  55. CUINode*) { return S_OK; }
  56. protected:
  57. HRESULT DSLoadAndAddMenuItem(IContextMenuCallback2* pIContextMenuCallback2,
  58. UINT nResourceID, // contains text and status text seperated by '\n'
  59. long lCommandID,
  60. long lInsertionPointID,
  61. long fFlags,
  62. PCWSTR pszLanguageIndependentID,
  63. long fSpecialFlags = 0);
  64. CDSComponentData* m_pComponentData;
  65. };
  66. ///////////////////////////////////////////////////////////////////////////
  67. // CSnapinRootMenuVerbs
  68. //
  69. class CSnapinRootMenuVerbs : public CContextMenuVerbs
  70. {
  71. public:
  72. CSnapinRootMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  73. {}
  74. virtual ~CSnapinRootMenuVerbs() {}
  75. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  76. CUINode* pUINode);
  77. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  78. CUINode* pUINode);
  79. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  80. CUINode* pUINode);
  81. };
  82. ///////////////////////////////////////////////////////////////////////////
  83. // CFavoritesFolderMenuVerbs
  84. //
  85. class CFavoritesFolderMenuVerbs : public CContextMenuVerbs
  86. {
  87. public:
  88. CFavoritesFolderMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  89. {}
  90. virtual ~CFavoritesFolderMenuVerbs() {}
  91. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  92. CUINode* pUINode);
  93. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  94. CUINode* pUINode);
  95. virtual HRESULT LoadNewMenu(IContextMenuCallback2* pContextMenuCallback,
  96. IShellExtInit* pShlInit,
  97. LPDATAOBJECT pDataObject,
  98. CUINode* pUINode,
  99. long *pInsertionAllowed);
  100. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  101. BOOL bScope,
  102. BOOL bSelect,
  103. CUINode* pUINode,
  104. CInternalFormatCracker& ifc,
  105. LPDATAOBJECT pDataObject);
  106. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  107. CUINode* pUINode);
  108. };
  109. ///////////////////////////////////////////////////////////////////////////
  110. // CSavedQueryMenuVerbs
  111. //
  112. class CSavedQueryMenuVerbs : public CContextMenuVerbs
  113. {
  114. public:
  115. CSavedQueryMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  116. {}
  117. virtual ~CSavedQueryMenuVerbs() {}
  118. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  119. CUINode* pUINode);
  120. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  121. CUINode* pUINode);
  122. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  123. BOOL bScope,
  124. BOOL bSelect,
  125. CUINode* pUINode,
  126. CInternalFormatCracker& ifc,
  127. LPDATAOBJECT pDataObject);
  128. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  129. CUINode* pUINode);
  130. };
  131. ///////////////////////////////////////////////////////////////////////////
  132. // CDSContextMenuVerbs
  133. //
  134. // This class is used to handle common behavior for DS objects
  135. //
  136. class CDSContextMenuVerbs : public CContextMenuVerbs
  137. {
  138. public:
  139. CDSContextMenuVerbs(CDSComponentData* pComponentData) : CContextMenuVerbs(pComponentData)
  140. {}
  141. virtual ~CDSContextMenuVerbs() {}
  142. virtual HRESULT LoadNewMenu(IContextMenuCallback2* pContextMenuCallback,
  143. IShellExtInit* pShlInit,
  144. LPDATAOBJECT pDataObject,
  145. CUINode* pUINode,
  146. long *pInsertionAllowed);
  147. virtual HRESULT LoadViewMenu(IContextMenuCallback2* pContextMenuCallback,
  148. CUINode* pUINode);
  149. virtual HRESULT LoadMenuExtensions(IContextMenuCallback2* pContextMenuCallback,
  150. IShellExtInit* pShlInit,
  151. LPDATAOBJECT pDataObject,
  152. CUINode* pUINode);
  153. protected:
  154. int InsertAtTopContextMenu(LPCWSTR pwszParentClass, LPCWSTR pwszChildClass);
  155. };
  156. ///////////////////////////////////////////////////////////////////////////
  157. // CDSAdminContextMenuVerbs
  158. //
  159. // This class is used to handle specific behavior for DSAdmin
  160. //
  161. class CDSAdminContextMenuVerbs : public CDSContextMenuVerbs
  162. {
  163. public:
  164. CDSAdminContextMenuVerbs(CDSComponentData* pComponentData) : CDSContextMenuVerbs(pComponentData)
  165. {}
  166. virtual ~CDSAdminContextMenuVerbs() {}
  167. virtual
  168. HRESULT
  169. LoadMainMenu(
  170. IContextMenuCallback2* pContextMenuCallback,
  171. LPDATAOBJECT,
  172. CUINode* pUINode) { return LoadTopMenu(pContextMenuCallback, pUINode); }
  173. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback,
  174. CUINode* pUINode);
  175. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback,
  176. CUINode* pUINode);
  177. virtual HRESULT LoadViewMenu(IContextMenuCallback2* piCMenuCallback,
  178. CUINode* pUINode);
  179. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  180. BOOL bScope,
  181. BOOL bSelect,
  182. CUINode* pUINode,
  183. CInternalFormatCracker& ifc,
  184. LPDATAOBJECT pDataObject);
  185. // virtual HRESULT LoadNewMenu() {}
  186. // virtual HRESULT LoadMainMenu();
  187. // virtual HRESULT LoadMenuExtensions() {}
  188. protected:
  189. HRESULT LoadTopTaskHelper(IContextMenuCallback2* pContextMenuCallback,
  190. CUINode* pUINode,
  191. int insertionPoint);
  192. };
  193. ///////////////////////////////////////////////////////////////////////////
  194. // CSARContextMenuVerbs
  195. //
  196. // This class is used to handle specific behavior for Sites and Repl
  197. //
  198. class CSARContextMenuVerbs : public CDSContextMenuVerbs
  199. {
  200. public:
  201. CSARContextMenuVerbs(CDSComponentData* pComponentData) : CDSContextMenuVerbs(pComponentData)
  202. {}
  203. virtual ~CSARContextMenuVerbs() {}
  204. virtual HRESULT LoadTopMenu(IContextMenuCallback2* pContextMenuCallback, CUINode* pUINode);
  205. virtual HRESULT LoadTaskMenu(IContextMenuCallback2* pContextMenuCallback, CUINode* pUINode);
  206. virtual HRESULT LoadViewMenu(IContextMenuCallback2* pContextMenuCallback, CUINode* pUINode);
  207. virtual HRESULT LoadMainMenu(IContextMenuCallback2* pContextMenuCallback,
  208. LPDATAOBJECT pDataObject,
  209. CUINode* pUINode);
  210. virtual void LoadStandardVerbs(IConsoleVerb* pConsoleVerb,
  211. BOOL bScope,
  212. BOOL bSelect,
  213. CUINode* pUINode,
  214. CInternalFormatCracker& ifc,
  215. LPDATAOBJECT pDataObject);
  216. // virtual HRESULT LoadNewMenu() {}
  217. // virtual HRESULT LoadMainMenu();
  218. // virtual HRESULT LoadStandardVerbs() {}
  219. // virtual HRESULT LoadMenuExtensions() {}
  220. protected:
  221. HRESULT LoadTopTaskHelper(IContextMenuCallback2* pContextMenuCallback,
  222. CUINode* pUINode,
  223. int insertionPoint);
  224. };
  225. #endif // __CONTEXTMENU_H_