GME
13
|
00001 // MgaMap2.h: interface for the CMgaMap class. 00002 // 00004 00005 #if !defined(AFX_MGAMAP2_H__4FB2B383_49D6_4C83_AB80_63DFF3C45380__INCLUDED_) 00006 #define AFX_MGAMAP2_H__4FB2B383_49D6_4C83_AB80_63DFF3C45380__INCLUDED_ 00007 00008 #if _MSC_VER > 1000 00009 #pragma once 00010 #endif // _MSC_VER > 1000 00011 00012 00013 #include "MgaObjectProxy.h" 00014 #include "AfxColl.h" 00015 00016 typedef CMap<HTREEITEM,HTREEITEM,CMgaObjectProxy*,CMgaObjectProxy*> CMapItem2Object; 00017 typedef CMap<LPUNKNOWN,LPUNKNOWN,HTREEITEM,HTREEITEM> CMapObject2Item; 00018 00019 00020 class CMgaMap 00021 { 00022 public: 00023 00024 // High level functions for complex operations eg. context menu 00025 void AddEntry(HTREEITEM hTreeItem, CMgaObjectProxy ObjectProxy); 00026 BOOL RemoveObjectProxy(CMgaObjectProxy MgaObjectProxy); 00027 BOOL RemoveTreeItem( HTREEITEM hTreeItem); 00028 BOOL LookupTreeItem(CMgaObjectProxy MgaObjectProxy, HTREEITEM& hTreeItem); 00029 BOOL LookupTreeItem(LPUNKNOWN pUnknown, HTREEITEM &hTreeItem); 00030 BOOL LookupObjectProxy(HTREEITEM hTreeItem,CMgaObjectProxy& rObjectProxy); 00031 00032 // Low level functions (involving IUnknown-based search) for efficiency 00033 // of the simple oprations 00034 BOOL bIsInMap(HTREEITEM hTreeItem); 00035 BOOL bIsInMap(LPUNKNOWN pUnknown); 00036 BOOL LookupObjectUnknown(HTREEITEM hTreeItem, LPUNKNOWN& pUnknown); 00037 void DestroyMap(); 00038 CMgaMap(); 00039 virtual ~CMgaMap(); 00040 00041 // Dump function 00042 #ifdef _DEBUG 00043 virtual void Dump(CDumpContext& dc ) const; 00044 #endif 00045 00046 00047 private: 00048 CMapObject2Item m_MapObject2Item; 00049 CMapItem2Object m_MapItem2Object; 00050 00051 }; 00052 00053 #endif // !defined(AFX_MGAMAP_H__4FB2B383_49D6_4C83_AB80_63DFF3C45380__INCLUDED_)