VirtualBox

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

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

FE/Qt: 7582: Runtime UI: Make the activate-on-hover behavior configurable.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 27.5 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: Display
168 * @{ */
169 /** Returns whether hovered machine-window should be activated. */
170 bool activateHoveredMachineWindow();
171 /** @} */
172
173 /** @name Settings: Keyboard
174 * @{ */
175 /** Returns shortcut overrides for shortcut-pool with @a strPoolExtraDataID. */
176 QStringList shortcutOverrides(const QString &strPoolExtraDataID);
177 /** @} */
178
179 /** @name Settings: Storage
180 * @{ */
181 /** Returns recent folder for hard-drives. */
182 QString recentFolderForHardDrives();
183 /** Returns recent folder for optical-disks. */
184 QString recentFolderForOpticalDisks();
185 /** Returns recent folder for floppy-disks. */
186 QString recentFolderForFloppyDisks();
187 /** Defines recent folder for hard-drives as @a strValue. */
188 void setRecentFolderForHardDrives(const QString &strValue);
189 /** Defines recent folder for optical-disk as @a strValue. */
190 void setRecentFolderForOpticalDisks(const QString &strValue);
191 /** Defines recent folder for floppy-disk as @a strValue. */
192 void setRecentFolderForFloppyDisks(const QString &strValue);
193
194 /** Returns the list of recently used hard-drives. */
195 QStringList recentListOfHardDrives();
196 /** Returns the list of recently used optical-disk. */
197 QStringList recentListOfOpticalDisks();
198 /** Returns the list of recently used floppy-disk. */
199 QStringList recentListOfFloppyDisks();
200 /** Defines the list of recently used hard-drives as @a value. */
201 void setRecentListOfHardDrives(const QStringList &value);
202 /** Defines the list of recently used optical-disks as @a value. */
203 void setRecentListOfOpticalDisks(const QStringList &value);
204 /** Defines the list of recently used floppy-disks as @a value. */
205 void setRecentListOfFloppyDisks(const QStringList &value);
206 /** @} */
207
208 /** @name VirtualBox Manager
209 * @{ */
210 /** Returns selector-window geometry using @a pWidget as the hint. */
211 QRect selectorWindowGeometry(QWidget *pWidget);
212 /** Returns whether selector-window should be maximized. */
213 bool selectorWindowShouldBeMaximized();
214 /** Defines selector-window @a geometry and @a fMaximized state. */
215 void setSelectorWindowGeometry(const QRect &geometry, bool fMaximized);
216
217 /** Returns selector-window splitter hints. */
218 QList<int> selectorWindowSplitterHints();
219 /** Defines selector-window splitter @a hints. */
220 void setSelectorWindowSplitterHints(const QList<int> &hints);
221
222 /** Returns whether selector-window tool-bar visible. */
223 bool selectorWindowToolBarVisible();
224 /** Defines whether selector-window tool-bar @a fVisible. */
225 void setSelectorWindowToolBarVisible(bool fVisible);
226
227 /** Returns whether selector-window status-bar visible. */
228 bool selectorWindowStatusBarVisible();
229 /** Defines whether selector-window status-bar @a fVisible. */
230 void setSelectorWindowStatusBarVisible(bool fVisible);
231
232 /** Clears all the existing selector-window chooser-pane' group definitions. */
233 void clearSelectorWindowGroupsDefinitions();
234 /** Returns selector-window chooser-pane' groups definitions for passed @a strGroupID. */
235 QStringList selectorWindowGroupsDefinitions(const QString &strGroupID);
236 /** Defines selector-window chooser-pane' groups @a definitions for passed @a strGroupID. */
237 void setSelectorWindowGroupsDefinitions(const QString &strGroupID, const QStringList &definitions);
238
239 /** Returns last-item ID of the item chosen in selector-window chooser-pane. */
240 QString selectorWindowLastItemChosen();
241 /** Defines @a lastItemID of the item chosen in selector-window chooser-pane. */
242 void setSelectorWindowLastItemChosen(const QString &strItemID);
243
244 /** Returns selector-window details-pane' elements. */
245 QMap<DetailsElementType, bool> selectorWindowDetailsElements();
246 /** Defines selector-window details-pane' @a elements. */
247 void setSelectorWindowDetailsElements(const QMap<DetailsElementType, bool> &elements);
248
249 /** Returns selector-window details-pane' preview update interval. */
250 PreviewUpdateIntervalType selectorWindowPreviewUpdateInterval();
251 /** Defines selector-window details-pane' preview update @a interval. */
252 void setSelectorWindowPreviewUpdateInterval(PreviewUpdateIntervalType interval);
253 /** @} */
254
255 /** @name Wizards
256 * @{ */
257 /** Returns mode for wizard of passed @a type. */
258 WizardMode modeForWizardType(WizardType type);
259 /** Defines @a mode for wizard of passed @a type. */
260 void setModeForWizardType(WizardType type, WizardMode mode);
261 /** @} */
262
263 /** @name Virtual Machine
264 * @{ */
265 /** Returns whether machine should be shown in selector-window chooser-pane. */
266 bool showMachineInSelectorChooser(const QString &strID);
267 /** Returns whether machine should be shown in selector-window details-pane. */
268 bool showMachineInSelectorDetails(const QString &strID);
269
270 /** Returns whether machine reconfiguration enabled. */
271 bool machineReconfigurationEnabled(const QString &strID);
272 /** Returns whether machine snapshot operations enabled. */
273 bool machineSnapshotOperationsEnabled(const QString &strID);
274
275 /** Returns whether this machine is first time started. */
276 bool machineFirstTimeStarted(const QString &strID);
277 /** Returns whether this machine is fFirstTimeStarted. */
278 void setMachineFirstTimeStarted(bool fFirstTimeStarted, const QString &strID);
279
280#ifndef Q_WS_MAC
281 /** Except Mac OS X: Returns redefined machine-window icon names. */
282 QStringList machineWindowIconNames(const QString &strID);
283 /** Except Mac OS X: Returns redefined machine-window name postfix. */
284 QString machineWindowNamePostfix(const QString &strID);
285#endif /* !Q_WS_MAC */
286
287 /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */
288 QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
289 /** Returns whether machine-window with @a uScreenIndex in @a visualStateType should be maximized. */
290 bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
291 /** Defines @a geometry and @a fMaximized state for machine-window with @a uScreenIndex in @a visualStateType. */
292 void setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QString &strID);
293
294 /** Returns whether Runtime UI menu-bar is enabled. */
295 bool menuBarEnabled(const QString &strID);
296 /** Defines whether Runtime UI menu-bar is @a fEnabled. */
297 void setMenuBarEnabled(bool fEnabled, const QString &strID);
298
299 /** Returns restricted Runtime UI menu types. */
300 UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const QString &strID);
301 /** Defines restricted Runtime UI menu types. */
302 void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QString &strID);
303
304#ifdef Q_WS_MAC
305 /** Mac OS X: Returns restricted Runtime UI action types for Application menu. */
306 UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QString &strID);
307 /** Mac OS X: Defines restricted Runtime UI action types for Application menu. */
308 void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QString &strID);
309#endif /* Q_WS_MAC */
310
311 /** Returns restricted Runtime UI action types for Machine menu. */
312 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QString &strID);
313 /** Defines restricted Runtime UI action types for Machine menu. */
314 void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QString &strID);
315
316 /** Returns restricted Runtime UI action types for View menu. */
317 UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QString &strID);
318 /** Defines restricted Runtime UI action types for View menu. */
319 void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QString &strID);
320
321 /** Returns restricted Runtime UI action types for Input menu. */
322 UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const QString &strID);
323 /** Defines restricted Runtime UI action types for Input menu. */
324 void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QString &strID);
325
326 /** Returns restricted Runtime UI action types for Devices menu. */
327 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QString &strID);
328 /** Defines restricted Runtime UI action types for Devices menu. */
329 void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QString &strID);
330
331#ifdef VBOX_WITH_DEBUGGER_GUI
332 /** Returns restricted Runtime UI action types for Debugger menu. */
333 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QString &strID);
334 /** Defines restricted Runtime UI action types for Debugger menu. */
335 void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QString &strID);
336#endif /* VBOX_WITH_DEBUGGER_GUI */
337
338 /** Returns restricted Runtime UI action types for Help menu. */
339 UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QString &strID);
340 /** Defines restricted Runtime UI action types for Help menu. */
341 void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QString &strID);
342
343 /** Returns restricted Runtime UI visual-states. */
344 UIVisualStateType restrictedVisualStates(const QString &strID);
345
346 /** Returns requested Runtime UI visual-state. */
347 UIVisualStateType requestedVisualState(const QString &strID);
348 /** Defines requested Runtime UI visual-state as @a visualState. */
349 void setRequestedVisualState(UIVisualStateType visualState, const QString &strID);
350
351#ifdef Q_WS_X11
352 /** Returns whether legacy full-screen mode is requested. */
353 bool legacyFullscreenModeRequested();
354#endif /* Q_WS_X11 */
355
356 /** Returns whether guest-screen auto-resize according machine-window size is enabled. */
357 bool guestScreenAutoResizeEnabled(const QString &strID);
358 /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */
359 void setGuestScreenAutoResizeEnabled(bool fEnabled, const QString &strID);
360
361 /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */
362 QSize lastGuestSizeHint(ulong uScreenIndex, const QString &strID);
363 /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */
364 void setLastGuestSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID);
365 /** Returns whether guest size-hint was for full or seamless screen with @a uScreenIndex. */
366 bool wasLastGuestSizeHintForFullScreen(ulong uScreenIndex, const QString &strID);
367 /** Defines whether guest size-hint @a fWas for full or seamless screen with @a uScreenIndex. */
368 void markLastGuestSizeHintAsFullScreen(ulong uScreenIndex, bool fWas, const QString &strID);
369
370 /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */
371 int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID);
372 /** Defines @a iHostScreenIndex corresponding to passed guest-screen @a iGuestScreenIndex. */
373 void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID);
374
375 /** Returns whether automatic mounting/unmounting of guest-screens enabled. */
376 bool autoMountGuestScreensEnabled(const QString &strID);
377
378#ifdef VBOX_WITH_VIDEOHWACCEL
379 /** Returns whether 2D acceleration should use linear sretch. */
380 bool useLinearStretch(const QString &strID);
381 /** Returns whether 2D acceleration should use YV12 pixel format. */
382 bool usePixelFormatYV12(const QString &strID);
383 /** Returns whether 2D acceleration should use UYVY pixel format. */
384 bool usePixelFormatUYVY(const QString &strID);
385 /** Returns whether 2D acceleration should use YUY2 pixel format. */
386 bool usePixelFormatYUY2(const QString &strID);
387 /** Returns whether 2D acceleration should use AYUV pixel format. */
388 bool usePixelFormatAYUV(const QString &strID);
389#endif /* VBOX_WITH_VIDEOHWACCEL */
390
391 /** Returns Runtime UI HiDPI optimization type. */
392 HiDPIOptimizationType hiDPIOptimizationType(const QString &strID);
393
394 /** Returns whether mini-toolbar is enabled for full and seamless screens. */
395 bool miniToolbarEnabled(const QString &strID);
396 /** Defines whether mini-toolbar is @a fEnabled for full and seamless screens. */
397 void setMiniToolbarEnabled(bool fEnabled, const QString &strID);
398
399 /** Returns whether mini-toolbar should auto-hide itself. */
400 bool autoHideMiniToolbar(const QString &strID);
401 /** Defines whether mini-toolbar should @a fAutoHide itself. */
402 void setAutoHideMiniToolbar(bool fAutoHide, const QString &strID);
403
404 /** Returns mini-toolbar alignment. */
405 Qt::AlignmentFlag miniToolbarAlignment(const QString &strID);
406 /** Returns mini-toolbar @a alignment. */
407 void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QString &strID);
408
409 /** Returns whether Runtime UI status-bar is enabled. */
410 bool statusBarEnabled(const QString &strID);
411 /** Defines whether Runtime UI status-bar is @a fEnabled. */
412 void setStatusBarEnabled(bool fEnabled, const QString &strID);
413
414 /** Returns restricted Runtime UI status-bar indicator list. */
415 QList<IndicatorType> restrictedStatusBarIndicators(const QString &strID);
416 /** Defines restricted Runtime UI status-bar indicator @a list. */
417 void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QString &strID);
418
419 /** Returns Runtime UI status-bar indicator order list. */
420 QList<IndicatorType> statusBarIndicatorOrder(const QString &strID);
421 /** Defines Runtime UI status-bar indicator order @a list. */
422 void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QString &strID);
423
424#ifdef Q_WS_MAC
425 /** Mac OS X: Returns whether 'presentation mode' enabled. */
426 bool presentationModeEnabled(const QString &strID);
427
428 /** Mac OS X: Returns whether Dock icon should be updated at runtime. */
429 bool realtimeDockIconUpdateEnabled(const QString &strID);
430 /** Mac OS X: Defines whether Dock icon update should be fEnabled at runtime. */
431 void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QString &strID);
432
433 /** Mac OS X: Returns guest-screen which Dock icon should reflect at runtime. */
434 int realtimeDockIconUpdateMonitor(const QString &strID);
435 /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */
436 void setRealtimeDockIconUpdateMonitor(int iIndex, const QString &strID);
437#endif /* Q_WS_MAC */
438
439 /** Returns whether machine should pass CAD to guest. */
440 bool passCADtoGuest(const QString &strID);
441
442 /** Returns the mouse-capture policy. */
443 MouseCapturePolicy mouseCapturePolicy(const QString &strID);
444
445 /** Returns redefined guru-meditation handler type. */
446 GuruMeditationHandlerType guruMeditationHandlerType(const QString &strID);
447
448 /** Returns whether machine should perform HID LEDs synchronization. */
449 bool hidLedsSyncState(const QString &strID);
450 /** @} */
451
452 /** @name Virtual Machine: Information dialog
453 * @{ */
454 /** Returns information-window geometry using @a pWidget and @a pParentWidget as hints. */
455 QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QString &strID);
456 /** Returns whether information-window should be maximized or not. */
457 bool informationWindowShouldBeMaximized(const QString &strID);
458 /** Defines information-window @a geometry and @a fMaximized state. */
459 void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QString &strID);
460 /** @} */
461
462 /** @name Virtual Machine: Close dialog
463 * @{ */
464 /** Returns default machine close action. */
465 MachineCloseAction defaultMachineCloseAction(const QString &strID);
466 /** Returns restricted machine close actions. */
467 MachineCloseAction restrictedMachineCloseActions(const QString &strID);
468
469 /** Returns last machine close action. */
470 MachineCloseAction lastMachineCloseAction(const QString &strID);
471 /** Defines last @a machineCloseAction. */
472 void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QString &strID);
473
474 /** Returns machine close hook script name as simple string. */
475 QString machineCloseHookScript(const QString &strID);
476 /** @} */
477
478#ifdef VBOX_WITH_DEBUGGER_GUI
479 /** @name Virtual Machine: Debug UI
480 * @{ */
481 /** Returns debug flag value for passed @a strDebugFlagKey. */
482 QString debugFlagValue(const QString &strDebugFlagKey);
483 /** @} */
484#endif /* VBOX_WITH_DEBUGGER_GUI */
485
486#ifdef DEBUG
487 /** @name VirtualBox: Extra-data Manager window
488 * @{ */
489 /** Returns Extra-data Manager geometry using @a pWidget as hint. */
490 QRect extraDataManagerGeometry(QWidget *pWidget);
491 /** Returns whether Extra-data Manager should be maximized or not. */
492 bool extraDataManagerShouldBeMaximized();
493 /** Defines Extra-data Manager @a geometry and @a fMaximized state. */
494 void setExtraDataManagerGeometry(const QRect &geometry, bool fMaximized);
495
496 /** Returns Extra-data Manager splitter hints using @a pWidget as hint. */
497 QList<int> extraDataManagerSplitterHints(QWidget *pWidget);
498 /** Defines Extra-data Manager splitter @a hints. */
499 void setExtraDataManagerSplitterHints(const QList<int> &hints);
500 /** @} */
501#endif /* DEBUG */
502
503private slots:
504
505 /** Handles 'extra-data change' event: */
506 void sltExtraDataChange(QString strMachineID, QString strKey, QString strValue);
507
508private:
509
510 /** Prepare Extra-data Manager. */
511 void prepare();
512 /** Prepare global extra-data map. */
513 void prepareGlobalExtraDataMap();
514 /** Prepare extra-data event-handler. */
515 void prepareExtraDataEventHandler();
516 /** Prepare Main event-listener. */
517 void prepareMainEventListener();
518#ifdef DEBUG
519 // /** Prepare window. */
520 // void prepareWindow();
521
522 /** Cleanup window. */
523 void cleanupWindow();
524#endif /* DEBUG */
525 /** Cleanup Main event-listener. */
526 void cleanupMainEventListener();
527 // /** Cleanup extra-data event-handler. */
528 // void cleanupExtraDataEventHandler();
529 // /** Cleanup extra-data map. */
530 // void cleanupExtraDataMap();
531 /** Cleanup Extra-data Manager. */
532 void cleanup();
533
534#ifdef DEBUG
535 /** Open window. */
536 void open(QWidget *pCenterWidget);
537#endif /* DEBUG */
538
539 /** Determines whether feature corresponding to passed @a strKey is allowed.
540 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
541 bool isFeatureAllowed(const QString &strKey, const QString &strID = GlobalID);
542 /** Determines whether feature corresponding to passed @a strKey is restricted.
543 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
544 bool isFeatureRestricted(const QString &strKey, const QString &strID = GlobalID);
545
546 /** Translates bool flag into 'allowed' value. */
547 QString toFeatureAllowed(bool fAllowed);
548 /** Translates bool flag into 'restricted' value. */
549 QString toFeatureRestricted(bool fRestricted);
550
551 /** Returns string consisting of @a strBase appended with @a uScreenIndex for the *non-primary* screen-index.
552 * If @a fSameRuleForPrimary is 'true' same rule will be used for *primary* screen-index. Used for storing per-screen extra-data. */
553 static QString extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex, bool fSameRuleForPrimary = false);
554
555 /** Singleton Extra-data Manager instance. */
556 static UIExtraDataManager *m_spInstance;
557
558 /** Holds main event-listener instance. */
559 CEventListener m_listener;
560 /** Holds extra-data event-handler instance. */
561 UIExtraDataEventHandler *m_pHandler;
562
563 /** Holds extra-data map instance. */
564 QMap<QString, ExtraDataMap> m_data;
565
566#ifdef DEBUG
567 /** Holds Extra-data Manager window instance. */
568 QPointer<UIExtraDataManagerWindow> m_pWindow;
569#endif /* DEBUG */
570};
571
572/** Singleton Extra-data Manager 'official' name. */
573#define gEDataManager UIExtraDataManager::instance()
574
575#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