VirtualBox

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

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

Few small style fixes for r106215.

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