VirtualBox

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

Last change on this file since 82781 was 78154, checked in by vboxsync, 5 years ago

FE/Qt: Putting back the file dialog menu item to machine UI devices menu.

  • 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.2 KB
Line 
1/* $Id: UIMediumDefs.h 78154 2019-04-17 12:53:27Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMedium related declarations.
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef FEQT_INCLUDED_SRC_medium_UIMediumDefs_h
19#define FEQT_INCLUDED_SRC_medium_UIMediumDefs_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QString>
26
27/* GUI includes: */
28#include "UILibraryDefs.h"
29
30/* COM includes: */
31#include "COMEnums.h"
32#include "CVirtualBox.h"
33
34/* Other VBox includes: */
35#include <VBox/com/defs.h>
36
37/* Forward declarations: */
38class CVirtualBox;
39
40
41/** Medium formats. */
42enum UIMediumFormat
43{
44 UIMediumFormat_VDI,
45 UIMediumFormat_VMDK,
46 UIMediumFormat_VHD,
47 UIMediumFormat_Parallels,
48 UIMediumFormat_QED,
49 UIMediumFormat_QCOW,
50};
51
52/** UIMediumDefs namespace. */
53namespace UIMediumDefs
54{
55 /** UIMedium types. */
56 enum UIMediumDeviceType
57 {
58 UIMediumDeviceType_HardDisk,
59 UIMediumDeviceType_DVD,
60 UIMediumDeviceType_Floppy,
61 UIMediumDeviceType_All,
62 UIMediumDeviceType_Invalid
63 };
64
65 /** Converts global medium type (KDeviceType) to local (UIMediumDeviceType). */
66 SHARED_LIBRARY_STUFF UIMediumDeviceType mediumTypeToLocal(KDeviceType globalType);
67 /** Convert local medium type (UIMediumDeviceType) to global (KDeviceType). */
68 SHARED_LIBRARY_STUFF KDeviceType mediumTypeToGlobal(UIMediumDeviceType localType);
69
70 /** Returns medium formats which are currently supported by @a comVBox for the given @a enmDeviceType. */
71 QList<QPair<QString, QString> > MediumBackends(const CVirtualBox &comVBox, KDeviceType enmDeviceType);
72 /** Returns which hard disk formats are currently supported by @a comVBox. */
73 QList<QPair<QString, QString> > HDDBackends(const CVirtualBox &comVBox);
74 /** Returns which optical disk formats are currently supported by @a comVBox. */
75 QList<QPair<QString, QString> > DVDBackends(const CVirtualBox &comVBox);
76 /** Returns which floppy disk formats are currently supported by @a comVBox. */
77 QList<QPair<QString, QString> > FloppyBackends(const CVirtualBox &comVBox);
78
79 /** Returns the first file extension of the list of file extension support for the @a enmDeviceType. */
80 QString getPreferredExtensionForMedium(KDeviceType enmDeviceType);
81 QVector<CMediumFormat> getFormatsForDeviceType(KDeviceType enmDeviceType);
82}
83/* Using this namespace globally: */
84using namespace UIMediumDefs;
85
86/** Medium-target. */
87struct UIMediumTarget
88{
89 /** Medium-target types. */
90 enum UIMediumTargetType
91 {
92 UIMediumTargetType_WithID,
93 UIMediumTargetType_WithLocation,
94 UIMediumTargetType_WithFileDialog,
95 UIMediumTargetType_CreateAdHocVISO,
96 UIMediumTargetType_CreateFloppyDisk
97 };
98
99 /** Medium-target constructor. */
100 UIMediumTarget(const QString &strName = QString(), LONG iPort = 0, LONG iDevice = 0,
101 UIMediumDeviceType aMediumType = UIMediumDeviceType_Invalid,
102 UIMediumTargetType aType = UIMediumTargetType_WithID, const QString &strData = QString())
103 : name(strName), port(iPort), device(iDevice)
104 , mediumType(aMediumType)
105 , type(aType), data(strData)
106 {}
107
108 /** Determines controller name. */
109 QString name;
110 /** Determines controller port. */
111 LONG port;
112 /** Determines controller device. */
113 LONG device;
114
115 /** Determines medium-target medium-type. */
116 UIMediumDeviceType mediumType;
117
118 /** Determines medium-target type. */
119 UIMediumTargetType type;
120 /** Depending on medium-target type holds <i>ID</i> or <i>location</i>. */
121 QString data;
122};
123
124/* Let QMetaType know about our types: */
125Q_DECLARE_METATYPE(UIMediumDeviceType);
126Q_DECLARE_METATYPE(UIMediumTarget);
127
128#endif /* !FEQT_INCLUDED_SRC_medium_UIMediumDefs_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use