1 | /* $Id: UIToolsView.h 104251 2024-04-09 12:36:47Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIToolsView 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_UIToolsView_h
|
---|
29 | #define FEQT_INCLUDED_SRC_manager_tools_UIToolsView_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "QIGraphicsView.h"
|
---|
36 |
|
---|
37 | /* Forward declarations: */
|
---|
38 | class UITools;
|
---|
39 |
|
---|
40 | /** QIGraphicsView extension used as VM Tools-pane view. */
|
---|
41 | class UIToolsView : public QIGraphicsView
|
---|
42 | {
|
---|
43 | Q_OBJECT;
|
---|
44 |
|
---|
45 | signals:
|
---|
46 |
|
---|
47 | /** Notifies listeners about resize. */
|
---|
48 | void sigResized();
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /** Constructs a Tools-view passing @a pParent to the base-class.
|
---|
53 | * @param pParent Brings the Tools-container to embed into. */
|
---|
54 | UIToolsView(UITools *pParent);
|
---|
55 |
|
---|
56 | /** @name General stuff.
|
---|
57 | * @{ */
|
---|
58 | /** Returns the Tools reference. */
|
---|
59 | UITools *tools() const { return m_pTools; }
|
---|
60 | /** @} */
|
---|
61 |
|
---|
62 | public slots:
|
---|
63 |
|
---|
64 | /** @name General stuff.
|
---|
65 | * @{ */
|
---|
66 | /** Handles focus change to @a pFocusItem. */
|
---|
67 | void sltFocusChanged();
|
---|
68 | /** @} */
|
---|
69 |
|
---|
70 | /** @name Layout stuff.
|
---|
71 | * @{ */
|
---|
72 | /** Handles minimum width @a iHint change. */
|
---|
73 | void sltMinimumWidthHintChanged(int iHint);
|
---|
74 | /** Handles minimum height @a iHint change. */
|
---|
75 | void sltMinimumHeightHintChanged(int iHint);
|
---|
76 | /** @} */
|
---|
77 |
|
---|
78 | protected:
|
---|
79 |
|
---|
80 | /** @name Event handling stuff.
|
---|
81 | * @{ */
|
---|
82 | /** Handles resize @a pEvent. */
|
---|
83 | virtual void resizeEvent(QResizeEvent *pEvent) RT_OVERRIDE;
|
---|
84 | /** @} */
|
---|
85 |
|
---|
86 | private slots:
|
---|
87 |
|
---|
88 | /** @name Event handling stuff.
|
---|
89 | * @{ */
|
---|
90 | /** Handles translation event. */
|
---|
91 | void sltRetranslateUI();
|
---|
92 | /** @} */
|
---|
93 |
|
---|
94 | private:
|
---|
95 |
|
---|
96 | /** @name Prepare/Cleanup cascade.
|
---|
97 | * @{ */
|
---|
98 | /** Prepares all. */
|
---|
99 | void prepare();
|
---|
100 | /** Prepares palette. */
|
---|
101 | void preparePalette();
|
---|
102 | /** @} */
|
---|
103 |
|
---|
104 | /** @name General stuff.
|
---|
105 | * @{ */
|
---|
106 | /** Updates scene rectangle. */
|
---|
107 | void updateSceneRect();
|
---|
108 | /** @} */
|
---|
109 |
|
---|
110 | /** @name General stuff.
|
---|
111 | * @{ */
|
---|
112 | /** Holds the Tools-pane reference. */
|
---|
113 | UITools *m_pTools;
|
---|
114 | /** @} */
|
---|
115 |
|
---|
116 | /** @name Layout stuff.
|
---|
117 | * @{ */
|
---|
118 | /** Holds the minimum width hint. */
|
---|
119 | int m_iMinimumWidthHint;
|
---|
120 | /** Holds the minimum height hint. */
|
---|
121 | int m_iMinimumHeightHint;
|
---|
122 | /** @} */
|
---|
123 | };
|
---|
124 |
|
---|
125 | #endif /* !FEQT_INCLUDED_SRC_manager_tools_UIToolsView_h */
|
---|