a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync/** @file
c7769c4b7e84511fcc4a12a85a04dd7fbfd82b46vboxsync * VBox Qt GUI - UIMachineLogicSeamless class declaration.
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync/*
30e185f304c70c0fc7538446c4f3b840e76e2590vboxsync * Copyright (C) 2010-2013 Oracle Corporation
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync *
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync * available from http://www.virtualbox.org. This file is free software;
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync * you can redistribute it and/or modify it under the terms of the GNU
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync * General Public License (GPL) as published by the Free Software
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
c7769c4b7e84511fcc4a12a85a04dd7fbfd82b46vboxsync#ifndef ___UIMachineLogicSeamless_h___
c7769c4b7e84511fcc4a12a85a04dd7fbfd82b46vboxsync#define ___UIMachineLogicSeamless_h___
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
e1ffd6bf06692ce47c4407230443e27cf5e23e4fvboxsync/* Local includes: */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync#include "UIMachineLogic.h"
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
e1ffd6bf06692ce47c4407230443e27cf5e23e4fvboxsync/* Forward declarations: */
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsyncclass UIMultiScreenLayout;
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
e1ffd6bf06692ce47c4407230443e27cf5e23e4fvboxsync/* Seamless machine logic implementation: */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsyncclass UIMachineLogicSeamless : public UIMachineLogic
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync{
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync Q_OBJECT;
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsyncprotected:
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
e1ffd6bf06692ce47c4407230443e27cf5e23e4fvboxsync /* Constructor/destructor: */
e1ffd6bf06692ce47c4407230443e27cf5e23e4fvboxsync UIMachineLogicSeamless(QObject *pParent, UISession *pSession);
30e185f304c70c0fc7538446c4f3b840e76e2590vboxsync ~UIMachineLogicSeamless();
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
e1ffd6bf06692ce47c4407230443e27cf5e23e4fvboxsync /* Check if this logic is available: */
6790bfa163a2b9f89bb950cefaab3e1d8fa4ddc2vboxsync bool checkAvailability();
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
cc5d7bee9ec00cd90fd28108739e683e47f48116vboxsync /** Returns machine-window flags for 'Seamless' machine-logic and passed @a uScreenId. */
cc5d7bee9ec00cd90fd28108739e683e47f48116vboxsync virtual Qt::WindowFlags windowFlags(ulong uScreenId) const { Q_UNUSED(uScreenId); return Qt::FramelessWindowHint; }
cc5d7bee9ec00cd90fd28108739e683e47f48116vboxsync
63053bf6ac5b4b7ea12b8d049180069e14f35d04vboxsync /** Adjusts machine-window geometry if necessary for 'Seamless'. */
63053bf6ac5b4b7ea12b8d049180069e14f35d04vboxsync virtual void adjustMachineWindowsGeometry();
63053bf6ac5b4b7ea12b8d049180069e14f35d04vboxsync
67d8048258ab7e245a0b2b6b759df0175ffab9a0vboxsync /* Helpers: Multi-screen stuff: */
30e185f304c70c0fc7538446c4f3b840e76e2590vboxsync int hostScreenForGuestScreen(int iScreenId) const;
16afd2d976f255ed0b7b443770e4fa93fb4847d1vboxsync bool hasHostScreenForGuestScreen(int iScreenId) const;
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync
6211aeccb73482a7f58316433f2288901ebc7dbavboxsync /* API: 3D overlay visibility stuff: */
6211aeccb73482a7f58316433f2288901ebc7dbavboxsync void notifyAbout3DOverlayVisibilityChange(bool fVisible);
6211aeccb73482a7f58316433f2288901ebc7dbavboxsync
95d93b11104612f4dd9a9aefad24a1a7b7bf82b8vboxsyncprivate slots:
95d93b11104612f4dd9a9aefad24a1a7b7bf82b8vboxsync
f979659894ba6ea0f1a467c7c21ca6f20062caafvboxsync /** Checks if some visual-state type was requested. */
f979659894ba6ea0f1a467c7c21ca6f20062caafvboxsync void sltCheckForRequestedVisualStateType();
f979659894ba6ea0f1a467c7c21ca6f20062caafvboxsync
74e03e3bff53d9ff9b266e0a8af97f59d54f4e23vboxsync /* Handler: Console callback stuff: */
74e03e3bff53d9ff9b266e0a8af97f59d54f4e23vboxsync void sltMachineStateChanged();
74e03e3bff53d9ff9b266e0a8af97f59d54f4e23vboxsync
c565a18412d9fa8fb4213dec5337ff9cc365ac6avboxsync /** Updates machine-window(s) location/size on screen-layout changes. */
c565a18412d9fa8fb4213dec5337ff9cc365ac6avboxsync void sltScreenLayoutChanged();
c565a18412d9fa8fb4213dec5337ff9cc365ac6avboxsync
f357d92e6a0d09e1d7be73372b322b75da6b3496vboxsync /** Handles guest-screen count change. */
f357d92e6a0d09e1d7be73372b322b75da6b3496vboxsync virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
f357d92e6a0d09e1d7be73372b322b75da6b3496vboxsync /** Handles host-screen count change. */
f357d92e6a0d09e1d7be73372b322b75da6b3496vboxsync virtual void sltHostScreenCountChange();
95d93b11104612f4dd9a9aefad24a1a7b7bf82b8vboxsync
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync#ifndef RT_OS_DARWIN
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync /** Invokes popup-menu. */
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync void sltInvokePopupMenu();
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync#endif /* !RT_OS_DARWIN */
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsyncprivate:
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync /* Prepare helpers: */
6790bfa163a2b9f89bb950cefaab3e1d8fa4ddc2vboxsync void prepareActionGroups();
c7769c4b7e84511fcc4a12a85a04dd7fbfd82b46vboxsync void prepareActionConnections();
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync void prepareMachineWindows();
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync#ifndef Q_WS_MAC
7b601f6c4b83b7e3a0f58a62b198352048c6f7c3vboxsync void prepareMenu();
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync#endif /* !Q_WS_MAC */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync /* Cleanup helpers: */
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync#ifndef Q_WS_MAC
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync void cleanupMenu();
236f71c54929e835b07c91ace8d7009beb6bf4bdvboxsync#endif /* !Q_WS_MAC */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync void cleanupMachineWindows();
c7769c4b7e84511fcc4a12a85a04dd7fbfd82b46vboxsync void cleanupActionConnections();
6790bfa163a2b9f89bb950cefaab3e1d8fa4ddc2vboxsync void cleanupActionGroups();
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
30e185f304c70c0fc7538446c4f3b840e76e2590vboxsync /* Variables: */
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync UIMultiScreenLayout *m_pScreenLayout;
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync#ifndef RT_OS_DARWIN
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync /** Holds the popup-menu instance. */
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync QMenu *m_pPopupMenu;
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync#endif /* !RT_OS_DARWIN */
4759f52dfc0c5362f3cf176490786142d85a73e9vboxsync
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync /* Friend classes: */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync friend class UIMachineLogic;
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync friend class UIMachineWindowSeamless;
05e698791961dae5d0330f0be614211cefdc3b8evboxsync friend class UIMachineViewSeamless;
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync};
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync
c7769c4b7e84511fcc4a12a85a04dd7fbfd82b46vboxsync#endif /* !___UIMachineLogicSeamless_h___ */
a4b605335b7e6a6ba6d5a301bc96de0e89e4b663vboxsync