VirtualBox

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

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

FE/Qt: ​​​bugref:8308: Event handlers rework/cleanup (part 06): Heavy encapsulation rework for the private event-handling parts which helps to avoid some of includes and to have common signal rules for all the event handlers we have.

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

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