1 | /* $Id: UIMachineAttributeSetter.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineAttributeSetter namespace declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019-2024 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 FEQT_INCLUDED_SRC_globals_UIMachineAttributeSetter_h
|
---|
29 | #define FEQT_INCLUDED_SRC_globals_UIMachineAttributeSetter_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* COM includes: */
|
---|
35 | #include "CMachine.h"
|
---|
36 | #include "KNetworkAttachmentType.h"
|
---|
37 |
|
---|
38 | /** Known machine attributes. */
|
---|
39 | enum MachineAttribute
|
---|
40 | {
|
---|
41 | MachineAttribute_Invalid,
|
---|
42 | MachineAttribute_Name,
|
---|
43 | MachineAttribute_OSType,
|
---|
44 | MachineAttribute_BaseMemory,
|
---|
45 | MachineAttribute_BootOrder,
|
---|
46 | MachineAttribute_VideoMemory,
|
---|
47 | MachineAttribute_GraphicsControllerType,
|
---|
48 | MachineAttribute_AudioHostDriverType,
|
---|
49 | MachineAttribute_AudioControllerType,
|
---|
50 | MachineAttribute_NetworkAttachmentType,
|
---|
51 | MachineAttribute_USBControllerType,
|
---|
52 | };
|
---|
53 |
|
---|
54 | /** Contains short network adapter description. */
|
---|
55 | struct UINetworkAdapterDescriptor
|
---|
56 | {
|
---|
57 | /** Composes network adapter descriptor for certain @a iSlot, @a enmType and @a strName. */
|
---|
58 | UINetworkAdapterDescriptor(int iSlot = -1,
|
---|
59 | KNetworkAttachmentType enmType = KNetworkAttachmentType_Null,
|
---|
60 | const QString &strName = QString())
|
---|
61 | : m_iSlot(iSlot), m_enmType(enmType), m_strName(strName)
|
---|
62 | {}
|
---|
63 |
|
---|
64 | /** Holds the slot of described network adapter. */
|
---|
65 | int m_iSlot;
|
---|
66 | /** Holds the attachment type of described network adapter. */
|
---|
67 | KNetworkAttachmentType m_enmType;
|
---|
68 | /** Holds the adapter name of described network adapter. */
|
---|
69 | QString m_strName;
|
---|
70 | };
|
---|
71 | Q_DECLARE_METATYPE(UINetworkAdapterDescriptor);
|
---|
72 |
|
---|
73 | /** A set of USB controller types. */
|
---|
74 | typedef QSet<KUSBControllerType> UIUSBControllerTypeSet;
|
---|
75 | Q_DECLARE_METATYPE(UIUSBControllerTypeSet);
|
---|
76 |
|
---|
77 | /** Namespace used to assign CMachine attributes on more convenient basis. */
|
---|
78 | namespace UIMachineAttributeSetter
|
---|
79 | {
|
---|
80 | /** Assigns @a comMachine @a guiAttribute of specified @a enmType. */
|
---|
81 | SHARED_LIBRARY_STUFF void setMachineAttribute(const CMachine &comMachine,
|
---|
82 | const MachineAttribute &enmType,
|
---|
83 | const QVariant &guiAttribute);
|
---|
84 |
|
---|
85 | /** Assigns @a comMachine @a strLocation. */
|
---|
86 | SHARED_LIBRARY_STUFF void setMachineLocation(const QUuid &uMachineId,
|
---|
87 | const QString &strLocation);
|
---|
88 | }
|
---|
89 | using namespace UIMachineAttributeSetter /* if header included */;
|
---|
90 |
|
---|
91 | #endif /* !FEQT_INCLUDED_SRC_globals_UIMachineAttributeSetter_h */
|
---|