VirtualBox

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

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

FE/Qt: 6278: Support for scaled video-output: UI setting in VM settings / Display page / Machine Window tab first of all.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 28.0 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 Runtime UI HiDPI optimization type. */
397 HiDPIOptimizationType hiDPIOptimizationType(const QString &strID);
398
399 /** Returns whether mini-toolbar is enabled for full and seamless screens. */
400 bool miniToolbarEnabled(const QString &strID);
401 /** Defines whether mini-toolbar is @a fEnabled for full and seamless screens. */
402 void setMiniToolbarEnabled(bool fEnabled, const QString &strID);
403
404 /** Returns whether mini-toolbar should auto-hide itself. */
405 bool autoHideMiniToolbar(const QString &strID);
406 /** Defines whether mini-toolbar should @a fAutoHide itself. */
407 void setAutoHideMiniToolbar(bool fAutoHide, const QString &strID);
408
409 /** Returns mini-toolbar alignment. */
410 Qt::AlignmentFlag miniToolbarAlignment(const QString &strID);
411 /** Returns mini-toolbar @a alignment. */
412 void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QString &strID);
413
414 /** Returns whether Runtime UI status-bar is enabled. */
415 bool statusBarEnabled(const QString &strID);
416 /** Defines whether Runtime UI status-bar is @a fEnabled. */
417 void setStatusBarEnabled(bool fEnabled, const QString &strID);
418
419 /** Returns restricted Runtime UI status-bar indicator list. */
420 QList<IndicatorType> restrictedStatusBarIndicators(const QString &strID);
421 /** Defines restricted Runtime UI status-bar indicator @a list. */
422 void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QString &strID);
423
424 /** Returns Runtime UI status-bar indicator order list. */
425 QList<IndicatorType> statusBarIndicatorOrder(const QString &strID);
426 /** Defines Runtime UI status-bar indicator order @a list. */
427 void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QString &strID);
428
429#ifdef Q_WS_MAC
430 /** Mac OS X: Returns whether 'presentation mode' enabled. */
431 bool presentationModeEnabled(const QString &strID);
432
433 /** Mac OS X: Returns whether Dock icon should be updated at runtime. */
434 bool realtimeDockIconUpdateEnabled(const QString &strID);
435 /** Mac OS X: Defines whether Dock icon update should be fEnabled at runtime. */
436 void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QString &strID);
437
438 /** Mac OS X: Returns guest-screen which Dock icon should reflect at runtime. */
439 int realtimeDockIconUpdateMonitor(const QString &strID);
440 /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */
441 void setRealtimeDockIconUpdateMonitor(int iIndex, const QString &strID);
442#endif /* Q_WS_MAC */
443
444 /** Returns whether machine should pass CAD to guest. */
445 bool passCADtoGuest(const QString &strID);
446
447 /** Returns the mouse-capture policy. */
448 MouseCapturePolicy mouseCapturePolicy(const QString &strID);
449
450 /** Returns redefined guru-meditation handler type. */
451 GuruMeditationHandlerType guruMeditationHandlerType(const QString &strID);
452
453 /** Returns whether machine should perform HID LEDs synchronization. */
454 bool hidLedsSyncState(const QString &strID);
455
456 /** Returns the scale-factor. */
457 double scaleFactor(const QString &strID);
458 /** Defines the @a dScaleFactor. */
459 void setScaleFactor(double dScaleFactor, const QString &strID);
460 /** @} */
461
462 /** @name Virtual Machine: Information dialog
463 * @{ */
464 /** Returns information-window geometry using @a pWidget and @a pParentWidget as hints. */
465 QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QString &strID);
466 /** Returns whether information-window should be maximized or not. */
467 bool informationWindowShouldBeMaximized(const QString &strID);
468 /** Defines information-window @a geometry and @a fMaximized state. */
469 void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QString &strID);
470 /** @} */
471
472 /** @name Virtual Machine: Close dialog
473 * @{ */
474 /** Returns default machine close action. */
475 MachineCloseAction defaultMachineCloseAction(const QString &strID);
476 /** Returns restricted machine close actions. */
477 MachineCloseAction restrictedMachineCloseActions(const QString &strID);
478
479 /** Returns last machine close action. */
480 MachineCloseAction lastMachineCloseAction(const QString &strID);
481 /** Defines last @a machineCloseAction. */
482 void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QString &strID);
483
484 /** Returns machine close hook script name as simple string. */
485 QString machineCloseHookScript(const QString &strID);
486 /** @} */
487
488#ifdef VBOX_WITH_DEBUGGER_GUI
489 /** @name Virtual Machine: Debug UI
490 * @{ */
491 /** Returns debug flag value for passed @a strDebugFlagKey. */
492 QString debugFlagValue(const QString &strDebugFlagKey);
493 /** @} */
494#endif /* VBOX_WITH_DEBUGGER_GUI */
495
496#ifdef DEBUG
497 /** @name VirtualBox: Extra-data Manager window
498 * @{ */
499 /** Returns Extra-data Manager geometry using @a pWidget as hint. */
500 QRect extraDataManagerGeometry(QWidget *pWidget);
501 /** Returns whether Extra-data Manager should be maximized or not. */
502 bool extraDataManagerShouldBeMaximized();
503 /** Defines Extra-data Manager @a geometry and @a fMaximized state. */
504 void setExtraDataManagerGeometry(const QRect &geometry, bool fMaximized);
505
506 /** Returns Extra-data Manager splitter hints using @a pWidget as hint. */
507 QList<int> extraDataManagerSplitterHints(QWidget *pWidget);
508 /** Defines Extra-data Manager splitter @a hints. */
509 void setExtraDataManagerSplitterHints(const QList<int> &hints);
510 /** @} */
511#endif /* DEBUG */
512
513private slots:
514
515 /** Handles 'extra-data change' event: */
516 void sltExtraDataChange(QString strMachineID, QString strKey, QString strValue);
517
518private:
519
520 /** Prepare Extra-data Manager. */
521 void prepare();
522 /** Prepare global extra-data map. */
523 void prepareGlobalExtraDataMap();
524 /** Prepare extra-data event-handler. */
525 void prepareExtraDataEventHandler();
526 /** Prepare Main event-listener. */
527 void prepareMainEventListener();
528#ifdef DEBUG
529 // /** Prepare window. */
530 // void prepareWindow();
531
532 /** Cleanup window. */
533 void cleanupWindow();
534#endif /* DEBUG */
535 /** Cleanup Main event-listener. */
536 void cleanupMainEventListener();
537 // /** Cleanup extra-data event-handler. */
538 // void cleanupExtraDataEventHandler();
539 // /** Cleanup extra-data map. */
540 // void cleanupExtraDataMap();
541 /** Cleanup Extra-data Manager. */
542 void cleanup();
543
544#ifdef DEBUG
545 /** Open window. */
546 void open(QWidget *pCenterWidget);
547#endif /* DEBUG */
548
549 /** Determines whether feature corresponding to passed @a strKey is allowed.
550 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
551 bool isFeatureAllowed(const QString &strKey, const QString &strID = GlobalID);
552 /** Determines whether feature corresponding to passed @a strKey is restricted.
553 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
554 bool isFeatureRestricted(const QString &strKey, const QString &strID = GlobalID);
555
556 /** Translates bool flag into 'allowed' value. */
557 QString toFeatureAllowed(bool fAllowed);
558 /** Translates bool flag into 'restricted' value. */
559 QString toFeatureRestricted(bool fRestricted);
560
561 /** Returns string consisting of @a strBase appended with @a uScreenIndex for the *non-primary* screen-index.
562 * If @a fSameRuleForPrimary is 'true' same rule will be used for *primary* screen-index. Used for storing per-screen extra-data. */
563 static QString extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex, bool fSameRuleForPrimary = false);
564
565 /** Singleton Extra-data Manager instance. */
566 static UIExtraDataManager *m_spInstance;
567
568 /** Holds main event-listener instance. */
569 CEventListener m_listener;
570 /** Holds extra-data event-handler instance. */
571 UIExtraDataEventHandler *m_pHandler;
572
573 /** Holds extra-data map instance. */
574 QMap<QString, ExtraDataMap> m_data;
575
576#ifdef DEBUG
577 /** Holds Extra-data Manager window instance. */
578 QPointer<UIExtraDataManagerWindow> m_pWindow;
579#endif /* DEBUG */
580};
581
582/** Singleton Extra-data Manager 'official' name. */
583#define gEDataManager UIExtraDataManager::instance()
584
585#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