1 | /* $Id: UIMediumDefs.h 69500 2017-10-28 15:14:05Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMedium related declarations.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2017 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 ___UIMediumDefs_h___
|
---|
19 | #define ___UIMediumDefs_h___
|
---|
20 |
|
---|
21 | /* Qt includes: */
|
---|
22 | #include <QString>
|
---|
23 |
|
---|
24 | /* COM includes: */
|
---|
25 | #include "COMEnums.h"
|
---|
26 |
|
---|
27 | /* Other VBox includes: */
|
---|
28 | #include <VBox/com/defs.h>
|
---|
29 |
|
---|
30 |
|
---|
31 | /** UIMediumDefs namespace. */
|
---|
32 | namespace UIMediumDefs
|
---|
33 | {
|
---|
34 | /** UIMedium types. */
|
---|
35 | enum UIMediumType
|
---|
36 | {
|
---|
37 | UIMediumType_HardDisk,
|
---|
38 | UIMediumType_DVD,
|
---|
39 | UIMediumType_Floppy,
|
---|
40 | UIMediumType_All,
|
---|
41 | UIMediumType_Invalid
|
---|
42 | };
|
---|
43 |
|
---|
44 | /** Converts global medium type (KDeviceType) to local (UIMediumType). */
|
---|
45 | UIMediumType mediumTypeToLocal(KDeviceType globalType);
|
---|
46 |
|
---|
47 | /** Convert local medium type (UIMediumType) to global (KDeviceType). */
|
---|
48 | KDeviceType mediumTypeToGlobal(UIMediumType localType);
|
---|
49 | }
|
---|
50 | /* Using this namespace globally: */
|
---|
51 | using namespace UIMediumDefs;
|
---|
52 |
|
---|
53 | /** Medium-target. */
|
---|
54 | struct UIMediumTarget
|
---|
55 | {
|
---|
56 | /** Medium-target types. */
|
---|
57 | enum UIMediumTargetType { UIMediumTargetType_WithID, UIMediumTargetType_WithLocation };
|
---|
58 |
|
---|
59 | /** Medium-target constructor. */
|
---|
60 | UIMediumTarget(const QString &strName = QString(), LONG iPort = 0, LONG iDevice = 0,
|
---|
61 | UIMediumType aMediumType = UIMediumType_Invalid,
|
---|
62 | UIMediumTargetType aType = UIMediumTargetType_WithID, const QString &strData = QString())
|
---|
63 | : name(strName), port(iPort), device(iDevice)
|
---|
64 | , mediumType(aMediumType)
|
---|
65 | , type(aType), data(strData)
|
---|
66 | {}
|
---|
67 |
|
---|
68 | /** Determines controller name. */
|
---|
69 | QString name;
|
---|
70 | /** Determines controller port. */
|
---|
71 | LONG port;
|
---|
72 | /** Determines controller device. */
|
---|
73 | LONG device;
|
---|
74 |
|
---|
75 | /** Determines medium-target medium-type. */
|
---|
76 | UIMediumType mediumType;
|
---|
77 |
|
---|
78 | /** Determines medium-target type. */
|
---|
79 | UIMediumTargetType type;
|
---|
80 | /** Depending on medium-target type holds <i>ID</i> or <i>location</i>. */
|
---|
81 | QString data;
|
---|
82 | };
|
---|
83 |
|
---|
84 | /* Let QMetaType know about our types: */
|
---|
85 | Q_DECLARE_METATYPE(UIMediumType);
|
---|
86 | Q_DECLARE_METATYPE(UIMediumTarget);
|
---|
87 |
|
---|
88 | #endif /* !___UIMediumDefs_h___ */
|
---|