VirtualBox

source: vbox/trunk/src/VBox/Main/include/SystemPropertiesImpl.h

Last change on this file was 109008, checked in by vboxsync, 3 weeks ago

VMM,Main: Working on ARM CPU profile support, which is neede/useful for getting info about the host CPU as well. The CPUDBENTRY typedef is used externally by Main, so we can't have two definitions of it, so left the bits that are common to both x86 and ARM in CPUDBENTRY and created sub-structures for each of the two targets/platforms. Also started reworking the VBoxCpuReport tool so we can use it on arm as well (much left to do there, though). jiraref:VBP-1598

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.4 KB
Line 
1/* $Id: SystemPropertiesImpl.h 109008 2025-04-16 20:59:36Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2024 Oracle and/or its affiliates.
10 *
11 * This file is part of VirtualBox base platform packages, as
12 * available from https://www.215389.xyz.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation, in version 3 of the
17 * License.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see <https://www.gnu.org/licenses>.
26 *
27 * SPDX-License-Identifier: GPL-3.0-only
28 */
29
30#ifndef MAIN_INCLUDED_SystemPropertiesImpl_h
31#define MAIN_INCLUDED_SystemPropertiesImpl_h
32#ifndef RT_WITHOUT_PRAGMA_ONCE
33# pragma once
34#endif
35
36#include "MediumFormatImpl.h"
37#include "SystemPropertiesWrap.h"
38
39#include <VBox/vmm/cpum.h> /* for CPUMDBENTRYTYPE */
40
41class CPUProfile;
42class PlatformProperties;
43
44namespace settings
45{
46 struct SystemProperties;
47}
48
49class ATL_NO_VTABLE SystemProperties :
50 public SystemPropertiesWrap
51{
52public:
53 typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
54 typedef std::list<ComObjPtr<CPUProfile> > CPUProfileList_T;
55
56 DECLARE_COMMON_CLASS_METHODS(SystemProperties)
57
58 HRESULT FinalConstruct();
59 void FinalRelease();
60
61 // public initializer/uninitializer for internal purposes only
62 HRESULT init(VirtualBox *aParent);
63 void uninit() RT_OVERRIDE;
64
65 // public methods for internal purposes only
66 // (ensure there is a caller and a read lock before calling them!)
67 HRESULT i_loadSettings(const settings::SystemProperties &data);
68 HRESULT i_saveSettings(settings::SystemProperties &data);
69
70 ComObjPtr<MediumFormat> i_mediumFormat(const Utf8Str &aFormat);
71 ComObjPtr<MediumFormat> i_mediumFormatFromExtension(const Utf8Str &aExt);
72
73 int i_loadVDPlugin(const char *pszPluginLibrary);
74 int i_unloadVDPlugin(const char *pszPluginLibrary);
75
76 HRESULT i_getDefaultAdditionsISO(com::Utf8Str &aDefaultAdditionsISO);
77
78private:
79
80 // wrapped ISystemProperties properties
81 HRESULT getMinGuestRAM(ULONG *aMinGuestRAM) RT_OVERRIDE;
82 HRESULT getMaxGuestRAM(ULONG *aMaxGuestRAM) RT_OVERRIDE;
83 HRESULT getMinGuestVRAM(ULONG *aMinGuestVRAM) RT_OVERRIDE;
84 HRESULT getMaxGuestVRAM(ULONG *aMaxGuestVRAM) RT_OVERRIDE;
85 HRESULT getMinGuestCPUCount(ULONG *aMinGuestCPUCount) RT_OVERRIDE;
86 HRESULT getMaxGuestCPUCount(ULONG *aMaxGuestCPUCount) RT_OVERRIDE;
87 HRESULT getMaxGuestMonitors(ULONG *aMaxGuestMonitors) RT_OVERRIDE;
88 HRESULT getInfoVDSize(LONG64 *aInfoVDSize) RT_OVERRIDE;
89 HRESULT getDefaultMachineFolder(com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE;
90 HRESULT setDefaultMachineFolder(const com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE;
91 HRESULT getLoggingLevel(com::Utf8Str &aLoggingLevel) RT_OVERRIDE;
92 HRESULT setLoggingLevel(const com::Utf8Str &aLoggingLevel) RT_OVERRIDE;
93 HRESULT getMediumFormats(std::vector<ComPtr<IMediumFormat> > &aMediumFormats) RT_OVERRIDE;
94 HRESULT getDefaultHardDiskFormat(com::Utf8Str &aDefaultHardDiskFormat) RT_OVERRIDE;
95 HRESULT setDefaultHardDiskFormat(const com::Utf8Str &aDefaultHardDiskFormat) RT_OVERRIDE;
96 HRESULT getFreeDiskSpaceWarning(LONG64 *aFreeDiskSpaceWarning) RT_OVERRIDE;
97 HRESULT setFreeDiskSpaceWarning(LONG64 aFreeDiskSpaceWarning) RT_OVERRIDE;
98 HRESULT getFreeDiskSpacePercentWarning(ULONG *aFreeDiskSpacePercentWarning) RT_OVERRIDE;
99 HRESULT setFreeDiskSpacePercentWarning(ULONG aFreeDiskSpacePercentWarning) RT_OVERRIDE;
100 HRESULT getFreeDiskSpaceError(LONG64 *aFreeDiskSpaceError) RT_OVERRIDE;
101 HRESULT setFreeDiskSpaceError(LONG64 aFreeDiskSpaceError) RT_OVERRIDE;
102 HRESULT getFreeDiskSpacePercentError(ULONG *aFreeDiskSpacePercentError) RT_OVERRIDE;
103 HRESULT setFreeDiskSpacePercentError(ULONG aFreeDiskSpacePercentError) RT_OVERRIDE;
104 HRESULT getVRDEAuthLibrary(com::Utf8Str &aVRDEAuthLibrary) RT_OVERRIDE;
105 HRESULT setVRDEAuthLibrary(const com::Utf8Str &aVRDEAuthLibrary) RT_OVERRIDE;
106 HRESULT getWebServiceAuthLibrary(com::Utf8Str &aWebServiceAuthLibrary) RT_OVERRIDE;
107 HRESULT setWebServiceAuthLibrary(const com::Utf8Str &aWebServiceAuthLibrary) RT_OVERRIDE;
108 HRESULT getDefaultVRDEExtPack(com::Utf8Str &aDefaultVRDEExtPack) RT_OVERRIDE;
109 HRESULT setDefaultVRDEExtPack(const com::Utf8Str &aDefaultVRDEExtPack) RT_OVERRIDE;
110 HRESULT getDefaultCryptoExtPack(com::Utf8Str &aDefaultCryptoExtPack) RT_OVERRIDE;
111 HRESULT setDefaultCryptoExtPack(const com::Utf8Str &aDefaultCryptoExtPack) RT_OVERRIDE;
112 HRESULT getLogHistoryCount(ULONG *aLogHistoryCount) RT_OVERRIDE;
113 HRESULT setLogHistoryCount(ULONG aLogHistoryCount) RT_OVERRIDE;
114 HRESULT getDefaultAudioDriver(AudioDriverType_T *aDefaultAudioDriver) RT_OVERRIDE;
115 HRESULT getAutostartDatabasePath(com::Utf8Str &aAutostartDatabasePath) RT_OVERRIDE;
116 HRESULT setAutostartDatabasePath(const com::Utf8Str &aAutostartDatabasePath) RT_OVERRIDE;
117 HRESULT getDefaultAdditionsISO(com::Utf8Str &aDefaultAdditionsISO) RT_OVERRIDE;
118 HRESULT setDefaultAdditionsISO(const com::Utf8Str &aDefaultAdditionsISO) RT_OVERRIDE;
119 HRESULT getDefaultFrontend(com::Utf8Str &aDefaultFrontend) RT_OVERRIDE;
120 HRESULT setDefaultFrontend(const com::Utf8Str &aDefaultFrontend) RT_OVERRIDE;
121 HRESULT getScreenShotFormats(std::vector<BitmapFormat_T> &aScreenShotFormats) RT_OVERRIDE;
122 HRESULT getPlatform(ComPtr<IPlatformProperties> &aPlatformProperties) RT_OVERRIDE;
123 HRESULT getProxyMode(ProxyMode_T *pProxyMode) RT_OVERRIDE;
124 HRESULT setProxyMode(ProxyMode_T aProxyMode) RT_OVERRIDE;
125 HRESULT getProxyURL(com::Utf8Str &aProxyURL) RT_OVERRIDE;
126 HRESULT setProxyURL(const com::Utf8Str &aProxyURL) RT_OVERRIDE;
127 HRESULT getSupportedPlatformArchitectures(std::vector<PlatformArchitecture_T> &aSupportedPlatformArchitectures) RT_OVERRIDE;
128 HRESULT getSupportedClipboardModes(std::vector<ClipboardMode_T> &aSupportedClipboardModes) RT_OVERRIDE;
129 HRESULT getSupportedDnDModes(std::vector<DnDMode_T> &aSupportedDnDModes) RT_OVERRIDE;
130 HRESULT getSupportedPointingHIDTypes(std::vector<PointingHIDType_T> &aSupportedPointingHIDTypes) RT_OVERRIDE;
131 HRESULT getSupportedKeyboardHIDTypes(std::vector<KeyboardHIDType_T> &aSupportedKeyboardHIDTypes) RT_OVERRIDE;
132 HRESULT getSupportedVFSTypes(std::vector<VFSType_T> &aSupportedVFSTypes) RT_OVERRIDE;
133 HRESULT getSupportedImportOptions(std::vector<ImportOptions_T> &aSupportedImportOptions) RT_OVERRIDE;
134 HRESULT getSupportedExportOptions(std::vector<ExportOptions_T> &aSupportedExportOptions) RT_OVERRIDE;
135 HRESULT getSupportedGraphicsFeatures(std::vector<GraphicsFeature_T> &aSupportedGraphicsFeatures) RT_OVERRIDE;
136 HRESULT getSupportedRecordingFeatures(std::vector<RecordingFeature_T> &aSupportedRecordingFeatures) RT_OVERRIDE;
137 HRESULT getSupportedRecordingAudioCodecs(std::vector<RecordingAudioCodec_T> &aSupportedRecordingAudioCodecs) RT_OVERRIDE;
138 HRESULT getSupportedRecordingVideoCodecs(std::vector<RecordingVideoCodec_T> &aSupportedRecordingVideoCodecs) RT_OVERRIDE;
139 HRESULT getSupportedRecordingVSModes(std::vector<RecordingVideoScalingMode_T> &aSupportedRecordingVideoScalingModes) RT_OVERRIDE;
140 HRESULT getSupportedRecordingARCModes(std::vector<RecordingRateControlMode_T> &aSupportedRecordingAudioRateControlModes) RT_OVERRIDE;
141 HRESULT getSupportedRecordingVRCModes(std::vector<RecordingRateControlMode_T> &aSupportedRecordingVideoRateControlModes) RT_OVERRIDE;
142 HRESULT getSupportedCloneOptions(std::vector<CloneOptions_T> &aSupportedCloneOptions) RT_OVERRIDE;
143 HRESULT getSupportedAutostopTypes(std::vector<AutostopType_T> &aSupportedAutostopTypes) RT_OVERRIDE;
144 HRESULT getSupportedVMProcPriorities(std::vector<VMProcPriority_T> &aSupportedVMProcPriorities) RT_OVERRIDE;
145 HRESULT getSupportedNetworkAttachmentTypes(std::vector<NetworkAttachmentType_T> &aSupportedNetworkAttachmentTypes) RT_OVERRIDE;
146 HRESULT getSupportedPortModes(std::vector<PortMode_T> &aSupportedPortModes) RT_OVERRIDE;
147 HRESULT getSupportedAudioDriverTypes(std::vector<AudioDriverType_T> &aSupportedAudioDriverTypes) RT_OVERRIDE;
148 HRESULT getLanguageId(com::Utf8Str &aLanguageId) RT_OVERRIDE;
149 HRESULT setLanguageId(const com::Utf8Str &aLanguageId) RT_OVERRIDE;
150
151 // wrapped ISystemProperties methods
152 HRESULT getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType,
153 BOOL *aEnabled) RT_OVERRIDE;
154 HRESULT getCPUProfiles(CPUArchitecture_T aArchitecture, const com::Utf8Str &aNamePattern,
155 std::vector<ComPtr<ICPUProfile> > &aProfiles) RT_OVERRIDE;
156 HRESULT getExecutionEnginesForVmCpuArchitecture(CPUArchitecture_T aCpuArchitecture,
157 std::vector<VMExecutionEngine_T> &aExecutionEngines) RT_OVERRIDE;
158
159 HRESULT i_getUserHomeDirectory(Utf8Str &strPath);
160 HRESULT i_setDefaultMachineFolder(const Utf8Str &strPath);
161 HRESULT i_setLoggingLevel(const com::Utf8Str &aLoggingLevel);
162 HRESULT i_setDefaultHardDiskFormat(const com::Utf8Str &aFormat);
163 HRESULT i_setVRDEAuthLibrary(const com::Utf8Str &aPath);
164
165 HRESULT i_setWebServiceAuthLibrary(const com::Utf8Str &aPath);
166 HRESULT i_setDefaultVRDEExtPack(const com::Utf8Str &aExtPack);
167 HRESULT i_setDefaultCryptoExtPack(const com::Utf8Str &aExtPack);
168 HRESULT i_setAutostartDatabasePath(const com::Utf8Str &aPath);
169 HRESULT i_setDefaultAdditionsISO(const com::Utf8Str &aPath);
170 HRESULT i_setDefaultFrontend(const com::Utf8Str &aDefaultFrontend);
171
172 HRESULT i_loadCPUProfilesFromVMM(const char *a_pszVMM, CPUMDBENTRYTYPE a_enmEntryType);
173
174 VirtualBox * const mParent;
175
176 settings::SystemProperties *m;
177
178 MediumFormatList m_llMediumFormats;
179
180 ComObjPtr<PlatformProperties> const m_platformProperties; /**< The host's platform properties. */
181 bool m_fLoadedX86CPUProfiles; /**< Set if we've loaded the x86 and AMD64 CPU profiles. */
182 bool m_fLoadedArmCPUProfiles; /**< Set if we've loaded the ARM CPU profiles. */
183 CPUProfileList_T m_llCPUProfiles; /**< List of loaded CPU profiles. */
184
185 friend class VirtualBox;
186};
187
188#endif /* !MAIN_INCLUDED_SystemPropertiesImpl_h */
189/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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