UISession.h revision 2bb5e094693f5a82438792bb7946cee00db72f66
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * VBox frontends: Qt GUI ("VirtualBox"):
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * UISession class declaration
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync * Copyright (C) 2010-2012 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 */
39345dfec876ad123c6e787de90ad83089441794vboxsync# else /* Q_WS_MAC */
39345dfec876ad123c6e787de90ad83089441794vboxsync# endif /* !Q_WS_MAC */
341c5004a837c62a8a12ec854b0f75cf7ffc15eavboxsync#endif /* VBOX_GUI_WITH_KEYS_RESET_HANDLER */
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: */
08de95260e5829c72e66326016c7e2fc861d9f26vboxsync bool isGuestAdditionsActive() const { return (m_ulGuestAdditionsRunLevel > AdditionsRunLevelType_None); }
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; }
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync /* Returns existing framebuffer for the given screen-number;
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync * Returns 0 (asserts) if screen-number attribute is out of bounds: */
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync /* Sets framebuffer for the given screen-number;
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync * Ignores (asserts) if screen-number attribute is out of bounds: */
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync void setFrameBuffer(ulong uScreenId, UIFrameBuffer* pFrameBuffer);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Console callback signals: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigNetworkAdapterChange(const CNetworkAdapter &networkAdapter);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigMediumChange(const CMediumAttachment &mediumAttachment);
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 */
19a29c5b8ea65c618ae3825b6cf84bc3688a36b0vboxsync void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
24ecfcc82c2eecb44373198021e69229e1c66490vboxsync /* Session signals: */
0019a5195e700f7380e64717fcb10e1ce0fcfd91vboxsync void sltInstallGuestAdditionsFrom(const QString &strSource);
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync /* Close uisession handler: */
346af0930020342df40a1ca8d13eb185ad48067evboxsync /* Console events slots */
346af0930020342df40a1ca8d13eb185ad48067evboxsync void sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape);
346af0930020342df40a1ca8d13eb185ad48067evboxsync void sltMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative, bool fNeedsHostCursor);
346af0930020342df40a1ca8d13eb185ad48067evboxsync void sltKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Private getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync UIMachine* uimachine() const { return m_pMachine; }
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);
341c5004a837c62a8a12ec854b0f75cf7ffc15eavboxsync static void signalHandlerSIGUSR1(int sig, siginfo_t *pInfo, void *pSecret);
341c5004a837c62a8a12ec854b0f75cf7ffc15eavboxsync#endif /* VBOX_GUI_WITH_KEYS_RESET_HANDLER */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Private variables: */
495d29c29d5aeaf966ec9e7148631e751c1862d1vboxsync /* Frame-buffers vector: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common variables: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Guest additions flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Keyboard flags: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Mouse flags: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Friend classes: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync#endif // !___UIConsole_h___