VirtualBox

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

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

FE/Qt: Mac OS X: 6278: Support for unscaled HiDPI (Retina) video-output: Allow to change the mode on-the-fly.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette