VirtualBox

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

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

FE/Qt: bugref:8900: Selector UI: Save/restore Machine/Global tools order/layout at exit/startup.

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