VirtualBox

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

Last change on this file since 50910 was 50910, checked in by vboxsync, 11 years ago

FE/Qt: UIMediumTarget rework: Taking into account further use (hard-drive mediums) and some simplification.

  • 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: 2.4 KB
Line 
1/** @file
2 * VBox Qt GUI - UIMedium related declarations.
3 */
4
5/*
6 * Copyright (C) 2006-2014 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 */
16
17#ifndef ___UIMediumDefs_h___
18#define ___UIMediumDefs_h___
19
20/* COM includes: */
21#include "COMEnums.h"
22
23/** UIMediumDefs namespace. */
24namespace UIMediumDefs
25{
26 /** UIMedium types. */
27 enum UIMediumType
28 {
29 UIMediumType_Invalid,
30 UIMediumType_HardDisk,
31 UIMediumType_DVD,
32 UIMediumType_Floppy,
33 UIMediumType_All
34 };
35
36 /** Converts global medium type (KDeviceType) to local (UIMediumType). */
37 UIMediumType mediumTypeToLocal(KDeviceType globalType);
38
39 /** Convert local medium type (UIMediumType) to global (KDeviceType). */
40 KDeviceType mediumTypeToGlobal(UIMediumType localType);
41}
42/* Using this namespace globally: */
43using namespace UIMediumDefs;
44
45/** Medium-target. */
46struct UIMediumTarget
47{
48 /** Medium-target types. */
49 enum UIMediumTargetType { UIMediumTargetType_WithID, UIMediumTargetType_WithLocation };
50
51 /** Medium-target constructor. */
52 UIMediumTarget(const QString &strName = QString(), LONG iPort = 0, LONG iDevice = 0,
53 UIMediumType aMediumType = UIMediumType_Invalid,
54 UIMediumTargetType aType = UIMediumTargetType_WithID, const QString &strData = QString())
55 : name(strName), port(iPort), device(iDevice)
56 , mediumType(aMediumType)
57 , type(aType), data(strData)
58 {}
59
60 /** Determines controller name. */
61 QString name;
62 /** Determines controller port. */
63 LONG port;
64 /** Determines controller device. */
65 LONG device;
66
67 /** Determines medium-target medium-type. */
68 UIMediumType mediumType;
69
70 /** Determines medium-target type. */
71 UIMediumTargetType type;
72 /** Depending on medium-target type holds <i>ID</i> or <i>location</i>. */
73 QString data;
74};
75
76/* Let QMetaType know about our types: */
77Q_DECLARE_METATYPE(UIMediumType);
78Q_DECLARE_METATYPE(UIMediumTarget);
79
80#endif /* !___UIMediumDefs_h___ */
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