1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
/* $Id: SystemPropertiesImpl.h $ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ____H_SYSTEMPROPERTIESIMPL
#define ____H_SYSTEMPROPERTIESIMPL
#include "VirtualBoxBase.h"
#include "MediumFormatImpl.h"
#include <VBox/com/array.h>
#include <list>
namespace settings
{
struct SystemProperties;
}
class ATL_NO_VTABLE SystemProperties :
public VirtualBoxBase,
VBOX_SCRIPTABLE_IMPL(ISystemProperties)
{
public:
VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SystemProperties, ISystemProperties)
DECLARE_NOT_AGGREGATABLE(SystemProperties)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(SystemProperties)
VBOX_DEFAULT_INTERFACE_ENTRIES(ISystemProperties)
END_COM_MAP()
DECLARE_EMPTY_CTOR_DTOR(SystemProperties)
HRESULT FinalConstruct();
void FinalRelease();
// public initializer/uninitializer for internal purposes only
HRESULT init(VirtualBox *aParent);
void uninit();
// ISystemProperties properties
STDMETHOD(COMGETTER(MinGuestRAM))(ULONG *minRAM);
STDMETHOD(COMGETTER(MaxGuestRAM))(ULONG *maxRAM);
STDMETHOD(COMGETTER(MinGuestVRAM))(ULONG *minVRAM);
STDMETHOD(COMGETTER(MaxGuestVRAM))(ULONG *maxVRAM);
STDMETHOD(COMGETTER(MinGuestCPUCount))(ULONG *minCPUCount);
STDMETHOD(COMGETTER(MaxGuestCPUCount))(ULONG *maxCPUCount);
STDMETHOD(COMGETTER(MaxGuestMonitors))(ULONG *maxMonitors);
STDMETHOD(COMGETTER(InfoVDSize))(LONG64 *infoVDSize);
STDMETHOD(COMGETTER(SerialPortCount))(ULONG *count);
STDMETHOD(COMGETTER(ParallelPortCount))(ULONG *count);
STDMETHOD(COMGETTER(MaxBootPosition))(ULONG *aMaxBootPosition);
STDMETHOD(COMGETTER(ExclusiveHwVirt))(BOOL *aExclusiveHwVirt);
STDMETHOD(COMSETTER(ExclusiveHwVirt))(BOOL aExclusiveHwVirt);
STDMETHOD(COMGETTER(LoggingLevel))(BSTR *aLoggingLevel);
STDMETHOD(COMSETTER(LoggingLevel))(IN_BSTR aLoggingLevel);
STDMETHOD(COMGETTER(DefaultMachineFolder))(BSTR *aDefaultMachineFolder);
STDMETHOD(COMSETTER(DefaultMachineFolder))(IN_BSTR aDefaultMachineFolder);
STDMETHOD(COMGETTER(MediumFormats))(ComSafeArrayOut(IMediumFormat *, aMediumFormats));
STDMETHOD(COMGETTER(DefaultHardDiskFormat))(BSTR *aDefaultHardDiskFormat);
STDMETHOD(COMSETTER(DefaultHardDiskFormat))(IN_BSTR aDefaultHardDiskFormat);
STDMETHOD(COMGETTER(FreeDiskSpaceWarning))(LONG64 *aFreeDiskSpace);
STDMETHOD(COMSETTER(FreeDiskSpaceWarning))(LONG64 aFreeDiskSpace);
STDMETHOD(COMGETTER(FreeDiskSpacePercentWarning))(ULONG *aFreeDiskSpacePercent);
STDMETHOD(COMSETTER(FreeDiskSpacePercentWarning))(ULONG aFreeDiskSpacePercent);
STDMETHOD(COMGETTER(FreeDiskSpaceError))(LONG64 *aFreeDiskSpace);
STDMETHOD(COMSETTER(FreeDiskSpaceError))(LONG64 aFreeDiskSpace);
STDMETHOD(COMGETTER(FreeDiskSpacePercentError))(ULONG *aFreeDiskSpacePercent);
STDMETHOD(COMSETTER(FreeDiskSpacePercentError))(ULONG aFreeDiskSpacePercent);
STDMETHOD(COMGETTER(VRDEAuthLibrary))(BSTR *aVRDEAuthLibrary);
STDMETHOD(COMSETTER(VRDEAuthLibrary))(IN_BSTR aVRDEAuthLibrary);
STDMETHOD(COMGETTER(WebServiceAuthLibrary))(BSTR *aWebServiceAuthLibrary);
STDMETHOD(COMSETTER(WebServiceAuthLibrary))(IN_BSTR aWebServiceAuthLibrary);
STDMETHOD(COMGETTER(DefaultVRDEExtPack))(BSTR *aExtPack);
STDMETHOD(COMSETTER(DefaultVRDEExtPack))(IN_BSTR aExtPack);
STDMETHOD(COMGETTER(LogHistoryCount))(ULONG *count);
STDMETHOD(COMSETTER(LogHistoryCount))(ULONG count);
STDMETHOD(COMGETTER(DefaultAudioDriver))(AudioDriverType_T *aAudioDriver);
STDMETHOD(COMGETTER(AutostartDatabasePath))(BSTR *aAutostartDbPath);
STDMETHOD(COMSETTER(AutostartDatabasePath))(IN_BSTR aAutostartDbPath);
STDMETHOD(COMGETTER(DefaultAdditionsISO))(BSTR *aDefaultAdditionsISO);
STDMETHOD(COMSETTER(DefaultAdditionsISO))(IN_BSTR aDefaultAdditionsISO);
STDMETHOD(COMGETTER(DefaultFrontend))(BSTR *aDefaultFrontend);
STDMETHOD(COMSETTER(DefaultFrontend))(IN_BSTR aDefaultFrontend);
STDMETHOD(GetMaxNetworkAdapters)(ChipsetType_T aChipset, ULONG *aMaxInstances);
STDMETHOD(GetMaxNetworkAdaptersOfType)(ChipsetType_T aChipset, NetworkAttachmentType_T aType, ULONG *aMaxInstances);
STDMETHOD(GetMaxDevicesPerPortForStorageBus)(StorageBus_T aBus, ULONG *aMaxDevicesPerPort);
STDMETHOD(GetMinPortCountForStorageBus)(StorageBus_T aBus, ULONG *aMinPortCount);
STDMETHOD(GetMaxPortCountForStorageBus)(StorageBus_T aBus, ULONG *aMaxPortCount);
STDMETHOD(GetMaxInstancesOfStorageBus)(ChipsetType_T aChipset, StorageBus_T aBus, ULONG *aMaxInstances);
STDMETHOD(GetDeviceTypesForStorageBus)(StorageBus_T aBus, ComSafeArrayOut(DeviceType_T, aDeviceTypes));
STDMETHOD(GetDefaultIoCacheSettingForStorageController)(StorageControllerType_T aControllerType, BOOL *aEnabled);
STDMETHOD(GetMaxInstancesOfUSBControllerType)(ChipsetType_T aChipset, USBControllerType_T aType, ULONG *aMaxInstances);
// public methods only for internal purposes
HRESULT loadSettings(const settings::SystemProperties &data);
HRESULT saveSettings(settings::SystemProperties &data);
ComObjPtr<MediumFormat> mediumFormat(const Utf8Str &aFormat);
ComObjPtr<MediumFormat> mediumFormatFromExtension(const Utf8Str &aExt);
// public methods for internal purposes only
// (ensure there is a caller and a read lock before calling them!)
private:
typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
HRESULT getUserHomeDirectory(Utf8Str &strPath);
HRESULT setDefaultMachineFolder(const Utf8Str &aPath);
HRESULT setLoggingLevel(const Utf8Str &aLoggingLevel);
HRESULT setDefaultHardDiskFormat(const Utf8Str &aFormat);
HRESULT setVRDEAuthLibrary(const Utf8Str &aPath);
HRESULT setWebServiceAuthLibrary(const Utf8Str &aPath);
HRESULT setDefaultVRDEExtPack(const Utf8Str &aPath);
HRESULT setAutostartDatabasePath(const Utf8Str &aPath);
HRESULT setDefaultAdditionsISO(const Utf8Str &aPath);
HRESULT setDefaultFrontend(const Utf8Str &aPath);
VirtualBox * const mParent;
settings::SystemProperties *m;
MediumFormatList m_llMediumFormats;
friend class VirtualBox;
};
#endif // ____H_SYSTEMPROPERTIESIMPL
/* vi: set tabstop=4 shiftwidth=4 expandtab: */
|