VirtualBox

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

Last change on this file since 52937 was 52937, checked in by vboxsync, 10 years ago

FE/Qt: Runtime UI: Separate Input menu having keyboard/mouse related actions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 27.3 KB
Line 
1/** @file
2 * VBox Qt GUI - UIExtraDataManager class declaration.
3 */
4
5/*
6 * Copyright (C) 2010-2014 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 */
16
17#ifndef ___UIExtraDataManager_h___
18#define ___UIExtraDataManager_h___
19
20/* Qt includes: */
21#include <QObject>
22#include <QMap>
23#ifdef DEBUG
24# include <QPointer>
25#endif /* DEBUG */
26
27/* GUI includes: */
28#include "UIExtraDataDefs.h"
29
30/* COM includes: */
31#include "CEventListener.h"
32
33/* Forward declarations: */
34class UIExtraDataEventHandler;
35#ifdef DEBUG
36class UIExtraDataManagerWindow;
37#endif /* DEBUG */
38
39/* Type definitions: */
40typedef QMap<QString, QString> ExtraDataMap;
41
42/** Singleton QObject extension
43 * providing GUI with corresponding extra-data values,
44 * and notifying it whenever any of those values changed. */
45class UIExtraDataManager : public QObject
46{
47 Q_OBJECT;
48
49 /** Extra-data Manager constructor. */
50 UIExtraDataManager();
51 /** Extra-data Manager destructor. */
52 ~UIExtraDataManager();
53
54signals:
55
56 /** Notifies about extra-data map acknowledging. */
57 void sigExtraDataMapAcknowledging(QString strID);
58
59 /** Notifies about extra-data change. */
60 void sigExtraDataChange(QString strID, QString strKey, QString strValue);
61
62 /** Notifies about GUI language change. */
63 void sigLanguageChange(QString strLanguage);
64
65 /** Notifies about Selector UI keyboard shortcut change. */
66 void sigSelectorUIShortcutChange();
67 /** Notifies about Runtime UI keyboard shortcut change. */
68 void sigRuntimeUIShortcutChange();
69
70 /** Notifies about menu-bar configuration change. */
71 void sigMenuBarConfigurationChange();
72 /** Notifies about status-bar configuration change. */
73 void sigStatusBarConfigurationChange();
74
75 /** Notifies about HID LEDs synchronization state change. */
76 void sigHidLedsSyncStateChange(bool fEnabled);
77
78#ifdef RT_OS_DARWIN
79 /** Mac OS X: Notifies about 'presentation mode' status change. */
80 void sigPresentationModeChange(bool fEnabled);
81 /** Mac OS X: Notifies about 'dock icon' appearance change. */
82 void sigDockIconAppearanceChange(bool fEnabled);
83#endif /* RT_OS_DARWIN */
84
85public:
86
87 /** Global extra-data ID. */
88 static const QString GlobalID;
89
90 /** Static Extra-data Manager instance/constructor. */
91 static UIExtraDataManager* instance();
92 /** Static Extra-data Manager destructor. */
93 static void destroy();
94
95#ifdef DEBUG
96 /** Static show and raise API. */
97 static void openWindow(QWidget *pCenterWidget);
98#endif /* DEBUG */
99
100 /** @name General
101 * @{ */
102 /** Returns whether Extra-data Manager cached the map with passed @a strID. */
103 bool contains(const QString &strID) const { return m_data.contains(strID); }
104 /** Returns read-only extra-data map for passed @a strID. */
105 const ExtraDataMap map(const QString &strID) const { return m_data.value(strID); }
106
107 /** Hot-load machine extra-data map. */
108 void hotloadMachineExtraDataMap(const QString &strID);
109
110 /** Returns extra-data value corresponding to passed @a strKey as QString.
111 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
112 QString extraDataString(const QString &strKey, const QString &strID = GlobalID);
113 /** Defines extra-data value corresponding to passed @a strKey as strValue.
114 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
115 void setExtraDataString(const QString &strKey, const QString &strValue, const QString &strID = GlobalID);
116
117 /** Returns extra-data value corresponding to passed @a strKey as QStringList.
118 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
119 QStringList extraDataStringList(const QString &strKey, const QString &strID = GlobalID);
120 /** Defines extra-data value corresponding to passed @a strKey as strValue.
121 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
122 void setExtraDataStringList(const QString &strKey, const QStringList &strValue, const QString &strID = GlobalID);
123 /** @} */
124
125 /** @name Messaging
126 * @{ */
127 /** Returns the list of supressed messages for the Message/Popup center frameworks. */
128 QStringList suppressedMessages();
129 /** Defines the @a list of supressed messages for the Message/Popup center frameworks. */
130 void setSuppressedMessages(const QStringList &list);
131
132 /** Returns the list of messages for the Message/Popup center frameworks with inverted check-box state. */
133 QStringList messagesWithInvertedOption();
134
135#if !defined(VBOX_BLEEDING_EDGE) && !defined(DEBUG)
136 /** Returns version for which user wants to prevent BETA build warning. */
137 QString preventBetaBuildWarningForVersion();
138#endif /* !defined(VBOX_BLEEDING_EDGE) && !defined(DEBUG) */
139 /** @} */
140
141#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
142 /** @name Application Update
143 * @{ */
144 /** Returns whether Application Update functionality enabled. */
145 bool applicationUpdateEnabled();
146
147 /** Returns Application Update data. */
148 QString applicationUpdateData();
149 /** Defines Application Update data as @a strValue. */
150 void setApplicationUpdateData(const QString &strValue);
151
152 /** Returns Application Update check counter. */
153 qulonglong applicationUpdateCheckCounter();
154 /** Increments Application Update check counter. */
155 void incrementApplicationUpdateCheckCounter();
156 /** @} */
157#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
158
159 /** @name Settings
160 * @{ */
161 /** Returns restricted global settings pages. */
162 QList<GlobalSettingsPageType> restrictedGlobalSettingsPages();
163 /** Returns restricted machine settings pages. */
164 QList<MachineSettingsPageType> restrictedMachineSettingsPages(const QString &strID);
165 /** @} */
166
167 /** @name Settings: Keyboard
168 * @{ */
169 /** Returns shortcut overrides for shortcut-pool with @a strPoolExtraDataID. */
170 QStringList shortcutOverrides(const QString &strPoolExtraDataID);
171 /** @} */
172
173 /** @name Settings: Storage
174 * @{ */
175 /** Returns recent folder for hard-drives. */
176 QString recentFolderForHardDrives();
177 /** Returns recent folder for optical-disks. */
178 QString recentFolderForOpticalDisks();
179 /** Returns recent folder for floppy-disks. */
180 QString recentFolderForFloppyDisks();
181 /** Defines recent folder for hard-drives as @a strValue. */
182 void setRecentFolderForHardDrives(const QString &strValue);
183 /** Defines recent folder for optical-disk as @a strValue. */
184 void setRecentFolderForOpticalDisks(const QString &strValue);
185 /** Defines recent folder for floppy-disk as @a strValue. */
186 void setRecentFolderForFloppyDisks(const QString &strValue);
187
188 /** Returns the list of recently used hard-drives. */
189 QStringList recentListOfHardDrives();
190 /** Returns the list of recently used optical-disk. */
191 QStringList recentListOfOpticalDisks();
192 /** Returns the list of recently used floppy-disk. */
193 QStringList recentListOfFloppyDisks();
194 /** Defines the list of recently used hard-drives as @a value. */
195 void setRecentListOfHardDrives(const QStringList &value);
196 /** Defines the list of recently used optical-disks as @a value. */
197 void setRecentListOfOpticalDisks(const QStringList &value);
198 /** Defines the list of recently used floppy-disks as @a value. */
199 void setRecentListOfFloppyDisks(const QStringList &value);
200 /** @} */
201
202 /** @name VirtualBox Manager
203 * @{ */
204 /** Returns selector-window geometry using @a pWidget as the hint. */
205 QRect selectorWindowGeometry(QWidget *pWidget);
206 /** Returns whether selector-window should be maximized. */
207 bool selectorWindowShouldBeMaximized();
208 /** Defines selector-window @a geometry and @a fMaximized state. */
209 void setSelectorWindowGeometry(const QRect &geometry, bool fMaximized);
210
211 /** Returns selector-window splitter hints. */
212 QList<int> selectorWindowSplitterHints();
213 /** Defines selector-window splitter @a hints. */
214 void setSelectorWindowSplitterHints(const QList<int> &hints);
215
216 /** Returns whether selector-window tool-bar visible. */
217 bool selectorWindowToolBarVisible();
218 /** Defines whether selector-window tool-bar @a fVisible. */
219 void setSelectorWindowToolBarVisible(bool fVisible);
220
221 /** Returns whether selector-window status-bar visible. */
222 bool selectorWindowStatusBarVisible();
223 /** Defines whether selector-window status-bar @a fVisible. */
224 void setSelectorWindowStatusBarVisible(bool fVisible);
225
226 /** Clears all the existing selector-window chooser-pane' group definitions. */
227 void clearSelectorWindowGroupsDefinitions();
228 /** Returns selector-window chooser-pane' groups definitions for passed @a strGroupID. */
229 QStringList selectorWindowGroupsDefinitions(const QString &strGroupID);
230 /** Defines selector-window chooser-pane' groups @a definitions for passed @a strGroupID. */
231 void setSelectorWindowGroupsDefinitions(const QString &strGroupID, const QStringList &definitions);
232
233 /** Returns last-item ID of the item chosen in selector-window chooser-pane. */
234 QString selectorWindowLastItemChosen();
235 /** Defines @a lastItemID of the item chosen in selector-window chooser-pane. */
236 void setSelectorWindowLastItemChosen(const QString &strItemID);
237
238 /** Returns selector-window details-pane' elements. */
239 QMap<DetailsElementType, bool> selectorWindowDetailsElements();
240 /** Defines selector-window details-pane' @a elements. */
241 void setSelectorWindowDetailsElements(const QMap<DetailsElementType, bool> &elements);
242
243 /** Returns selector-window details-pane' preview update interval. */
244 PreviewUpdateIntervalType selectorWindowPreviewUpdateInterval();
245 /** Defines selector-window details-pane' preview update @a interval. */
246 void setSelectorWindowPreviewUpdateInterval(PreviewUpdateIntervalType interval);
247 /** @} */
248
249 /** @name Wizards
250 * @{ */
251 /** Returns mode for wizard of passed @a type. */
252 WizardMode modeForWizardType(WizardType type);
253 /** Defines @a mode for wizard of passed @a type. */
254 void setModeForWizardType(WizardType type, WizardMode mode);
255 /** @} */
256
257 /** @name Virtual Machine
258 * @{ */
259 /** Returns whether machine should be shown in selector-window chooser-pane. */
260 bool showMachineInSelectorChooser(const QString &strID);
261 /** Returns whether machine should be shown in selector-window details-pane. */
262 bool showMachineInSelectorDetails(const QString &strID);
263
264 /** Returns whether machine reconfiguration enabled. */
265 bool machineReconfigurationEnabled(const QString &strID);
266 /** Returns whether machine snapshot operations enabled. */
267 bool machineSnapshotOperationsEnabled(const QString &strID);
268
269 /** Returns whether this machine is first time started. */
270 bool machineFirstTimeStarted(const QString &strID);
271 /** Returns whether this machine is fFirstTimeStarted. */
272 void setMachineFirstTimeStarted(bool fFirstTimeStarted, const QString &strID);
273
274#ifndef Q_WS_MAC
275 /** Except Mac OS X: Returns redefined machine-window icon names. */
276 QStringList machineWindowIconNames(const QString &strID);
277 /** Except Mac OS X: Returns redefined machine-window name postfix. */
278 QString machineWindowNamePostfix(const QString &strID);
279#endif /* !Q_WS_MAC */
280
281 /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */
282 QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
283 /** Returns whether machine-window with @a uScreenIndex in @a visualStateType should be maximized. */
284 bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
285 /** Defines @a geometry and @a fMaximized state for machine-window with @a uScreenIndex in @a visualStateType. */
286 void setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QString &strID);
287
288 /** Returns whether Runtime UI menu-bar is enabled. */
289 bool menuBarEnabled(const QString &strID);
290 /** Defines whether Runtime UI menu-bar is @a fEnabled. */
291 void setMenuBarEnabled(bool fEnabled, const QString &strID);
292
293 /** Returns restricted Runtime UI menu types. */
294 UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const QString &strID);
295 /** Defines restricted Runtime UI menu types. */
296 void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QString &strID);
297
298#ifdef Q_WS_MAC
299 /** Mac OS X: Returns restricted Runtime UI action types for Application menu. */
300 UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QString &strID);
301 /** Mac OS X: Defines restricted Runtime UI action types for Application menu. */
302 void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QString &strID);
303#endif /* Q_WS_MAC */
304
305 /** Returns restricted Runtime UI action types for Machine menu. */
306 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QString &strID);
307 /** Defines restricted Runtime UI action types for Machine menu. */
308 void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QString &strID);
309
310 /** Returns restricted Runtime UI action types for View menu. */
311 UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QString &strID);
312 /** Defines restricted Runtime UI action types for View menu. */
313 void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QString &strID);
314
315 /** Returns restricted Runtime UI action types for Input menu. */
316 UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const QString &strID);
317 /** Defines restricted Runtime UI action types for Input menu. */
318 void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QString &strID);
319
320 /** Returns restricted Runtime UI action types for Devices menu. */
321 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QString &strID);
322 /** Defines restricted Runtime UI action types for Devices menu. */
323 void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QString &strID);
324
325#ifdef VBOX_WITH_DEBUGGER_GUI
326 /** Returns restricted Runtime UI action types for Debugger menu. */
327 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QString &strID);
328 /** Defines restricted Runtime UI action types for Debugger menu. */
329 void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QString &strID);
330#endif /* VBOX_WITH_DEBUGGER_GUI */
331
332 /** Returns restricted Runtime UI action types for Help menu. */
333 UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QString &strID);
334 /** Defines restricted Runtime UI action types for Help menu. */
335 void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QString &strID);
336
337 /** Returns restricted Runtime UI visual-states. */
338 UIVisualStateType restrictedVisualStates(const QString &strID);
339
340 /** Returns requested Runtime UI visual-state. */
341 UIVisualStateType requestedVisualState(const QString &strID);
342 /** Defines requested Runtime UI visual-state as @a visualState. */
343 void setRequestedVisualState(UIVisualStateType visualState, const QString &strID);
344
345#ifdef Q_WS_X11
346 /** Returns whether legacy full-screen mode is requested. */
347 bool legacyFullscreenModeRequested();
348#endif /* Q_WS_X11 */
349
350 /** Returns whether guest-screen auto-resize according machine-window size is enabled. */
351 bool guestScreenAutoResizeEnabled(const QString &strID);
352 /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */
353 void setGuestScreenAutoResizeEnabled(bool fEnabled, const QString &strID);
354
355 /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */
356 QSize lastGuestSizeHint(ulong uScreenIndex, const QString &strID);
357 /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */
358 void setLastGuestSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID);
359 /** Returns whether guest size-hint was for full or seamless screen with @a uScreenIndex. */
360 bool wasLastGuestSizeHintForFullScreen(ulong uScreenIndex, const QString &strID);
361 /** Defines whether guest size-hint @a fWas for full or seamless screen with @a uScreenIndex. */
362 void markLastGuestSizeHintAsFullScreen(ulong uScreenIndex, bool fWas, const QString &strID);
363
364 /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */
365 int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID);
366 /** Defines @a iHostScreenIndex corresponding to passed guest-screen @a iGuestScreenIndex. */
367 void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID);
368
369 /** Returns whether automatic mounting/unmounting of guest-screens enabled. */
370 bool autoMountGuestScreensEnabled(const QString &strID);
371
372#ifdef VBOX_WITH_VIDEOHWACCEL
373 /** Returns whether 2D acceleration should use linear sretch. */
374 bool useLinearStretch(const QString &strID);
375 /** Returns whether 2D acceleration should use YV12 pixel format. */
376 bool usePixelFormatYV12(const QString &strID);
377 /** Returns whether 2D acceleration should use UYVY pixel format. */
378 bool usePixelFormatUYVY(const QString &strID);
379 /** Returns whether 2D acceleration should use YUY2 pixel format. */
380 bool usePixelFormatYUY2(const QString &strID);
381 /** Returns whether 2D acceleration should use AYUV pixel format. */
382 bool usePixelFormatAYUV(const QString &strID);
383#endif /* VBOX_WITH_VIDEOHWACCEL */
384
385 /** Returns Runtime UI HiDPI optimization type. */
386 HiDPIOptimizationType hiDPIOptimizationType(const QString &strID);
387
388 /** Returns whether mini-toolbar is enabled for full and seamless screens. */
389 bool miniToolbarEnabled(const QString &strID);
390 /** Defines whether mini-toolbar is @a fEnabled for full and seamless screens. */
391 void setMiniToolbarEnabled(bool fEnabled, const QString &strID);
392
393 /** Returns whether mini-toolbar should auto-hide itself. */
394 bool autoHideMiniToolbar(const QString &strID);
395 /** Defines whether mini-toolbar should @a fAutoHide itself. */
396 void setAutoHideMiniToolbar(bool fAutoHide, const QString &strID);
397
398 /** Returns mini-toolbar alignment. */
399 Qt::AlignmentFlag miniToolbarAlignment(const QString &strID);
400 /** Returns mini-toolbar @a alignment. */
401 void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QString &strID);
402
403 /** Returns whether Runtime UI status-bar is enabled. */
404 bool statusBarEnabled(const QString &strID);
405 /** Defines whether Runtime UI status-bar is @a fEnabled. */
406 void setStatusBarEnabled(bool fEnabled, const QString &strID);
407
408 /** Returns restricted Runtime UI status-bar indicator list. */
409 QList<IndicatorType> restrictedStatusBarIndicators(const QString &strID);
410 /** Defines restricted Runtime UI status-bar indicator @a list. */
411 void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QString &strID);
412
413 /** Returns Runtime UI status-bar indicator order list. */
414 QList<IndicatorType> statusBarIndicatorOrder(const QString &strID);
415 /** Defines Runtime UI status-bar indicator order @a list. */
416 void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QString &strID);
417
418#ifdef Q_WS_MAC
419 /** Mac OS X: Returns whether 'presentation mode' enabled. */
420 bool presentationModeEnabled(const QString &strID);
421
422 /** Mac OS X: Returns whether Dock icon should be updated at runtime. */
423 bool realtimeDockIconUpdateEnabled(const QString &strID);
424 /** Mac OS X: Defines whether Dock icon update should be fEnabled at runtime. */
425 void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QString &strID);
426
427 /** Mac OS X: Returns guest-screen which Dock icon should reflect at runtime. */
428 int realtimeDockIconUpdateMonitor(const QString &strID);
429 /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */
430 void setRealtimeDockIconUpdateMonitor(int iIndex, const QString &strID);
431#endif /* Q_WS_MAC */
432
433 /** Returns whether machine should pass CAD to guest. */
434 bool passCADtoGuest(const QString &strID);
435
436 /** Returns the mouse-capture policy. */
437 MouseCapturePolicy mouseCapturePolicy(const QString &strID);
438
439 /** Returns redefined guru-meditation handler type. */
440 GuruMeditationHandlerType guruMeditationHandlerType(const QString &strID);
441
442 /** Returns whether machine should perform HID LEDs synchronization. */
443 bool hidLedsSyncState(const QString &strID);
444 /** @} */
445
446 /** @name Virtual Machine: Information dialog
447 * @{ */
448 /** Returns information-window geometry using @a pWidget and @a pParentWidget as hints. */
449 QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QString &strID);
450 /** Returns whether information-window should be maximized or not. */
451 bool informationWindowShouldBeMaximized(const QString &strID);
452 /** Defines information-window @a geometry and @a fMaximized state. */
453 void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QString &strID);
454 /** @} */
455
456 /** @name Virtual Machine: Close dialog
457 * @{ */
458 /** Returns default machine close action. */
459 MachineCloseAction defaultMachineCloseAction(const QString &strID);
460 /** Returns restricted machine close actions. */
461 MachineCloseAction restrictedMachineCloseActions(const QString &strID);
462
463 /** Returns last machine close action. */
464 MachineCloseAction lastMachineCloseAction(const QString &strID);
465 /** Defines last @a machineCloseAction. */
466 void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QString &strID);
467
468 /** Returns machine close hook script name as simple string. */
469 QString machineCloseHookScript(const QString &strID);
470 /** @} */
471
472#ifdef VBOX_WITH_DEBUGGER_GUI
473 /** @name Virtual Machine: Debug UI
474 * @{ */
475 /** Returns debug flag value for passed @a strDebugFlagKey. */
476 QString debugFlagValue(const QString &strDebugFlagKey);
477 /** @} */
478#endif /* VBOX_WITH_DEBUGGER_GUI */
479
480#ifdef DEBUG
481 /** @name VirtualBox: Extra-data Manager window
482 * @{ */
483 /** Returns Extra-data Manager geometry using @a pWidget as hint. */
484 QRect extraDataManagerGeometry(QWidget *pWidget);
485 /** Returns whether Extra-data Manager should be maximized or not. */
486 bool extraDataManagerShouldBeMaximized();
487 /** Defines Extra-data Manager @a geometry and @a fMaximized state. */
488 void setExtraDataManagerGeometry(const QRect &geometry, bool fMaximized);
489
490 /** Returns Extra-data Manager splitter hints using @a pWidget as hint. */
491 QList<int> extraDataManagerSplitterHints(QWidget *pWidget);
492 /** Defines Extra-data Manager splitter @a hints. */
493 void setExtraDataManagerSplitterHints(const QList<int> &hints);
494 /** @} */
495#endif /* DEBUG */
496
497private slots:
498
499 /** Handles 'extra-data change' event: */
500 void sltExtraDataChange(QString strMachineID, QString strKey, QString strValue);
501
502private:
503
504 /** Prepare Extra-data Manager. */
505 void prepare();
506 /** Prepare global extra-data map. */
507 void prepareGlobalExtraDataMap();
508 /** Prepare extra-data event-handler. */
509 void prepareExtraDataEventHandler();
510 /** Prepare Main event-listener. */
511 void prepareMainEventListener();
512#ifdef DEBUG
513 // /** Prepare window. */
514 // void prepareWindow();
515
516 /** Cleanup window. */
517 void cleanupWindow();
518#endif /* DEBUG */
519 /** Cleanup Main event-listener. */
520 void cleanupMainEventListener();
521 // /** Cleanup extra-data event-handler. */
522 // void cleanupExtraDataEventHandler();
523 // /** Cleanup extra-data map. */
524 // void cleanupExtraDataMap();
525 /** Cleanup Extra-data Manager. */
526 void cleanup();
527
528#ifdef DEBUG
529 /** Open window. */
530 void open(QWidget *pCenterWidget);
531#endif /* DEBUG */
532
533 /** Determines whether feature corresponding to passed @a strKey is allowed.
534 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
535 bool isFeatureAllowed(const QString &strKey, const QString &strID = GlobalID);
536 /** Determines whether feature corresponding to passed @a strKey is restricted.
537 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
538 bool isFeatureRestricted(const QString &strKey, const QString &strID = GlobalID);
539
540 /** Translates bool flag into 'allowed' value. */
541 QString toFeatureAllowed(bool fAllowed);
542 /** Translates bool flag into 'restricted' value. */
543 QString toFeatureRestricted(bool fRestricted);
544
545 /** Returns string consisting of @a strBase appended with @a uScreenIndex for the *non-primary* screen-index.
546 * If @a fSameRuleForPrimary is 'true' same rule will be used for *primary* screen-index. Used for storing per-screen extra-data. */
547 static QString extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex, bool fSameRuleForPrimary = false);
548
549 /** Singleton Extra-data Manager instance. */
550 static UIExtraDataManager *m_spInstance;
551
552 /** Holds main event-listener instance. */
553 CEventListener m_listener;
554 /** Holds extra-data event-handler instance. */
555 UIExtraDataEventHandler *m_pHandler;
556
557 /** Holds extra-data map instance. */
558 QMap<QString, ExtraDataMap> m_data;
559
560#ifdef DEBUG
561 /** Holds Extra-data Manager window instance. */
562 QPointer<UIExtraDataManagerWindow> m_pWindow;
563#endif /* DEBUG */
564};
565
566/** Singleton Extra-data Manager 'official' name. */
567#define gEDataManager UIExtraDataManager::instance()
568
569#endif /* !___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