VirtualBox

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

Last change on this file since 80773 was 80773, checked in by vboxsync, 5 years ago

FE/Qt: bugref:9510: Extra data related cleanup

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