[55401] | 1 | /* $Id: UIToolPaneMachine.h 103803 2024-03-12 11:15:18Z vboxsync $ */
|
---|
[382] | 2 | /** @file
|
---|
[73424] | 3 | * VBox Qt GUI - UIToolPaneMachine class declaration.
|
---|
[382] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2017-2023 Oracle and/or its affiliates.
|
---|
[382] | 8 | *
|
---|
[96407] | 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
|
---|
[382] | 26 | */
|
---|
| 27 |
|
---|
[76581] | 28 | #ifndef FEQT_INCLUDED_SRC_manager_UIToolPaneMachine_h
|
---|
| 29 | #define FEQT_INCLUDED_SRC_manager_UIToolPaneMachine_h
|
---|
[76532] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[382] | 33 |
|
---|
[44318] | 34 | /* Qt includes: */
|
---|
[99218] | 35 | #include <QUuid>
|
---|
[44318] | 36 | #include <QWidget>
|
---|
| 37 |
|
---|
[68235] | 38 | /* GUI includes: */
|
---|
[68304] | 39 | #include "UIExtraDataDefs.h"
|
---|
[68235] | 40 |
|
---|
[75144] | 41 | /* COM includes: */
|
---|
| 42 | #include "CMachine.h"
|
---|
| 43 |
|
---|
[44318] | 44 | /* Forward declarations: */
|
---|
[67068] | 45 | class QHBoxLayout;
|
---|
[67091] | 46 | class QStackedLayout;
|
---|
[67068] | 47 | class QVBoxLayout;
|
---|
[68175] | 48 | class UIActionPool;
|
---|
[73424] | 49 | class UIDetails;
|
---|
[74557] | 50 | class UIErrorPane;
|
---|
[89036] | 51 | class UIVMActivityToolWidget;
|
---|
[67068] | 52 | class UISnapshotPane;
|
---|
[73424] | 53 | class UIVirtualMachineItem;
|
---|
[74557] | 54 | class UIVMLogViewerWidget;
|
---|
[92615] | 55 | class UIFileManager;
|
---|
[382] | 56 |
|
---|
[67068] | 57 | /** QWidget subclass representing container for tool panes. */
|
---|
[74557] | 58 | class UIToolPaneMachine : public QWidget
|
---|
[382] | 59 | {
|
---|
[9729] | 60 | Q_OBJECT;
|
---|
[382] | 61 |
|
---|
[67110] | 62 | signals:
|
---|
| 63 |
|
---|
[73424] | 64 | /** Redirects signal from UIVirtualBoxManager to UIDetails. */
|
---|
[68175] | 65 | void sigToggleStarted();
|
---|
[73424] | 66 | /** Redirects signal from UIVirtualBoxManager to UIDetails. */
|
---|
[68175] | 67 | void sigToggleFinished();
|
---|
[73424] | 68 | /** Redirects signal from UIDetails to UIVirtualBoxManager. */
|
---|
[74942] | 69 | void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &uId);
|
---|
[67110] | 70 |
|
---|
[75093] | 71 | /** Notifies listeners about current Snapshot pane item change. */
|
---|
| 72 | void sigCurrentSnapshotItemChange();
|
---|
| 73 |
|
---|
[89094] | 74 | /** Notifies listeners about request to switch to Activity Overview pane. */
|
---|
| 75 | void sigSwitchToActivityOverviewPane();
|
---|
[87101] | 76 |
|
---|
[102787] | 77 | /** Notifies listeners about request to detach pane with tool type @enmToolType. */
|
---|
| 78 | void sigDetachToolPane(UIToolType enmToolType);
|
---|
[102723] | 79 |
|
---|
[382] | 80 | public:
|
---|
| 81 |
|
---|
[67068] | 82 | /** Constructs tools pane passing @a pParent to the base-class. */
|
---|
[73424] | 83 | UIToolPaneMachine(UIActionPool *pActionPool, QWidget *pParent = 0);
|
---|
[67091] | 84 | /** Destructs tools pane. */
|
---|
[93990] | 85 | virtual ~UIToolPaneMachine() RT_OVERRIDE;
|
---|
[12695] | 86 |
|
---|
[83482] | 87 | /** Defines whether this pane is @a fActive. */
|
---|
| 88 | void setActive(bool fActive);
|
---|
| 89 | /** Returns whether this pane is active. */
|
---|
| 90 | bool active() const { return m_fActive; }
|
---|
| 91 |
|
---|
[68221] | 92 | /** Returns type of tool currently opened. */
|
---|
[75016] | 93 | UIToolType currentTool() const;
|
---|
[67110] | 94 | /** Returns whether tool of particular @a enmType is opened. */
|
---|
[75016] | 95 | bool isToolOpened(UIToolType enmType) const;
|
---|
[68175] | 96 | /** Activates tool of passed @a enmType, creates new one if necessary. */
|
---|
[75016] | 97 | void openTool(UIToolType enmType);
|
---|
[68175] | 98 | /** Closes tool of passed @a enmType, deletes one if exists. */
|
---|
[75016] | 99 | void closeTool(UIToolType enmType);
|
---|
[67110] | 100 |
|
---|
[74557] | 101 | /** Defines error @a strDetails and switches to Error pane. */
|
---|
| 102 | void setErrorDetails(const QString &strDetails);
|
---|
[68175] | 103 |
|
---|
| 104 | /** Defines the machine @a items. */
|
---|
[73424] | 105 | void setItems(const QList<UIVirtualMachineItem*> &items);
|
---|
[68175] | 106 |
|
---|
[75093] | 107 | /** Returns whether current-state item of Snapshot pane is selected. */
|
---|
| 108 | bool isCurrentStateItemSelected() const;
|
---|
| 109 |
|
---|
[99218] | 110 | /** Returns currently selected snapshot ID if any. */
|
---|
| 111 | QUuid currentSnapshotId();
|
---|
| 112 |
|
---|
[87022] | 113 | /** Returns the help keyword of the current tool's widget. */
|
---|
| 114 | QString currentHelpKeyword() const;
|
---|
| 115 |
|
---|
[102787] | 116 | private slots:
|
---|
| 117 |
|
---|
| 118 | /** Handles the detach signals received from panes.*/
|
---|
| 119 | void sltDetachToolPane();
|
---|
| 120 |
|
---|
[44318] | 121 | private:
|
---|
[382] | 122 |
|
---|
[67068] | 123 | /** Prepares all. */
|
---|
| 124 | void prepare();
|
---|
[67091] | 125 | /** Prepares stacked-layout. */
|
---|
| 126 | void prepareStackedLayout();
|
---|
| 127 | /** Cleanups all. */
|
---|
| 128 | void cleanup();
|
---|
[67068] | 129 |
|
---|
[83482] | 130 | /** Handles token change. */
|
---|
| 131 | void handleTokenChange();
|
---|
| 132 |
|
---|
[68175] | 133 | /** Holds the action pool reference. */
|
---|
| 134 | UIActionPool *m_pActionPool;
|
---|
[67068] | 135 |
|
---|
[67091] | 136 | /** Holds the stacked-layout instance. */
|
---|
[70185] | 137 | QStackedLayout *m_pLayout;
|
---|
[74557] | 138 | /** Holds the Error pane instance. */
|
---|
| 139 | UIErrorPane *m_pPaneError;
|
---|
[68175] | 140 | /** Holds the Details pane instance. */
|
---|
[74557] | 141 | UIDetails *m_pPaneDetails;
|
---|
[68175] | 142 | /** Holds the Snapshots pane instance. */
|
---|
[70185] | 143 | UISnapshotPane *m_pPaneSnapshots;
|
---|
| 144 | /** Holds the Logviewer pane instance. */
|
---|
| 145 | UIVMLogViewerWidget *m_pPaneLogViewer;
|
---|
[85396] | 146 | /** Holds the Performance Monitor pane instance. */
|
---|
[89036] | 147 | UIVMActivityToolWidget *m_pPaneVMActivityMonitor;
|
---|
[92615] | 148 | /** Holds the File Manager pane instance. */
|
---|
| 149 | UIFileManager *m_pPaneFileManager;
|
---|
[75144] | 150 |
|
---|
[83482] | 151 | /** Holds whether this pane is active. */
|
---|
| 152 | bool m_fActive;
|
---|
| 153 |
|
---|
[75144] | 154 | /** Holds the cache of passed items. */
|
---|
| 155 | QList<UIVirtualMachineItem*> m_items;
|
---|
[382] | 156 | };
|
---|
| 157 |
|
---|
[76581] | 158 | #endif /* !FEQT_INCLUDED_SRC_manager_UIToolPaneMachine_h */
|
---|