VirtualBox

source: vbox/trunk/src/VBox/Main/include/GuestOSTypeImpl.h@ 25414

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

API: big medium handling change and lots of assorted other cleanups and fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2009 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_GUESTOSTYPEIMPL
23#define ____H_GUESTOSTYPEIMPL
24
25#include "VirtualBoxBase.h"
26#include "Global.h"
27
28#include <VBox/ostypes.h>
29
30class ATL_NO_VTABLE GuestOSType :
31 public VirtualBoxBase,
32 public VirtualBoxSupportErrorInfoImpl<GuestOSType, IGuestOSType>,
33 public VirtualBoxSupportTranslation<GuestOSType>,
34 VBOX_SCRIPTABLE_IMPL(IGuestOSType)
35{
36public:
37
38 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (GuestOSType)
39
40 DECLARE_NOT_AGGREGATABLE(GuestOSType)
41
42 DECLARE_PROTECT_FINAL_CONSTRUCT()
43
44 BEGIN_COM_MAP(GuestOSType)
45 COM_INTERFACE_ENTRY(ISupportErrorInfo)
46 COM_INTERFACE_ENTRY(IGuestOSType)
47 COM_INTERFACE_ENTRY(IDispatch)
48 END_COM_MAP()
49
50 DECLARE_EMPTY_CTOR_DTOR (GuestOSType)
51
52 HRESULT FinalConstruct();
53 void FinalRelease();
54
55 // public initializer/uninitializer for internal purposes only
56 HRESULT init (const char *aFamilyId, const char *aFamilyDescription,
57 const char *aId, const char *aDescription,
58 VBOXOSTYPE aOSType, uint32_t aOSHint,
59 uint32_t aRAMSize, uint32_t aVRAMSize, uint32_t aHDDSize,
60 NetworkAdapterType_T aNetworkAdapterType, uint32_t numSerialEnabled);
61 void uninit();
62
63 // IGuestOSType properties
64 STDMETHOD(COMGETTER(FamilyId)) (BSTR *aFamilyId);
65 STDMETHOD(COMGETTER(FamilyDescription)) (BSTR *aFamilyDescription);
66 STDMETHOD(COMGETTER(Id)) (BSTR *aId);
67 STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
68 STDMETHOD(COMGETTER(Is64Bit)) (BOOL *aIs64Bit);
69 STDMETHOD(COMGETTER(RecommendedIOAPIC)) (BOOL *aRecommendedIOAPIC);
70 STDMETHOD(COMGETTER(RecommendedVirtEx)) (BOOL *aRecommendedVirtEx);
71 STDMETHOD(COMGETTER(RecommendedRAM)) (ULONG *aRAMSize);
72 STDMETHOD(COMGETTER(RecommendedVRAM)) (ULONG *aVRAMSize);
73 STDMETHOD(COMGETTER(RecommendedHDD)) (ULONG *aHDDSize);
74 STDMETHOD(COMGETTER(AdapterType)) (NetworkAdapterType_T *aNetworkAdapterType);
75
76 // public methods only for internal purposes
77 const Bstr &id() const { return mID; }
78 bool is64Bit() const { return !!(mOSHint & VBOXOSHINT_64BIT); }
79 bool recommendedIOAPIC() const { return !!(mOSHint & VBOXOSHINT_IOAPIC); }
80 bool recommendedVirtEx() const { return !!(mOSHint & VBOXOSHINT_HWVIRTEX); }
81 NetworkAdapterType_T networkAdapterType() const { return mNetworkAdapterType; }
82 uint32_t numSerialEnabled() const { return mNumSerialEnabled; }
83
84 // for VirtualBoxSupportErrorInfoImpl
85 static const wchar_t *getComponentName() { return L"GuestOSType"; }
86
87private:
88
89 const Bstr mFamilyID;
90 const Bstr mFamilyDescription;
91 const Bstr mID;
92 const Bstr mDescription;
93 const VBOXOSTYPE mOSType;
94 const uint32_t mOSHint;
95 const uint32_t mRAMSize;
96 const uint32_t mVRAMSize;
97 const uint32_t mHDDSize;
98 const uint32_t mMonitorCount;
99 const NetworkAdapterType_T mNetworkAdapterType;
100 const uint32_t mNumSerialEnabled;
101};
102
103#endif // ____H_GUESTOSTYPEIMPL
104/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use