1 | /* $Id: UIGuestProcessControlWidget.h 104297 2024-04-11 13:20:43Z 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 "QIManagerDialog.h"
|
---|
43 | #include "UIMainEventListener.h"
|
---|
44 |
|
---|
45 | /* Forward declarations: */
|
---|
46 | class QVBoxLayout;
|
---|
47 | class QIToolBar;
|
---|
48 | class UIGuestControlTreeWidget;
|
---|
49 |
|
---|
50 | /** QWidget extension
|
---|
51 | * providing GUI with guest session information and control tab in session-information window. */
|
---|
52 | class UIGuestProcessControlWidget : public QWidget
|
---|
53 | {
|
---|
54 | Q_OBJECT;
|
---|
55 |
|
---|
56 | public:
|
---|
57 |
|
---|
58 | UIGuestProcessControlWidget(EmbedTo enmEmbedding, const CGuest &comGuest, QWidget *pParent,
|
---|
59 | QString strMachineName = QString(), bool fShowToolbar = false);
|
---|
60 | ~UIGuestProcessControlWidget();
|
---|
61 | /** When true we delete the corresponding tree item as soon as the guest session/process is unregistered. */
|
---|
62 | static const bool s_fDeleteAfterUnregister;
|
---|
63 |
|
---|
64 | private slots:
|
---|
65 |
|
---|
66 | void sltRetranslateUI();
|
---|
67 | void sltGuestSessionsUpdated();
|
---|
68 | void sltGuestSessionRegistered(CGuestSession guestSession);
|
---|
69 | void sltGuestSessionUnregistered(CGuestSession guestSession);
|
---|
70 | void sltTreeItemUpdated();
|
---|
71 | void sltCloseSessionOrProcess();
|
---|
72 | void sltShowProperties();
|
---|
73 | void sltCleanupListener();
|
---|
74 |
|
---|
75 | private:
|
---|
76 |
|
---|
77 | void prepareObjects();
|
---|
78 | void prepareConnections();
|
---|
79 | void prepareToolBar();
|
---|
80 | void prepareListener();
|
---|
81 | void initGuestSessionTree();
|
---|
82 | void updateTreeWidget();
|
---|
83 | void addGuestSession(CGuestSession guestSession);
|
---|
84 |
|
---|
85 | CGuest m_comGuest;
|
---|
86 | QVBoxLayout *m_pMainLayout;
|
---|
87 | UIGuestControlTreeWidget *m_pTreeWidget;
|
---|
88 | const EmbedTo m_enmEmbedding;
|
---|
89 | QIToolBar *m_pToolBar;
|
---|
90 |
|
---|
91 | /** Holds the Qt event listener instance. */
|
---|
92 | ComObjPtr<UIMainEventListenerImpl> m_pQtListener;
|
---|
93 |
|
---|
94 | /** Holds the COM event listener instance. */
|
---|
95 | CEventListener m_comEventListener;
|
---|
96 | const bool m_fShowToolbar;
|
---|
97 | QString m_strMachineName;
|
---|
98 | };
|
---|
99 |
|
---|
100 | #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIGuestProcessControlWidget_h */
|
---|