VirtualBox

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

Last change on this file since 86958 was 86958, checked in by vboxsync, 4 years ago

FE/Qt: bugref:9831. Saving/loding bookmarks

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 43.6 KB
Line 
1/* $Id: UIExtraDataManager.h 86958 2020-11-23 11:23:43Z 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 a list of restricted dialogs. */
161 UIExtraDataMetaDefs::DialogType restrictedDialogTypes(const QUuid &uID);
162 /** Defines a list of restricted dialogs. */
163 void setRestrictedDialogTypes(UIExtraDataMetaDefs::DialogType enmTypes, const QUuid &uID);
164 /** @} */
165
166 /** @name Messaging
167 * @{ */
168 /** Returns the list of supressed messages for the Message/Popup center frameworks. */
169 QStringList suppressedMessages(const QUuid &uID = GlobalID);
170 /** Defines the @a list of supressed messages for the Message/Popup center frameworks. */
171 void setSuppressedMessages(const QStringList &list);
172
173 /** Returns the list of messages for the Message/Popup center frameworks with inverted check-box state. */
174 QStringList messagesWithInvertedOption();
175
176#if !defined(VBOX_BLEEDING_EDGE) && !defined(DEBUG)
177 /** Returns version for which user wants to prevent BETA build warning. */
178 QString preventBetaBuildWarningForVersion();
179#endif
180 /** @} */
181
182#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
183 /** @name Application Update
184 * @{ */
185 /** Returns whether Application Update functionality enabled. */
186 bool applicationUpdateEnabled();
187
188 /** Returns Application Update data. */
189 QString applicationUpdateData();
190 /** Defines Application Update data as @a strValue. */
191 void setApplicationUpdateData(const QString &strValue);
192
193 /** Returns Application Update check counter. */
194 qulonglong applicationUpdateCheckCounter();
195 /** Increments Application Update check counter. */
196 void incrementApplicationUpdateCheckCounter();
197 /** @} */
198#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
199
200 /** @name Progress
201 * @{ */
202 /** Returns whether legacy progress handling method is requested. */
203 bool legacyProgressHandlingRequested();
204 /** @} */
205
206 /** @name Settings
207 * @{ */
208 /** Returns whether GUI @a enmFeature is enabled. */
209 bool guiFeatureEnabled(GUIFeatureType enmFeature);
210
211 /** Returns restricted global settings pages. */
212 QList<GlobalSettingsPageType> restrictedGlobalSettingsPages();
213 /** Returns restricted machine settings pages. */
214 QList<MachineSettingsPageType> restrictedMachineSettingsPages(const QUuid &uID);
215 /** @} */
216
217 /** @name Settings: Language
218 * @{ */
219 /** Returns the GUI language ID. */
220 QString languageId();
221 /** Defines the GUI @a strLanguageId. */
222 void setLanguageId(const QString &strLanguageId);
223 /** @} */
224
225 /** @name Settings: Display
226 * @{ */
227 /** Returns maximum guest-screen resolution policy. */
228 MaxGuestResolutionPolicy maxGuestResolutionPolicy();
229 /** Defines maximum guest-screen resolution @a enmPolicy or @a resolution itself for Fixed policy. */
230 void setMaxGuestScreenResolution(MaxGuestResolutionPolicy enmPolicy, const QSize resolution = QSize());
231 /** Returns maximum guest-screen resolution for fixed policy. */
232 QSize maxGuestResolutionForPolicyFixed();
233 /** Defines maximum guest-screen @a resolution for fixed policy. */
234 void setMaxGuestResolutionForPolicyFixed(const QSize &resolution);
235
236 /** Returns whether hovered machine-window should be activated. */
237 bool activateHoveredMachineWindow();
238 /** Defines whether hovered machine-window should be @a fActivated. */
239 void setActivateHoveredMachineWindow(bool fActivate);
240 /** @} */
241
242 /** @name Settings: Keyboard
243 * @{ */
244 /** Returns the Runtime UI host-key combination. */
245 QString hostKeyCombination();
246 /** Defines the Runtime UI host-key combination. */
247 void setHostKeyCombination(const QString &strHostCombo);
248
249 /** Returns shortcut overrides for shortcut-pool with @a strPoolExtraDataID. */
250 QStringList shortcutOverrides(const QString &strPoolExtraDataID);
251
252 /** Returns whether the Runtime UI auto-capture is enabled. */
253 bool autoCaptureEnabled();
254 /** Defines whether the Runtime UI auto-capture is @a fEnabled. */
255 void setAutoCaptureEnabled(bool fEnabled);
256
257 /** Returns the Runtime UI remapped scan codes. */
258 QString remappedScanCodes();
259 /** @} */
260
261 /** @name Settings: Proxy
262 * @{ */
263 /** Returns VBox proxy settings. */
264 QString proxySettings();
265 /** Defines VBox proxy @a strSettings. */
266 void setProxySettings(const QString &strSettings);
267 /** @} */
268
269 /** @name Settings: Storage
270 * @{ */
271 /** Returns recent folder for hard-drives. */
272 QString recentFolderForHardDrives();
273 /** Returns recent folder for optical-disks. */
274 QString recentFolderForOpticalDisks();
275 /** Returns recent folder for floppy-disks. */
276 QString recentFolderForFloppyDisks();
277 /** Defines recent folder for hard-drives as @a strValue. */
278 void setRecentFolderForHardDrives(const QString &strValue);
279 /** Defines recent folder for optical-disk as @a strValue. */
280 void setRecentFolderForOpticalDisks(const QString &strValue);
281 /** Defines recent folder for floppy-disk as @a strValue. */
282 void setRecentFolderForFloppyDisks(const QString &strValue);
283
284 /** Returns the list of recently used hard-drives. */
285 QStringList recentListOfHardDrives();
286 /** Returns the list of recently used optical-disk. */
287 QStringList recentListOfOpticalDisks();
288 /** Returns the list of recently used floppy-disk. */
289 QStringList recentListOfFloppyDisks();
290 /** Defines the list of recently used hard-drives as @a value. */
291 void setRecentListOfHardDrives(const QStringList &value);
292 /** Defines the list of recently used optical-disks as @a value. */
293 void setRecentListOfOpticalDisks(const QStringList &value);
294 /** Defines the list of recently used floppy-disks as @a value. */
295 void setRecentListOfFloppyDisks(const QStringList &value);
296 /** @} */
297
298 /** @name Settings: Network
299 * @{ */
300 /** Returns the list of restricted network attachment types. */
301 UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork restrictedNetworkAttachmentTypes();
302 /** @} */
303
304 /** @name VISO Creator
305 * @{ */
306 /** Returns recent folder for VISO creation content. */
307 QString visoCreatorRecentFolder();
308 /** Defines recent folder for VISO creation content as @a strValue. */
309 void setVISOCreatorRecentFolder(const QString &strValue);
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 Cloud Profile Manager restrictions. */
405 QStringList cloudProfileManagerRestrictions();
406 /** Defines Cloud Profile Manager @a restrictions. */
407 void setCloudProfileManagerRestrictions(const QStringList &restrictions);
408
409 /** Returns whether Cloud Profile Manager details expanded. */
410 bool cloudProfileManagerDetailsExpanded();
411 /** Defines whether Cloud Profile Manager details @a fExpanded. */
412 void setCloudProfileManagerDetailsExpanded(bool fExpanded);
413 /** @} */
414
415 /** @name Cloud Console Manager
416 * @{ */
417 /** Returns registered Cloud Console Manager applications. */
418 QStringList cloudConsoleManagerApplications();
419 /** Returns registered Cloud Console Manager profiles for application with @a strId. */
420 QStringList cloudConsoleManagerProfiles(const QString &strId);
421
422 /** Returns definition for Cloud Console Manager application with @a strId. */
423 QString cloudConsoleManagerApplication(const QString &strId);
424 /** Defines @a strDefinition for Cloud Console Manager application with @a strId. */
425 void setCloudConsoleManagerApplication(const QString &strId, const QString &strDefinition);
426
427 /** Returns definition for Cloud Console Manager profile with @a strProfileId for application with @a strApplicationId. */
428 QString cloudConsoleManagerProfile(const QString &strApplicationId, const QString &strProfileId);
429 /** Returns @a strDefinition for Cloud Console Manager profile with @a strProfileId for application with @a strApplicationId. */
430 void setCloudConsoleManagerProfile(const QString &strApplicationId, const QString &strProfileId, const QString &strDefinition);
431
432 /** Returns Cloud Console Manager restrictions. */
433 QStringList cloudConsoleManagerRestrictions();
434 /** Defines Cloud Console Manager @a restrictions. */
435 void setCloudConsoleManagerRestrictions(const QStringList &restrictions);
436
437 /** Returns whether Cloud Console Manager details expanded. */
438 bool cloudConsoleManagerDetailsExpanded();
439 /** Defines whether Cloud Console Manager details @a fExpanded. */
440 void setCloudConsoleManagerDetailsExpanded(bool fExpanded);
441 /** @} */
442
443 /** @name Cloud Console
444 * @{ */
445 /** Returns Cloud Console public key path. */
446 QString cloudConsolePublicKeyPath();
447 /** Defines Cloud Console public key @a strPath. */
448 void setCloudConsolePublicKeyPath(const QString &strPath);
449 /** @} */
450
451 /** @name Wizards
452 * @{ */
453 /** Returns mode for wizard of passed @a type. */
454 WizardMode modeForWizardType(WizardType type);
455 /** Defines @a mode for wizard of passed @a type. */
456 void setModeForWizardType(WizardType type, WizardMode mode);
457 /** @} */
458
459 /** @name Virtual Machine
460 * @{ */
461 /** Returns whether machine should be shown in VirtualBox Manager Chooser-pane. */
462 bool showMachineInVirtualBoxManagerChooser(const QUuid &uID);
463 /** Returns whether machine should be shown in VirtualBox Manager Details-pane. */
464 bool showMachineInVirtualBoxManagerDetails(const QUuid &uID);
465
466 /** Returns whether machine reconfiguration enabled. */
467 bool machineReconfigurationEnabled(const QUuid &uID);
468 /** Returns whether machine snapshot operations enabled. */
469 bool machineSnapshotOperationsEnabled(const QUuid &uID);
470
471 /** Returns whether this machine is first time started. */
472 bool machineFirstTimeStarted(const QUuid &uID);
473 /** Returns whether this machine is fFirstTimeStarted. */
474 void setMachineFirstTimeStarted(bool fFirstTimeStarted, const QUuid &uID);
475
476 /** Except Mac OS X: Returns redefined machine-window icon names. */
477 QStringList machineWindowIconNames(const QUuid &uID);
478#ifndef VBOX_WS_MAC
479 /** Except Mac OS X: Returns redefined machine-window name postfix. */
480 QString machineWindowNamePostfix(const QUuid &uID);
481#endif
482
483 /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */
484 QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &uID);
485 /** Returns whether machine-window with @a uScreenIndex in @a visualStateType should be maximized. */
486 bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &uID);
487 /** Defines @a geometry and @a fMaximized state for machine-window with @a uScreenIndex in @a visualStateType. */
488 void setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QUuid &uID);
489
490#ifndef VBOX_WS_MAC
491 /** Returns whether Runtime UI menu-bar is enabled. */
492 bool menuBarEnabled(const QUuid &uID);
493 /** Defines whether Runtime UI menu-bar is @a fEnabled. */
494 void setMenuBarEnabled(bool fEnabled, const QUuid &uID);
495#endif /* !VBOX_WS_MAC */
496
497 /** Returns whether Runtime UI menu-bar context-menu is enabled. */
498 bool menuBarContextMenuEnabled(const QUuid &uID);
499 /** Defines whether Runtime UI menu-bar context-menu is @a fEnabled. */
500 void setMenuBarContextMenuEnabled(bool fEnabled, const QUuid &uID);
501
502 /** Returns restricted Runtime UI menu types. */
503 UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const QUuid &uID);
504 /** Defines restricted Runtime UI menu types. */
505 void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QUuid &uID);
506
507 /** Returns restricted Runtime UI action types for Application menu. */
508 UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QUuid &uID);
509 /** Defines restricted Runtime UI action types for Application menu. */
510 void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QUuid &uID);
511
512 /** Returns restricted Runtime UI action types for Machine menu. */
513 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QUuid &uID);
514 /** Defines restricted Runtime UI action types for Machine menu. */
515 void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QUuid &uID);
516
517 /** Returns restricted Runtime UI action types for View menu. */
518 UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QUuid &uID);
519 /** Defines restricted Runtime UI action types for View menu. */
520 void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QUuid &uID);
521
522 /** Returns restricted Runtime UI action types for Input menu. */
523 UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const QUuid &uID);
524 /** Defines restricted Runtime UI action types for Input menu. */
525 void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QUuid &uID);
526
527 /** Returns restricted Runtime UI action types for Devices menu. */
528 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QUuid &uID);
529 /** Defines restricted Runtime UI action types for Devices menu. */
530 void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QUuid &uID);
531
532#ifdef VBOX_WITH_DEBUGGER_GUI
533 /** Returns restricted Runtime UI action types for Debugger menu. */
534 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QUuid &uID);
535 /** Defines restricted Runtime UI action types for Debugger menu. */
536 void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QUuid &uID);
537#endif /* VBOX_WITH_DEBUGGER_GUI */
538
539#ifdef VBOX_WS_MAC
540 /** Mac OS X: Returns restricted Runtime UI action types for Window menu. */
541 UIExtraDataMetaDefs::MenuWindowActionType restrictedRuntimeMenuWindowActionTypes(const QUuid &uID);
542 /** Mac OS X: Defines restricted Runtime UI action types for Window menu. */
543 void setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QUuid &uID);
544#endif /* VBOX_WS_MAC */
545
546 /** Returns restricted Runtime UI action types for Help menu. */
547 UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QUuid &uID);
548 /** Defines restricted Runtime UI action types for Help menu. */
549 void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QUuid &uID);
550
551 /** Returns restricted Runtime UI visual-states. */
552 UIVisualStateType restrictedVisualStates(const QUuid &uID);
553
554 /** Returns requested Runtime UI visual-state. */
555 UIVisualStateType requestedVisualState(const QUuid &uID);
556 /** Defines requested Runtime UI visual-state as @a visualState. */
557 void setRequestedVisualState(UIVisualStateType visualState, const QUuid &uID);
558
559#ifdef VBOX_WS_X11
560 /** Returns whether legacy full-screen mode is requested. */
561 bool legacyFullscreenModeRequested();
562
563 /** Returns whether internal machine-window name should be unique. */
564 bool distinguishMachineWindowGroups(const QUuid &uID);
565 /** Defines whether internal machine-window name should be unique. */
566 void setDistinguishMachineWindowGroups(const QUuid &uID, bool fEnabled);
567#endif /* VBOX_WS_X11 */
568
569 /** Returns whether guest-screen auto-resize according machine-window size is enabled. */
570 bool guestScreenAutoResizeEnabled(const QUuid &uID);
571 /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */
572 void setGuestScreenAutoResizeEnabled(bool fEnabled, const QUuid &uID);
573
574 /** Returns last guest-screen visibility status for screen with @a uScreenIndex. */
575 bool lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QUuid &uID);
576 /** Defines whether last guest-screen visibility status was @a fEnabled for screen with @a uScreenIndex. */
577 void setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QUuid &uID);
578
579 /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */
580 QSize lastGuestScreenSizeHint(ulong uScreenIndex, const QUuid &uID);
581 /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */
582 void setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QUuid &uID);
583
584 /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */
585 int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QUuid &uID);
586 /** Defines @a iHostScreenIndex corresponding to passed guest-screen @a iGuestScreenIndex. */
587 void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QUuid &uID);
588
589 /** Returns whether automatic mounting/unmounting of guest-screens enabled. */
590 bool autoMountGuestScreensEnabled(const QUuid &uID);
591
592#ifndef VBOX_WS_MAC
593 /** Returns whether mini-toolbar is enabled for full and seamless screens. */
594 bool miniToolbarEnabled(const QUuid &uID);
595 /** Defines whether mini-toolbar is @a fEnabled for full and seamless screens. */
596 void setMiniToolbarEnabled(bool fEnabled, const QUuid &uID);
597
598 /** Returns whether mini-toolbar should auto-hide itself. */
599 bool autoHideMiniToolbar(const QUuid &uID);
600 /** Defines whether mini-toolbar should @a fAutoHide itself. */
601 void setAutoHideMiniToolbar(bool fAutoHide, const QUuid &uID);
602
603 /** Returns mini-toolbar alignment. */
604 Qt::AlignmentFlag miniToolbarAlignment(const QUuid &uID);
605 /** Returns mini-toolbar @a alignment. */
606 void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QUuid &uID);
607#endif /* VBOX_WS_MAC */
608
609 /** Returns whether Runtime UI status-bar is enabled. */
610 bool statusBarEnabled(const QUuid &uID);
611 /** Defines whether Runtime UI status-bar is @a fEnabled. */
612 void setStatusBarEnabled(bool fEnabled, const QUuid &uID);
613
614 /** Returns whether Runtime UI status-bar context-menu is enabled. */
615 bool statusBarContextMenuEnabled(const QUuid &uID);
616 /** Defines whether Runtime UI status-bar context-menu is @a fEnabled. */
617 void setStatusBarContextMenuEnabled(bool fEnabled, const QUuid &uID);
618
619 /** Returns restricted Runtime UI status-bar indicator list. */
620 QList<IndicatorType> restrictedStatusBarIndicators(const QUuid &uID);
621 /** Defines restricted Runtime UI status-bar indicator @a list. */
622 void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QUuid &uID);
623
624 /** Returns Runtime UI status-bar indicator order list. */
625 QList<IndicatorType> statusBarIndicatorOrder(const QUuid &uID);
626 /** Defines Runtime UI status-bar indicator order @a list. */
627 void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QUuid &uID);
628
629#ifdef VBOX_WS_MAC
630 /** Mac OS X: Returns whether Dock icon should be updated at runtime. */
631 bool realtimeDockIconUpdateEnabled(const QUuid &uID);
632 /** Mac OS X: Defines whether Dock icon update should be fEnabled at runtime. */
633 void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QUuid &uID);
634
635 /** Mac OS X: Returns guest-screen which Dock icon should reflect at runtime. */
636 int realtimeDockIconUpdateMonitor(const QUuid &uID);
637 /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */
638 void setRealtimeDockIconUpdateMonitor(int iIndex, const QUuid &uID);
639
640 /** Mac OS X: Returns whether Dock icon overlay is disabled. */
641 bool dockIconDisableOverlay(const QUuid &uID);
642 /** Mac OS X: Defines whether Dock icon overlay is @a fDisabled. */
643 void setDockIconDisableOverlay(bool fDisabled, const QUuid &uID);
644#endif /* VBOX_WS_MAC */
645
646 /** Returns whether machine should pass CAD to guest. */
647 bool passCADtoGuest(const QUuid &uID);
648
649 /** Returns the mouse-capture policy. */
650 MouseCapturePolicy mouseCapturePolicy(const QUuid &uID);
651
652 /** Returns redefined guru-meditation handler type. */
653 GuruMeditationHandlerType guruMeditationHandlerType(const QUuid &uID);
654
655 /** Returns whether machine should perform HID LEDs synchronization. */
656 bool hidLedsSyncState(const QUuid &uID);
657
658 /** Returns the scale-factor. */
659 double scaleFactor(const QUuid &uID, const int uScreenIndex);
660 QList<double> scaleFactors(const QUuid &uID);
661 /** Saves the @a dScaleFactor for the monitor with @a uScreenIndex. If the existing scale factor
662 * list (from extra data) does not have scale factors for the screens with ids in [0, uScreenIndex)
663 * the this function appends a default scale factor for said screens.*/
664 void setScaleFactor(double dScaleFactor, const QUuid &uID, const int uScreenIndex);
665 /** Replaces the scale factor list of the machine with @a uID with @a scaleFactors. */
666 void setScaleFactors(const QList<double> &scaleFactors, const QUuid &uID);
667
668 /** Returns the scaling optimization type. */
669 ScalingOptimizationType scalingOptimizationType(const QUuid &uID);
670 /** @} */
671
672 /** @name Virtual Machine: Session Information dialog
673 * @{ */
674 /** Returns session information dialog geometry using @a pWidget and @a pParentWidget as hints. */
675 QRect sessionInformationDialogGeometry(QWidget *pWidget, QWidget *pParentWidget);
676 /** Returns whether information-window should be maximized or not. */
677 bool sessionInformationDialogShouldBeMaximized();
678 /** Defines information-window @a geometry and @a fMaximized state. */
679 void setSessionInformationDialogGeometry(const QRect &geometry, bool fMaximized);
680 /** @} */
681
682 /** @name Guest Control related dialogs
683 * @{ */
684 void setGuestControlProcessControlSplitterHints(const QList<int> &hints);
685 QList<int> guestControlProcessControlSplitterHints();
686 QRect fileManagerDialogGeometry(QWidget *pWidget, QWidget *pParentWidget);
687 bool fileManagerDialogShouldBeMaximized();
688 void setFileManagerDialogGeometry(const QRect &geometry, bool fMaximized);
689 QRect guestProcessControlDialogGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry);
690 bool guestProcessControlDialogShouldBeMaximized();
691 void setGuestProcessControlDialogGeometry(const QRect &geometry, bool fMaximized);
692 void setFileManagerVisiblePanels(const QStringList &panelNameList);
693 QStringList fileManagerVisiblePanels();
694 /** @} */
695
696 /** @name Soft Keyboard
697 * @{ */
698 QRect softKeyboardDialogGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry);
699 void setSoftKeyboardDialogGeometry(const QRect &geometry, bool fMaximized);
700 bool softKeyboardDialogShouldBeMaximized();
701 void setSoftKeyboardOptions(bool fShowNumPad, bool fHideOSMenuKeys, bool fMultimediaKeys);
702 void softKeyboardOptions(bool &fOutShowNumPad, bool &fOutHideOSMenuKeys, bool &fOutHideMultimediaKeys);
703 void setSoftKeyboardColorTheme(const QStringList &colorStringList);
704 QStringList softKeyboardColorTheme();
705 void setSoftKeyboardSelectedColorTheme(const QString &strColorThemeName);
706 QString softKeyboardSelectedColorTheme();
707 void setSoftKeyboardSelectedLayout(const QUuid &uLayoutUid);
708 QUuid softKeyboardSelectedLayout();
709 /** @} */
710
711 /** @name File Manager options
712 * @{ */
713 void setFileManagerOptions(bool fListDirectoriesFirst,
714 bool fShowDeleteConfirmation,
715 bool fshowHumanReadableSizes,
716 bool fShowHiddenObjects);
717 bool fileManagerListDirectoriesFirst();
718 bool fileManagerShowDeleteConfirmation();
719 bool fileManagerShowHumanReadableSizes();
720 bool fileManagerShowHiddenObjects();
721 /** @} */
722
723 /** @name Virtual Machine: Close dialog
724 * @{ */
725 /** Returns default machine close action. */
726 MachineCloseAction defaultMachineCloseAction(const QUuid &uID);
727 /** Returns restricted machine close actions. */
728 MachineCloseAction restrictedMachineCloseActions(const QUuid &uID);
729
730 /** Returns last machine close action. */
731 MachineCloseAction lastMachineCloseAction(const QUuid &uID);
732 /** Defines last @a machineCloseAction. */
733 void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QUuid &uID);
734
735 /** Returns machine close hook script name as simple string. */
736 QString machineCloseHookScript(const QUuid &uID);
737 /** @} */
738
739#ifdef VBOX_WITH_DEBUGGER_GUI
740 /** @name Virtual Machine: Debug UI
741 * @{ */
742 /** Returns debug flag value for passed @a strDebugFlagKey. */
743 QString debugFlagValue(const QString &strDebugFlagKey);
744 /** @} */
745#endif /* VBOX_WITH_DEBUGGER_GUI */
746
747#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
748 /** @name VirtualBox: Extra-data Manager window
749 * @{ */
750 /** Returns Extra-data Manager geometry using @a pWidget and @a pParentWidget as hint. */
751 QRect extraDataManagerGeometry(QWidget *pWidget, QWidget *pParentWidget);
752 /** Returns whether Extra-data Manager should be maximized or not. */
753 bool extraDataManagerShouldBeMaximized();
754 /** Defines Extra-data Manager @a geometry and @a fMaximized state. */
755 void setExtraDataManagerGeometry(const QRect &geometry, bool fMaximized);
756
757 /** Returns Extra-data Manager splitter hints using @a pWidget as hint. */
758 QList<int> extraDataManagerSplitterHints(QWidget *pWidget);
759 /** Defines Extra-data Manager splitter @a hints. */
760 void setExtraDataManagerSplitterHints(const QList<int> &hints);
761 /** @} */
762#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
763
764 /** @name Virtual Machine: Log Viewer dialog
765 * @{ */
766 /** Returns log-window geometry using @a pWidget, @a pParentWidget and @a defaultGeometry as hints. */
767 QRect logWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry);
768 /** Returns whether log-window should be maximized or not. */
769 bool logWindowShouldBeMaximized();
770 /** Defines log-window @a geometry and @a fMaximized state. */
771 void setLogWindowGeometry(const QRect &geometry, bool fMaximized);
772 /** @} */
773
774 /** @name Virtual Machine: Log Viewer widget options
775 * @{ */
776 void setLogViweverOptions(const QFont &font, bool wrapLines, bool showLineNumbers);
777 /** Returns log-viewer line wrapping flag. */
778 bool logViewerWrapLines();
779 /** Returns log-viewer show line numbers flag. */
780 bool logViewerShowLineNumbers();
781 /** Tries to find system font by searching by family and style strings within the font database. */
782 QFont logViewerFont();
783 void setLogViewerVisiblePanels(const QStringList &panelNameList);
784 QStringList logViewerVisiblePanels();
785 /** @} */
786
787 /** @name Help Browser
788 * @{ */
789 void setHelpBrowserLastUrlList(const QStringList &urlList);
790 QStringList helpBrowserLastUrlList();
791 QRect helpBrowserDialogGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry);
792 void setHelpBrowserDialogGeometry(const QRect &geometry, bool fMaximized);
793 bool helpBrowserDialogShouldBeMaximized();
794 void setHelpBrowserBookmarks(const QStringList &bookmarks);
795 QStringList helpBrowserBookmarks();
796 /** @} */
797
798 /** @name Manager UI: VM Resource Monitor
799 * @{ */
800 void setVMResourceMonitorHiddenColumnList(const QStringList &hiddenColumnList);
801 QStringList VMResourceMonitorHiddenColumnList();
802 /** @} */
803
804private slots:
805
806 /** Handles 'extra-data change' event: */
807 void sltExtraDataChange(const QUuid &uMachineID, const QString &strKey, const QString &strValue);
808
809private:
810
811 /** Prepare Extra-data Manager. */
812 void prepare();
813 /** Prepare global extra-data map. */
814 void prepareGlobalExtraDataMap();
815 /** Prepare extra-data event-handler. */
816 void prepareExtraDataEventHandler();
817#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
818 // /** Prepare window. */
819 // void prepareWindow();
820
821 /** Cleanup window. */
822 void cleanupWindow();
823#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
824 /** Cleanup extra-data event-handler. */
825 void cleanupExtraDataEventHandler();
826 // /** Cleanup extra-data map. */
827 // void cleanupExtraDataMap();
828 /** Cleanup Extra-data Manager. */
829 void cleanup();
830
831#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
832 /** Open window. */
833 void open(QWidget *pCenterWidget);
834#endif
835
836 /** Retrieves an extra-data key from both machine and global sources.
837 *
838 * If @a uID isn't #GlobalID, this will first check the extra-data associated
839 * with the machine given by @a uID then fallback on the global extra-data.
840 *
841 * @returns String value if found, null string if not.
842 * @param strKey The extra-data key to get.
843 * @param uID Machine UUID or #GlobalID.
844 * @param strValue Where to return the value when found. */
845 QString extraDataStringUnion(const QString &strKey, const QUuid &uID);
846 /** Determines whether feature corresponding to passed @a strKey is allowed.
847 * If valid @a uID is set => applies to machine and global extra-data,
848 * otherwise => only to global one. */
849 bool isFeatureAllowed(const QString &strKey, const QUuid &uID = GlobalID);
850 /** Determines whether feature corresponding to passed @a strKey is restricted.
851 * If valid @a uID is set => applies to machine and global extra-data,
852 * otherwise => only to global one. */
853 bool isFeatureRestricted(const QString &strKey, const QUuid &uID = GlobalID);
854
855 /** Translates bool flag into QString value. */
856 QString toFeatureState(bool fState);
857 /** Translates bool flag into 'allowed' value. */
858 QString toFeatureAllowed(bool fAllowed);
859 /** Translates bool flag into 'restricted' value. */
860 QString toFeatureRestricted(bool fRestricted);
861
862 /** Defines saved dialog geometry according to specified attributes.
863 * @param strKey Brings geometry extra-data key of particular dialog.
864 * @param geometry Brings the dialog geometry to save.
865 * @param fMaximized Brings whether saved dialog geometry should be marked as maximized. */
866 void setDialogGeometry(const QString &strKey, const QRect &geometry, bool fMaximized);
867 /** Returns saved dialog geometry according to specified attributes.
868 * @param strKey Brings geometry extra-data key of particular dialog.
869 * @param pWidget Brings the widget to limit geometry bounds according to.
870 * @param pParentWidget Brings the widget to center geometry rectangle according to.
871 * @param defaultGeometry Brings the default geometry which should be used to
872 * calculate resulting geometry if saved was not found. */
873 QRect dialogGeometry(const QString &strKey, QWidget *pWidget, QWidget *pParentWidget = 0, const QRect &defaultGeometry = QRect());
874
875 /** Returns string consisting of @a strBase appended with @a uScreenIndex for the *non-primary* screen-index.
876 * If @a fSameRuleForPrimary is 'true' same rule will be used for *primary* screen-index. Used for storing per-screen extra-data. */
877 static QString extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex, bool fSameRuleForPrimary = false);
878
879 /** Holds the singleton instance. */
880 static UIExtraDataManager *s_pInstance;
881
882 /** Holds extra-data event-handler instance. */
883 UIExtraDataEventHandler *m_pHandler;
884
885 /** Holds extra-data map instance. */
886 MapOfExtraDataMaps m_data;
887
888#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
889 /** Holds Extra-data Manager window instance. */
890 QPointer<UIExtraDataManagerWindow> m_pWindow;
891#endif
892};
893
894/** Singleton Extra-data Manager 'official' name. */
895#define gEDataManager UIExtraDataManager::instance()
896
897#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