VirtualBox

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

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

FE/Qt: 7909: Mac OS X: Runtime UI: Extra-Data Manager: Renaming extra-data key from GUI_DockIconOverlayEnabled to GUI_DockIconOverlayDisabled to keep name consistency.

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