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.

98 lines
4.2 KiB

  1. #ifndef _BRANCHES_H
  2. #define _BRANCHES_H
  3. #include <mmc.h>
  4. #include <crtdbg.h>
  5. #include "globals.h"
  6. #include "resource.h"
  7. #include "localres.h"
  8. #include "uddi.h"
  9. class CComponent;
  10. class CComponentData;
  11. class CDelegationBase
  12. {
  13. public:
  14. CDelegationBase();
  15. virtual ~CDelegationBase();
  16. virtual const _TCHAR *GetDisplayName( int nCol = 0 ) = 0;
  17. virtual const GUID & getNodeType(){ _ASSERT(FALSE); return IID_NULL; }
  18. virtual const LPARAM GetCookie(){ return reinterpret_cast<LPARAM>(this); }
  19. virtual const int GetBitmapIndex() = 0;
  20. virtual HRESULT GetResultViewType( LPOLESTR *ppViewType, long *pViewOptions ) { return S_FALSE; }
  21. virtual void SetScopeItemValue( HSCOPEITEM hscopeitem ) { m_hsiThis = hscopeitem; }
  22. virtual HSCOPEITEM GetScopeItemValue() { return m_hsiThis; }
  23. virtual HSCOPEITEM GetParentScopeItem() { return m_hsiParent; }
  24. virtual void SetParentScopeItem( HSCOPEITEM hscopeitem ) { m_hsiParent = hscopeitem; }
  25. virtual BOOL IsDirty() { return FALSE; }
  26. virtual HRESULT Load( IStream *pStm ){ return S_OK; }
  27. virtual HRESULT Save( IStream *pStm, BOOL fClearDirty ){ return S_OK; }
  28. virtual ULONG GetSizeMax(){ return 0UL; }
  29. virtual const wstring& GetHelpFile()
  30. {
  31. if( 0 == m_wstrHelpFile.length() )
  32. {
  33. WCHAR szWindowsDir[ MAX_PATH ];
  34. if( 0 == GetWindowsDirectoryW( szWindowsDir, MAX_PATH ) )
  35. return m_wstrHelpFile;
  36. m_wstrHelpFile = szWindowsDir;
  37. m_wstrHelpFile += L"\\Help\\uddi.mmc.chm";
  38. }
  39. return m_wstrHelpFile;
  40. }
  41. virtual BOOL IsExtension(){ return m_bIsExtension; }
  42. virtual void SetExtension( BOOL bExtension ){ m_bIsExtension = bExtension; }
  43. virtual BOOL HasChildren() { return TRUE; }
  44. virtual BOOL ChildExists( const WCHAR *pwszName ) { return FALSE; }
  45. virtual HRESULT RemoveChildren( IConsoleNameSpace *pNS ) { return S_FALSE; }
  46. public:
  47. //
  48. // Virtual functions go here (for MMCN_*)
  49. //
  50. virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
  51. virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
  52. virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
  53. virtual HRESULT OnRename(LPOLESTR pszNewName) { return S_FALSE; }
  54. virtual HRESULT OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) { return S_FALSE; }
  55. virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) { return S_FALSE; }
  56. virtual HRESULT OnRefresh(IConsole *pConsole) { return S_FALSE; }
  57. virtual HRESULT OnDelete(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsoleComp) { return S_FALSE; }
  58. virtual HRESULT OnPropertyChange(IConsole *pConsole, CComponent *pComponent) { return S_OK; }
  59. virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) { return S_FALSE; }
  60. virtual HRESULT OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) { return S_FALSE; }
  61. virtual HRESULT OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) { return S_FALSE; }
  62. virtual HRESULT OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) { return S_FALSE; }
  63. virtual HRESULT OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) { return S_FALSE; }
  64. virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle){ return S_FALSE; }
  65. virtual HRESULT HasPropertySheets() { return S_FALSE; }
  66. virtual HRESULT GetWatermarks( HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch ) { return S_FALSE; }
  67. public:
  68. static HBITMAP m_pBMapSm;
  69. static HBITMAP m_pBMapLg;
  70. protected:
  71. static void LoadBitmaps()
  72. {
  73. m_pBMapSm = LoadBitmap( g_hinst, MAKEINTRESOURCE(IDR_SMICONS) );
  74. m_pBMapLg = LoadBitmap( g_hinst, MAKEINTRESOURCE(IDR_LGICONS) );
  75. }
  76. BOOL m_bExpanded;
  77. wstring m_wstrHelpFile;
  78. BOOL m_bIsExtension;
  79. HSCOPEITEM m_hsiParent;
  80. HSCOPEITEM m_hsiThis;
  81. private:
  82. static const GUID thisGuid;
  83. };
  84. #endif // _BRANCHES_H