1 | /* $Id: UIGlobalSettingsDisplay.h 101717 2023-11-02 12:22:25Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIGlobalSettingsDisplay class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsDisplay_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsDisplay_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UISettingsPage.h"
|
---|
36 |
|
---|
37 | /* Forward declarations: */
|
---|
38 | class UIDisplayFeaturesEditor;
|
---|
39 | class UIFontScaleEditor;
|
---|
40 | class UIMaximumGuestScreenSizeEditor;
|
---|
41 | class UIScaleFactorEditor;
|
---|
42 | struct UIDataSettingsGlobalDisplay;
|
---|
43 | typedef UISettingsCache<UIDataSettingsGlobalDisplay> UISettingsCacheGlobalDisplay;
|
---|
44 |
|
---|
45 | /** Global settings: Display page. */
|
---|
46 | class SHARED_LIBRARY_STUFF UIGlobalSettingsDisplay : public UISettingsPageGlobal
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /** Constructs Display settings page. */
|
---|
53 | UIGlobalSettingsDisplay();
|
---|
54 | /** Destructs Display settings page. */
|
---|
55 | virtual ~UIGlobalSettingsDisplay() RT_OVERRIDE;
|
---|
56 |
|
---|
57 | protected:
|
---|
58 |
|
---|
59 | /** Returns whether the page content was changed. */
|
---|
60 | virtual bool changed() const RT_OVERRIDE;
|
---|
61 |
|
---|
62 | /** Loads settings from external object(s) packed inside @a data to cache.
|
---|
63 | * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
|
---|
64 | virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
|
---|
65 | /** Loads data from cache to corresponding widgets.
|
---|
66 | * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
|
---|
67 | virtual void getFromCache() RT_OVERRIDE;
|
---|
68 |
|
---|
69 | /** Saves data from corresponding widgets to cache.
|
---|
70 | * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
|
---|
71 | virtual void putToCache() RT_OVERRIDE;
|
---|
72 | /** Saves settings from cache to external object(s) packed inside @a data.
|
---|
73 | * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
|
---|
74 | virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
|
---|
75 |
|
---|
76 | /** Handles translation event. */
|
---|
77 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
78 |
|
---|
79 | /** Handles filter change. */
|
---|
80 | virtual void handleFilterChange() RT_OVERRIDE;
|
---|
81 |
|
---|
82 | private:
|
---|
83 |
|
---|
84 | /** Prepares all. */
|
---|
85 | void prepare();
|
---|
86 | /** Prepares widgets. */
|
---|
87 | void prepareWidgets();
|
---|
88 | /** Cleanups all. */
|
---|
89 | void cleanup();
|
---|
90 |
|
---|
91 | /** Saves existing data from cache. */
|
---|
92 | bool saveData();
|
---|
93 |
|
---|
94 | /** Updates minimum layout hint. */
|
---|
95 | void updateMinimumLayoutHint();
|
---|
96 |
|
---|
97 | /** Holds the page data cache instance. */
|
---|
98 | UISettingsCacheGlobalDisplay *m_pCache;
|
---|
99 |
|
---|
100 | /** @name Widgets
|
---|
101 | * @{ */
|
---|
102 | /** Holds the 'maximum guest screen size' editor instance. */
|
---|
103 | UIMaximumGuestScreenSizeEditor *m_pEditorMaximumGuestScreenSize;
|
---|
104 | /** Holds the 'scale-factor' editor instance. */
|
---|
105 | UIScaleFactorEditor *m_pEditorScaleFactor;
|
---|
106 | /** Holds the 'font scale' editor instance. */
|
---|
107 | UIFontScaleEditor *m_pFontScaleEditor;
|
---|
108 | /** Holds the 'display features' editor instance. */
|
---|
109 | UIDisplayFeaturesEditor *m_pEditorDisplayFeatures;
|
---|
110 | /** @} */
|
---|
111 | };
|
---|
112 |
|
---|
113 | #endif /* !FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsDisplay_h */
|
---|