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. */
|
---|
24 | namespace 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: */
|
---|
43 | using namespace UIMediumDefs;
|
---|
44 |
|
---|
45 | /** Medium-target. */
|
---|
46 | struct 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: */
|
---|
77 | Q_DECLARE_METATYPE(UIMediumType);
|
---|
78 | Q_DECLARE_METATYPE(UIMediumTarget);
|
---|
79 |
|
---|
80 | #endif /* !___UIMediumDefs_h___ */
|
---|