VirtualBox

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

Last change on this file since 75427 was 75427, checked in by vboxsync, 6 years ago

FE/Qt: bugref:9289: VirtualBox Manager / Details pane: Support for extra-data options, for now console only, no UI.

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