VirtualBox

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

Last change on this file since 92400 was 92400, checked in by vboxsync, 3 years ago

FE/Qt: bugref:10067: UINotificationCenter: Support for Ascending/Descending notification ordering; Corresponding flag is GUI/NotificationCenter/Order.

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