VirtualBox

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

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

FE/Qt: bugref:9827: Global properties / General page: Removing screen-saver options, they are not used for many years already.

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette