1 | /* $Id: UIMachineWindowScale.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineWindowScale 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_scale_UIMachineWindowScale_h
|
---|
29 | #define FEQT_INCLUDED_SRC_runtime_scale_UIMachineWindowScale_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UIMachineWindow.h"
|
---|
36 |
|
---|
37 | /** UIMachineWindow subclass used as scaled machine window implementation. */
|
---|
38 | class UIMachineWindowScale : public UIMachineWindow
|
---|
39 | {
|
---|
40 | Q_OBJECT;
|
---|
41 |
|
---|
42 | public:
|
---|
43 |
|
---|
44 | /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
|
---|
45 | UIMachineWindowScale(UIMachineLogic *pMachineLogic, ulong uScreenId);
|
---|
46 |
|
---|
47 | private:
|
---|
48 |
|
---|
49 | /** Prepare main-layout routine. */
|
---|
50 | void prepareMainLayout();
|
---|
51 | /** Prepare notification-center routine. */
|
---|
52 | void prepareNotificationCenter();
|
---|
53 | #ifdef VBOX_WS_MAC
|
---|
54 | /** Prepare visual-state routine. */
|
---|
55 | void prepareVisualState();
|
---|
56 | #endif /* VBOX_WS_MAC */
|
---|
57 | /** Load settings routine. */
|
---|
58 | void loadSettings();
|
---|
59 |
|
---|
60 | #ifdef VBOX_WS_MAC
|
---|
61 | /** Cleanup visual-state routine. */
|
---|
62 | void cleanupVisualState();
|
---|
63 | #endif /* VBOX_WS_MAC */
|
---|
64 | /** Cleanup notification-center routine. */
|
---|
65 | void cleanupNotificationCenter();
|
---|
66 |
|
---|
67 | /** Updates visibility according to visual-state. */
|
---|
68 | void showInNecessaryMode();
|
---|
69 |
|
---|
70 | /** Restores cached window geometry. */
|
---|
71 | virtual void restoreCachedGeometry() RT_OVERRIDE;
|
---|
72 |
|
---|
73 | /** Performs window geometry normalization according to guest-size and host's available geometry.
|
---|
74 | * @param fAdjustPosition Determines whether is it necessary to adjust position as well.
|
---|
75 | * @param fResizeToGuestDisplay Determines whether is it necessary to resize the window to fit to guest display size. */
|
---|
76 | virtual void normalizeGeometry(bool fAdjustPosition, bool fResizeToGuestDisplay) RT_OVERRIDE;
|
---|
77 |
|
---|
78 | /** Common @a pEvent handler. */
|
---|
79 | bool event(QEvent *pEvent);
|
---|
80 |
|
---|
81 | /** Returns whether this window is maximized. */
|
---|
82 | bool isMaximizedChecked();
|
---|
83 |
|
---|
84 | /** Holds the current window geometry. */
|
---|
85 | QRect m_geometry;
|
---|
86 | /** Holds the geometry save timer ID. */
|
---|
87 | int m_iGeometrySaveTimerId;
|
---|
88 | };
|
---|
89 |
|
---|
90 | #endif /* !FEQT_INCLUDED_SRC_runtime_scale_UIMachineWindowScale_h */
|
---|