1 | /* $Id: UIWizardImportApp.h 103982 2024-03-21 11:43:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardImportApp 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_importappliance_UIWizardImportApp_h
|
---|
29 | #define FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportApp_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 "CVirtualSystemDescriptionForm.h"
|
---|
40 |
|
---|
41 | /** MAC address policies. */
|
---|
42 | enum MACAddressImportPolicy
|
---|
43 | {
|
---|
44 | MACAddressImportPolicy_KeepAllMACs,
|
---|
45 | MACAddressImportPolicy_KeepNATMACs,
|
---|
46 | MACAddressImportPolicy_StripAllMACs,
|
---|
47 | MACAddressImportPolicy_MAX
|
---|
48 | };
|
---|
49 | Q_DECLARE_METATYPE(MACAddressImportPolicy);
|
---|
50 |
|
---|
51 | /** Import Appliance wizard. */
|
---|
52 | class UIWizardImportApp : public UINativeWizard
|
---|
53 | {
|
---|
54 | Q_OBJECT;
|
---|
55 |
|
---|
56 | public:
|
---|
57 |
|
---|
58 | /** Constructs Import Appliance wizard passing @a pParent to the base-class.
|
---|
59 | * @param fImportFromOCIByDefault Brings whether wizard should start with OCI target.
|
---|
60 | * @param strFileName Brings local file name to import OVF/OVA from. */
|
---|
61 | UIWizardImportApp(QWidget *pParent,
|
---|
62 | bool fImportFromOCIByDefault,
|
---|
63 | const QString &strFileName);
|
---|
64 |
|
---|
65 | /** @name Common fields.
|
---|
66 | * @{ */
|
---|
67 | /** Returns whether source is cloud one. */
|
---|
68 | bool isSourceCloudOne() const { return m_fSourceCloudOne; }
|
---|
69 | /** Defines whether source is @a fCloudOne. */
|
---|
70 | void setSourceCloudOne(bool fCloudOne) { m_fSourceCloudOne = fCloudOne; }
|
---|
71 | /** @} */
|
---|
72 |
|
---|
73 | /** @name Local import fields.
|
---|
74 | * @{ */
|
---|
75 | /** Returns local Appliance object. */
|
---|
76 | CAppliance localAppliance() const { return m_comLocalAppliance; }
|
---|
77 | /** Defines file @a strName. */
|
---|
78 | bool setFile(const QString &strName);
|
---|
79 |
|
---|
80 | /** Returns MAC address import policy. */
|
---|
81 | MACAddressImportPolicy macAddressImportPolicy() const { return m_enmMacAddressImportPolicy; }
|
---|
82 | /** Defines MAC address import @a enmPolicy. */
|
---|
83 | void setMACAddressImportPolicy(MACAddressImportPolicy enmPolicy) { m_enmMacAddressImportPolicy = enmPolicy; }
|
---|
84 |
|
---|
85 | /** Returns whether hard disks should be imported as VDIs. */
|
---|
86 | bool isImportHDsAsVDI() const { return m_fImportHDsAsVDI; }
|
---|
87 | /** Defines whether hard disks should be imported @a fAsVDI. */
|
---|
88 | void setImportHDsAsVDI(bool fAsVDI) { m_fImportHDsAsVDI = fAsVDI; }
|
---|
89 | /** @} */
|
---|
90 |
|
---|
91 | /** @name Cloud import fields.
|
---|
92 | * @{ */
|
---|
93 | /** Returns cloud Appliance object. */
|
---|
94 | CAppliance cloudAppliance() const { return m_comCloudAppliance; }
|
---|
95 | /** Defines cloud @a comAppliance object. */
|
---|
96 | void setCloudAppliance(const CAppliance &comAppliance) { m_comCloudAppliance = comAppliance; }
|
---|
97 |
|
---|
98 | /** Returns Virtual System Description import form object. */
|
---|
99 | CVirtualSystemDescriptionForm vsdImportForm() const { return m_comVsdImportForm; }
|
---|
100 | /** Defines Virtual System Description import @a comForm object. */
|
---|
101 | void setVsdImportForm(const CVirtualSystemDescriptionForm &comForm) { m_comVsdImportForm = comForm; }
|
---|
102 | /** @} */
|
---|
103 |
|
---|
104 | /** @name Auxiliary stuff.
|
---|
105 | * @{ */
|
---|
106 | /** Imports appliance. */
|
---|
107 | bool importAppliance();
|
---|
108 | /** @} */
|
---|
109 |
|
---|
110 | protected:
|
---|
111 |
|
---|
112 | /** @name Inherited stuff.
|
---|
113 | * @{ */
|
---|
114 | /** Populates pages. */
|
---|
115 | virtual void populatePages() RT_OVERRIDE RT_FINAL;
|
---|
116 | /** @} */
|
---|
117 |
|
---|
118 | private slots:
|
---|
119 |
|
---|
120 | /** Handles translation event. */
|
---|
121 | virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
|
---|
122 |
|
---|
123 | private:
|
---|
124 |
|
---|
125 | /** @name Auxiliary stuff.
|
---|
126 | * @{ */
|
---|
127 | /** Returns a list of license agreement pairs. */
|
---|
128 | QList<QPair<QString, QString> > licenseAgreements() const;
|
---|
129 | /** @} */
|
---|
130 |
|
---|
131 | /** @name Arguments.
|
---|
132 | * @{ */
|
---|
133 | /** Holds whether default source should be Import from OCI. */
|
---|
134 | bool m_fImportFromOCIByDefault;
|
---|
135 | /** Handles the appliance file name. */
|
---|
136 | QString m_strFileName;
|
---|
137 | /** @} */
|
---|
138 |
|
---|
139 | /** @name Common fields.
|
---|
140 | * @{ */
|
---|
141 | /** */
|
---|
142 | bool m_fSourceCloudOne;
|
---|
143 | /** @} */
|
---|
144 |
|
---|
145 | /** @name Local import fields.
|
---|
146 | * @{ */
|
---|
147 | /** Holds the local appliance wrapper object. */
|
---|
148 | CAppliance m_comLocalAppliance;
|
---|
149 |
|
---|
150 | /** Holds the MAC address import policy. */
|
---|
151 | MACAddressImportPolicy m_enmMacAddressImportPolicy;
|
---|
152 |
|
---|
153 | /** Holds whether hard disks should be imported as VDIs. */
|
---|
154 | bool m_fImportHDsAsVDI;
|
---|
155 | /** @} */
|
---|
156 |
|
---|
157 | /** @name Cloud import fields.
|
---|
158 | * @{ */
|
---|
159 | /** Holds the cloud appliance wrapper object. */
|
---|
160 | CAppliance m_comCloudAppliance;
|
---|
161 |
|
---|
162 | /** Holds the Virtual System Description import form wrapper object. */
|
---|
163 | CVirtualSystemDescriptionForm m_comVsdImportForm;
|
---|
164 | /** @} */
|
---|
165 | };
|
---|
166 |
|
---|
167 | #endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportApp_h */
|
---|