VirtualBox

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

Last change on this file since 77014 was 77014, checked in by vboxsync, 6 years ago

FE/Qt: Adding a search functionality to medium manager.

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