VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h@ 98451

Last change on this file since 98451 was 98451, checked in by vboxsync, 2 years ago

FE/Qt: bugref:10322: Runtime UI: Cleanup for UISession stuff across whole the Runtime UI; Removing where it's possible.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: UIMachineLogicSeamless.h 98451 2023-02-02 15:47:01Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMachineLogicSeamless 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_seamless_UIMachineLogicSeamless_h
29#define FEQT_INCLUDED_SRC_runtime_seamless_UIMachineLogicSeamless_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UIMachineLogic.h"
36
37/* Forward declarations: */
38class UIMultiScreenLayout;
39
40/** UIMachineLogic subclass used as seamless machine logic implementation. */
41class UIMachineLogicSeamless : public UIMachineLogic
42{
43 Q_OBJECT;
44
45public:
46
47 /** Constructs a logic passing @a pMachine and @a pSession to the base-class.
48 * @param pMachine Brings the machine this logic belongs to. */
49 UIMachineLogicSeamless(UIMachine *pMachine);
50 /** Destructs the logic. */
51 virtual ~UIMachineLogicSeamless() RT_OVERRIDE;
52
53 /** Returns visual state type. */
54 virtual UIVisualStateType visualStateType() const { return UIVisualStateType_Seamless; }
55
56 /** Returns an index of host-screen for guest-screen with @a iScreenId specified. */
57 int hostScreenForGuestScreen(int iScreenId) const;
58 /** Returns whether there is a host-screen for guest-screen with @a iScreenId specified. */
59 bool hasHostScreenForGuestScreen(int iScreenId) const;
60
61protected:
62
63 /* Check if this logic is available: */
64 bool checkAvailability();
65
66 /** Returns machine-window flags for 'Seamless' machine-logic and passed @a uScreenId. */
67 virtual Qt::WindowFlags windowFlags(ulong uScreenId) const { Q_UNUSED(uScreenId); return Qt::FramelessWindowHint; }
68
69 /** Adjusts machine-window geometry if necessary for 'Seamless'. */
70 virtual void adjustMachineWindowsGeometry();
71
72private slots:
73
74 /** Checks if some visual-state type was requested. */
75 void sltCheckForRequestedVisualStateType();
76
77 /* Handler: Console callback stuff: */
78 void sltMachineStateChanged();
79
80 /** Updates machine-window(s) location/size on screen-layout changes. */
81 void sltScreenLayoutChanged();
82
83 /** Handles guest-screen count change. */
84 virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
85 /** Handles host-screen count change. */
86 virtual void sltHostScreenCountChange();
87 /** Handles additions-state change. */
88 virtual void sltAdditionsStateChanged();
89
90#ifndef RT_OS_DARWIN
91 /** Invokes popup-menu. */
92 void sltInvokePopupMenu();
93#endif /* !RT_OS_DARWIN */
94
95private:
96
97 /* Prepare helpers: */
98 void prepareActionGroups();
99 void prepareActionConnections();
100 void prepareMachineWindows();
101#ifndef VBOX_WS_MAC
102 void prepareMenu();
103#endif /* !VBOX_WS_MAC */
104
105 /* Cleanup helpers: */
106#ifndef VBOX_WS_MAC
107 void cleanupMenu();
108#endif /* !VBOX_WS_MAC */
109 void cleanupMachineWindows();
110 void cleanupActionConnections();
111 void cleanupActionGroups();
112
113 /* Variables: */
114 UIMultiScreenLayout *m_pScreenLayout;
115
116#ifndef RT_OS_DARWIN
117 /** Holds the popup-menu instance. */
118 QMenu *m_pPopupMenu;
119#endif /* !RT_OS_DARWIN */
120};
121
122#endif /* !FEQT_INCLUDED_SRC_runtime_seamless_UIMachineLogicSeamless_h */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette