1 | /* $Id: UITaskCloudGetSettingsForm.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UITaskCloudGetSettingsForm class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2020-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_manager_UITaskCloudGetSettingsForm_h
|
---|
29 | #define FEQT_INCLUDED_SRC_manager_UITaskCloudGetSettingsForm_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QMutex>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UITask.h"
|
---|
39 |
|
---|
40 | /* COM includes: */
|
---|
41 | #include "COMEnums.h"
|
---|
42 | #include "CCloudMachine.h"
|
---|
43 | #include "CForm.h"
|
---|
44 |
|
---|
45 | /** UITask extension used to get cloud machine settings form. */
|
---|
46 | class UITaskCloudGetSettingsForm : public UITask
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /** Constructs update task taking @a comCloudMachine as data.
|
---|
53 | * @param comCloudMachine Brings the cloud machine object. */
|
---|
54 | UITaskCloudGetSettingsForm(const CCloudMachine &comCloudMachine);
|
---|
55 |
|
---|
56 | /** Returns cloud machine object. */
|
---|
57 | CCloudMachine cloudMachine() const { return m_comCloudMachine; }
|
---|
58 |
|
---|
59 | /** Returns error info. */
|
---|
60 | QString errorInfo() const;
|
---|
61 |
|
---|
62 | /** Returns the task result. */
|
---|
63 | CForm result() const;
|
---|
64 |
|
---|
65 | protected:
|
---|
66 |
|
---|
67 | /** Contains the task body. */
|
---|
68 | virtual void run() RT_OVERRIDE;
|
---|
69 |
|
---|
70 | private:
|
---|
71 |
|
---|
72 | /** Holds the mutex to access result. */
|
---|
73 | mutable QMutex m_mutex;
|
---|
74 |
|
---|
75 | /** Holds the cloud machine object. */
|
---|
76 | CCloudMachine m_comCloudMachine;
|
---|
77 |
|
---|
78 | /** Holds the error info. */
|
---|
79 | QString m_strErrorInfo;
|
---|
80 |
|
---|
81 | /** Holds the task result. */
|
---|
82 | CForm m_comResult;
|
---|
83 | };
|
---|
84 |
|
---|
85 | /** QObject extension used to receive and redirect result
|
---|
86 | * of get cloud machine settings form task described above. */
|
---|
87 | class UIReceiverCloudGetSettingsForm : public QObject
|
---|
88 | {
|
---|
89 | Q_OBJECT;
|
---|
90 |
|
---|
91 | signals:
|
---|
92 |
|
---|
93 | /** Notifies about task is complete with certain comResult. */
|
---|
94 | void sigTaskComplete(const CForm &comResult);
|
---|
95 | /** Notifies about task is failed with certain strErrorMessage. */
|
---|
96 | void sigTaskFailed(const QString &strErrorMessage);
|
---|
97 |
|
---|
98 | public:
|
---|
99 |
|
---|
100 | /** Constructs receiver passing @a pParent to the base-class. */
|
---|
101 | UIReceiverCloudGetSettingsForm(QWidget *pParent);
|
---|
102 |
|
---|
103 | public slots:
|
---|
104 |
|
---|
105 | /** Handles thread-pool signal about @a pTask is complete. */
|
---|
106 | void sltHandleTaskComplete(UITask *pTask);
|
---|
107 |
|
---|
108 | private:
|
---|
109 |
|
---|
110 | /** Holds the parent widget reference. */
|
---|
111 | QWidget *m_pParent;
|
---|
112 | };
|
---|
113 |
|
---|
114 | #endif /* !FEQT_INCLUDED_SRC_manager_UITaskCloudGetSettingsForm_h */
|
---|