1 | /* $Id: PlatformPropertiesImpl.h 101299 2023-09-27 21:21:05Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM class implementation - Platform properties.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef MAIN_INCLUDED_PlatformPropertiesImpl_h
|
---|
29 | #define MAIN_INCLUDED_PlatformPropertiesImpl_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "PlatformPropertiesWrap.h"
|
---|
35 |
|
---|
36 | namespace settings
|
---|
37 | {
|
---|
38 | struct PlatformProperties;
|
---|
39 | }
|
---|
40 |
|
---|
41 | class ATL_NO_VTABLE PlatformProperties :
|
---|
42 | public PlatformPropertiesWrap
|
---|
43 | {
|
---|
44 | public:
|
---|
45 |
|
---|
46 | DECLARE_COMMON_CLASS_METHODS(PlatformProperties)
|
---|
47 |
|
---|
48 | HRESULT FinalConstruct();
|
---|
49 | void FinalRelease();
|
---|
50 |
|
---|
51 | // public initializer/uninitializer for internal purposes only
|
---|
52 | HRESULT init(VirtualBox *aParent, bool fIsHost = false);
|
---|
53 | void uninit();
|
---|
54 |
|
---|
55 | // public internal methods
|
---|
56 | //HRESULT i_loadSettings(const settings::PlatformProperties &data);
|
---|
57 | //HRESULT i_saveSettings(settings::PlatformProperties &data);
|
---|
58 | //void i_rollback();
|
---|
59 | //void i_commit();
|
---|
60 | //void i_copyFrom(PlatformProperties *aThat);
|
---|
61 | HRESULT i_setArchitecture(PlatformArchitecture_T aArchitecture);
|
---|
62 |
|
---|
63 | // public static helper functions
|
---|
64 | static PlatformArchitecture_T s_getHostPlatformArchitecture(void);
|
---|
65 |
|
---|
66 | // public static methods, for stuff which does not have a state
|
---|
67 | static ULONG s_getMaxNetworkAdapters(ChipsetType_T aChipset);
|
---|
68 | static ULONG s_getMaxNetworkAdaptersOfType(ChipsetType_T aChipset, NetworkAttachmentType_T aType);
|
---|
69 |
|
---|
70 | private:
|
---|
71 |
|
---|
72 | // wrapped IPlatformProperties properties
|
---|
73 | HRESULT getSerialPortCount(ULONG *aSerialPortCount) RT_OVERRIDE;
|
---|
74 | HRESULT getParallelPortCount(ULONG *aParallelPortCount) RT_OVERRIDE;
|
---|
75 | HRESULT getMaxBootPosition(ULONG *aMaxBootPosition) RT_OVERRIDE;
|
---|
76 | HRESULT getRawModeSupported(BOOL *aRawModeSupported) RT_OVERRIDE;
|
---|
77 | HRESULT getExclusiveHwVirt(BOOL *aExclusiveHwVirt) RT_OVERRIDE;
|
---|
78 | HRESULT setExclusiveHwVirt(BOOL aExclusiveHwVirt) RT_OVERRIDE;
|
---|
79 | HRESULT getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders) RT_OVERRIDE;
|
---|
80 | HRESULT getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes) RT_OVERRIDE;
|
---|
81 | HRESULT getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE;
|
---|
82 | HRESULT getSupportedGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aSupportedGuestOSTypes);
|
---|
83 | HRESULT getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes) RT_OVERRIDE;
|
---|
84 | HRESULT getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes) RT_OVERRIDE;
|
---|
85 | HRESULT getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes) RT_OVERRIDE;
|
---|
86 | HRESULT getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes) RT_OVERRIDE;
|
---|
87 | HRESULT getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses) RT_OVERRIDE;
|
---|
88 | HRESULT getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes) RT_OVERRIDE;
|
---|
89 | HRESULT getSupportedChipsetTypes(std::vector<ChipsetType_T> &aSupportedChipsetTypes) RT_OVERRIDE;
|
---|
90 | HRESULT getSupportedIommuTypes(std::vector<IommuType_T> &aSupportedIommuTypes) RT_OVERRIDE;
|
---|
91 | HRESULT getSupportedTpmTypes(std::vector<TpmType_T> &aSupportedTpmTypes) RT_OVERRIDE;
|
---|
92 |
|
---|
93 | // wrapped IPlatformProperties methods
|
---|
94 | HRESULT getMaxNetworkAdapters(ChipsetType_T aChipset,
|
---|
95 | ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
|
---|
96 | HRESULT getMaxNetworkAdaptersOfType(ChipsetType_T aChipset,
|
---|
97 | NetworkAttachmentType_T aType,
|
---|
98 | ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
|
---|
99 | HRESULT getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
|
---|
100 | ULONG *aMaxDevicesPerPort) RT_OVERRIDE;
|
---|
101 | HRESULT getMinPortCountForStorageBus(StorageBus_T aBus,
|
---|
102 | ULONG *aMinPortCount) RT_OVERRIDE;
|
---|
103 | HRESULT getMaxPortCountForStorageBus(StorageBus_T aBus,
|
---|
104 | ULONG *aMaxPortCount) RT_OVERRIDE;
|
---|
105 | HRESULT getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
|
---|
106 | StorageBus_T aBus,
|
---|
107 | ULONG *aMaxInstances) RT_OVERRIDE;
|
---|
108 | HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus,
|
---|
109 | std::vector<DeviceType_T> &aDeviceTypes) RT_OVERRIDE;
|
---|
110 | HRESULT getStorageBusForControllerType(StorageControllerType_T aStorageControllerType,
|
---|
111 | StorageBus_T *aStorageBus) RT_OVERRIDE;
|
---|
112 | HRESULT getStorageControllerTypesForBus(StorageBus_T aStorageBus,
|
---|
113 | std::vector<StorageControllerType_T> &aStorageControllerTypes) RT_OVERRIDE;
|
---|
114 | HRESULT getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,
|
---|
115 | BOOL *aHotplugCapable) RT_OVERRIDE;
|
---|
116 | HRESULT getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
|
---|
117 | USBControllerType_T aType,
|
---|
118 | ULONG *aMaxInstances) RT_OVERRIDE;
|
---|
119 |
|
---|
120 | VirtualBox * const mParent;
|
---|
121 | /** Platform architecture the properties are for. */
|
---|
122 | PlatformArchitecture_T mPlatformArchitecture;
|
---|
123 | /** Flag set to \c true if this instance handles platform properties
|
---|
124 | * for the host, or set to \c false for guests. */
|
---|
125 | bool const mfIsHost;
|
---|
126 |
|
---|
127 | // Data
|
---|
128 |
|
---|
129 | settings::PlatformProperties *m;
|
---|
130 | };
|
---|
131 |
|
---|
132 | #endif /* !MAIN_INCLUDED_PlatformPropertiesImpl_h */
|
---|
133 |
|
---|