VirtualBox

source: vbox/trunk/src/VBox/Main/include/GuestImpl.h@ 27607

Last change on this file since 27607 was 27607, checked in by vboxsync, 15 years ago

Main: remove templates for 'weak' com pointers which do nothing anyway

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
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
28class Console;
29
30#define GUEST_STAT_INVALID (ULONG)-1
31
32class ATL_NO_VTABLE Guest :
33 public VirtualBoxSupportErrorInfoImpl<Guest, IGuest>,
34 public VirtualBoxSupportTranslation<Guest>,
35 public VirtualBoxBase,
36 VBOX_SCRIPTABLE_IMPL(IGuest)
37{
38public:
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 DECLARE_EMPTY_CTOR_DTOR (Guest)
51
52 HRESULT FinalConstruct();
53 void FinalRelease();
54
55 // public initializer/uninitializer for internal purposes only
56 HRESULT init (Console *aParent);
57 void uninit();
58
59 // IGuest properties
60 STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
61 STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive);
62 STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
63 STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless);
64 STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics);
65 STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
66 STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
67 STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
68 STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
69
70 // IGuest methods
71 STDMETHOD(SetCredentials)(IN_BSTR aUserName, IN_BSTR aPassword,
72 IN_BSTR aDomain, BOOL aAllowInteractiveLogon);
73 STDMETHOD(GetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG *aStatVal);
74
75 // public methods that are not in IDL
76 void setAdditionsVersion (Bstr aVersion, VBOXOSTYPE aOsType);
77
78 void setSupportsSeamless (BOOL aSupportsSeamless);
79
80 void setSupportsGraphics (BOOL aSupportsGraphics);
81
82 STDMETHOD(SetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG aStatVal);
83
84 // for VirtualBoxSupportErrorInfoImpl
85 static const wchar_t *getComponentName() { return L"Guest"; }
86
87private:
88
89 struct Data
90 {
91 Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE),
92 mSupportsGraphics (FALSE) {}
93
94 Bstr mOSTypeId;
95 BOOL mAdditionsActive;
96 Bstr mAdditionsVersion;
97 BOOL mSupportsSeamless;
98 BOOL mSupportsGraphics;
99 };
100
101 ULONG mMemoryBalloonSize;
102 ULONG mStatUpdateInterval;
103
104 ULONG mCurrentGuestStat[GuestStatisticType_MaxVal];
105
106 Console *mParent;
107 Data mData;
108};
109
110#endif // ____H_GUESTIMPL
111/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette