1 | /* $Id: UIGuestProcessControlWidget.h 103977 2024-03-21 02:04:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIGuestProcessControlWidget class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-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_guestctrl_UIGuestProcessControlWidget_h
|
---|
29 | #define FEQT_INCLUDED_SRC_guestctrl_UIGuestProcessControlWidget_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QWidget>
|
---|
36 |
|
---|
37 | /* COM includes: */
|
---|
38 | #include "CGuest.h"
|
---|
39 | #include "CEventListener.h"
|
---|
40 |
|
---|
41 | /* GUI includes: */
|
---|
42 | #include "QIWithRetranslateUI.h"
|
---|
43 | #include "QIManagerDialog.h"
|
---|
44 | #include "UIMainEventListener.h"
|
---|
45 |
|
---|
46 | /* Forward declarations: */
|
---|
47 | class QVBoxLayout;
|
---|
48 | class QIToolBar;
|
---|
49 | class UIGuestControlTreeWidget;
|
---|
50 |
|
---|
51 | /** QWidget extension
|
---|
52 | * providing GUI with guest session information and control tab in session-information window. */
|
---|
53 | class UIGuestProcessControlWidget : public QIWithRetranslateUI<QWidget>
|
---|
54 | {
|
---|
55 | Q_OBJECT;
|
---|
56 |
|
---|
57 | public:
|
---|
58 |
|
---|
59 | UIGuestProcessControlWidget(EmbedTo enmEmbedding, const CGuest &comGuest, QWidget *pParent,
|
---|
60 | QString strMachineName = QString(), bool fShowToolbar = false);
|
---|
61 | ~UIGuestProcessControlWidget();
|
---|
62 | /** When true we delete the corresponding tree item as soon as the guest session/process is unregistered. */
|
---|
63 | static const bool s_fDeleteAfterUnregister;
|
---|
64 |
|
---|
65 | protected:
|
---|
66 |
|
---|
67 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
68 |
|
---|
69 | private slots:
|
---|
70 |
|
---|
71 | void sltGuestSessionsUpdated();
|
---|
72 | void sltGuestSessionRegistered(CGuestSession guestSession);
|
---|
73 | void sltGuestSessionUnregistered(CGuestSession guestSession);
|
---|
74 | void sltTreeItemUpdated();
|
---|
75 | void sltCloseSessionOrProcess();
|
---|
76 | void sltShowProperties();
|
---|
77 | void sltCleanupListener();
|
---|
78 |
|
---|
79 | private:
|
---|
80 |
|
---|
81 | void prepareObjects();
|
---|
82 | void prepareConnections();
|
---|
83 | void prepareToolBar();
|
---|
84 | void prepareListener();
|
---|
85 | void initGuestSessionTree();
|
---|
86 | void updateTreeWidget();
|
---|
87 | void addGuestSession(CGuestSession guestSession);
|
---|
88 |
|
---|
89 | CGuest m_comGuest;
|
---|
90 | QVBoxLayout *m_pMainLayout;
|
---|
91 | UIGuestControlTreeWidget *m_pTreeWidget;
|
---|
92 | const EmbedTo m_enmEmbedding;
|
---|
93 | QIToolBar *m_pToolBar;
|
---|
94 |
|
---|
95 | /** Holds the Qt event listener instance. */
|
---|
96 | ComObjPtr<UIMainEventListenerImpl> m_pQtListener;
|
---|
97 |
|
---|
98 | /** Holds the COM event listener instance. */
|
---|
99 | CEventListener m_comEventListener;
|
---|
100 | const bool m_fShowToolbar;
|
---|
101 | QString m_strMachineName;
|
---|
102 | };
|
---|
103 |
|
---|
104 | #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIGuestProcessControlWidget_h */
|
---|