GME  13
ExpressionChecker.h
Go to the documentation of this file.
00001 // ExpressionChecker.h : Declaration of the CExpressionChecker
00002 
00003 #ifndef __EXPRESSIONCHECKER_H_
00004 #define __EXPRESSIONCHECKER_H_
00005 
00006 #include "resource.h"       // main symbols
00007 
00008 #include "commonsmart.h"
00009 #include "commonMFC.h"
00010 #include "commonerror.h"
00011 #include "CommonVersionInfo.h"
00012 #include "OCLGMEECFacade.h"
00013 
00014 #define EXP_COMPONENT_PROGID "Mga.AddOn.ExpressionChecker"
00015 #define EXP_COMPONENT_NAME "ExpressionChecker"
00016 #define EXP_CETYPE ((componenttype_enum)(COMPONENTTYPE_ADDON))
00017 #define EXP_PARADIGM "MetaGME"
00018 
00020 // CExpressionChecker
00021 class CExpressionChecker;
00022 
00023 class ATL_NO_VTABLE CExpEventSink :
00024 public CComObjectRootEx<CComSingleThreadModel>, public IMgaEventSink {
00025 public:
00026         CExpressionChecker *ec;
00027 BEGIN_COM_MAP(CExpEventSink)
00028         COM_INTERFACE_ENTRY(IMgaEventSink)
00029 END_COM_MAP()
00030         STDMETHOD(GlobalEvent) (globalevent_enum event);
00031         STDMETHOD(ObjectEvent) (IMgaObject * obj, unsigned long eventmask, VARIANT v);
00032 };
00033 
00034 
00035 class ATL_NO_VTABLE CExpressionChecker :
00036         public CComObjectRootEx<CComSingleThreadModel>,
00037         public CComCoClass<CExpressionChecker, &CLSID_ExpressionChecker>,
00038         public ISupportErrorInfo,
00039         public IDispatchImpl<IMgaComponentEx, &IID_IMgaComponentEx, &LIBID_CONSTRAINTMANAGERLib>,
00040         public IGMEVersionInfoImpl
00041 {
00042 public:
00043         CExpressionChecker()
00044         {
00045         }
00046 
00047 DECLARE_REGISTRY_RESOURCEID(IDR_EXPRESSIONCHECKER)
00048 
00049 DECLARE_PROTECT_FINAL_CONSTRUCT()
00050 
00051 BEGIN_COM_MAP(CExpressionChecker)
00052         COM_INTERFACE_ENTRY(IMgaComponentEx)
00053         COM_INTERFACE_ENTRY_IID(IID_IMgaComponent, IMgaComponentEx)
00054         COM_INTERFACE_ENTRY_IID(IID_IDispatch, IMgaComponentEx)
00055         COM_INTERFACE_ENTRY(ISupportErrorInfo)
00056         COM_INTERFACE_ENTRY_IID(IID_IGMEVersionInfo, IGMEVersionInfoImpl)
00057 END_COM_MAP()
00058 
00059 // IMgaComponentEx
00060 public:
00061         STDMETHOD(Invoke)(IMgaProject *project, IMgaFCOs *selectedobjs, long param);
00062         STDMETHOD(InvokeEx)(IMgaProject *project, IMgaFCO *currentobj, IMgaFCOs *selectedobjs, long param);
00063         STDMETHOD(ObjectsInvokeEx)(IMgaProject *project, IMgaObject *currentobj, IMgaObjects *selectedobjs, long param);
00064 
00065         STDMETHOD(Initialize)(IMgaProject *p);
00066         STDMETHOD(Enable)(VARIANT_BOOL enabled);
00067         STDMETHOD(get_InteractiveMode)(VARIANT_BOOL * enabled);
00068         STDMETHOD(put_InteractiveMode)(VARIANT_BOOL enabled);
00069         STDMETHOD(get_ComponentName)(BSTR *rVal);
00070         STDMETHOD(get_ComponentType)(componenttype_enum *t);
00071         STDMETHOD(get_Paradigm)(BSTR *rVal);
00072         STDMETHOD(get_ComponentProgID)(BSTR *rVal);
00073         STDMETHOD(get_ComponentParameter)(BSTR name, VARIANT *pVal);
00074         STDMETHOD(put_ComponentParameter)(BSTR name, VARIANT newVal);
00075 
00076 
00077         STDMETHOD(GlobalEvent) (globalevent_enum event);
00078         STDMETHOD(ObjectEvent) (IMgaObject * obj, unsigned long eventmask, VARIANT v);
00079 
00080         STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) {
00081                 ASSERT( InlineIsEqualGUID( riid,IID_IMgaComponentEx ) || InlineIsEqualGUID( riid,IID_IMgaComponent ) );
00082                 return S_OK;
00083         };
00084 
00085 private:
00086         CComObjPtr<IMgaTerritory>       m_spTerritory;
00087         CComObjPtr<CExpEventSink>       m_spEventSink;
00088         CComObjPtr<IMgaProject>                 m_spProject;
00089         CComPtr<IMgaAddOn>                      m_spAddOn;
00090 
00091         OclGmeEC::Facade                                        m_Facade;
00092 };
00093 
00094 #endif //__EXPRESSIONCHECKER_H_