VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h@ 104158

Last change on this file since 104158 was 103803, checked in by vboxsync, 11 months ago

FE/Qt. bugref:10618. Splitting COMEnums.h file into individual enum header files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.6 KB
Line 
1/* $Id: UIMachineSettingsStorage.h 103803 2024-03-12 11:15:18Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMachineSettingsStorage class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-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_machine_UIMachineSettingsStorage_h
29#define FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsStorage_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* COM includes: */
35#include "KChipsetType.h"
36
37/* GUI includes: */
38#include "UISettingsPage.h"
39
40/* Forward declarations: */
41class UIActionPool;
42class UIStorageSettingsEditor;
43struct UIDataSettingsMachineStorage;
44struct UIDataSettingsMachineStorageController;
45struct UIDataSettingsMachineStorageAttachment;
46typedef UISettingsCache<UIDataSettingsMachineStorageAttachment> UISettingsCacheMachineStorageAttachment;
47typedef UISettingsCachePool<UIDataSettingsMachineStorageController, UISettingsCacheMachineStorageAttachment> UISettingsCacheMachineStorageController;
48typedef UISettingsCachePool<UIDataSettingsMachineStorage, UISettingsCacheMachineStorageController> UISettingsCacheMachineStorage;
49
50/** Machine settings: Storage page. */
51class SHARED_LIBRARY_STUFF UIMachineSettingsStorage : public UISettingsPageMachine
52{
53 Q_OBJECT;
54
55signals:
56
57 /** Notifies listeners about storage changed. */
58 void sigStorageChanged();
59
60public:
61
62 /** Constructs Storage settings page. */
63 UIMachineSettingsStorage(UIActionPool *pActionPool);
64 /** Destructs Storage settings page. */
65 virtual ~UIMachineSettingsStorage() RT_OVERRIDE;
66
67 /** Defines chipset @a enmType. */
68 void setChipsetType(KChipsetType enmType);
69
70protected:
71
72 /** Returns whether the page content was changed. */
73 virtual bool changed() const RT_OVERRIDE;
74
75 /** Loads settings from external object(s) packed inside @a data to cache.
76 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
77 virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
78 /** Loads data from cache to corresponding widgets.
79 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
80 virtual void getFromCache() RT_OVERRIDE;
81
82 /** Saves data from corresponding widgets to cache.
83 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
84 virtual void putToCache() RT_OVERRIDE;
85 /** Saves settings from cache to external object(s) packed inside @a data.
86 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
87 virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
88
89 /** Performs validation, updates @a messages list if something is wrong. */
90 virtual bool validate(QList<UIValidationMessage> &messages) RT_OVERRIDE;
91
92 /** Defines the configuration access @a enmLevel. */
93 virtual void setConfigurationAccessLevel(ConfigurationAccessLevel enmLevel) RT_OVERRIDE;
94
95 /** Handles translation event. */
96 virtual void retranslateUi() RT_OVERRIDE;
97
98 /** Performs final page polishing. */
99 virtual void polishPage() RT_OVERRIDE;
100
101private:
102
103 /** Prepares all. */
104 void prepare();
105 /** Prepares widgets. */
106 void prepareWidgets();
107 /** Prepares connections. */
108 void prepareConnections();
109
110 /** Cleanups all. */
111 void cleanup();
112
113 /** Saves existing data from cache. */
114 bool saveData();
115 /** Removes existing storage controller described by the @a controllerCache. */
116 bool removeStorageController(const UISettingsCacheMachineStorageController &controllerCache);
117 /** Creates existing storage controller described by the @a controllerCache. */
118 bool createStorageController(const UISettingsCacheMachineStorageController &controllerCache);
119 /** Updates existing storage controller described by the @a controllerCache. */
120 bool updateStorageController(const UISettingsCacheMachineStorageController &controllerCache,
121 bool fRemovingStep);
122 /** Removes existing storage attachment described by the @a controllerCache and @a attachmentCache. */
123 bool removeStorageAttachment(const UISettingsCacheMachineStorageController &controllerCache,
124 const UISettingsCacheMachineStorageAttachment &attachmentCache);
125 /** Creates existing storage attachment described by the @a controllerCache and @a attachmentCache. */
126 bool createStorageAttachment(const UISettingsCacheMachineStorageController &controllerCache,
127 const UISettingsCacheMachineStorageAttachment &attachmentCache);
128 /** Updates existing storage attachment described by the @a controllerCache and @a attachmentCache. */
129 bool updateStorageAttachment(const UISettingsCacheMachineStorageController &controllerCache,
130 const UISettingsCacheMachineStorageAttachment &attachmentCache);
131 /** Returns whether the controller described by the @a controllerCache could be updated or recreated otherwise. */
132 bool isControllerCouldBeUpdated(const UISettingsCacheMachineStorageController &controllerCache) const;
133 /** Returns whether the attachment described by the @a attachmentCache could be updated or recreated otherwise. */
134 bool isAttachmentCouldBeUpdated(const UISettingsCacheMachineStorageAttachment &attachmentCache) const;
135
136 /** Holds the action pool instance. */
137 UIActionPool *m_pActionPool;
138
139 /** Holds the machine ID. */
140 QUuid m_uMachineId;
141 /** Holds the machine name. */
142 QString m_strMachineName;
143 /** Holds the machine settings file-path. */
144 QString m_strMachineSettingsFilePath;
145 /** Holds the machine guest OS type ID. */
146 QString m_strMachineGuestOSTypeId;
147
148 /** Holds the page data cache instance. */
149 UISettingsCacheMachineStorage *m_pCache;
150
151 /** @name Widgets
152 * @{ */
153 /** Holds the storage settings editor instance. */
154 UIStorageSettingsEditor *m_pEditorStorageSettings;
155 /** @} */
156};
157
158#endif /* !FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsStorage_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