1 | /* $Id: UIWizardExportApp.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardExportApp class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-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_wizards_exportappliance_UIWizardExportApp_h
|
---|
29 | #define FEQT_INCLUDED_SRC_wizards_exportappliance_UIWizardExportApp_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UINativeWizard.h"
|
---|
36 |
|
---|
37 | /* COM includes: */
|
---|
38 | #include "COMEnums.h"
|
---|
39 | #include "CAppliance.h"
|
---|
40 | #include "CCloudClient.h"
|
---|
41 | #include "CVirtualSystemDescription.h"
|
---|
42 | #include "CVirtualSystemDescriptionForm.h"
|
---|
43 |
|
---|
44 | /** MAC address export policies. */
|
---|
45 | enum MACAddressExportPolicy
|
---|
46 | {
|
---|
47 | MACAddressExportPolicy_KeepAllMACs,
|
---|
48 | MACAddressExportPolicy_StripAllNonNATMACs,
|
---|
49 | MACAddressExportPolicy_StripAllMACs,
|
---|
50 | MACAddressExportPolicy_MAX
|
---|
51 | };
|
---|
52 | Q_DECLARE_METATYPE(MACAddressExportPolicy);
|
---|
53 |
|
---|
54 | /** Cloud export option modes. */
|
---|
55 | enum CloudExportMode
|
---|
56 | {
|
---|
57 | CloudExportMode_Invalid,
|
---|
58 | CloudExportMode_AskThenExport,
|
---|
59 | CloudExportMode_ExportThenAsk,
|
---|
60 | CloudExportMode_DoNotAsk
|
---|
61 | };
|
---|
62 | Q_DECLARE_METATYPE(CloudExportMode);
|
---|
63 |
|
---|
64 | /** Export Appliance wizard. */
|
---|
65 | class UIWizardExportApp : public UINativeWizard
|
---|
66 | {
|
---|
67 | Q_OBJECT;
|
---|
68 |
|
---|
69 | public:
|
---|
70 |
|
---|
71 | /** Constructs Export Appliance wizard passing @a pParent to the base-class.
|
---|
72 | * @param predefinedMachineNames Brings the predefined list of machine names.
|
---|
73 | * @param fFastTraverToExportOCI Brings whether wizard should start with OCI target. */
|
---|
74 | UIWizardExportApp(QWidget *pParent,
|
---|
75 | const QStringList &predefinedMachineNames = QStringList(),
|
---|
76 | bool fFastTraverToExportOCI = false);
|
---|
77 |
|
---|
78 | /** @name Common fields.
|
---|
79 | * @{ */
|
---|
80 | /** Returns a list of machine names. */
|
---|
81 | QStringList machineNames() const { return m_machineNames; }
|
---|
82 | /** Returns a list of machine IDs. */
|
---|
83 | QList<QUuid> machineIDs() const { return m_machineIDs; }
|
---|
84 |
|
---|
85 | /** Returns format. */
|
---|
86 | QString format() const { return m_strFormat; }
|
---|
87 |
|
---|
88 | /** Returns whether format is cloud one. */
|
---|
89 | bool isFormatCloudOne() const { return m_fFormatCloudOne; }
|
---|
90 | /** @} */
|
---|
91 |
|
---|
92 | /** @name Local export fields.
|
---|
93 | * @{ */
|
---|
94 | /** Returns path. */
|
---|
95 | QString path() const { return m_strPath; }
|
---|
96 |
|
---|
97 | /** Returns MAC address export policy. */
|
---|
98 | MACAddressExportPolicy macAddressExportPolicy() const { return m_enmMACAddressExportPolicy; }
|
---|
99 |
|
---|
100 | /** Returns whether manifest is selected. */
|
---|
101 | bool isManifestSelected() const { return m_fManifestSelected; }
|
---|
102 |
|
---|
103 | /** Returns whether include ISOs is selected. */
|
---|
104 | bool isIncludeISOsSelected() const { return m_fIncludeISOsSelected; }
|
---|
105 |
|
---|
106 | /** Returns local appliance object. */
|
---|
107 | CAppliance localAppliance() const { return m_comLocalAppliance; }
|
---|
108 | /** @} */
|
---|
109 |
|
---|
110 | /** @name Cloud export fields.
|
---|
111 | * @{ */
|
---|
112 | /** Returns profile name. */
|
---|
113 | QString profileName() const { return m_strProfileName; }
|
---|
114 |
|
---|
115 | /** Returns cloud appliance object. */
|
---|
116 | CAppliance cloudAppliance() const { return m_comCloudAppliance; }
|
---|
117 |
|
---|
118 | /** Returns cloud client object. */
|
---|
119 | CCloudClient cloudClient() const { return m_comCloudClient; }
|
---|
120 |
|
---|
121 | /** Returns virtual system description object. */
|
---|
122 | CVirtualSystemDescription vsd() const { return m_comVsd; }
|
---|
123 |
|
---|
124 | /** Returns virtual system description export form object. */
|
---|
125 | CVirtualSystemDescriptionForm vsdExportForm() const { return m_comVsdExportForm; }
|
---|
126 |
|
---|
127 | /** Returns virtual system description launch form object. */
|
---|
128 | CVirtualSystemDescriptionForm vsdLaunchForm() const { return m_comVsdLaunchForm; }
|
---|
129 |
|
---|
130 | /** Returns cloud export mode. */
|
---|
131 | CloudExportMode cloudExportMode() const { return m_enmCloudExportMode; }
|
---|
132 | /** @} */
|
---|
133 |
|
---|
134 | /** @name Auxiliary stuff.
|
---|
135 | * @{ */
|
---|
136 | /** Goes forward. Required for fast travel to next page. */
|
---|
137 | void goForward();
|
---|
138 |
|
---|
139 | /** Disables basic/expert and next/back buttons. */
|
---|
140 | void disableButtons();
|
---|
141 |
|
---|
142 | /** Composes universal resource identifier.
|
---|
143 | * @param fWithFile Brings whether uri should include file name as well. */
|
---|
144 | QString uri(bool fWithFile = true) const;
|
---|
145 |
|
---|
146 | /** Exports Appliance. */
|
---|
147 | bool exportAppliance();
|
---|
148 |
|
---|
149 | /** Creates VSD Form. */
|
---|
150 | void createVsdLaunchForm();
|
---|
151 |
|
---|
152 | /** Creates New Cloud VM. */
|
---|
153 | bool createCloudVM();
|
---|
154 | /** @} */
|
---|
155 |
|
---|
156 | public slots:
|
---|
157 |
|
---|
158 | /** @name Common fields.
|
---|
159 | * @{ */
|
---|
160 | /** Defines a list of machine @a names. */
|
---|
161 | void setMachineNames(const QStringList &names) { m_machineNames = names; }
|
---|
162 | /** Defines a list of machine @a ids. */
|
---|
163 | void setMachineIDs(const QList<QUuid> &ids) { m_machineIDs = ids; }
|
---|
164 |
|
---|
165 | /** Defines @a strFormat. */
|
---|
166 | void setFormat(const QString &strFormat) { m_strFormat = strFormat; }
|
---|
167 |
|
---|
168 | /** Defines whether format is @a fCloudOne. */
|
---|
169 | void setFormatCloudOne(bool fCloudOne) { m_fFormatCloudOne = fCloudOne; }
|
---|
170 | /** @} */
|
---|
171 |
|
---|
172 | /** @name Local export fields.
|
---|
173 | * @{ */
|
---|
174 | /** Defines @a strPath. */
|
---|
175 | void setPath(const QString &strPath) { m_strPath = strPath; }
|
---|
176 |
|
---|
177 | /** Defines MAC address export @a enmPolicy. */
|
---|
178 | void setMACAddressExportPolicy(MACAddressExportPolicy enmPolicy) { m_enmMACAddressExportPolicy = enmPolicy; }
|
---|
179 |
|
---|
180 | /** Defines whether manifest is @a fSelected. */
|
---|
181 | void setManifestSelected(bool fSelected) { m_fManifestSelected = fSelected; }
|
---|
182 |
|
---|
183 | /** Defines whether include ISOs is @a fSelected. */
|
---|
184 | void setIncludeISOsSelected(bool fSelected) { m_fIncludeISOsSelected = fSelected; }
|
---|
185 |
|
---|
186 | /** Defines local @a comAppliance object. */
|
---|
187 | void setLocalAppliance(const CAppliance &comAppliance) { m_comLocalAppliance = comAppliance; }
|
---|
188 | /** @} */
|
---|
189 |
|
---|
190 | /** @name Cloud export fields.
|
---|
191 | * @{ */
|
---|
192 | /** Defines profile @a strName. */
|
---|
193 | void setProfileName(const QString &strName) { m_strProfileName = strName; }
|
---|
194 |
|
---|
195 | /** Defines cloud @a comAppliance object. */
|
---|
196 | void setCloudAppliance(const CAppliance &comAppliance) { m_comCloudAppliance = comAppliance; }
|
---|
197 |
|
---|
198 | /** Defines cloud @a comClient object. */
|
---|
199 | void setCloudClient(const CCloudClient &comClient) { m_comCloudClient = comClient; }
|
---|
200 |
|
---|
201 | /** Defines virtual system @a comDescription object. */
|
---|
202 | void setVsd(const CVirtualSystemDescription &comDescription) { m_comVsd = comDescription; }
|
---|
203 |
|
---|
204 | /** Defines virtual system description export @a comForm object. */
|
---|
205 | void setVsdExportForm(const CVirtualSystemDescriptionForm &comForm) { m_comVsdExportForm = comForm; }
|
---|
206 |
|
---|
207 | /** Defines virtual system description launch @a comForm object. */
|
---|
208 | void setVsdLaunchForm(const CVirtualSystemDescriptionForm &comForm) { m_comVsdLaunchForm = comForm; }
|
---|
209 |
|
---|
210 | /** Defines cloud export @a enmMode. */
|
---|
211 | void setCloudExportMode(const CloudExportMode &enmMode) { m_enmCloudExportMode = enmMode; }
|
---|
212 | /** @} */
|
---|
213 |
|
---|
214 | protected:
|
---|
215 |
|
---|
216 | /** @name Virtual stuff.
|
---|
217 | * @{ */
|
---|
218 | /** Populates pages. */
|
---|
219 | virtual void populatePages() /* override final */;
|
---|
220 |
|
---|
221 | /** Handles translation event. */
|
---|
222 | virtual void retranslateUi() /* override final */;
|
---|
223 | /** @} */
|
---|
224 |
|
---|
225 | private:
|
---|
226 |
|
---|
227 | /** @name Auxiliary stuff.
|
---|
228 | * @{ */
|
---|
229 | /** Exports VMs enumerated in @a comAppliance. */
|
---|
230 | bool exportVMs(CAppliance &comAppliance);
|
---|
231 | /** @} */
|
---|
232 |
|
---|
233 | /** @name Arguments.
|
---|
234 | * @{ */
|
---|
235 | /** Holds the predefined list of machine names. */
|
---|
236 | QStringList m_predefinedMachineNames;
|
---|
237 | /** Holds whether we should fast travel to page 2. */
|
---|
238 | bool m_fFastTraverToExportOCI;
|
---|
239 | /** @} */
|
---|
240 |
|
---|
241 | /** @name Common fields.
|
---|
242 | * @{ */
|
---|
243 | /** Holds the list of machine names. */
|
---|
244 | QStringList m_machineNames;
|
---|
245 | /** Holds the list of machine IDs. */
|
---|
246 | QList<QUuid> m_machineIDs;
|
---|
247 |
|
---|
248 | /** Holds the format. */
|
---|
249 | QString m_strFormat;
|
---|
250 | /** Holds whether format is cloud one. */
|
---|
251 | bool m_fFormatCloudOne;
|
---|
252 | /** @} */
|
---|
253 |
|
---|
254 | /** @name Local export fields.
|
---|
255 | * @{ */
|
---|
256 | /** Holds the path. */
|
---|
257 | QString m_strPath;
|
---|
258 | /** Holds the MAC address export policy. */
|
---|
259 | MACAddressExportPolicy m_enmMACAddressExportPolicy;
|
---|
260 | /** Holds whether manifest is selected. */
|
---|
261 | bool m_fManifestSelected;
|
---|
262 | /** Holds whether ISOs are included. */
|
---|
263 | bool m_fIncludeISOsSelected;
|
---|
264 | /** Holds local appliance object. */
|
---|
265 | CAppliance m_comLocalAppliance;
|
---|
266 | /** @} */
|
---|
267 |
|
---|
268 | /** @name Cloud export fields.
|
---|
269 | * @{ */
|
---|
270 | /** Holds profile name. */
|
---|
271 | QString m_strProfileName;
|
---|
272 | /** Holds cloud appliance object. */
|
---|
273 | CAppliance m_comCloudAppliance;
|
---|
274 | /** Returns cloud client object. */
|
---|
275 | CCloudClient m_comCloudClient;
|
---|
276 | /** Returns virtual system description object. */
|
---|
277 | CVirtualSystemDescription m_comVsd;
|
---|
278 | /** Returns virtual system description export form object. */
|
---|
279 | CVirtualSystemDescriptionForm m_comVsdExportForm;
|
---|
280 | /** Returns virtual system description launch form object. */
|
---|
281 | CVirtualSystemDescriptionForm m_comVsdLaunchForm;
|
---|
282 | /** Returns cloud export mode. */
|
---|
283 | CloudExportMode m_enmCloudExportMode;
|
---|
284 | /** @} */
|
---|
285 | };
|
---|
286 |
|
---|
287 | #endif /* !FEQT_INCLUDED_SRC_wizards_exportappliance_UIWizardExportApp_h */
|
---|