GME  13
MgaMetaFolder.h
Go to the documentation of this file.
00001 
00002 #ifndef MGA_MGAMETAFOLDER_H
00003 #define MGA_MGAMETAFOLDER_H
00004 
00005 #ifndef MGA_MGAMETABASE_H
00006 #include "MgaMetaBase.h"
00007 #endif
00008 
00009 // --------------------------- CMgaMetaFolder
00010 
00011 class ATL_NO_VTABLE CMgaMetaFolder : 
00012         public CComObjectRootEx<CComSingleThreadModel>,
00013         public CComCoClass<CMgaMetaFolder, &__uuidof(MgaMetaFolder)>,
00014         public IDispatchImpl<IMgaMetaFolder, &__uuidof(IMgaMetaFolder), &__uuidof(__MGAMetaLib)>,
00015         public CMgaMetaBase
00016 {
00017 public:
00018         IUnknown *GetUnknown() const { return (IMgaMetaFolder*)this; }
00019 
00020 DECLARE_REGISTRY_RESOURCEID(IDR_MGAMETAFOLDER)
00021 DECLARE_ONLY_AGGREGATABLE(CMgaMetaFolder)
00022 
00023 BEGIN_COM_MAP(CMgaMetaFolder)
00024         COM_INTERFACE_ENTRY(IMgaMetaFolder)
00025         COM_INTERFACE_ENTRY2(IMgaMetaBase, CMgaMetaBase)
00026         COM_INTERFACE_ENTRY2(IDispatch, IMgaMetaFolder)
00027 END_COM_MAP()
00028 
00029 DECLARE_MGAMETABASE()
00030 
00031 // ------- Methods
00032 
00033 public:
00034         STDMETHOD(get_DefinedIn)(IMgaMetaFolder **p)
00035         { return ComGetPointerValue(GetUnknown(), ATTRID_DEFFOLDER_PTR, p); }
00036 
00037         STDMETHOD(get_DefinedFolders)(IMgaMetaFolders **p)
00038         { return ComGetCollectionValue<IMgaMetaFolder>(GetUnknown(), ATTRID_DEFFOLDER_PTR, p); }
00039 
00040         STDMETHOD(get_DefinedFolderByName)(BSTR name, VARIANT_BOOL inscope, IMgaMetaFolder **p);
00041 
00042         STDMETHOD(GetDefinedFolderByNameDisp)(BSTR name, VARIANT_BOOL inscope, IMgaMetaFolder **p)
00043         { return get_DefinedFolderByName( name, inscope, p); }
00044 
00045         STDMETHOD(get_DefinedFCOs)(IMgaMetaFCOs **p)
00046         {       return ComGetSortedCollValue<IMgaMetaFCO>(GetUnknown(), ATTRID_DEFFCO_PTR, p); }
00047 
00048         STDMETHOD(get_DefinedFCOByName)(BSTR name, VARIANT_BOOL inscope, IMgaMetaFCO **p);
00049 
00050         STDMETHOD(GetDefinedFCOByNameDisp)(BSTR name, VARIANT_BOOL inscope, IMgaMetaFCO **p)
00051         { return get_DefinedFCOByName( name, inscope, p); }
00052 
00053         STDMETHOD(get_DefinedAttributes)(IMgaMetaAttributes **p)
00054         { return ComGetSortedCollValue<IMgaMetaAttribute>(GetUnknown(), ATTRID_DEFATTR_PTR, p); }
00055 
00056         STDMETHOD(get_DefinedAttributeByName)(BSTR name, VARIANT_BOOL inscope, IMgaMetaAttribute **p);
00057 
00058         STDMETHOD(GetDefinedAttributeByNameDisp)(BSTR name, VARIANT_BOOL inscope, IMgaMetaAttribute **p)
00059         { return get_DefinedAttributeByName( name, inscope, p); }
00060 
00061         STDMETHOD(get_LegalChildFolders)(IMgaMetaFolders **p)
00062         { return ComGetSortedLinkCollValue<IMgaMetaFolder>(GetUnknown(),
00063                 ATTRID_FOLDERLINK_PARENT_PTR, ATTRID_FOLDERLINK_CHILD_PTR, p); }
00064 
00065         STDMETHOD(get_LegalChildFolderByName)(BSTR name, IMgaMetaFolder **p)
00066         { return ComGetLinkCollValueByName(name, GetUnknown(), 
00067                 ATTRID_FOLDERLINK_PARENT_PTR, ATTRID_FOLDERLINK_CHILD_PTR, p); }
00068 
00069         STDMETHOD(GetLegalChildFolderByNameDisp)(BSTR name, IMgaMetaFolder **p)
00070         { return get_LegalChildFolderByName( name, p); }
00071 
00072         STDMETHOD(get_LegalRootObjects)(IMgaMetaFCOs **p)
00073         {   return ComGetSortedLinkCollValue<IMgaMetaFCO>(GetUnknown(),
00074                 ATTRID_ROOTOBJLINK_FOLDER_PTR, ATTRID_ROOTOBJLINK_OBJECT_PTR, p); }
00075 
00076         STDMETHOD(get_LegalRootObjectByName)(BSTR name, IMgaMetaFCO **p)
00077         { return ComGetLinkCollValueByName(name, GetUnknown(),
00078                 ATTRID_ROOTOBJLINK_FOLDER_PTR, ATTRID_ROOTOBJLINK_OBJECT_PTR, p); }
00079 
00080         STDMETHOD(GetLegalRootObjectByNameDisp)(BSTR name, IMgaMetaFCO **p)
00081         { return get_LegalRootObjectByName( name, p); }
00082 
00083         STDMETHOD(get_UsedInFolders)(IMgaMetaFolders **p)
00084         { return ComGetLinkCollectionValue<IMgaMetaFolder>(GetUnknown(),
00085                 ATTRID_FOLDERLINK_CHILD_PTR, ATTRID_FOLDERLINK_PARENT_PTR, p); }
00086 
00087 // ------- Edit
00088 
00089 public:
00090         STDMETHOD(DefineFolder)(IMgaMetaFolder **p)
00091         { return ComDefineBase(this, METAID_METAFOLDER, ATTRID_DEFFOLDER_PTR, p); }
00092 
00093         STDMETHOD(DefineModel)(IMgaMetaModel **p)
00094         { return ComDefineBase(this, METAID_METAMODEL, ATTRID_DEFFCO_PTR, p); }
00095 
00096         STDMETHOD(DefineAtom)(IMgaMetaAtom **p)
00097         { return ComDefineBase(this, METAID_METAATOM, ATTRID_DEFFCO_PTR, p); }
00098 
00099         STDMETHOD(DefineReference)(IMgaMetaReference **p)
00100         { return ComDefineBase(this, METAID_METAREFERENCE, ATTRID_DEFFCO_PTR, p); }
00101 
00102         STDMETHOD(DefineSet)(IMgaMetaSet **p)
00103         { return ComDefineBase(this, METAID_METASET, ATTRID_DEFFCO_PTR, p); }
00104 
00105         STDMETHOD(DefineConnection)(IMgaMetaConnection **p)
00106         { return ComDefineBase(this, METAID_METACONNECTION, ATTRID_DEFFCO_PTR, p); }
00107 
00108         STDMETHOD(DefineAttribute)(IMgaMetaAttribute **p)
00109         { return ComDefineBase(this, METAID_METAATTRIBUTE, ATTRID_DEFATTR_PTR, p); }
00110 
00111         STDMETHOD(AddLegalChildFolder)(IMgaMetaFolder *p)
00112         { return ComAddLink(this, METAID_METAFOLDERLINK, ATTRID_FOLDERLINK_PARENT_PTR,
00113                 ATTRID_FOLDERLINK_CHILD_PTR, p); }
00114 
00115         STDMETHOD(RemoveLegalChildFolder)(IMgaMetaFolder *p)
00116         { return ComRemoveLink(this, METAID_METAFOLDERLINK, ATTRID_FOLDERLINK_PARENT_PTR,
00117                 ATTRID_FOLDERLINK_CHILD_PTR, p); }
00118 
00119         STDMETHOD(AddLegalRootObject)(IMgaMetaFCO *p)
00120         { return ComAddLink(this, METAID_METAROOTOBJLINK, ATTRID_ROOTOBJLINK_FOLDER_PTR,
00121                 ATTRID_ROOTOBJLINK_OBJECT_PTR, p); }
00122 
00123         STDMETHOD(RemoveLegalRootObject)(IMgaMetaFCO *p)
00124         { return ComRemoveLink(this, METAID_METAROOTOBJLINK, ATTRID_ROOTOBJLINK_FOLDER_PTR,
00125                 ATTRID_ROOTOBJLINK_OBJECT_PTR, p); }
00126 
00127 // ------- Traverse
00128 
00129 public:
00130         static void Traverse(CMgaMetaProject *metaproject, CCoreObjectPtr &me);
00131 };
00132 
00133 #endif//MGA_MGAMETAFOLDER_H