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