VirtualBox

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

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

FE/Qt: Mac OS X: 6278: Support for unscaled HiDPI (Retina) video-output.

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