Index: /trunk/src/VBox/Main/EventImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/EventImpl.cpp	(revision 30311)
+++ /trunk/src/VBox/Main/EventImpl.cpp	(revision 30311)
@@ -0,0 +1,154 @@
+/* $Id$ */
+/** @file
+ * VirtualBox COM Event class implementation
+ */
+
+/*
+ * Copyright (C) 2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "EventImpl.h"
+
+struct VBoxEvent::Data
+{
+    Data()
+        : 
+        mType(VBoxEventType_Invalid),
+        mWaitable(FALSE)
+    {}
+    VBoxEventType_T mType;
+    BOOL            mWaitable;
+};
+
+HRESULT VBoxEvent::FinalConstruct()
+{
+    m = new Data;
+    return S_OK;
+}
+
+void VBoxEvent::FinalRelease()
+{
+    uninit();
+    delete m;
+}
+
+
+HRESULT VBoxEvent::init(IEventSource *aSource, VBoxEventType_T aType, BOOL aWaitable)
+{
+    HRESULT rc = S_OK;
+
+    m->mType = aType;
+    m->mWaitable = aWaitable;
+
+    return rc;
+}
+
+void VBoxEvent::uninit()
+{
+    m->mType = VBoxEventType_Invalid;
+}
+
+STDMETHODIMP VBoxEvent::COMGETTER(Type)(VBoxEventType_T *aType)
+{
+    // never  changes till event alive, no locking?
+    *aType = m->mType;
+    return S_OK;
+}
+
+STDMETHODIMP VBoxEvent::COMGETTER(Source)(IEventSource* *aSource)
+{
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP VBoxEvent::COMGETTER(Waitable)(BOOL *aWaitable)
+{
+    // never  changes till event alive, no locking?
+    *aWaitable = m->mWaitable;
+    return S_OK;
+}
+
+
+STDMETHODIMP VBoxEvent::SetProcessed()
+{
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP VBoxEvent::WaitProcessed(LONG aTimeout, BOOL *aResult)
+{
+    return E_NOTIMPL;
+}
+
+
+struct EventSource::Data
+{
+    Data()
+        : 
+        mBogus(0)
+    {}
+    int32_t            mBogus;
+};
+
+HRESULT EventSource::FinalConstruct()
+{
+    m = new Data;
+    return S_OK;
+}
+
+void EventSource::FinalRelease()
+{
+    uninit();
+    delete m;
+}
+
+
+HRESULT EventSource::init()
+{
+    HRESULT rc = S_OK;
+    return rc;
+}
+
+void EventSource::uninit()
+{
+}
+
+STDMETHODIMP EventSource::RegisterListener(IEventListener * aListener, 
+                                           ComSafeArrayIn(VBoxEventType, aInterested),
+                                           BOOL             aActive)
+{
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP EventSource::UnregisterListener(IEventListener * aListener)
+{
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP EventSource::FireEvent(IEvent * aEvent,
+                                    LONG     aTimeout,
+                                    BOOL     *aProcessed)
+{
+    return E_NOTIMPL;
+}
+
+
+STDMETHODIMP EventSource::GetEvent(IEventListener * aListener,
+                                   LONG      aTimeout,
+                                   IEvent  * *aEvent)
+{
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP EventSource::EventProcessed(IEventListener * aListener,
+                                         IEvent *         aEvent)
+{
+    return E_NOTIMPL;
+}
+
Index: /trunk/src/VBox/Main/include/EventImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/EventImpl.h	(revision 30311)
+++ /trunk/src/VBox/Main/include/EventImpl.h	(revision 30311)
@@ -0,0 +1,123 @@
+/** @file
+ *
+ * VirtualBox COM IEvent implementation
+ */
+
+/*
+ * Copyright (C) 2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef ____H_EVENTIMPL
+#define ____H_EVENTIMPL
+
+#include "VirtualBoxBase.h"
+
+class ATL_NO_VTABLE VBoxEvent :
+    public VirtualBoxSupportErrorInfoImpl<VBoxEvent, IEvent>,
+    public VirtualBoxSupportTranslation<VBoxEvent>,
+    public VirtualBoxBase,
+    VBOX_SCRIPTABLE_IMPL(IEvent)
+{
+public:
+    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(VBoxEvent)
+
+    DECLARE_NOT_AGGREGATABLE(VBoxEvent)
+
+    DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+    BEGIN_COM_MAP(VBoxEvent)
+        COM_INTERFACE_ENTRY(ISupportErrorInfo)
+        COM_INTERFACE_ENTRY(IEvent)
+        COM_INTERFACE_ENTRY(IDispatch)
+    END_COM_MAP()
+
+    VBoxEvent() {}
+    virtual ~VBoxEvent() {}
+
+    HRESULT FinalConstruct();
+    void FinalRelease();
+
+    // public initializer/uninitializer for internal purposes only
+    HRESULT init (IEventSource *aSource, VBoxEventType_T aType, BOOL aWaitable);
+    void uninit();
+
+    // IEvent properties
+    STDMETHOD(COMGETTER(Type)) (VBoxEventType_T *aType);
+    STDMETHOD(COMGETTER(Source)) (IEventSource * *aSource);
+    STDMETHOD(COMGETTER(Waitable)) (BOOL *aWaitable);
+    
+    // IEvent methods
+    STDMETHOD(SetProcessed)();
+    STDMETHOD(WaitProcessed)(LONG aTimeout, BOOL *aResult);
+
+    // for VirtualBoxSupportErrorInfoImpl
+    static const wchar_t *getComponentName() { return L"Event"; }
+
+private:
+    struct Data;
+
+    Data* m;
+};
+
+class ATL_NO_VTABLE EventSource :
+    public VirtualBoxSupportErrorInfoImpl<EventSource, IEventSource>,
+    public VirtualBoxSupportTranslation<EventSource>,
+    public VirtualBoxBase,
+    VBOX_SCRIPTABLE_IMPL(IEventSource)
+{
+public:
+
+    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(EventSource)
+
+    DECLARE_NOT_AGGREGATABLE(EventSource)
+
+    DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+    BEGIN_COM_MAP(EventSource)
+        COM_INTERFACE_ENTRY(ISupportErrorInfo)
+        COM_INTERFACE_ENTRY(IEventSource)
+        COM_INTERFACE_ENTRY(IDispatch)
+    END_COM_MAP()
+
+    EventSource() {}
+    virtual ~EventSource() {}
+
+    HRESULT FinalConstruct();
+    void FinalRelease();
+
+    // public initializer/uninitializer for internal purposes only
+    HRESULT init ();
+    void uninit();
+
+    // IEventSource methods
+    STDMETHOD(RegisterListener)(IEventListener * aListener, 
+                                ComSafeArrayIn(VBoxEventType, aInterested),
+                                BOOL             aActive);
+    STDMETHOD(UnregisterListener)(IEventListener * aListener);
+    STDMETHOD(FireEvent)(IEvent * aEvent,
+                         LONG     aTimeout,
+                         BOOL     *aProcessed);
+    STDMETHOD(GetEvent)(IEventListener * aListener,
+                        LONG      aTimeout,
+                        IEvent  * *aEvent);
+    STDMETHOD(EventProcessed)(IEventListener * aListener,
+                              IEvent *         aEvent);
+
+    // for VirtualBoxSupportErrorInfoImpl
+    static const wchar_t *getComponentName() { return L"EventSource"; }
+
+private:
+    struct Data;
+
+    Data* m;
+};
+
+#endif // ____H_EVENTIMPL
