1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox COM class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | * additional information or have any questions.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef ____H_GUESTIMPL
|
---|
23 | #define ____H_GUESTIMPL
|
---|
24 |
|
---|
25 | #include "VirtualBoxBase.h"
|
---|
26 | #include <VBox/ostypes.h>
|
---|
27 |
|
---|
28 | class Console;
|
---|
29 |
|
---|
30 | #define GUEST_STAT_INVALID (ULONG)-1
|
---|
31 |
|
---|
32 | class ATL_NO_VTABLE Guest :
|
---|
33 | public VirtualBoxSupportErrorInfoImpl <Guest, IGuest>,
|
---|
34 | public VirtualBoxSupportTranslation <Guest>,
|
---|
35 | public VirtualBoxBaseNEXT,
|
---|
36 | VBOX_SCRIPTABLE_IMPL(IGuest)
|
---|
37 | {
|
---|
38 | public:
|
---|
39 |
|
---|
40 | DECLARE_NOT_AGGREGATABLE(Guest)
|
---|
41 |
|
---|
42 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
43 |
|
---|
44 | BEGIN_COM_MAP(Guest)
|
---|
45 | COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
---|
46 | COM_INTERFACE_ENTRY(IGuest)
|
---|
47 | COM_INTERFACE_ENTRY(IDispatch)
|
---|
48 | END_COM_MAP()
|
---|
49 |
|
---|
50 | NS_DECL_ISUPPORTS
|
---|
51 |
|
---|
52 | DECLARE_EMPTY_CTOR_DTOR (Guest)
|
---|
53 |
|
---|
54 | HRESULT FinalConstruct();
|
---|
55 | void FinalRelease();
|
---|
56 |
|
---|
57 | // public initializer/uninitializer for internal purposes only
|
---|
58 | HRESULT init (Console *aParent);
|
---|
59 | void uninit();
|
---|
60 |
|
---|
61 | // IGuest properties
|
---|
62 | STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
|
---|
63 | STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive);
|
---|
64 | STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
|
---|
65 | STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless);
|
---|
66 | STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics);
|
---|
67 | STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
|
---|
68 | STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
|
---|
69 | STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
|
---|
70 | STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
|
---|
71 |
|
---|
72 | // IGuest methods
|
---|
73 | STDMETHOD(SetCredentials)(IN_BSTR aUserName, IN_BSTR aPassword,
|
---|
74 | IN_BSTR aDomain, BOOL aAllowInteractiveLogon);
|
---|
75 | STDMETHOD(GetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG *aStatVal);
|
---|
76 |
|
---|
77 | // public methods that are not in IDL
|
---|
78 | void setAdditionsVersion (Bstr aVersion, VBOXOSTYPE aOsType);
|
---|
79 |
|
---|
80 | void setSupportsSeamless (BOOL aSupportsSeamless);
|
---|
81 |
|
---|
82 | void setSupportsGraphics (BOOL aSupportsGraphics);
|
---|
83 |
|
---|
84 | STDMETHOD(SetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG aStatVal);
|
---|
85 |
|
---|
86 | // for VirtualBoxSupportErrorInfoImpl
|
---|
87 | static const wchar_t *getComponentName() { return L"Guest"; }
|
---|
88 |
|
---|
89 | private:
|
---|
90 |
|
---|
91 | struct Data
|
---|
92 | {
|
---|
93 | Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE),
|
---|
94 | /* Windows and OS/2 guests take this for granted */
|
---|
95 | mSupportsGraphics (TRUE) {}
|
---|
96 |
|
---|
97 | Bstr mOSTypeId;
|
---|
98 | BOOL mAdditionsActive;
|
---|
99 | Bstr mAdditionsVersion;
|
---|
100 | BOOL mSupportsSeamless;
|
---|
101 | BOOL mSupportsGraphics;
|
---|
102 | };
|
---|
103 |
|
---|
104 | ULONG mMemoryBalloonSize;
|
---|
105 | ULONG mStatUpdateInterval;
|
---|
106 |
|
---|
107 | ULONG mCurrentGuestStat[GuestStatisticType_MaxVal];
|
---|
108 |
|
---|
109 | ComObjPtr <Console, ComWeakRef> mParent;
|
---|
110 | Data mData;
|
---|
111 | };
|
---|
112 |
|
---|
113 | #endif // ____H_GUESTIMPL
|
---|
114 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|