VirtualBox

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

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

FE/Qt: 6278: Support for scaled video-output: Initial implementation, no UI settings for now.

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