1 | /* $Id: UIMachineLogicNormal.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineLogicNormal 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_UIMachineLogicNormal_h
|
---|
29 | #define FEQT_INCLUDED_SRC_runtime_normal_UIMachineLogicNormal_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UIMachineLogic.h"
|
---|
36 |
|
---|
37 | /** UIMachineLogic subclass used as normal machine logic implementation. */
|
---|
38 | class UIMachineLogicNormal : public UIMachineLogic
|
---|
39 | {
|
---|
40 | Q_OBJECT;
|
---|
41 |
|
---|
42 | public:
|
---|
43 |
|
---|
44 | /** Constructs a logic passing @a pMachine and @a pSession to the base-class.
|
---|
45 | * @param pMachine Brings the machine this logic belongs to. */
|
---|
46 | UIMachineLogicNormal(UIMachine *pMachine);
|
---|
47 |
|
---|
48 | /** Returns visual state type. */
|
---|
49 | virtual UIVisualStateType visualStateType() const RT_OVERRIDE { return UIVisualStateType_Normal; }
|
---|
50 |
|
---|
51 | protected:
|
---|
52 |
|
---|
53 | /* Check if this logic is available: */
|
---|
54 | bool checkAvailability() RT_OVERRIDE;
|
---|
55 |
|
---|
56 | /** Returns machine-window flags for 'Normal' machine-logic and passed @a uScreenId. */
|
---|
57 | virtual Qt::WindowFlags windowFlags(ulong uScreenId) const RT_OVERRIDE { Q_UNUSED(uScreenId); return Qt::Window; }
|
---|
58 |
|
---|
59 | private slots:
|
---|
60 |
|
---|
61 | /** Checks if some visual-state type was requested. */
|
---|
62 | void sltCheckForRequestedVisualStateType() RT_OVERRIDE;
|
---|
63 |
|
---|
64 | #ifndef RT_OS_DARWIN
|
---|
65 | /** Invokes popup-menu. */
|
---|
66 | void sltInvokePopupMenu();
|
---|
67 | #endif /* RT_OS_DARWIN */
|
---|
68 |
|
---|
69 | /** Opens menu-bar editor.*/
|
---|
70 | void sltOpenMenuBarSettings();
|
---|
71 | /** Handles menu-bar editor closing.*/
|
---|
72 | void sltMenuBarSettingsClosed();
|
---|
73 | #ifndef RT_OS_DARWIN
|
---|
74 | /** Toggles menu-bar presence.*/
|
---|
75 | void sltToggleMenuBar();
|
---|
76 | #endif /* !RT_OS_DARWIN */
|
---|
77 |
|
---|
78 | /** Opens status-bar editor.*/
|
---|
79 | void sltOpenStatusBarSettings();
|
---|
80 | /** Handles status-bar editor closing.*/
|
---|
81 | void sltStatusBarSettingsClosed();
|
---|
82 | /** Toggles status-bar presence.*/
|
---|
83 | void sltToggleStatusBar();
|
---|
84 |
|
---|
85 | /** Handles host-screen available-area change. */
|
---|
86 | virtual void sltHostScreenAvailableAreaChange() RT_OVERRIDE;
|
---|
87 |
|
---|
88 | private:
|
---|
89 |
|
---|
90 | /* Prepare helpers: */
|
---|
91 | virtual void prepareActionGroups() RT_OVERRIDE;
|
---|
92 | void prepareActionConnections() RT_OVERRIDE;
|
---|
93 | void prepareMachineWindows() RT_OVERRIDE;
|
---|
94 | #ifndef VBOX_WS_MAC
|
---|
95 | void prepareMenu() RT_OVERRIDE RT_FINAL;
|
---|
96 | #endif /* !VBOX_WS_MAC */
|
---|
97 |
|
---|
98 | /* Cleanup helpers: */
|
---|
99 | #ifndef VBOX_WS_MAC
|
---|
100 | void cleanupMenu() RT_OVERRIDE RT_FINAL;
|
---|
101 | #endif /* !VBOX_WS_MAC */
|
---|
102 | void cleanupMachineWindows() RT_OVERRIDE;
|
---|
103 | void cleanupActionConnections() RT_OVERRIDE;
|
---|
104 |
|
---|
105 | #ifndef VBOX_WS_MAC
|
---|
106 | /** Holds the popup-menu instance. */
|
---|
107 | QMenu *m_pPopupMenu;
|
---|
108 | #endif /* !VBOX_WS_MAC */
|
---|
109 | };
|
---|
110 |
|
---|
111 | #endif /* !FEQT_INCLUDED_SRC_runtime_normal_UIMachineLogicNormal_h */
|
---|