VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

Last change on this file was 103989, checked in by vboxsync, 6 months ago

FE/Qt. bugref:10624. Build fix.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1/* $Id: UIMachineWindowFullscreen.h 103989 2024-03-21 14:02:02Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMachineWindowFullscreen class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-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_runtime_fullscreen_UIMachineWindowFullscreen_h
29#define FEQT_INCLUDED_SRC_runtime_fullscreen_UIMachineWindowFullscreen_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UIMachineWindow.h"
36
37#if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
38/* Forward declarations: */
39class UIMiniToolBar;
40#endif /* VBOX_WS_WIN || VBOX_WS_NIX */
41
42/** UIMachineWindow subclass used as full-screen machine window implementation. */
43class UIMachineWindowFullscreen : public UIMachineWindow
44{
45 Q_OBJECT;
46
47#ifdef RT_OS_DARWIN
48signals:
49 /** Mac OS X: Notifies listener about native 'fullscreen' will be entered. */
50 void sigNotifyAboutNativeFullscreenWillEnter();
51 /** Mac OS X: Notifies listener about native 'fullscreen' entered. */
52 void sigNotifyAboutNativeFullscreenDidEnter();
53 /** Mac OS X: Notifies listener about native 'fullscreen' will be exited. */
54 void sigNotifyAboutNativeFullscreenWillExit();
55 /** Mac OS X: Notifies listener about native 'fullscreen' exited. */
56 void sigNotifyAboutNativeFullscreenDidExit();
57 /** Mac OS X: Notifies listener about native 'fullscreen' fail to enter. */
58 void sigNotifyAboutNativeFullscreenFailToEnter();
59#endif /* RT_OS_DARWIN */
60
61public:
62
63 /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
64 UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId);
65
66protected:
67
68#ifdef VBOX_WS_MAC
69 /** Mac OS X: Handles native notifications @a strNativeNotificationName for 'fullscreen' window. */
70 void handleNativeNotification(const QString &strNativeNotificationName) RT_OVERRIDE RT_FINAL;
71 /** Mac OS X: Returns whether window is in 'fullscreen' transition. */
72 bool isInFullscreenTransition() const { return m_fIsInFullscreenTransition; }
73#endif /* VBOX_WS_MAC */
74
75private slots:
76
77#if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
78 /** Handles machine state change event. */
79 void sltMachineStateChanged() RT_OVERRIDE RT_FINAL;
80
81 /** Revokes window activation. */
82 void sltRevokeWindowActivation();
83
84 /** Handles signal about mini-toolbar auto-hide toggled.
85 * @param fEnabled Brings whether auto-hide is enabled. */
86 void sltHandleMiniToolBarAutoHideToggled(bool fEnabled);
87#endif /* VBOX_WS_WIN || VBOX_WS_NIX */
88
89#ifdef RT_OS_DARWIN
90 /** Mac OS X: Commands @a pMachineWindow to enter native 'fullscreen' mode if possible. */
91 void sltEnterNativeFullscreen(UIMachineWindow *pMachineWindow);
92 /** Mac OS X: Commands @a pMachineWindow to exit native 'fullscreen' mode if possible. */
93 void sltExitNativeFullscreen(UIMachineWindow *pMachineWindow);
94#endif /* RT_OS_DARWIN */
95
96 /** Shows window in minimized state. */
97 void sltShowMinimized();
98
99private:
100
101 /** Prepare notification-center routine. */
102 void prepareNotificationCenter() RT_OVERRIDE RT_FINAL;
103 /** Prepare visual-state routine. */
104 void prepareVisualState() RT_OVERRIDE RT_FINAL;
105#if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
106 /** Prepare mini-toolbar routine. */
107 void prepareMiniToolbar();
108#endif /* VBOX_WS_WIN || VBOX_WS_NIX */
109
110#if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
111 /** Cleanup mini-toolbar routine. */
112 void cleanupMiniToolbar();
113#endif /* VBOX_WS_WIN || VBOX_WS_NIX */
114 /** Cleanup visual-state routine. */
115 void cleanupVisualState() RT_OVERRIDE RT_FINAL;
116 /** Cleanup notification-center routine. */
117 void cleanupNotificationCenter() RT_OVERRIDE RT_FINAL;
118
119 /** Updates geometry according to visual-state. */
120 void placeOnScreen();
121 /** Updates visibility according to visual-state. */
122 void showInNecessaryMode() RT_OVERRIDE RT_FINAL;
123
124#if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
125 /** Common update routine. */
126 void updateAppearanceOf(int iElement) RT_OVERRIDE RT_FINAL;
127#endif /* VBOX_WS_WIN || VBOX_WS_NIX */
128
129#ifdef VBOX_WS_NIX
130 /** X11: Handles @a pEvent about state change. */
131 void changeEvent(QEvent *pEvent) RT_OVERRIDE RT_FINAL;
132#endif
133
134#ifdef VBOX_WS_WIN
135 /** Win: Handles show @a pEvent. */
136 void showEvent(QShowEvent *pEvent);
137#endif
138
139#if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
140 /** Holds the mini-toolbar instance. */
141 UIMiniToolBar *m_pMiniToolBar;
142#endif /* VBOX_WS_WIN || VBOX_WS_NIX */
143
144#ifdef VBOX_WS_MAC
145 /** Mac OS X: Reflects whether window is in 'fullscreen' transition. */
146 bool m_fIsInFullscreenTransition;
147 /** Mac OS X: Allows 'fullscreen' API access: */
148 friend class UIMachineLogicFullscreen;
149#endif /* VBOX_WS_MAC */
150
151 /** Holds whether the window was minimized before became hidden.
152 * Used to restore minimized state when the window shown again. */
153 bool m_fWasMinimized;
154#ifdef VBOX_WS_NIX
155 /** X11: Holds whether the window minimization is currently requested.
156 * Used to prevent accidentally restoring to full-screen state. */
157 bool m_fIsMinimizationRequested;
158 /** X11: Holds whether the window is currently minimized.
159 * Used to restore full-screen state when the window restored again. */
160 bool m_fIsMinimized;
161#endif
162};
163
164#endif /* !FEQT_INCLUDED_SRC_runtime_fullscreen_UIMachineWindowFullscreen_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle
ContactPrivacy/Do Not Sell My InfoTerms of Use