VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h@ 74954

Last change on this file since 74954 was 74954, checked in by vboxsync, 6 years ago

FE/Qt: bugref:9264: Remove OCI-Classic from the GUI.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1/* $Id: UIDefs.h 74954 2018-10-19 18:07:53Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Global definitions.
4 */
5
6/*
7 * Copyright (C) 2006-2018 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 ___UIDefs_h___
19#define ___UIDefs_h___
20
21/* Qt includes: */
22#include <QEvent>
23#include <QStringList>
24
25/* GUI includes: */
26#include "UILibraryDefs.h"
27
28/* COM includes: */
29#include "COMEnums.h"
30
31/* Define GUI log group: */
32// WORKAROUND:
33// This define should go *before* VBox/log.h include!
34#ifndef VBOX_WITH_PRECOMPILED_HEADERS
35# define LOG_GROUP LOG_GROUP_GUI
36#endif
37
38/* Other VBox includes: */
39#include <VBox/log.h>
40#include <VBox/com/defs.h>
41
42/* Defines: */
43#ifdef DEBUG
44# define AssertWrapperOk(w) \
45 AssertMsg (w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC()))
46# define AssertWrapperOkMsg(w, m) \
47 AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC()))
48#else /* !DEBUG */
49# define AssertWrapperOk(w) do {} while (0)
50# define AssertWrapperOkMsg(w, m) do {} while (0)
51#endif /* !DEBUG */
52
53#ifndef SIZEOF_ARRAY
54# define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
55#endif
56
57
58/** Global namespace. */
59namespace UIDefs
60{
61 /** Additional Qt event types. */
62 enum UIEventType
63 {
64 ActivateActionEventType = QEvent::User + 101,
65#ifdef VBOX_WS_MAC
66 ShowWindowEventType,
67#endif
68#ifdef VBOX_GUI_USE_QGL
69 VHWACommandProcessType,
70#endif
71 };
72
73 /** Size formatting types. */
74 enum FormatSize
75 {
76 FormatSize_Round,
77 FormatSize_RoundDown,
78 FormatSize_RoundUp
79 };
80
81 /** Default guest additions image name. */
82 SHARED_LIBRARY_STUFF extern const char* GUI_GuestAdditionsName;
83 /** Default extension pack name. */
84 SHARED_LIBRARY_STUFF extern const char* GUI_ExtPackName;
85
86 /** Allowed VBox file extensions. */
87 SHARED_LIBRARY_STUFF extern QStringList VBoxFileExts;
88 /** Allowed VBox Extension Pack file extensions. */
89 SHARED_LIBRARY_STUFF extern QStringList VBoxExtPackFileExts;
90 /** Allowed OVF file extensions. */
91 SHARED_LIBRARY_STUFF extern QStringList OVFFileExts;
92}
93using namespace UIDefs /* if header included */;
94
95
96#ifdef VBOX_WS_MAC
97/** Known macOS releases. */
98enum MacOSXRelease
99{
100 MacOSXRelease_Old,
101 MacOSXRelease_SnowLeopard,
102 MacOSXRelease_Lion,
103 MacOSXRelease_MountainLion,
104 MacOSXRelease_Mavericks,
105 MacOSXRelease_Yosemite,
106 MacOSXRelease_ElCapitan,
107 MacOSXRelease_New,
108};
109#endif /* VBOX_WS_MAC */
110
111
112/** Size suffixes. */
113enum SizeSuffix
114{
115 SizeSuffix_Byte = 0,
116 SizeSuffix_KiloByte,
117 SizeSuffix_MegaByte,
118 SizeSuffix_GigaByte,
119 SizeSuffix_TeraByte,
120 SizeSuffix_PetaByte,
121 SizeSuffix_Max
122};
123
124
125/** Storage-slot struct. */
126struct StorageSlot
127{
128 StorageSlot() : bus(KStorageBus_Null), port(0), device(0) {}
129 StorageSlot(const StorageSlot &other) : bus(other.bus), port(other.port), device(other.device) {}
130 StorageSlot(KStorageBus otherBus, LONG iPort, LONG iDevice) : bus(otherBus), port(iPort), device(iDevice) {}
131 StorageSlot& operator=(const StorageSlot &other) { bus = other.bus; port = other.port; device = other.device; return *this; }
132 bool operator==(const StorageSlot &other) const { return bus == other.bus && port == other.port && device == other.device; }
133 bool operator!=(const StorageSlot &other) const { return bus != other.bus || port != other.port || device != other.device; }
134 bool operator<(const StorageSlot &other) const { return (bus < other.bus) ||
135 (bus == other.bus && port < other.port) ||
136 (bus == other.bus && port == other.port && device < other.device); }
137 bool operator>(const StorageSlot &other) const { return (bus > other.bus) ||
138 (bus == other.bus && port > other.port) ||
139 (bus == other.bus && port == other.port && device > other.device); }
140 bool isNull() const { return bus == KStorageBus_Null; }
141 KStorageBus bus; LONG port; LONG device;
142};
143Q_DECLARE_METATYPE(StorageSlot);
144
145
146/** Storage-slot struct extension with exact controller name. */
147struct ExactStorageSlot : public StorageSlot
148{
149 ExactStorageSlot(const QString &strController,
150 KStorageBus enmBus, LONG iPort, LONG iDevice)
151 : StorageSlot(enmBus, iPort, iDevice)
152 , controller(strController)
153 {}
154 QString controller;
155};
156
157
158#endif /* !___UIDefs_h___ */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use