GME  13
MgaMetaPointerSpec.h
Go to the documentation of this file.
00001 
00002 #ifndef MGA_MGAMETAPOINTERSPEC_H
00003 #define MGA_MGAMETAPOINTERSPEC_H
00004 
00005 // --------------------------- CMgaMetaPointerSpec
00006 
00007 class ATL_NO_VTABLE CMgaMetaPointerSpec : 
00008         public CComObjectRootEx<CComSingleThreadModel>,
00009         public CComCoClass<CMgaMetaPointerSpec, &__uuidof(MgaMetaPointerSpec)>,
00010         public IDispatchImpl<IMgaMetaPointerSpec, &__uuidof(IMgaMetaPointerSpec), &__uuidof(__MGAMetaLib)>
00011 {
00012 public:
00013         IUnknown *GetUnknown() const { return (IMgaMetaPointerSpec*)this; }
00014 
00015 DECLARE_REGISTRY_RESOURCEID(IDR_MGAMETAPOINTERSPEC)
00016 DECLARE_ONLY_AGGREGATABLE(CMgaMetaPointerSpec)
00017 
00018 BEGIN_COM_MAP(CMgaMetaPointerSpec)
00019         COM_INTERFACE_ENTRY(IMgaMetaPointerSpec)
00020         // intentionally omitted: COM_INTERFACE_ENTRY2(IDispatch, IMgaMetaPointerSpec)
00021         //    if CMgaMetaPointerSpec would expose this interface, we can't get IDispatch for IMgaMetaReference
00022         //    (of course now we can't get IDispatch for IMgaMetaPointerSpec, but this is less bad)
00023 END_COM_MAP()
00024 
00025 public:
00026         STDMETHOD(get_Parent)(IDispatch **p);
00027 
00028         STDMETHOD(get_Name)(BSTR *p)
00029         { return ComGetAttrValue(GetUnknown(), ATTRID_PTRSPECNAME, p); }
00030 
00031         STDMETHOD(get_Items)(IMgaMetaPointerItems **p)
00032         { return ComGetCollectionValue<IMgaMetaPointerItem>(
00033                 GetUnknown(), ATTRID_PTRITEMS_COLL, p); }
00034 
00035 // ------- Edit
00036 
00037 public:
00038         STDMETHOD(put_Name)(BSTR p)
00039         { return ComPutAttrValue(GetUnknown(), ATTRID_PTRSPECNAME, p); }
00040 
00041         STDMETHOD(CreateItem)(IMgaMetaPointerItem **p)
00042         { return ComCreateMetaObj(GetUnknown(), METAID_METAPOINTERITEM, ATTRID_PTRITEMS_COLL, p); }
00043 
00044 // ------- Methods
00045 
00046 public:
00047         static void Traverse(CMgaMetaProject *metaproject, CCoreObjectPtr &me);
00048         static bool CheckPath(CCoreObjectPtr &self, pathitems_type &pathitems, bool global);
00049 };
00050 
00051 #endif//MGA_MGAMETAPOINTERSPEC_H