GME  13
GMEActiveBrowserCtl.h
Go to the documentation of this file.
00001 #if !defined(AFX_GMEACTIVEBROWSERCTL_H__F16A65B4_8221_4ABF_B2D6_463802025C5F__INCLUDED_)
00002 #define AFX_GMEACTIVEBROWSERCTL_H__F16A65B4_8221_4ABF_B2D6_463802025C5F__INCLUDED_
00003 
00004 #include "ActiveBrowserPropertyFrame.h"
00005 #include "MgaObjectEventList.h" // Added by ClassView
00006 
00007 #if _MSC_VER > 1000
00008 #pragma once
00009 #endif // _MSC_VER > 1000
00010 
00011 // GMEActiveBrowserCtl.h : Declaration of the CGMEActiveBrowserCtrl ActiveX Control class.
00012 
00014 // CGMEActiveBrowserCtrl : See GMEActiveBrowserCtl.cpp for implementation.
00015 
00016 
00017 class CGMEActiveBrowserCtrl : public COleControl
00018 {
00019         DECLARE_DYNCREATE(CGMEActiveBrowserCtrl)
00020 
00021         CActiveBrowserPropertyFrame* m_pPropFrame;
00022         CGMEActiveBrowserApp* m_pApp;
00023 // Constructor
00024 public:
00025         CGMEActiveBrowserCtrl();
00026 
00027         // Event handlers for the MGA layer
00028         void OnMgaObjectEvent(IMgaObject * obj, unsigned long eventmask, VARIANT v);
00029         void OnMgaGlobalEvent(globalevent_enum event);
00030 
00031 // Overrides
00032         // ClassWizard generated virtual function overrides
00033         //{{AFX_VIRTUAL(CGMEActiveBrowserCtrl)
00034         public:
00035         virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
00036         virtual void DoPropExchange(CPropExchange* pPX);
00037         virtual void OnResetState();
00038         virtual DWORD GetControlFlags();
00039         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00040         //}}AFX_VIRTUAL
00041 
00042 // Event maps
00043         //{{AFX_EVENT(CGMEActiveBrowserCtrl)
00044         void FireDblClickMgaObject(LPUNKNOWN pMgaObject)
00045                 {FireEvent(eventidDblClickMgaObject,EVENT_PARAM(VTS_UNKNOWN), pMgaObject);}
00046         void FireShowAttributes(LPUNKNOWN pMgaObject)
00047                 {FireEvent(eventidShowAttributes,EVENT_PARAM(VTS_UNKNOWN), pMgaObject);}
00048         void FireShowPreferences(LPUNKNOWN pMgaObject)
00049                 {FireEvent(eventidShowPreferences,EVENT_PARAM(VTS_UNKNOWN), pMgaObject);}
00050         void FireShowProperties()
00051                 {FireEvent(eventidShowProperties,EVENT_PARAM(VTS_NONE));}
00052         void FireClickMgaObject(LPUNKNOWN pMgaObject)
00053                 {FireEvent(eventidClickMgaObject,EVENT_PARAM(VTS_UNKNOWN), pMgaObject);}
00054         void FireShowInParentMgaObject(LPUNKNOWN pMgaObject)
00055                 {FireEvent(eventidShowInParentMgaObject,EVENT_PARAM(VTS_UNKNOWN), pMgaObject);}
00056         void FireRootFolderNameChanged()
00057                 {FireEvent(eventidRootFolderNameChanged, EVENT_PARAM(VTS_NONE)); }
00058         void FireShowFindDlg()
00059                 {FireEvent(eventidShowFindDlg, EVENT_PARAM(VTS_NONE)); }
00060         void FireShowObjInspDlg()
00061                 {FireEvent(eventidShowObjInspDlg, EVENT_PARAM(VTS_NONE)); }
00062         void FireCycleObjInsp(VARIANT_BOOL pFrwd)
00063                 {FireEvent(eventidCycleObjInsp, EVENT_PARAM(VTS_BOOL), pFrwd); }
00064         //}}AFX_EVENT
00065         DECLARE_EVENT_MAP()
00066 
00067 
00068 // Implementation
00069 protected:
00070         ~CGMEActiveBrowserCtrl();
00071 
00072         DECLARE_OLECREATE_EX(CGMEActiveBrowserCtrl)    // Class factory and guid
00073         DECLARE_OLETYPELIB(CGMEActiveBrowserCtrl)      // GetTypeInfo
00074         DECLARE_PROPPAGEIDS(CGMEActiveBrowserCtrl)     // Property page IDs
00075         DECLARE_OLECTLTYPE(CGMEActiveBrowserCtrl)               // Type name and misc status
00076 
00077 // Message maps
00078         //{{AFX_MSG(CGMEActiveBrowserCtrl)
00079         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00080         afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00081         //}}AFX_MSG
00082         DECLARE_MESSAGE_MAP()
00083 
00084 // Dispatch maps
00085         //{{AFX_DISPATCH(CGMEActiveBrowserCtrl)
00086         afx_msg short SetCurrentProject(LPUNKNOWN pMgaProject);
00087         afx_msg short CloseCurrentProject();
00088         afx_msg void RefreshAll();
00089         afx_msg LPUNKNOWN GetSelectedMgaObjects();
00090         afx_msg void OpenProject(LPCTSTR pProjectName);
00091 
00092         afx_msg void FocusItem(BSTR Id);
00093         afx_msg void OpenItem(BSTR Id);
00094         afx_msg void OpenSubtree(BSTR Id);
00095         afx_msg void CloseSubtree(BSTR Id);
00096         afx_msg void Up();
00097         afx_msg void Down();
00098         afx_msg void ChangePropPage(browser_page page);
00099         //}}AFX_DISPATCH
00100         DECLARE_DISPATCH_MAP()
00101 
00102 
00103 
00104         // Native COM interfaces - peter
00105         DECLARE_INTERFACE_MAP()
00106 public:
00107         BEGIN_INTERFACE_PART(EventSink, IMgaEventSink)
00108                 STDMETHOD(GlobalEvent(globalevent_enum event));
00109                 STDMETHOD(ObjectEvent(IMgaObject * obj, unsigned long eventmask, VARIANT v));
00110         END_INTERFACE_PART(EventSink)
00111 // Dispatch and event IDs
00112 public:
00113         enum {
00114         //{{AFX_DISP_ID(CGMEActiveBrowserCtrl)
00115         dispidSetCurrentProject = 1L,
00116         dispidCloseCurrentProject = 2L,
00117         dispidRefreshAll = 3L,
00118         dispidGetSelectedMgaObjects = 4L,
00119         dispidOpenProject = 5L,
00120         dispidFocusItem = 6L,
00121         dispidOpenItem = 7L,
00122         dispidOpenSubtree = 8L,
00123         dispidCloseSubtree = 9L,
00124         dispidUp = 10L,
00125         dispidDown = 11L,
00126         dispidChangePropPage = 12L,
00127         eventidDblClickMgaObject = 1L,
00128         eventidShowAttributes = 2L,
00129         eventidShowPreferences = 3L,
00130         eventidShowProperties = 4L,
00131         eventidClickMgaObject = 5L,
00132         eventidShowInParentMgaObject = 6L,
00133         eventidRootFolderNameChanged = 7L,
00134         eventidShowFindDlg = 8L,
00135         eventidShowObjInspDlg = 9L,
00136         eventidCycleObjInsp = 10L
00137         //}}AFX_DISP_ID
00138         };
00139 private:
00140         void PropagateMgaMessages();
00141         CMgaObjectEventList m_MgaObjectEventList;
00142         int CreateActiveBrowser();
00143 public:
00144         void HighlightItem(IUnknown* item, int highlight);
00145 };
00146 
00147 //{{AFX_INSERT_LOCATION}}
00148 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00149 
00150 #endif // !defined(AFX_GMEACTIVEBROWSERCTL_H__F16A65B4_8221_4ABF_B2D6_463802025C5F__INCLUDED)