VirtualBox

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

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

FE/Qt: Adding necesarry extradata stuff to be able to disable some dialogs.

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