1 | /* $Id: UIMachineWindowNormal.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineWindowNormal class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-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_runtime_normal_UIMachineWindowNormal_h
|
---|
29 | #define FEQT_INCLUDED_SRC_runtime_normal_UIMachineWindowNormal_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UIMachineWindow.h"
|
---|
36 |
|
---|
37 | /* Forward declarations: */
|
---|
38 | class CMediumAttachment;
|
---|
39 | class UIIndicatorsPool;
|
---|
40 | class UIAction;
|
---|
41 |
|
---|
42 | /** UIMachineWindow subclass used as normal machine window implementation. */
|
---|
43 | class UIMachineWindowNormal : public UIMachineWindow
|
---|
44 | {
|
---|
45 | Q_OBJECT;
|
---|
46 |
|
---|
47 | signals:
|
---|
48 |
|
---|
49 | /** Notifies about geometry change. */
|
---|
50 | void sigGeometryChange(const QRect &rect);
|
---|
51 |
|
---|
52 | public:
|
---|
53 |
|
---|
54 | /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
|
---|
55 | UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId);
|
---|
56 |
|
---|
57 | private slots:
|
---|
58 |
|
---|
59 | /** Handles machine state change event. */
|
---|
60 | void sltMachineStateChanged() RT_OVERRIDE;
|
---|
61 |
|
---|
62 | #ifndef RT_OS_DARWIN
|
---|
63 | /** Handles menu-bar configuration-change. */
|
---|
64 | void sltHandleMenuBarConfigurationChange(const QUuid &uMachineID);
|
---|
65 | /** Handles menu-bar context-menu-request. */
|
---|
66 | void sltHandleMenuBarContextMenuRequest(const QPoint &position);
|
---|
67 | #endif /* !RT_OS_DARWIN */
|
---|
68 |
|
---|
69 | /** Handles status-bar configuration-change. */
|
---|
70 | void sltHandleStatusBarConfigurationChange(const QUuid &uMachineID);
|
---|
71 | /** Handles status-bar context-menu-request. */
|
---|
72 | void sltHandleStatusBarContextMenuRequest(const QPoint &position);
|
---|
73 | /** Handles status-bar indicator context-menu-request. */
|
---|
74 | void sltHandleIndicatorContextMenuRequest(IndicatorType enmIndicatorType, const QPoint &indicatorPosition);
|
---|
75 |
|
---|
76 | #ifdef VBOX_WS_MAC
|
---|
77 | /** Handles signal about some @a pAction hovered. */
|
---|
78 | void sltActionHovered(UIAction *pAction);
|
---|
79 | #endif /* VBOX_WS_MAC */
|
---|
80 |
|
---|
81 | private:
|
---|
82 |
|
---|
83 | #ifndef VBOX_WS_MAC
|
---|
84 | /** Prepare menu routine. */
|
---|
85 | void prepareMenu() RT_OVERRIDE RT_FINAL;
|
---|
86 | #endif /* !VBOX_WS_MAC */
|
---|
87 | /** Prepare status-bar routine. */
|
---|
88 | void prepareStatusBar() RT_OVERRIDE;
|
---|
89 | /** Prepare notification-center routine. */
|
---|
90 | void prepareNotificationCenter() RT_OVERRIDE;
|
---|
91 | /** Prepare visual-state routine. */
|
---|
92 | void prepareVisualState() RT_OVERRIDE;
|
---|
93 | /** Load settings routine. */
|
---|
94 | void loadSettings() RT_OVERRIDE;
|
---|
95 |
|
---|
96 | /** Cleanup visual-state routine. */
|
---|
97 | void cleanupVisualState() RT_OVERRIDE;
|
---|
98 | /** Cleanup notification-center routine. */
|
---|
99 | void cleanupNotificationCenter() RT_OVERRIDE;
|
---|
100 | /** Cleanup status-bar routine. */
|
---|
101 | void cleanupStatusBar() RT_OVERRIDE;
|
---|
102 |
|
---|
103 | /** Updates visibility according to visual-state. */
|
---|
104 | void showInNecessaryMode() RT_OVERRIDE;
|
---|
105 |
|
---|
106 | /** Restores cached window geometry. */
|
---|
107 | virtual void restoreCachedGeometry() RT_OVERRIDE;
|
---|
108 |
|
---|
109 | /** Performs window geometry normalization according to guest-size and host's available geometry.
|
---|
110 | * @param fAdjustPosition Determines whether is it necessary to adjust position as well.
|
---|
111 | * @param fResizeToGuestDisplay Determines whether is it necessary to resize the window to fit to guest display size. */
|
---|
112 | virtual void normalizeGeometry(bool fAdjustPosition, bool fResizeToGuestDisplay) RT_OVERRIDE;
|
---|
113 |
|
---|
114 | /** Common update routine. */
|
---|
115 | void updateAppearanceOf(int aElement) RT_OVERRIDE;
|
---|
116 |
|
---|
117 | #ifndef VBOX_WS_MAC
|
---|
118 | /** Updates menu-bar content. */
|
---|
119 | void updateMenu();
|
---|
120 | #endif /* !VBOX_WS_MAC */
|
---|
121 |
|
---|
122 | /** Common @a pEvent handler. */
|
---|
123 | bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
124 |
|
---|
125 | /** Returns whether this window is maximized. */
|
---|
126 | bool isMaximizedChecked();
|
---|
127 |
|
---|
128 | /** Holds the indicator-pool instance. */
|
---|
129 | UIIndicatorsPool *m_pIndicatorsPool;
|
---|
130 |
|
---|
131 | /** Holds the current window geometry. */
|
---|
132 | QRect m_geometry;
|
---|
133 | /** Holds the geometry save timer ID. */
|
---|
134 | int m_iGeometrySaveTimerId;
|
---|
135 | };
|
---|
136 |
|
---|
137 | #endif /* !FEQT_INCLUDED_SRC_runtime_normal_UIMachineWindowNormal_h */
|
---|