VirtualBox

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

Last change on this file was 106061, checked in by vboxsync, 3 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1/* $Id: UIMachineLogicSeamless.h 106061 2024-09-16 14:03:52Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMachineLogicSeamless 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_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 RT_OVERRIDE { 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() RT_OVERRIDE;
65
66 /** Returns machine-window flags for 'Seamless' machine-logic and passed @a uScreenId. */
67 virtual Qt::WindowFlags windowFlags(ulong uScreenId) const RT_OVERRIDE { Q_UNUSED(uScreenId); return Qt::FramelessWindowHint; }
68
69 /** Adjusts machine-window geometry if necessary for 'Seamless'. */
70 virtual void adjustMachineWindowsGeometry() RT_OVERRIDE;
71
72private slots:
73
74 /** Checks if some visual-state type was requested. */
75 void sltCheckForRequestedVisualStateType() RT_OVERRIDE;
76
77 /* Handler: Console callback stuff: */
78 void sltMachineStateChanged() RT_OVERRIDE;
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) RT_OVERRIDE;
85 /** Handles host-screen count change. */
86 virtual void sltHostScreenCountChange() RT_OVERRIDE;
87 /** Handles additions-state change. */
88 virtual void sltAdditionsStateChanged() RT_OVERRIDE;
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() RT_OVERRIDE;
99 void prepareActionConnections() RT_OVERRIDE;
100 void prepareMachineWindows() RT_OVERRIDE;
101#ifndef VBOX_WS_MAC
102 void prepareMenu() RT_OVERRIDE RT_FINAL;
103#endif /* !VBOX_WS_MAC */
104
105 /* Cleanup helpers: */
106#ifndef VBOX_WS_MAC
107 void cleanupMenu() RT_OVERRIDE RT_FINAL;
108#endif /* !VBOX_WS_MAC */
109 void cleanupMachineWindows() RT_OVERRIDE;
110 void cleanupActionConnections() RT_OVERRIDE;
111 void cleanupActionGroups() RT_OVERRIDE;
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.

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