1 | /* $Id: VirtualBoxClientImpl.h 34421 2010-11-26 17:44:43Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * Header file for the VirtualBoxClient (IVirtualBoxClient) class, VBoxC.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2010 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef ____H_VIRTUALBOXCLIENTIMPL
|
---|
20 | #define ____H_VIRTUALBOXCLIENTIMPL
|
---|
21 |
|
---|
22 | #include "VirtualBoxBase.h"
|
---|
23 | #include "EventImpl.h"
|
---|
24 |
|
---|
25 | #ifdef RT_OS_WINDOWS
|
---|
26 | # include "win/resource.h"
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | class ATL_NO_VTABLE VirtualBoxClient :
|
---|
30 | public VirtualBoxBase,
|
---|
31 | VBOX_SCRIPTABLE_IMPL(IVirtualBoxClient)
|
---|
32 | #ifdef RT_OS_WINDOWS
|
---|
33 | , public CComCoClass<VirtualBoxClient, &CLSID_VirtualBoxClient>
|
---|
34 | #endif
|
---|
35 | {
|
---|
36 | public:
|
---|
37 |
|
---|
38 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(VirtualBoxClient, IVirtualBoxClient)
|
---|
39 |
|
---|
40 | DECLARE_CLASSFACTORY_SINGLETON(VirtualBoxClient)
|
---|
41 |
|
---|
42 | DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
|
---|
43 | DECLARE_NOT_AGGREGATABLE(VirtualBoxClient)
|
---|
44 |
|
---|
45 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
46 |
|
---|
47 | BEGIN_COM_MAP(VirtualBoxClient)
|
---|
48 | COM_INTERFACE_ENTRY2(IDispatch, IVirtualBoxClient)
|
---|
49 | COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
---|
50 | COM_INTERFACE_ENTRY(IVirtualBoxClient)
|
---|
51 | END_COM_MAP()
|
---|
52 |
|
---|
53 | DECLARE_EMPTY_CTOR_DTOR(VirtualBoxClient)
|
---|
54 |
|
---|
55 | HRESULT FinalConstruct();
|
---|
56 | void FinalRelease();
|
---|
57 |
|
---|
58 | // public initializer/uninitializer for internal purposes only
|
---|
59 | HRESULT init();
|
---|
60 | void uninit();
|
---|
61 |
|
---|
62 | // IUSBDevice properties
|
---|
63 | STDMETHOD(COMGETTER(VirtualBox))(IVirtualBox **aVirtualBox);
|
---|
64 | STDMETHOD(COMGETTER(Session))(ISession **aSession);
|
---|
65 | STDMETHOD(COMGETTER(EventSource))(IEventSource **aEventSource);
|
---|
66 |
|
---|
67 | private:
|
---|
68 |
|
---|
69 | static DECLCALLBACK(int) SVCWatcherThread(RTTHREAD ThreadSelf, void *pvUser);
|
---|
70 |
|
---|
71 | struct Data
|
---|
72 | {
|
---|
73 | Data()
|
---|
74 | {}
|
---|
75 |
|
---|
76 | const ComPtr<IVirtualBox> m_pVirtualBox;
|
---|
77 | const ComObjPtr<EventSource> m_pEventSource;
|
---|
78 |
|
---|
79 | RTTHREAD m_ThreadWatcher;
|
---|
80 | RTSEMEVENT m_SemEvWatcher;
|
---|
81 | };
|
---|
82 |
|
---|
83 | Data mData;
|
---|
84 | };
|
---|
85 |
|
---|
86 | #endif // ____H_VIRTUALBOXCLIENTIMPL
|
---|
87 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|