VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

Last change on this file was 106061, checked in by vboxsync, 3 weeks ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.5 KB
Line 
1/* $Id: UIChooser.h 106061 2024-09-16 14:03:52Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIChooser class declaration.
4 */
5
6/*
7 * Copyright (C) 2012-2024 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_chooser_UIChooser_h
29#define FEQT_INCLUDED_SRC_manager_chooser_UIChooser_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QWidget>
36
37/* GUI includes: */
38#include "UIExtraDataDefs.h"
39
40/* Forward declarations: */
41class UIActionPool;
42class UIChooserModel;
43class UIChooserView;
44class UIVirtualMachineItem;
45class UIVirtualMachineItemCloud;
46
47/** QWidget extension used as VM Chooser-pane. */
48class UIChooser : public QWidget
49{
50 Q_OBJECT;
51
52signals:
53
54 /** @name Group saving stuff.
55 * @{ */
56 /** Notifies listeners about group saving state change. */
57 void sigGroupSavingStateChanged();
58 /** @} */
59
60 /** @name Cloud update stuff.
61 * @{ */
62 /** Notifies listeners about cloud profile state change.
63 * @param strProviderShortName Brings the cloud provider short name.
64 * @param strProfileName Brings the cloud profile name. */
65 void sigCloudProfileStateChange(const QString &strProviderShortName,
66 const QString &strProfileName);
67 /** Notifies listeners about cloud machine state change.
68 * @param uId Brings the cloud machine ID. */
69 void sigCloudMachineStateChange(const QUuid &uId);
70
71 /** Notifies listeners about cloud update state change. */
72 void sigCloudUpdateStateChanged();
73 /** @} */
74
75 /** @name Tool stuff.
76 * @{ */
77 /** Notifies listeners about tool popup-menu request for certain @a position and optionally machine @a pItem. */
78 void sigToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem);
79 /** @} */
80
81 /** @name Selection stuff.
82 * @{ */
83 /** Notifies listeners about selection changed. */
84 void sigSelectionChanged();
85 /** Notifies listeners about selection invalidated. */
86 void sigSelectionInvalidated();
87
88 /** Notifies listeners about group toggling started. */
89 void sigToggleStarted();
90 /** Notifies listeners about group toggling finished. */
91 void sigToggleFinished();
92 /** @} */
93
94 /** @name Action stuff.
95 * @{ */
96 /** Notifies listeners about start or show request. */
97 void sigStartOrShowRequest();
98 /** Notifies listeners about machine search widget visibility changed to @a fVisible. */
99 void sigMachineSearchWidgetVisibilityChanged(bool fVisible);
100 /** @} */
101
102public:
103
104 /** Constructs Chooser-pane passing @a pParent to the base-class.
105 * @param pActionPool Brings the action-pool reference. */
106 UIChooser(QWidget *pParent, UIActionPool *pActionPool);
107 /** Destructs Chooser-pane. */
108 virtual ~UIChooser() RT_OVERRIDE;
109
110 /** @name General stuff.
111 * @{ */
112 /** Returns the action-pool reference. */
113 UIActionPool *actionPool() const { return m_pActionPool; }
114
115 /** Return the Chooser-model instance. */
116 UIChooserModel *model() const { return m_pChooserModel; }
117 /** Return the Chooser-view instance. */
118 UIChooserView *view() const { return m_pChooserView; }
119 /** @} */
120
121 /** @name Group saving stuff.
122 * @{ */
123 /** Returns whether group saving is in progress. */
124 bool isGroupSavingInProgress() const;
125 /** @} */
126
127 /** @name Cloud update stuff.
128 * @{ */
129 /** Defines whether real cloud nodes should be kept updated. */
130 void setKeepCloudNodesUpdated(bool fUpdate);
131
132 /** Returns whether at least one cloud profile currently being updated. */
133 bool isCloudProfileUpdateInProgress() const;
134
135 /** Returns a list of real cloud machine items. */
136 QList<UIVirtualMachineItemCloud*> cloudMachineItems() const;
137 /** @} */
138
139 /** @name Current-item stuff.
140 * @{ */
141 /** Returns current-item. */
142 UIVirtualMachineItem *currentItem() const;
143 /** Returns a list of current-items. */
144 QList<UIVirtualMachineItem*> currentItems() const;
145
146 /** Returns whether group item is selected. */
147 bool isGroupItemSelected() const;
148 /** Returns whether global item is selected. */
149 bool isGlobalItemSelected() const;
150 /** Returns whether machine item is selected. */
151 bool isMachineItemSelected() const;
152 /** Returns whether local machine item is selected. */
153 bool isLocalMachineItemSelected() const;
154 /** Returns whether cloud machine item is selected. */
155 bool isCloudMachineItemSelected() const;
156
157 /** Returns whether single group is selected. */
158 bool isSingleGroupSelected() const;
159 /** Returns whether single local group is selected. */
160 bool isSingleLocalGroupSelected() const;
161 /** Returns whether single cloud provider group is selected. */
162 bool isSingleCloudProviderGroupSelected() const;
163 /** Returns whether single cloud profile group is selected. */
164 bool isSingleCloudProfileGroupSelected() const;
165 /** Returns whether all items of one group are selected. */
166 bool isAllItemsOfOneGroupSelected() const;
167
168 /** Returns full name of currently selected group. */
169 QString fullGroupName() const;
170 /** @} */
171
172 /** @name Action handling stuff.
173 * @{ */
174 /** Opens group name editor. */
175 void openGroupNameEditor();
176 /** Disbands group. */
177 void disbandGroup();
178 /** Removes machine. */
179 void removeMachine();
180 /** Moves machine to a group with certain @a strName. */
181 void moveMachineToGroup(const QString &strName);
182 /** Returns possible groups for machine with passed @a uId to move to. */
183 QStringList possibleGroupsForMachineToMove(const QUuid &uId);
184 /** Returns possible groups for group with passed @a strFullName to move to. */
185 QStringList possibleGroupsForGroupToMove(const QString &strFullName);
186 /** Refreshes machine. */
187 void refreshMachine();
188 /** Sorts group. */
189 void sortGroup();
190 /** Toggle machine search widget to be @a fVisible. */
191 void setMachineSearchWidgetVisibility(bool fVisible);
192 /** Changes current machine to the one with certain @a uId. */
193 void setCurrentMachine(const QUuid &uId);
194 /** Set global tools to be the current item. */
195 void setCurrentGlobal();
196 /** @} */
197
198public slots:
199
200 /** @name Layout stuff.
201 * @{ */
202 /** Defines global item @a iHeight. */
203 void setGlobalItemHeightHint(int iHeight);
204 /** @} */
205
206private slots:
207
208 /** @name General stuff.
209 * @{ */
210 /** Handles signal about tool popup-menu request for certain @a position and optionally machine @a pItem. */
211 void sltToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem);
212 /** @} */
213
214private:
215
216 /** @name Prepare/Cleanup cascade.
217 * @{ */
218 /** Prepares all. */
219 void prepare();
220 /** Prepares model. */
221 void prepareModel();
222 /** Prepares widgets. */
223 void prepareWidgets();
224 /** Prepares connections. */
225 void prepareConnections();
226 /** Init model. */
227 void initModel();
228
229 /** Deinit model. */
230 void deinitModel();
231 /** Cleanups connections. */
232 void cleanupConnections();
233 /** Cleanups all. */
234 void cleanup();
235 /** @} */
236
237 /** @name General stuff.
238 * @{ */
239 /** Holds the action-pool reference. */
240 UIActionPool *m_pActionPool;
241
242 /** Holds the Chooser-model instane. */
243 UIChooserModel *m_pChooserModel;
244 /** Holds the Chooser-view instane. */
245 UIChooserView *m_pChooserView;
246 /** @} */
247};
248
249#endif /* !FEQT_INCLUDED_SRC_manager_chooser_UIChooser_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette