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.

88 lines
3.1 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to
  4. // existing Microsoft documentation.
  5. //
  6. //
  7. //
  8. //
  9. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  10. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  11. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  12. // PURPOSE.
  13. //
  14. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  15. //
  16. //
  17. //
  18. //==============================================================;
  19. #ifndef _BRANCHES_H
  20. #define _BRANCHES_H
  21. #include <mmc.h>
  22. #include <crtdbg.h>
  23. #include "globals.h"
  24. #include "resource.h"
  25. #include "LocalRes.h"
  26. class CComponentData;
  27. class CDelegationBase {
  28. public:
  29. CDelegationBase();
  30. virtual ~CDelegationBase();
  31. virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
  32. virtual void GetChildColumnInfo(RESULTDATAITEM *rdi) { }
  33. virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
  34. virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
  35. virtual const int GetBitmapIndex() = 0;
  36. virtual CDelegationBase *GetChildPtr(int index) { return NULL; }
  37. virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
  38. virtual HRESULT SelectItem(IConsole *pConsole)
  39. {
  40. return pConsole->SelectScopeItem(HSCOPEITEM(m_handle));
  41. }
  42. public:
  43. // virtual functions go here (for MMCN_*)
  44. virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
  45. virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
  46. virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
  47. virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) { return S_FALSE; }
  48. virtual HRESULT OnRefresh(IConsole *pConsole) { return S_FALSE; }
  49. virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) { return S_FALSE; }
  50. virtual HRESULT OnRename(LPOLESTR pszNewName) { return S_FALSE; }
  51. // cut / copy / paste implementation
  52. virtual HRESULT OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) { return S_FALSE; }
  53. virtual HRESULT OnQueryPaste(CDelegationBase *pPasted) { return S_FALSE; }
  54. virtual HRESULT OnDelete(IConsole *pConsole) { return S_FALSE; }
  55. virtual HRESULT OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) { _ASSERT(FALSE); return S_FALSE; }
  56. public:
  57. static HBITMAP m_pBMapSm;
  58. static HBITMAP m_pBMapLg;
  59. HANDLE GetHandle() { return m_handle; }
  60. void SetHandle(HANDLE handle) { m_handle = handle; }
  61. protected:
  62. static void LoadBitmaps() {
  63. m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
  64. m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
  65. }
  66. BOOL bExpanded;
  67. private:
  68. // {2974380B-4C4B-11d2-89D8-000021473128}
  69. static const GUID thisGuid;
  70. HANDLE m_handle;
  71. };
  72. #endif // _BRANCHES_H