VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h@ 66589

Last change on this file since 66589 was 66589, checked in by vboxsync, 8 years ago

FE/Qt: Get rid of VBoxGlobalSettings: Moving remapped scan codes handling into extra-data manager (it's X11 stuff generally).

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette