VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h@ 102493

Last change on this file since 102493 was 98103, checked in by vboxsync, 20 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h74233
    /branches/VBox-4.2/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h91223
    /branches/VBox-4.3/trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h91223
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h79224,​79228,​79233,​79235,​79258,​79262-79263,​79273,​79341,​79345,​79354,​79357,​79387-79388,​79559-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h79645-79692
File size: 4.4 KB
Line 
1/* $Id: UIMediumDefs.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMedium related declarations.
4 */
5
6/*
7 * Copyright (C) 2006-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 FEQT_INCLUDED_SRC_medium_UIMediumDefs_h
29#define FEQT_INCLUDED_SRC_medium_UIMediumDefs_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QString>
36
37/* GUI includes: */
38#include "UILibraryDefs.h"
39
40/* COM includes: */
41#include "COMEnums.h"
42#include "CVirtualBox.h"
43
44/* Other VBox includes: */
45#include <VBox/com/defs.h>
46
47/* Forward declarations: */
48class CVirtualBox;
49
50
51/** Medium formats. */
52enum UIMediumFormat
53{
54 UIMediumFormat_VDI,
55 UIMediumFormat_VMDK,
56 UIMediumFormat_VHD,
57 UIMediumFormat_Parallels,
58 UIMediumFormat_QED,
59 UIMediumFormat_QCOW,
60};
61
62/** UIMediumDefs namespace. */
63namespace UIMediumDefs
64{
65 /** UIMedium types. */
66 enum UIMediumDeviceType
67 {
68 UIMediumDeviceType_HardDisk,
69 UIMediumDeviceType_DVD,
70 UIMediumDeviceType_Floppy,
71 UIMediumDeviceType_All,
72 UIMediumDeviceType_Invalid
73 };
74
75 /** Converts global medium type (KDeviceType) to local (UIMediumDeviceType). */
76 SHARED_LIBRARY_STUFF UIMediumDeviceType mediumTypeToLocal(KDeviceType globalType);
77 /** Convert local medium type (UIMediumDeviceType) to global (KDeviceType). */
78 SHARED_LIBRARY_STUFF KDeviceType mediumTypeToGlobal(UIMediumDeviceType localType);
79
80 /** Returns medium formats which are currently supported by @a comVBox for the given @a enmDeviceType. */
81 QList<QPair<QString, QString> > MediumBackends(const CVirtualBox &comVBox, KDeviceType enmDeviceType);
82 /** Returns which hard disk formats are currently supported by @a comVBox. */
83 QList<QPair<QString, QString> > HDDBackends(const CVirtualBox &comVBox);
84 /** Returns which optical disk formats are currently supported by @a comVBox. */
85 QList<QPair<QString, QString> > DVDBackends(const CVirtualBox &comVBox);
86 /** Returns which floppy disk formats are currently supported by @a comVBox. */
87 QList<QPair<QString, QString> > FloppyBackends(const CVirtualBox &comVBox);
88
89 /** Returns the first file extension of the list of file extension support for the @a enmDeviceType. */
90 QString getPreferredExtensionForMedium(KDeviceType enmDeviceType);
91 QVector<CMediumFormat> getFormatsForDeviceType(KDeviceType enmDeviceType);
92}
93/* Using this namespace globally: */
94using namespace UIMediumDefs;
95
96/** Medium-target. */
97struct UIMediumTarget
98{
99 /** Medium-target types. */
100 enum UIMediumTargetType
101 {
102 UIMediumTargetType_WithID,
103 UIMediumTargetType_WithLocation,
104 UIMediumTargetType_WithFileDialog,
105 UIMediumTargetType_CreateAdHocVISO,
106 UIMediumTargetType_CreateFloppyDisk
107 };
108
109 /** Medium-target constructor. */
110 UIMediumTarget(const QString &strName = QString(), LONG iPort = 0, LONG iDevice = 0,
111 UIMediumDeviceType aMediumType = UIMediumDeviceType_Invalid,
112 UIMediumTargetType aType = UIMediumTargetType_WithID, const QString &strData = QString())
113 : name(strName), port(iPort), device(iDevice)
114 , mediumType(aMediumType)
115 , type(aType), data(strData)
116 {}
117
118 /** Determines controller name. */
119 QString name;
120 /** Determines controller port. */
121 LONG port;
122 /** Determines controller device. */
123 LONG device;
124
125 /** Determines medium-target medium-type. */
126 UIMediumDeviceType mediumType;
127
128 /** Determines medium-target type. */
129 UIMediumTargetType type;
130 /** Depending on medium-target type holds <i>ID</i> or <i>location</i>. */
131 QString data;
132};
133
134/* Let QMetaType know about our types: */
135Q_DECLARE_METATYPE(UIMediumDeviceType);
136Q_DECLARE_METATYPE(UIMediumTarget);
137
138#endif /* !FEQT_INCLUDED_SRC_medium_UIMediumDefs_h */
Note: See TracBrowser for help on using the repository browser.

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