UISession.h revision 4bc74a1db929517da626b12e61cc468fa0947927
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * VBox frontends: Qt GUI ("VirtualBox"):
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * UISession class declaration
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * Copyright (C) 2010 Oracle Corporation
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/* Global includes */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* Local includes */
0ae258e7d0d2520036514d896a9eea58bf285f03vboxsync/* Global forwards */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* Local forwards */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* CConsole callback event types: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_MousePointerShapeChange = QEvent::User + 1,
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: UIConsoleEventType_SerialPortChange, */
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: UIConsoleEventType_ParallelPortChange, */
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: UIConsoleEventType_StorageControllerChange, */
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: UIConsoleEventType_CPUChange, */
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync /* Machine uisession constructor/destructor: */
d9d070cfd2c99624fe6974842b7ad4a30d5b71e7vboxsync /* Common members: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync KMachineState machineState() const { return m_machineState; }
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync QMenu* newMenu(UIMainMenuType fOptions = UIMainMenuType_All);
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync QMenuBar* newMenuBar(UIMainMenuType fOptions = UIMainMenuType_All);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isSaved() const { return machineState() == KMachineState_Saved; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isTurnedOff() const { return machineState() == KMachineState_PoweredOff ||
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync 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; }
00c120c036112e6430a84cb41ddc3e847ba1e9e2vboxsync bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRuntimeMediumsChanging; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
83ee0b9fd6aa227bf4276f9d41af7ef59c03e8eevboxsync bool isSeamlessModeRequested() const { return m_fIsSeamlessModeRequested; }
6361862f262bb5f90ed82f2a6e926c35bfa9cf18vboxsync bool isAutoCaptureDisabled() const { return m_fIsAutoCaptureDisabled; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Guest additions state getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isGuestAdditionsActive() const { return m_fIsGuestAdditionsActive; }
e99106e1706f8e87456f34b22c40becae61e1ed0vboxsync bool isGuestSupportsGraphics() const { return isGuestAdditionsActive() && m_fIsGuestSupportsGraphics; }
e99106e1706f8e87456f34b22c40becae61e1ed0vboxsync bool isGuestSupportsSeamless() const { return isGuestSupportsGraphics() && m_fIsGuestSupportsSeamless; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Keyboard getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isScrollLock() const { return m_fScrollLock; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync uint numLockAdaptionCnt() const { return m_uNumLockAdaptionCnt; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync 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; }
08640b1dc58f26140fca6525ced3dbdef4ce45f7vboxsync bool isValidPointerShapePresent() const { return m_fIsValidPointerShapePresent; }
770da3dbb247278c98d1b21d2e11a0a7769131a4vboxsync bool isHidingHostPointer() const { return m_fIsHidingHostPointer; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common setters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; }
83ee0b9fd6aa227bf4276f9d41af7ef59c03e8eevboxsync void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; }
6361862f262bb5f90ed82f2a6e926c35bfa9cf18vboxsync void setAutoCaptureDisabled(bool fIsAutoCaptureDisabled) { m_fIsAutoCaptureDisabled = fIsAutoCaptureDisabled; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Keyboard setters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setNumLockAdaptionCnt(uint uNumLockAdaptionCnt) { m_uNumLockAdaptionCnt = uNumLockAdaptionCnt; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setCapsLockAdaptionCnt(uint uCapsLockAdaptionCnt) { m_uCapsLockAdaptionCnt = uCapsLockAdaptionCnt; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Mouse setters: */
4bc74a1db929517da626b12e61cc468fa0947927vboxsync void setMouseCaptured(bool fIsMouseCaptured) { m_fIsMouseCaptured = fIsMouseCaptured; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setMouseIntegrated(bool fIsMouseIntegrated) { m_fIsMouseIntegrated = fIsMouseIntegrated; }
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync /* return a persisted framebuffer for the given screen
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync * see comment below for the m_FrameBufferVector field */
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync /* @return VINF_SUCCESS - on success
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync * VERR_INVALID_PARAMETER - if screenId is invalid */
40b38a663dc0fd3003f7cdb0a69a01959d79b1f0vboxsync int setFrameBuffer(ulong screenId, UIFrameBuffer* pFrameBuffer);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Console callback signals: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigNetworkAdapterChange(const CNetworkAdapter &networkAdapter);
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: void sigSerialPortChange(const CSerialPort &serialPort); */
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: void sigParallelPortChange(const CParallelPort ¶llelPort); */
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: void sigStorageControllerChange(); */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigMediumChange(const CMediumAttachment &mediumAttachment);
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: void sigCPUChange(ulong uCPU, bool bRemove); */
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: void sigVRDPServerChange(); */
22500d40977b2e17949f8598de4f3c6d59ab405avboxsync /* Not used: void sigRemoteDisplayInfoChange(); */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigUSBDeviceStateChange(const CUSBDevice &device, bool bIsAttached, const CVirtualBoxErrorInfo &error);
374979da4e9440f386798bce28aa9165f3fb5e3avboxsync void sigRuntimeError(bool bIsFatal, const QString &strErrorId, const QString &strMessage);
303ea6bb23384a122bac365c48db3dc4971cf9b1vboxsync#endif /* RT_OS_DARWIN */
24ecfcc82c2eecb44373198021e69229e1c66490vboxsync /* Session signals: */
0019a5195e700f7380e64717fcb10e1ce0fcfd91vboxsync void sltInstallGuestAdditionsFrom(const QString &strSource);
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync /* Close uisession handler: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Private getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync UIMachine* uimachine() const { return m_pMachine; }
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Event handlers: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Prepare helpers: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Cleanup helpers: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common helpers: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setPointerShape(const uchar *pShapeData, bool fHasAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Private variables: */
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync /* When 2D is enabled we do not re-create Framebuffers. This is done
40b38a663dc0fd3003f7cdb0a69a01959d79b1f0vboxsync * 1. to avoid 2D command loss during the time slot when no framebuffer is
40b38a663dc0fd3003f7cdb0a69a01959d79b1f0vboxsync * assigned to the display
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync * 2. to make it easier to preserve the current 2D state */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common variables: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Guest additions flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Keyboard flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Mouse flags: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Friend classes: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync#endif // !___UIConsole_h___