UISession.h revision 9161d9a8318db73b2848c1feaef3880980474e64
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * VBox frontends: Qt GUI ("VirtualBox"):
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * UISession class declaration
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync * Copyright (C) 2010 Sun Microsystems, Inc.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * available from http://www.virtualbox.org. This file is free software;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * General Public License (GPL) as published by the Free Software
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * additional information or have any questions.
8bf8c6b1914c9e7e60b1547888400668f1774497vboxsync/* Global includes */
8bf8c6b1914c9e7e60b1547888400668f1774497vboxsync/* Local includes */
0ae258e7d0d2520036514d896a9eea58bf285f03vboxsync/* Global forwards */
39345dfec876ad123c6e787de90ad83089441794vboxsync/* Local forwards */
9161d9a8318db73b2848c1feaef3880980474e64vboxsync/* CConsole callback event types: */
8bf8c6b1914c9e7e60b1547888400668f1774497vboxsync UIConsoleEventType_MousePointerShapeChange = QEvent::User + 1,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Machine uisession constructor/destructor: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Common members: */
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync /* Common getters: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync KMachineState machineState() const { return m_machineState; }
d9d070cfd2c99624fe6974842b7ad4a30d5b71e7vboxsync QMenu* newMenu(UIMainMenuType fOptions = UIMainMenuType_All);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync QMenuBar* newMenuBar(UIMainMenuType fOptions = UIMainMenuType_All);
9161d9a8318db73b2848c1feaef3880980474e64vboxsync bool isSaved() const { return machineState() == KMachineState_Saved; }
2bb5e094693f5a82438792bb7946cee00db72f66vboxsync bool isTurnedOff() const { return machineState() == KMachineState_PoweredOff ||
04e845ee9ef813501cd2570a4188cb852d170408vboxsync bool isPaused() const { return machineState() == KMachineState_Paused ||
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync machineState() == KMachineState_TeleportingPausedVM; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isRunning() const { return machineState() == KMachineState_Running ||
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync machineState() == KMachineState_LiveSnapshotting; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isFirstTimeStarted() const { return m_fIsFirstTimeStarted; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRutimeMediumsChanging; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isSeamlessModeRequested() const { return m_fIsSeamlessModeRequested; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Guest additions state getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isGuestAdditionsActive() const { return m_fIsGuestAdditionsActive; }
00c120c036112e6430a84cb41ddc3e847ba1e9e2vboxsync bool isGuestSupportsGraphics() const { return isGuestAdditionsActive() && m_fIsGuestSupportsGraphics; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isGuestSupportsSeamless() const { return isGuestSupportsGraphics() && m_fIsGuestSupportsSeamless; }
6361862f262bb5f90ed82f2a6e926c35bfa9cf18vboxsync /* Keyboard getters: */
08de95260e5829c72e66326016c7e2fc861d9f26vboxsync bool isScrollLock() const { return m_fScrollLock; }
e99106e1706f8e87456f34b22c40becae61e1ed0vboxsync uint numLockAdaptionCnt() const { return m_uNumLockAdaptionCnt; }
e99106e1706f8e87456f34b22c40becae61e1ed0vboxsync uint capsLockAdaptionCnt() const { return m_uCapsLockAdaptionCnt; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Mouse getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isMouseSupportsAbsolute() const { return m_fIsMouseSupportsAbsolute; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isMouseSupportsRelative() const { return m_fIsMouseSupportsRelative; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isMouseHostCursorNeeded() const { return m_fIsMouseHostCursorNeeded; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isMouseCaptured() const { return m_fIsMouseCaptured; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isMouseIntegrated() const { return m_fIsMouseIntegrated; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isValidPointerShapePresent() const { return m_fIsValidPointerShapePresent; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isHidingHostPointer() const { return m_fIsHidingHostPointer; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common setters: */
08640b1dc58f26140fca6525ced3dbdef4ce45f7vboxsync void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; }
770da3dbb247278c98d1b21d2e11a0a7769131a4vboxsync void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Keyboard setters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setNumLockAdaptionCnt(uint uNumLockAdaptionCnt) { m_uNumLockAdaptionCnt = uNumLockAdaptionCnt; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setCapsLockAdaptionCnt(uint uCapsLockAdaptionCnt) { m_uCapsLockAdaptionCnt = uCapsLockAdaptionCnt; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Mouse setters: */
83ee0b9fd6aa227bf4276f9d41af7ef59c03e8eevboxsync void setMouseCaptured(bool fIsMouseCaptured) { m_fIsMouseCaptured = fIsMouseCaptured; emit sigMouseCapturedStatusChanged(); }
6361862f262bb5f90ed82f2a6e926c35bfa9cf18vboxsync void setMouseIntegrated(bool fIsMouseIntegrated) { m_fIsMouseIntegrated = fIsMouseIntegrated; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* return a persisted framebuffer for the given screen
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync * see comment below for the m_FrameBufferVector field */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* @return VINF_SUCCESS - on success
4bc74a1db929517da626b12e61cc468fa0947927vboxsync * VERR_INVALID_PARAMETER - if screenId is invalid */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync int setFrameBuffer(ulong screenId, UIFrameBuffer* pFrameBuffer);
41f11838cf4a7f490889239ae52b83c27830c52bvboxsync /* Console callback signals: */
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync void sigNetworkAdapterChange(const CNetworkAdapter &networkAdapter);
ddfcbd0a2ee61ce75ecc10a6001d5d834893bf8fvboxsync void sigSerialPortChange(const CSerialPort &serialPort);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigParallelPortChange(const CParallelPort ¶llelPort);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void sigMediumChange(const CMediumAttachment &mediumAttachment);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigUSBDeviceStateChange(const CUSBDevice &device, bool bIsAttached, const CVirtualBoxErrorInfo &error);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigRuntimeError(bool bIsFatal, const QString &strErrorId, const QString &strMessage);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Session signals: */
303ea6bb23384a122bac365c48db3dc4971cf9b1vboxsync void sltInstallGuestAdditionsFrom(const QString &strSource);
24ecfcc82c2eecb44373198021e69229e1c66490vboxsync /* Close uisession handler: */
0019a5195e700f7380e64717fcb10e1ce0fcfd91vboxsync /* Private getters: */
0019a5195e700f7380e64717fcb10e1ce0fcfd91vboxsync UIMachine* uimachine() const { return m_pMachine; }
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync /* Event handlers: */
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync /* Prepare helpers: */
346af0930020342df40a1ca8d13eb185ad48067evboxsync /* Cleanup helpers: */
346af0930020342df40a1ca8d13eb185ad48067evboxsync /* Common helpers: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void setPointerShape(const uchar *pShapeData, bool fHasAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Private variables: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* When 2D is enabled we do not re-create Framebuffers. This is done
83fd17a3a00dc7bf6a36e23bbd2393dfc953da06vboxsync * 1. to avoid 2D command loss during the time slot when no framebuffer is
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync * assigned to the display
41f11838cf4a7f490889239ae52b83c27830c52bvboxsync * 2. to make it easier to preserve the current 2D state */
224edf755dff839a1896d3930ea7627f69eb0d9fvboxsync /* Common variables: */
341c5004a837c62a8a12ec854b0f75cf7ffc15eavboxsync /* Common flags: */
83fd17a3a00dc7bf6a36e23bbd2393dfc953da06vboxsync /* Guest additions flags: */
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync /* Keyboard flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Mouse flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Friend classes: */
0229ec87789aab83ed0595b9ad5151351778e2cfvboxsync#endif // !___UIConsole_h___