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