1 | /* $Id: UITools.h 102813 2024-01-10 12:27:28Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UITools class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-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_tools_UITools_h
|
---|
29 | #define FEQT_INCLUDED_SRC_manager_tools_UITools_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QWidget>
|
---|
36 |
|
---|
37 | /* GUI icludes: */
|
---|
38 | #include "UIExtraDataDefs.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QVBoxLayout;
|
---|
42 | class UIActionPool;
|
---|
43 | class UIToolsItem;
|
---|
44 | class UIToolsModel;
|
---|
45 | class UIToolsView;
|
---|
46 | class UIVirtualBoxManagerWidget;
|
---|
47 |
|
---|
48 | /** QWidget extension used as VM Tools-pane. */
|
---|
49 | class UITools : public QWidget
|
---|
50 | {
|
---|
51 | Q_OBJECT;
|
---|
52 |
|
---|
53 | signals:
|
---|
54 |
|
---|
55 | /** @name General stuff.
|
---|
56 | * @{ */
|
---|
57 | /** Notifies listeners about selection changed.
|
---|
58 | * @param enmType Brings current tool type. */
|
---|
59 | void sigSelectionChanged(UIToolType enmType);
|
---|
60 |
|
---|
61 | /** Notifies listeners about expanding started. */
|
---|
62 | void sigExpandingStarted();
|
---|
63 | /** Notifies listeners about expanding finished. */
|
---|
64 | void sigExpandingFinished();
|
---|
65 | /** @} */
|
---|
66 |
|
---|
67 | public:
|
---|
68 |
|
---|
69 | /** Constructs Tools-pane passing @a pParent to the base-class.
|
---|
70 | * @param Brings the tools class, it will be fixed one. */
|
---|
71 | UITools(UIToolClass enmClass, UIVirtualBoxManagerWidget *pParent = 0);
|
---|
72 |
|
---|
73 | /** @name General stuff.
|
---|
74 | * @{ */
|
---|
75 | /** Returns the manager-widget reference. */
|
---|
76 | UIVirtualBoxManagerWidget *managerWidget() const { return m_pManagerWidget; }
|
---|
77 |
|
---|
78 | /** Returns the action-pool reference. */
|
---|
79 | UIActionPool *actionPool() const;
|
---|
80 |
|
---|
81 | /** Return the Tools-model instance. */
|
---|
82 | UIToolsModel *model() const { return m_pToolsModel; }
|
---|
83 | /** Return the Tools-view instance. */
|
---|
84 | UIToolsView *view() const { return m_pToolsView; }
|
---|
85 |
|
---|
86 | /** Defines current tools @a enmType. */
|
---|
87 | void setToolsType(UIToolType enmType);
|
---|
88 | /** Returns current tools type. */
|
---|
89 | UIToolType toolsType() const;
|
---|
90 |
|
---|
91 | /** Defines whether tool items @a fEnabled.*/
|
---|
92 | void setItemsEnabled(bool fEnabled);
|
---|
93 | /** Returns whether tool items enabled.*/
|
---|
94 | bool isItemsEnabled() const;
|
---|
95 |
|
---|
96 | /** Defines restructed tool @a types. */
|
---|
97 | void setRestrictedToolTypes(const QList<UIToolType> &types);
|
---|
98 | /** Returns restricted tool types. */
|
---|
99 | QList<UIToolType> restrictedToolTypes() const;
|
---|
100 | /** @} */
|
---|
101 |
|
---|
102 | /** @name Current item stuff.
|
---|
103 | * @{ */
|
---|
104 | /** Returns current item. */
|
---|
105 | UIToolsItem *currentItem() const;
|
---|
106 | /** @} */
|
---|
107 |
|
---|
108 | private:
|
---|
109 |
|
---|
110 | /** @name Prepare/Cleanup cascade.
|
---|
111 | * @{ */
|
---|
112 | /** Prepares all. */
|
---|
113 | void prepare();
|
---|
114 | /** Prepares contents. */
|
---|
115 | void prepareContents();
|
---|
116 | /** Prepares model. */
|
---|
117 | void prepareModel();
|
---|
118 | /** Prepares view. */
|
---|
119 | void prepareView();
|
---|
120 | /** Prepares connections. */
|
---|
121 | void prepareConnections();
|
---|
122 | /** Inits model. */
|
---|
123 | void initModel();
|
---|
124 | /** @} */
|
---|
125 |
|
---|
126 | /** @name General stuff.
|
---|
127 | * @{ */
|
---|
128 | /** Holds the tools class. */
|
---|
129 | const UIToolClass m_enmClass;
|
---|
130 |
|
---|
131 | /** Holds the manager-widget reference. */
|
---|
132 | UIVirtualBoxManagerWidget *m_pManagerWidget;
|
---|
133 |
|
---|
134 | /** Holds the main layout instane. */
|
---|
135 | QVBoxLayout *m_pMainLayout;
|
---|
136 | /** Holds the Tools-model instane. */
|
---|
137 | UIToolsModel *m_pToolsModel;
|
---|
138 | /** Holds the Tools-view instane. */
|
---|
139 | UIToolsView *m_pToolsView;
|
---|
140 | /** @} */
|
---|
141 | };
|
---|
142 |
|
---|
143 | #endif /* !FEQT_INCLUDED_SRC_manager_tools_UITools_h */
|
---|