1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox COM class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
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 |
|
---|
18 | #ifndef ____H_GUESTIMPL
|
---|
19 | #define ____H_GUESTIMPL
|
---|
20 |
|
---|
21 | #include "VirtualBoxBase.h"
|
---|
22 |
|
---|
23 | class Console;
|
---|
24 |
|
---|
25 | #define GUEST_STAT_INVALID (ULONG)-1
|
---|
26 |
|
---|
27 | class ATL_NO_VTABLE Guest :
|
---|
28 | public VirtualBoxSupportErrorInfoImpl <Guest, IGuest>,
|
---|
29 | public VirtualBoxSupportTranslation <Guest>,
|
---|
30 | public VirtualBoxBase,
|
---|
31 | public IGuest
|
---|
32 | {
|
---|
33 | public:
|
---|
34 |
|
---|
35 | DECLARE_NOT_AGGREGATABLE(Guest)
|
---|
36 |
|
---|
37 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
38 |
|
---|
39 | BEGIN_COM_MAP(Guest)
|
---|
40 | COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
---|
41 | COM_INTERFACE_ENTRY(IGuest)
|
---|
42 | END_COM_MAP()
|
---|
43 |
|
---|
44 | NS_DECL_ISUPPORTS
|
---|
45 |
|
---|
46 | DECLARE_EMPTY_CTOR_DTOR (Guest)
|
---|
47 |
|
---|
48 | HRESULT FinalConstruct();
|
---|
49 | void FinalRelease();
|
---|
50 |
|
---|
51 | // public initializer/uninitializer for internal purposes only
|
---|
52 | HRESULT init (Console *aParent);
|
---|
53 | void uninit();
|
---|
54 |
|
---|
55 | // IGuest properties
|
---|
56 | STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
|
---|
57 | STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive);
|
---|
58 | STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
|
---|
59 | STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless);
|
---|
60 | STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics);
|
---|
61 | STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
|
---|
62 | STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
|
---|
63 | STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
|
---|
64 | STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
|
---|
65 |
|
---|
66 | // IGuest methods
|
---|
67 | STDMETHOD(SetCredentials)(INPTR BSTR aUserName, INPTR BSTR aPassword,
|
---|
68 | INPTR BSTR aDomain, BOOL aAllowInteractiveLogon);
|
---|
69 | STDMETHOD(GetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG *aStatVal);
|
---|
70 |
|
---|
71 | // public methods that are not in IDL
|
---|
72 | void setAdditionsVersion (Bstr aVersion);
|
---|
73 |
|
---|
74 | void setSupportsSeamless (BOOL aSupportsSeamless);
|
---|
75 |
|
---|
76 | void setSupportsGraphics (BOOL aSupportsGraphics);
|
---|
77 |
|
---|
78 | STDMETHOD(SetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG aStatVal);
|
---|
79 |
|
---|
80 | // for VirtualBoxSupportErrorInfoImpl
|
---|
81 | static const wchar_t *getComponentName() { return L"Guest"; }
|
---|
82 |
|
---|
83 | private:
|
---|
84 |
|
---|
85 | struct Data
|
---|
86 | {
|
---|
87 | Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE),
|
---|
88 | /* Windows and OS/2 guests take this for granted */
|
---|
89 | mSupportsGraphics (TRUE) {}
|
---|
90 |
|
---|
91 | Bstr mOSTypeId;
|
---|
92 | BOOL mAdditionsActive;
|
---|
93 | Bstr mAdditionsVersion;
|
---|
94 | BOOL mSupportsSeamless;
|
---|
95 | BOOL mSupportsGraphics;
|
---|
96 | };
|
---|
97 |
|
---|
98 | ULONG mMemoryBalloonSize;
|
---|
99 | ULONG mStatUpdateInterval;
|
---|
100 |
|
---|
101 | ULONG mCurrentGuestStat[GuestStatisticType_MaxVal];
|
---|
102 |
|
---|
103 | ComObjPtr <Console, ComWeakRef> mParent;
|
---|
104 | Data mData;
|
---|
105 | };
|
---|
106 |
|
---|
107 | #endif // ____H_GUESTIMPL
|
---|