summaryrefslogtreecommitdiff
path: root/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
blob: 9ee72768607f9c796af590796475045cec293095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/* $Id$ */
/** @file
 * VBox Qt GUI - UIMachineSettingsSystem class declaration.
 */

/*
 * Copyright (C) 2008-2022 Oracle Corporation
 *
 * This file is part of VirtualBox Open Source Edition (OSE), as
 * available from http://www.virtualbox.org. This file is free software;
 * you can redistribute it and/or modify it under the terms of the GNU
 * General Public License (GPL) as published by the Free Software
 * Foundation, in version 2 as it comes in the "COPYING" file of the
 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 */

#ifndef FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsSystem_h
#define FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsSystem_h
#ifndef RT_WITHOUT_PRAGMA_ONCE
# pragma once
#endif

/* GUI includes: */
#include "UISettingsPage.h"

/* Forward declarations: */
struct UIDataSettingsMachineSystem;
typedef UISettingsCache<UIDataSettingsMachineSystem> UISettingsCacheMachineSystem;
class QITabWidget;
class UIAccelerationFeaturesEditor;
class UIBaseMemoryEditor;
class UIBootOrderEditor;
class UIChipsetEditor;
class UIExecutionCapEditor;
class UIMotherboardFeaturesEditor;
class UIParavirtProviderEditor;
class UIPointingHIDEditor;
class UIProcessorFeaturesEditor;
class UIVirtualCPUEditor;

/** Machine settings: System page. */
class SHARED_LIBRARY_STUFF UIMachineSettingsSystem : public UISettingsPageMachine
{
    Q_OBJECT;

public:

    /** Constructs System settings page. */
    UIMachineSettingsSystem();
    /** Destructs System settings page. */
    virtual ~UIMachineSettingsSystem() RT_OVERRIDE;

    /** Returns whether the HW Virt Ex is supported. */
    bool isHWVirtExSupported() const;
    /** Returns whether the HW Virt Ex is enabled. */
    bool isHWVirtExEnabled() const;

    /** Returns whether the Nested Paging is supported. */
    bool isNestedPagingSupported() const;
    /** Returns whether the Nested Paging is enabled. */
    bool isNestedPagingEnabled() const;

    /** Returns whether the Nested HW Virt Ex is supported. */
    bool isNestedHWVirtExSupported() const;
    /** Returns whether the Nested HW Virt Ex is enabled. */
    bool isNestedHWVirtExEnabled() const;

    /** Returns whether the HID is enabled. */
    bool isHIDEnabled() const;

    /** Returns the chipset type. */
    KChipsetType chipsetType() const;

    /** Defines whether the USB is enabled. */
    void setUSBEnabled(bool fEnabled);

protected:

    /** Returns whether the page content was changed. */
    virtual bool changed() const RT_OVERRIDE;

    /** Loads settings from external object(s) packed inside @a data to cache.
      * @note  This task WILL be performed in other than the GUI thread, no widget interactions! */
    virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
    /** Loads data from cache to corresponding widgets.
      * @note  This task WILL be performed in the GUI thread only, all widget interactions here! */
    virtual void getFromCache() RT_OVERRIDE;

    /** Saves data from corresponding widgets to cache.
      * @note  This task WILL be performed in the GUI thread only, all widget interactions here! */
    virtual void putToCache() RT_OVERRIDE;
    /** Saves settings from cache to external object(s) packed inside @a data.
      * @note  This task WILL be performed in other than the GUI thread, no widget interactions! */
    virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;

    /** Performs validation, updates @a messages list if something is wrong. */
    virtual bool validate(QList<UIValidationMessage> &messages) RT_OVERRIDE;

    /** Defines TAB order for passed @a pWidget. */
    virtual void setOrderAfter(QWidget *pWidget) RT_OVERRIDE;

    /** Handles translation event. */
    virtual void retranslateUi() RT_OVERRIDE;

    /** Performs final page polishing. */
    virtual void polishPage() RT_OVERRIDE;

private slots:

    /** Handles HW Virt Ex check-box toggling. */
    void sltHandleHwVirtExToggle();

private:

    /** Prepares all. */
    void prepare();
    /** Prepares widgets. */
    void prepareWidgets();
    /** Prepares 'Motherboard' tab. */
    void prepareTabMotherboard();
    /** Prepares 'Processor' tab. */
    void prepareTabProcessor();
    /** Prepares 'Acceleration' tab. */
    void prepareTabAcceleration();
    /** Prepares connections. */
    void prepareConnections();
    /** Cleanups all. */
    void cleanup();

    /** Saves existing data from cache. */
    bool saveData();
    /** Saves existing 'Motherboard' data from cache. */
    bool saveMotherboardData();
    /** Saves existing 'Processor' data from cache. */
    bool saveProcessorData();
    /** Saves existing 'Acceleration' data from cache. */
    bool saveAccelerationData();

    /** Holds whether the USB is enabled. */
    bool m_fIsUSBEnabled;

    /** Holds the page data cache instance. */
    UISettingsCacheMachineSystem *m_pCache;

    /** @name Widgets
     * @{ */
        /** Holds the tab-widget instance. */
        QITabWidget *m_pTabWidget;

        /** Holds the 'Motherboard' tab instance. */
        QWidget                     *m_pTabMotherboard;
        /** Holds the base memory editor instance. */
        UIBaseMemoryEditor          *m_pEditorBaseMemory;
        /** Holds the boot order editor instance. */
        UIBootOrderEditor           *m_pEditorBootOrder;
        /** Holds the chipset editor instance. */
        UIChipsetEditor             *m_pEditorChipset;
        /** Holds the pointing HID editor instance. */
        UIPointingHIDEditor         *m_pEditorPointingHID;
        /** Holds the motherboard features editor instance. */
        UIMotherboardFeaturesEditor *m_pEditorMotherboardFeatures;

        /** Holds the 'Processor' tab instance. */
        QWidget                   *m_pTabProcessor;
        /** Holds the VCPU editor instance. */
        UIVirtualCPUEditor        *m_pEditorVCPU;
        /** Holds the exec cap editor instance. */
        UIExecutionCapEditor      *m_pEditorExecCap;
        /** Holds the motherboard features editor instance. */
        UIProcessorFeaturesEditor *m_pEditorProcessorFeatures;

        /** Holds the 'Acceleration' tab instance. */
        QWidget                      *m_pTabAcceleration;
        /** Holds the paravirtualization provider editor instance. */
        UIParavirtProviderEditor     *m_pEditorParavirtProvider;
        /** Holds the acceleration features editor instance. */
        UIAccelerationFeaturesEditor *m_pEditorAccelerationFeatures;
   /** @} */
};

#endif /* !FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsSystem_h */