1 | /** @file
|
---|
2 | * VBox Qt GUI - UIExtraDataManager class declaration.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2010-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 ___UIExtraDataManager_h___
|
---|
18 | #define ___UIExtraDataManager_h___
|
---|
19 |
|
---|
20 | /* Qt includes: */
|
---|
21 | #include <QObject>
|
---|
22 | #include <QMap>
|
---|
23 | #ifdef DEBUG
|
---|
24 | # include <QPointer>
|
---|
25 | #endif /* DEBUG */
|
---|
26 |
|
---|
27 | /* GUI includes: */
|
---|
28 | #include "UIExtraDataDefs.h"
|
---|
29 |
|
---|
30 | /* COM includes: */
|
---|
31 | #include "CEventListener.h"
|
---|
32 |
|
---|
33 | /* Forward declarations: */
|
---|
34 | class UIExtraDataEventHandler;
|
---|
35 | #ifdef DEBUG
|
---|
36 | class UIExtraDataManagerWindow;
|
---|
37 | #endif /* DEBUG */
|
---|
38 |
|
---|
39 | /* Type definitions: */
|
---|
40 | typedef QMap<QString, QString> ExtraDataMap;
|
---|
41 |
|
---|
42 | /** Singleton QObject extension
|
---|
43 | * providing GUI with corresponding extra-data values,
|
---|
44 | * and notifying it whenever any of those values changed. */
|
---|
45 | class UIExtraDataManager : public QObject
|
---|
46 | {
|
---|
47 | Q_OBJECT;
|
---|
48 |
|
---|
49 | /** Extra-data Manager constructor. */
|
---|
50 | UIExtraDataManager();
|
---|
51 | /** Extra-data Manager destructor. */
|
---|
52 | ~UIExtraDataManager();
|
---|
53 |
|
---|
54 | signals:
|
---|
55 |
|
---|
56 | /** Notifies about extra-data map acknowledging. */
|
---|
57 | void sigExtraDataMapAcknowledging(QString strID);
|
---|
58 |
|
---|
59 | /** Notifies about extra-data change. */
|
---|
60 | void sigExtraDataChange(QString strID, QString strKey, QString strValue);
|
---|
61 |
|
---|
62 | /** Notifies about GUI language change. */
|
---|
63 | void sigLanguageChange(QString strLanguage);
|
---|
64 |
|
---|
65 | /** Notifies about Selector UI keyboard shortcut change. */
|
---|
66 | void sigSelectorUIShortcutChange();
|
---|
67 | /** Notifies about Runtime UI keyboard shortcut change. */
|
---|
68 | void sigRuntimeUIShortcutChange();
|
---|
69 |
|
---|
70 | /** Notifies about menu-bar configuration change. */
|
---|
71 | void sigMenuBarConfigurationChange(const QString &strMachineID);
|
---|
72 | /** Notifies about status-bar configuration change. */
|
---|
73 | void sigStatusBarConfigurationChange(const QString &strMachineID);
|
---|
74 |
|
---|
75 | /** Notifies about HID LEDs synchronization state change. */
|
---|
76 | void sigHidLedsSyncStateChange(bool fEnabled);
|
---|
77 |
|
---|
78 | /** Notifies about the scale-factor change. */
|
---|
79 | void sigScaleFactorChange(const QString &strMachineID);
|
---|
80 |
|
---|
81 | /** Notifies about unscaled HiDPI output mode change. */
|
---|
82 | void sigUnscaledHiDPIOutputModeChange(const QString &strMachineID);
|
---|
83 |
|
---|
84 | #ifdef RT_OS_DARWIN
|
---|
85 | /** Mac OS X: Notifies about 'presentation mode' status change. */
|
---|
86 | void sigPresentationModeChange(bool fEnabled);
|
---|
87 | /** Mac OS X: Notifies about 'dock icon' appearance change. */
|
---|
88 | void sigDockIconAppearanceChange(bool fEnabled);
|
---|
89 | #endif /* RT_OS_DARWIN */
|
---|
90 |
|
---|
91 | public:
|
---|
92 |
|
---|
93 | /** Global extra-data ID. */
|
---|
94 | static const QString GlobalID;
|
---|
95 |
|
---|
96 | /** Static Extra-data Manager instance/constructor. */
|
---|
97 | static UIExtraDataManager* instance();
|
---|
98 | /** Static Extra-data Manager destructor. */
|
---|
99 | static void destroy();
|
---|
100 |
|
---|
101 | #ifdef DEBUG
|
---|
102 | /** Static show and raise API. */
|
---|
103 | static void openWindow(QWidget *pCenterWidget);
|
---|
104 | #endif /* DEBUG */
|
---|
105 |
|
---|
106 | /** @name General
|
---|
107 | * @{ */
|
---|
108 | /** Returns whether Extra-data Manager cached the map with passed @a strID. */
|
---|
109 | bool contains(const QString &strID) const { return m_data.contains(strID); }
|
---|
110 | /** Returns read-only extra-data map for passed @a strID. */
|
---|
111 | const ExtraDataMap map(const QString &strID) const { return m_data.value(strID); }
|
---|
112 |
|
---|
113 | /** Hot-load machine extra-data map. */
|
---|
114 | void hotloadMachineExtraDataMap(const QString &strID);
|
---|
115 |
|
---|
116 | /** Returns extra-data value corresponding to passed @a strKey as QString.
|
---|
117 | * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
|
---|
118 | QString extraDataString(const QString &strKey, const QString &strID = GlobalID);
|
---|
119 | /** Defines extra-data value corresponding to passed @a strKey as strValue.
|
---|
120 | * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
|
---|
121 | void setExtraDataString(const QString &strKey, const QString &strValue, const QString &strID = GlobalID);
|
---|
122 |
|
---|
123 | /** Returns extra-data value corresponding to passed @a strKey as QStringList.
|
---|
124 | * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
|
---|
125 | QStringList extraDataStringList(const QString &strKey, const QString &strID = GlobalID);
|
---|
126 | /** Defines extra-data value corresponding to passed @a strKey as strValue.
|
---|
127 | * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
|
---|
128 | void setExtraDataStringList(const QString &strKey, const QStringList &strValue, const QString &strID = GlobalID);
|
---|
129 | /** @} */
|
---|
130 |
|
---|
131 | /** @name Messaging
|
---|
132 | * @{ */
|
---|
133 | /** Returns the list of supressed messages for the Message/Popup center frameworks. */
|
---|
134 | QStringList suppressedMessages();
|
---|
135 | /** Defines the @a list of supressed messages for the Message/Popup center frameworks. */
|
---|
136 | void setSuppressedMessages(const QStringList &list);
|
---|
137 |
|
---|
138 | /** Returns the list of messages for the Message/Popup center frameworks with inverted check-box state. */
|
---|
139 | QStringList messagesWithInvertedOption();
|
---|
140 |
|
---|
141 | #if !defined(VBOX_BLEEDING_EDGE) && !defined(DEBUG)
|
---|
142 | /** Returns version for which user wants to prevent BETA build warning. */
|
---|
143 | QString preventBetaBuildWarningForVersion();
|
---|
144 | #endif /* !defined(VBOX_BLEEDING_EDGE) && !defined(DEBUG) */
|
---|
145 | /** @} */
|
---|
146 |
|
---|
147 | #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
|
---|
148 | /** @name Application Update
|
---|
149 | * @{ */
|
---|
150 | /** Returns whether Application Update functionality enabled. */
|
---|
151 | bool applicationUpdateEnabled();
|
---|
152 |
|
---|
153 | /** Returns Application Update data. */
|
---|
154 | QString applicationUpdateData();
|
---|
155 | /** Defines Application Update data as @a strValue. */
|
---|
156 | void setApplicationUpdateData(const QString &strValue);
|
---|
157 |
|
---|
158 | /** Returns Application Update check counter. */
|
---|
159 | qulonglong applicationUpdateCheckCounter();
|
---|
160 | /** Increments Application Update check counter. */
|
---|
161 | void incrementApplicationUpdateCheckCounter();
|
---|
162 | /** @} */
|
---|
163 | #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
|
---|
164 |
|
---|
165 | /** @name Settings
|
---|
166 | * @{ */
|
---|
167 | /** Returns restricted global settings pages. */
|
---|
168 | QList<GlobalSettingsPageType> restrictedGlobalSettingsPages();
|
---|
169 | /** Returns restricted machine settings pages. */
|
---|
170 | QList<MachineSettingsPageType> restrictedMachineSettingsPages(const QString &strID);
|
---|
171 | /** @} */
|
---|
172 |
|
---|
173 | /** @name Settings: Display
|
---|
174 | * @{ */
|
---|
175 | /** Returns whether hovered machine-window should be activated. */
|
---|
176 | bool activateHoveredMachineWindow();
|
---|
177 | /** Defines whether hovered machine-window should be @a fActivated. */
|
---|
178 | void setActivateHoveredMachineWindow(bool fActivate);
|
---|
179 | /** @} */
|
---|
180 |
|
---|
181 | /** @name Settings: Keyboard
|
---|
182 | * @{ */
|
---|
183 | /** Returns shortcut overrides for shortcut-pool with @a strPoolExtraDataID. */
|
---|
184 | QStringList shortcutOverrides(const QString &strPoolExtraDataID);
|
---|
185 | /** @} */
|
---|
186 |
|
---|
187 | /** @name Settings: Storage
|
---|
188 | * @{ */
|
---|
189 | /** Returns recent folder for hard-drives. */
|
---|
190 | QString recentFolderForHardDrives();
|
---|
191 | /** Returns recent folder for optical-disks. */
|
---|
192 | QString recentFolderForOpticalDisks();
|
---|
193 | /** Returns recent folder for floppy-disks. */
|
---|
194 | QString recentFolderForFloppyDisks();
|
---|
195 | /** Defines recent folder for hard-drives as @a strValue. */
|
---|
196 | void setRecentFolderForHardDrives(const QString &strValue);
|
---|
197 | /** Defines recent folder for optical-disk as @a strValue. */
|
---|
198 | void setRecentFolderForOpticalDisks(const QString &strValue);
|
---|
199 | /** Defines recent folder for floppy-disk as @a strValue. */
|
---|
200 | void setRecentFolderForFloppyDisks(const QString &strValue);
|
---|
201 |
|
---|
202 | /** Returns the list of recently used hard-drives. */
|
---|
203 | QStringList recentListOfHardDrives();
|
---|
204 | /** Returns the list of recently used optical-disk. */
|
---|
205 | QStringList recentListOfOpticalDisks();
|
---|
206 | /** Returns the list of recently used floppy-disk. */
|
---|
207 | QStringList recentListOfFloppyDisks();
|
---|
208 | /** Defines the list of recently used hard-drives as @a value. */
|
---|
209 | void setRecentListOfHardDrives(const QStringList &value);
|
---|
210 | /** Defines the list of recently used optical-disks as @a value. */
|
---|
211 | void setRecentListOfOpticalDisks(const QStringList &value);
|
---|
212 | /** Defines the list of recently used floppy-disks as @a value. */
|
---|
213 | void setRecentListOfFloppyDisks(const QStringList &value);
|
---|
214 | /** @} */
|
---|
215 |
|
---|
216 | /** @name VirtualBox Manager
|
---|
217 | * @{ */
|
---|
218 | /** Returns selector-window geometry using @a pWidget as the hint. */
|
---|
219 | QRect selectorWindowGeometry(QWidget *pWidget);
|
---|
220 | /** Returns whether selector-window should be maximized. */
|
---|
221 | bool selectorWindowShouldBeMaximized();
|
---|
222 | /** Defines selector-window @a geometry and @a fMaximized state. */
|
---|
223 | void setSelectorWindowGeometry(const QRect &geometry, bool fMaximized);
|
---|
224 |
|
---|
225 | /** Returns selector-window splitter hints. */
|
---|
226 | QList<int> selectorWindowSplitterHints();
|
---|
227 | /** Defines selector-window splitter @a hints. */
|
---|
228 | void setSelectorWindowSplitterHints(const QList<int> &hints);
|
---|
229 |
|
---|
230 | /** Returns whether selector-window tool-bar visible. */
|
---|
231 | bool selectorWindowToolBarVisible();
|
---|
232 | /** Defines whether selector-window tool-bar @a fVisible. */
|
---|
233 | void setSelectorWindowToolBarVisible(bool fVisible);
|
---|
234 |
|
---|
235 | /** Returns whether selector-window status-bar visible. */
|
---|
236 | bool selectorWindowStatusBarVisible();
|
---|
237 | /** Defines whether selector-window status-bar @a fVisible. */
|
---|
238 | void setSelectorWindowStatusBarVisible(bool fVisible);
|
---|
239 |
|
---|
240 | /** Clears all the existing selector-window chooser-pane' group definitions. */
|
---|
241 | void clearSelectorWindowGroupsDefinitions();
|
---|
242 | /** Returns selector-window chooser-pane' groups definitions for passed @a strGroupID. */
|
---|
243 | QStringList selectorWindowGroupsDefinitions(const QString &strGroupID);
|
---|
244 | /** Defines selector-window chooser-pane' groups @a definitions for passed @a strGroupID. */
|
---|
245 | void setSelectorWindowGroupsDefinitions(const QString &strGroupID, const QStringList &definitions);
|
---|
246 |
|
---|
247 | /** Returns last-item ID of the item chosen in selector-window chooser-pane. */
|
---|
248 | QString selectorWindowLastItemChosen();
|
---|
249 | /** Defines @a lastItemID of the item chosen in selector-window chooser-pane. */
|
---|
250 | void setSelectorWindowLastItemChosen(const QString &strItemID);
|
---|
251 |
|
---|
252 | /** Returns selector-window details-pane' elements. */
|
---|
253 | QMap<DetailsElementType, bool> selectorWindowDetailsElements();
|
---|
254 | /** Defines selector-window details-pane' @a elements. */
|
---|
255 | void setSelectorWindowDetailsElements(const QMap<DetailsElementType, bool> &elements);
|
---|
256 |
|
---|
257 | /** Returns selector-window details-pane' preview update interval. */
|
---|
258 | PreviewUpdateIntervalType selectorWindowPreviewUpdateInterval();
|
---|
259 | /** Defines selector-window details-pane' preview update @a interval. */
|
---|
260 | void setSelectorWindowPreviewUpdateInterval(PreviewUpdateIntervalType interval);
|
---|
261 | /** @} */
|
---|
262 |
|
---|
263 | /** @name Wizards
|
---|
264 | * @{ */
|
---|
265 | /** Returns mode for wizard of passed @a type. */
|
---|
266 | WizardMode modeForWizardType(WizardType type);
|
---|
267 | /** Defines @a mode for wizard of passed @a type. */
|
---|
268 | void setModeForWizardType(WizardType type, WizardMode mode);
|
---|
269 | /** @} */
|
---|
270 |
|
---|
271 | /** @name Virtual Machine
|
---|
272 | * @{ */
|
---|
273 | /** Returns whether machine should be shown in selector-window chooser-pane. */
|
---|
274 | bool showMachineInSelectorChooser(const QString &strID);
|
---|
275 | /** Returns whether machine should be shown in selector-window details-pane. */
|
---|
276 | bool showMachineInSelectorDetails(const QString &strID);
|
---|
277 |
|
---|
278 | /** Returns whether machine reconfiguration enabled. */
|
---|
279 | bool machineReconfigurationEnabled(const QString &strID);
|
---|
280 | /** Returns whether machine snapshot operations enabled. */
|
---|
281 | bool machineSnapshotOperationsEnabled(const QString &strID);
|
---|
282 |
|
---|
283 | /** Returns whether this machine is first time started. */
|
---|
284 | bool machineFirstTimeStarted(const QString &strID);
|
---|
285 | /** Returns whether this machine is fFirstTimeStarted. */
|
---|
286 | void setMachineFirstTimeStarted(bool fFirstTimeStarted, const QString &strID);
|
---|
287 |
|
---|
288 | #ifndef Q_WS_MAC
|
---|
289 | /** Except Mac OS X: Returns redefined machine-window icon names. */
|
---|
290 | QStringList machineWindowIconNames(const QString &strID);
|
---|
291 | /** Except Mac OS X: Returns redefined machine-window name postfix. */
|
---|
292 | QString machineWindowNamePostfix(const QString &strID);
|
---|
293 | #endif /* !Q_WS_MAC */
|
---|
294 |
|
---|
295 | /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */
|
---|
296 | QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
|
---|
297 | /** Returns whether machine-window with @a uScreenIndex in @a visualStateType should be maximized. */
|
---|
298 | bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
|
---|
299 | /** Defines @a geometry and @a fMaximized state for machine-window with @a uScreenIndex in @a visualStateType. */
|
---|
300 | void setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QString &strID);
|
---|
301 |
|
---|
302 | #ifndef Q_WS_MAC
|
---|
303 | /** Returns whether Runtime UI menu-bar is enabled. */
|
---|
304 | bool menuBarEnabled(const QString &strID);
|
---|
305 | /** Defines whether Runtime UI menu-bar is @a fEnabled. */
|
---|
306 | void setMenuBarEnabled(bool fEnabled, const QString &strID);
|
---|
307 | #endif /* !Q_WS_MAC */
|
---|
308 |
|
---|
309 | /** Returns restricted Runtime UI menu types. */
|
---|
310 | UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const QString &strID);
|
---|
311 | /** Defines restricted Runtime UI menu types. */
|
---|
312 | void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QString &strID);
|
---|
313 |
|
---|
314 | #ifdef Q_WS_MAC
|
---|
315 | /** Mac OS X: Returns restricted Runtime UI action types for Application menu. */
|
---|
316 | UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QString &strID);
|
---|
317 | /** Mac OS X: Defines restricted Runtime UI action types for Application menu. */
|
---|
318 | void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QString &strID);
|
---|
319 | #endif /* Q_WS_MAC */
|
---|
320 |
|
---|
321 | /** Returns restricted Runtime UI action types for Machine menu. */
|
---|
322 | UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QString &strID);
|
---|
323 | /** Defines restricted Runtime UI action types for Machine menu. */
|
---|
324 | void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QString &strID);
|
---|
325 |
|
---|
326 | /** Returns restricted Runtime UI action types for View menu. */
|
---|
327 | UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QString &strID);
|
---|
328 | /** Defines restricted Runtime UI action types for View menu. */
|
---|
329 | void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QString &strID);
|
---|
330 |
|
---|
331 | /** Returns restricted Runtime UI action types for Input menu. */
|
---|
332 | UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const QString &strID);
|
---|
333 | /** Defines restricted Runtime UI action types for Input menu. */
|
---|
334 | void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QString &strID);
|
---|
335 |
|
---|
336 | /** Returns restricted Runtime UI action types for Devices menu. */
|
---|
337 | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QString &strID);
|
---|
338 | /** Defines restricted Runtime UI action types for Devices menu. */
|
---|
339 | void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QString &strID);
|
---|
340 |
|
---|
341 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
342 | /** Returns restricted Runtime UI action types for Debugger menu. */
|
---|
343 | UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QString &strID);
|
---|
344 | /** Defines restricted Runtime UI action types for Debugger menu. */
|
---|
345 | void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QString &strID);
|
---|
346 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
347 |
|
---|
348 | #ifdef Q_WS_MAC
|
---|
349 | /** Mac OS X: Returns restricted Runtime UI action types for Window menu. */
|
---|
350 | UIExtraDataMetaDefs::MenuWindowActionType restrictedRuntimeMenuWindowActionTypes(const QString &strID);
|
---|
351 | /** Mac OS X: Defines restricted Runtime UI action types for Window menu. */
|
---|
352 | void setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QString &strID);
|
---|
353 | #endif /* Q_WS_MAC */
|
---|
354 |
|
---|
355 | /** Returns restricted Runtime UI action types for Help menu. */
|
---|
356 | UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QString &strID);
|
---|
357 | /** Defines restricted Runtime UI action types for Help menu. */
|
---|
358 | void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QString &strID);
|
---|
359 |
|
---|
360 | /** Returns restricted Runtime UI visual-states. */
|
---|
361 | UIVisualStateType restrictedVisualStates(const QString &strID);
|
---|
362 |
|
---|
363 | /** Returns requested Runtime UI visual-state. */
|
---|
364 | UIVisualStateType requestedVisualState(const QString &strID);
|
---|
365 | /** Defines requested Runtime UI visual-state as @a visualState. */
|
---|
366 | void setRequestedVisualState(UIVisualStateType visualState, const QString &strID);
|
---|
367 |
|
---|
368 | #ifdef Q_WS_X11
|
---|
369 | /** Returns whether legacy full-screen mode is requested. */
|
---|
370 | bool legacyFullscreenModeRequested();
|
---|
371 | #endif /* Q_WS_X11 */
|
---|
372 |
|
---|
373 | /** Returns whether guest-screen auto-resize according machine-window size is enabled. */
|
---|
374 | bool guestScreenAutoResizeEnabled(const QString &strID);
|
---|
375 | /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */
|
---|
376 | void setGuestScreenAutoResizeEnabled(bool fEnabled, const QString &strID);
|
---|
377 |
|
---|
378 | /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */
|
---|
379 | QSize lastGuestSizeHint(ulong uScreenIndex, const QString &strID);
|
---|
380 | /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */
|
---|
381 | void setLastGuestSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID);
|
---|
382 | /** Returns whether guest size-hint was for full or seamless screen with @a uScreenIndex. */
|
---|
383 | bool wasLastGuestSizeHintForFullScreen(ulong uScreenIndex, const QString &strID);
|
---|
384 | /** Defines whether guest size-hint @a fWas for full or seamless screen with @a uScreenIndex. */
|
---|
385 | void markLastGuestSizeHintAsFullScreen(ulong uScreenIndex, bool fWas, const QString &strID);
|
---|
386 |
|
---|
387 | /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */
|
---|
388 | int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID);
|
---|
389 | /** Defines @a iHostScreenIndex corresponding to passed guest-screen @a iGuestScreenIndex. */
|
---|
390 | void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID);
|
---|
391 |
|
---|
392 | /** Returns whether automatic mounting/unmounting of guest-screens enabled. */
|
---|
393 | bool autoMountGuestScreensEnabled(const QString &strID);
|
---|
394 |
|
---|
395 | #ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
396 | /** Returns whether 2D acceleration should use linear sretch. */
|
---|
397 | bool useLinearStretch(const QString &strID);
|
---|
398 | /** Returns whether 2D acceleration should use YV12 pixel format. */
|
---|
399 | bool usePixelFormatYV12(const QString &strID);
|
---|
400 | /** Returns whether 2D acceleration should use UYVY pixel format. */
|
---|
401 | bool usePixelFormatUYVY(const QString &strID);
|
---|
402 | /** Returns whether 2D acceleration should use YUY2 pixel format. */
|
---|
403 | bool usePixelFormatYUY2(const QString &strID);
|
---|
404 | /** Returns whether 2D acceleration should use AYUV pixel format. */
|
---|
405 | bool usePixelFormatAYUV(const QString &strID);
|
---|
406 | #endif /* VBOX_WITH_VIDEOHWACCEL */
|
---|
407 |
|
---|
408 | /** Returns whether Runtime UI should use unscaled HiDPI output. */
|
---|
409 | bool useUnscaledHiDPIOutput(const QString &strID);
|
---|
410 | /** Defines whether Runtime UI should @a fUseUnscaledHiDPIOutput. */
|
---|
411 | void setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput, const QString &strID);
|
---|
412 |
|
---|
413 | /** Returns Runtime UI HiDPI optimization type. */
|
---|
414 | HiDPIOptimizationType hiDPIOptimizationType(const QString &strID);
|
---|
415 |
|
---|
416 | #ifndef Q_WS_MAC
|
---|
417 | /** Returns whether mini-toolbar is enabled for full and seamless screens. */
|
---|
418 | bool miniToolbarEnabled(const QString &strID);
|
---|
419 | /** Defines whether mini-toolbar is @a fEnabled for full and seamless screens. */
|
---|
420 | void setMiniToolbarEnabled(bool fEnabled, const QString &strID);
|
---|
421 |
|
---|
422 | /** Returns whether mini-toolbar should auto-hide itself. */
|
---|
423 | bool autoHideMiniToolbar(const QString &strID);
|
---|
424 | /** Defines whether mini-toolbar should @a fAutoHide itself. */
|
---|
425 | void setAutoHideMiniToolbar(bool fAutoHide, const QString &strID);
|
---|
426 |
|
---|
427 | /** Returns mini-toolbar alignment. */
|
---|
428 | Qt::AlignmentFlag miniToolbarAlignment(const QString &strID);
|
---|
429 | /** Returns mini-toolbar @a alignment. */
|
---|
430 | void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QString &strID);
|
---|
431 | #endif /* Q_WS_MAC */
|
---|
432 |
|
---|
433 | /** Returns whether Runtime UI status-bar is enabled. */
|
---|
434 | bool statusBarEnabled(const QString &strID);
|
---|
435 | /** Defines whether Runtime UI status-bar is @a fEnabled. */
|
---|
436 | void setStatusBarEnabled(bool fEnabled, const QString &strID);
|
---|
437 |
|
---|
438 | /** Returns restricted Runtime UI status-bar indicator list. */
|
---|
439 | QList<IndicatorType> restrictedStatusBarIndicators(const QString &strID);
|
---|
440 | /** Defines restricted Runtime UI status-bar indicator @a list. */
|
---|
441 | void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QString &strID);
|
---|
442 |
|
---|
443 | /** Returns Runtime UI status-bar indicator order list. */
|
---|
444 | QList<IndicatorType> statusBarIndicatorOrder(const QString &strID);
|
---|
445 | /** Defines Runtime UI status-bar indicator order @a list. */
|
---|
446 | void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QString &strID);
|
---|
447 |
|
---|
448 | #ifdef Q_WS_MAC
|
---|
449 | /** Mac OS X: Returns whether 'presentation mode' enabled. */
|
---|
450 | bool presentationModeEnabled(const QString &strID);
|
---|
451 |
|
---|
452 | /** Mac OS X: Returns whether Dock icon should be updated at runtime. */
|
---|
453 | bool realtimeDockIconUpdateEnabled(const QString &strID);
|
---|
454 | /** Mac OS X: Defines whether Dock icon update should be fEnabled at runtime. */
|
---|
455 | void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QString &strID);
|
---|
456 |
|
---|
457 | /** Mac OS X: Returns guest-screen which Dock icon should reflect at runtime. */
|
---|
458 | int realtimeDockIconUpdateMonitor(const QString &strID);
|
---|
459 | /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */
|
---|
460 | void setRealtimeDockIconUpdateMonitor(int iIndex, const QString &strID);
|
---|
461 | #endif /* Q_WS_MAC */
|
---|
462 |
|
---|
463 | /** Returns whether machine should pass CAD to guest. */
|
---|
464 | bool passCADtoGuest(const QString &strID);
|
---|
465 |
|
---|
466 | /** Returns the mouse-capture policy. */
|
---|
467 | MouseCapturePolicy mouseCapturePolicy(const QString &strID);
|
---|
468 |
|
---|
469 | /** Returns redefined guru-meditation handler type. */
|
---|
470 | GuruMeditationHandlerType guruMeditationHandlerType(const QString &strID);
|
---|
471 |
|
---|
472 | /** Returns whether machine should perform HID LEDs synchronization. */
|
---|
473 | bool hidLedsSyncState(const QString &strID);
|
---|
474 |
|
---|
475 | /** Returns the scale-factor. */
|
---|
476 | double scaleFactor(const QString &strID);
|
---|
477 | /** Defines the @a dScaleFactor. */
|
---|
478 | void setScaleFactor(double dScaleFactor, const QString &strID);
|
---|
479 | /** @} */
|
---|
480 |
|
---|
481 | /** @name Virtual Machine: Information dialog
|
---|
482 | * @{ */
|
---|
483 | /** Returns information-window geometry using @a pWidget and @a pParentWidget as hints. */
|
---|
484 | QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QString &strID);
|
---|
485 | /** Returns whether information-window should be maximized or not. */
|
---|
486 | bool informationWindowShouldBeMaximized(const QString &strID);
|
---|
487 | /** Defines information-window @a geometry and @a fMaximized state. */
|
---|
488 | void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QString &strID);
|
---|
489 | /** @} */
|
---|
490 |
|
---|
491 | /** @name Virtual Machine: Close dialog
|
---|
492 | * @{ */
|
---|
493 | /** Returns default machine close action. */
|
---|
494 | MachineCloseAction defaultMachineCloseAction(const QString &strID);
|
---|
495 | /** Returns restricted machine close actions. */
|
---|
496 | MachineCloseAction restrictedMachineCloseActions(const QString &strID);
|
---|
497 |
|
---|
498 | /** Returns last machine close action. */
|
---|
499 | MachineCloseAction lastMachineCloseAction(const QString &strID);
|
---|
500 | /** Defines last @a machineCloseAction. */
|
---|
501 | void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QString &strID);
|
---|
502 |
|
---|
503 | /** Returns machine close hook script name as simple string. */
|
---|
504 | QString machineCloseHookScript(const QString &strID);
|
---|
505 | /** @} */
|
---|
506 |
|
---|
507 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
508 | /** @name Virtual Machine: Debug UI
|
---|
509 | * @{ */
|
---|
510 | /** Returns debug flag value for passed @a strDebugFlagKey. */
|
---|
511 | QString debugFlagValue(const QString &strDebugFlagKey);
|
---|
512 | /** @} */
|
---|
513 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
514 |
|
---|
515 | #ifdef DEBUG
|
---|
516 | /** @name VirtualBox: Extra-data Manager window
|
---|
517 | * @{ */
|
---|
518 | /** Returns Extra-data Manager geometry using @a pWidget as hint. */
|
---|
519 | QRect extraDataManagerGeometry(QWidget *pWidget);
|
---|
520 | /** Returns whether Extra-data Manager should be maximized or not. */
|
---|
521 | bool extraDataManagerShouldBeMaximized();
|
---|
522 | /** Defines Extra-data Manager @a geometry and @a fMaximized state. */
|
---|
523 | void setExtraDataManagerGeometry(const QRect &geometry, bool fMaximized);
|
---|
524 |
|
---|
525 | /** Returns Extra-data Manager splitter hints using @a pWidget as hint. */
|
---|
526 | QList<int> extraDataManagerSplitterHints(QWidget *pWidget);
|
---|
527 | /** Defines Extra-data Manager splitter @a hints. */
|
---|
528 | void setExtraDataManagerSplitterHints(const QList<int> &hints);
|
---|
529 | /** @} */
|
---|
530 | #endif /* DEBUG */
|
---|
531 |
|
---|
532 | private slots:
|
---|
533 |
|
---|
534 | /** Handles 'extra-data change' event: */
|
---|
535 | void sltExtraDataChange(QString strMachineID, QString strKey, QString strValue);
|
---|
536 |
|
---|
537 | private:
|
---|
538 |
|
---|
539 | /** Prepare Extra-data Manager. */
|
---|
540 | void prepare();
|
---|
541 | /** Prepare global extra-data map. */
|
---|
542 | void prepareGlobalExtraDataMap();
|
---|
543 | /** Prepare extra-data event-handler. */
|
---|
544 | void prepareExtraDataEventHandler();
|
---|
545 | /** Prepare Main event-listener. */
|
---|
546 | void prepareMainEventListener();
|
---|
547 | #ifdef DEBUG
|
---|
548 | // /** Prepare window. */
|
---|
549 | // void prepareWindow();
|
---|
550 |
|
---|
551 | /** Cleanup window. */
|
---|
552 | void cleanupWindow();
|
---|
553 | #endif /* DEBUG */
|
---|
554 | /** Cleanup Main event-listener. */
|
---|
555 | void cleanupMainEventListener();
|
---|
556 | // /** Cleanup extra-data event-handler. */
|
---|
557 | // void cleanupExtraDataEventHandler();
|
---|
558 | // /** Cleanup extra-data map. */
|
---|
559 | // void cleanupExtraDataMap();
|
---|
560 | /** Cleanup Extra-data Manager. */
|
---|
561 | void cleanup();
|
---|
562 |
|
---|
563 | #ifdef DEBUG
|
---|
564 | /** Open window. */
|
---|
565 | void open(QWidget *pCenterWidget);
|
---|
566 | #endif /* DEBUG */
|
---|
567 |
|
---|
568 | /** Determines whether feature corresponding to passed @a strKey is allowed.
|
---|
569 | * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
|
---|
570 | bool isFeatureAllowed(const QString &strKey, const QString &strID = GlobalID);
|
---|
571 | /** Determines whether feature corresponding to passed @a strKey is restricted.
|
---|
572 | * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
|
---|
573 | bool isFeatureRestricted(const QString &strKey, const QString &strID = GlobalID);
|
---|
574 |
|
---|
575 | /** Translates bool flag into 'allowed' value. */
|
---|
576 | QString toFeatureAllowed(bool fAllowed);
|
---|
577 | /** Translates bool flag into 'restricted' value. */
|
---|
578 | QString toFeatureRestricted(bool fRestricted);
|
---|
579 |
|
---|
580 | /** Returns string consisting of @a strBase appended with @a uScreenIndex for the *non-primary* screen-index.
|
---|
581 | * If @a fSameRuleForPrimary is 'true' same rule will be used for *primary* screen-index. Used for storing per-screen extra-data. */
|
---|
582 | static QString extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex, bool fSameRuleForPrimary = false);
|
---|
583 |
|
---|
584 | /** Singleton Extra-data Manager instance. */
|
---|
585 | static UIExtraDataManager *m_spInstance;
|
---|
586 |
|
---|
587 | /** Holds main event-listener instance. */
|
---|
588 | CEventListener m_listener;
|
---|
589 | /** Holds extra-data event-handler instance. */
|
---|
590 | UIExtraDataEventHandler *m_pHandler;
|
---|
591 |
|
---|
592 | /** Holds extra-data map instance. */
|
---|
593 | QMap<QString, ExtraDataMap> m_data;
|
---|
594 |
|
---|
595 | #ifdef DEBUG
|
---|
596 | /** Holds Extra-data Manager window instance. */
|
---|
597 | QPointer<UIExtraDataManagerWindow> m_pWindow;
|
---|
598 | #endif /* DEBUG */
|
---|
599 | };
|
---|
600 |
|
---|
601 | /** Singleton Extra-data Manager 'official' name. */
|
---|
602 | #define gEDataManager UIExtraDataManager::instance()
|
---|
603 |
|
---|
604 | #endif /* !___UIExtraDataManager_h___ */
|
---|