VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.h@ 103977

Last change on this file since 103977 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h74233
    /branches/VBox-4.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h91223
    /branches/VBox-4.3/trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h91223
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h79562-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h79645-79692
    /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h79225,​79271
File size: 5.9 KB
Line 
1/* $Id: UIDetailsItem.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIDetailsItem 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_details_UIDetailsItem_h
29#define FEQT_INCLUDED_SRC_manager_details_UIDetailsItem_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes */
35#include <QUuid>
36
37/* GUI includes: */
38#include "QIGraphicsWidget.h"
39#include "QIWithRetranslateUI.h"
40
41/* Forward declaration: */
42class QGraphicsSceneHoverEvent;
43class QGraphicsSceneMouseEvent;
44class UIDetailsElement;
45class UIDetailsGroup;
46class UIDetailsModel;
47class UIDetailsSet;
48
49
50/** UIDetailsItem types. */
51enum UIDetailsItemType
52{
53 UIDetailsItemType_Any = QGraphicsItem::UserType,
54 UIDetailsItemType_Group,
55 UIDetailsItemType_Set,
56 UIDetailsItemType_Element,
57 UIDetailsItemType_Preview
58};
59
60
61/** QIGraphicsWidget extension used as interface
62 * for graphics details model/view architecture. */
63class UIDetailsItem : public QIWithRetranslateUI4<QIGraphicsWidget>
64{
65 Q_OBJECT;
66
67signals:
68
69 /** @name Item stuff.
70 * @{ */
71 /** Notifies listeners about step build should be started.
72 * @param uStepId Brings the step ID.
73 * @param iStepNumber Brings the step number. */
74 void sigBuildStep(const QUuid &uStepId, int iStepNumber);
75 /** Notifies listeners about step build complete. */
76 void sigBuildDone();
77 /** @} */
78
79public:
80
81 /** Constructs item passing @a pParent to the base-class. */
82 UIDetailsItem(UIDetailsItem *pParent);
83
84 /** @name Item stuff.
85 * @{ */
86 /** Returns parent reference. */
87 UIDetailsItem *parentItem() const { return m_pParent; }
88
89 /** Casts item to group one. */
90 UIDetailsGroup *toGroup();
91 /** Casts item to set one. */
92 UIDetailsSet *toSet();
93 /** Casts item to element one. */
94 UIDetailsElement *toElement();
95
96 /** Returns model reference. */
97 UIDetailsModel *model() const;
98
99 /** Returns the description of the item. */
100 virtual QString description() const = 0;
101
102 /** Installs event-filter for @a pSource object.
103 * @note Base-class implementation does nothing. */
104 virtual void installEventFilterHelper(QObject *pSource) { Q_UNUSED(pSource); }
105 /** @} */
106
107 /** @name Children stuff.
108 * @{ */
109 /** Adds child @a pItem. */
110 virtual void addItem(UIDetailsItem *pItem) = 0;
111 /** Removes child @a pItem. */
112 virtual void removeItem(UIDetailsItem *pItem) = 0;
113
114 /** Returns children items of certain @a enmType. */
115 virtual QList<UIDetailsItem*> items(UIDetailsItemType enmType = UIDetailsItemType_Any) const = 0;
116 /** Returns whether there are children items of certain @a enmType. */
117 virtual bool hasItems(UIDetailsItemType enmType = UIDetailsItemType_Any) const = 0;
118 /** Clears children items of certain @a enmType. */
119 virtual void clearItems(UIDetailsItemType enmType = UIDetailsItemType_Any) = 0;
120 /** @} */
121
122 /** @name Layout stuff.
123 * @{ */
124 /** Updates geometry. */
125 virtual void updateGeometry() RT_OVERRIDE;
126
127 /** Updates layout. */
128 virtual void updateLayout() = 0;
129
130 /** Returns minimum width-hint. */
131 virtual int minimumWidthHint() const = 0;
132 /** Returns minimum height-hint. */
133 virtual int minimumHeightHint() const = 0;
134
135 /** Returns size-hint.
136 * @param enmWhich Brings size-hint type.
137 * @param constraint Brings size constraint. */
138 virtual QSizeF sizeHint(Qt::SizeHint enmWhich, const QSizeF &constraint = QSizeF()) const RT_OVERRIDE;
139 /** @} */
140
141public slots:
142
143 /** @name Item stuff.
144 * @{ */
145 /** Handles request about starting step build.
146 * @param uStepId Brings the step ID.
147 * @param iStepNumber Brings the step number. */
148 /** @} */
149 virtual void sltBuildStep(const QUuid &uStepId, int iStepNumber);
150
151protected:
152
153 /** @name Event-handling stuff.
154 * @{ */
155 /** Handles translation event. */
156 virtual void retranslateUi() RT_OVERRIDE {}
157 /** @} */
158
159private:
160
161 /** Holds the parent item reference. */
162 UIDetailsItem *m_pParent;
163};
164
165
166/** QObject extension used to prepare details steps. */
167class UIPrepareStep : public QObject
168{
169 Q_OBJECT;
170
171signals:
172
173 /** Notifies listeners about step preparing is complete.
174 * @param strStepId Brings the step ID.
175 * @param iStepNumber Brings the step number. */
176 void sigStepDone(const QUuid& aStepId, int iStepNumber);
177
178public:
179
180 /** Constructs step preparing object passing @a pParent to the base-class.
181 * @param pBuildObject Brings the build object reference.
182 * @param uStepId Brings the step ID.
183 * @param iStepNumber Brings the step number.*/
184 UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QUuid &uStepId, int iStepNumber);
185
186private slots:
187
188 /** Handles step prepare completion. */
189 void sltStepDone();
190
191private:
192
193 /** Holds the step ID. */
194 QUuid m_uStepId;
195 /** Holds the step number. */
196 int m_iStepNumber;
197};
198
199
200#endif /* !FEQT_INCLUDED_SRC_manager_details_UIDetailsItem_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