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