VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.h@ 104158

Last change on this file since 104158 was 103982, checked in by vboxsync, 10 months ago

FE/Qt: bugref:10624. Replacing override and final keywords with RT_OVERRIDE and RT_FINAL defines.

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