VirtualBox

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

Last change on this file since 61195 was 61195, checked in by vboxsync, 9 years ago

FE/Qt: ​​​​​​​​​​bugref:7420: Request GUI/SuppressMessages value from the machine extra-data first, then global one after that (no combining).

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