UISession.h revision 8bf8c6b1914c9e7e60b1547888400668f1774497
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * VBox frontends: Qt GUI ("VirtualBox"):
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * UISession class declaration
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * 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/* Qt includes: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* GUI includes: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* COM includes: */
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync/* Forward declarations: */
04e845ee9ef813501cd2570a4188cb852d170408vboxsync# else /* Q_WS_MAC */
0019a5195e700f7380e64717fcb10e1ce0fcfd91vboxsync# endif /* !Q_WS_MAC */
9161d9a8318db73b2848c1feaef3880980474e64vboxsync#endif /* VBOX_GUI_WITH_KEYS_RESET_HANDLER */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* CConsole callback event types: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_MousePointerShapeChange = QEvent::User + 1,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Not used: UIConsoleEventType_SerialPortChange, */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Not used: UIConsoleEventType_ParallelPortChange, */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Not used: UIConsoleEventType_StorageControllerChange, */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Not used: UIConsoleEventType_CPUChange, */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Machine uisession constructor/destructor: */
d9d070cfd2c99624fe6974842b7ad4a30d5b71e7vboxsync /* Common members: */
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync /* Common getters: */
04e845ee9ef813501cd2570a4188cb852d170408vboxsync KMachineState machineState() const { return m_machineState; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync QMenu* newMenu(UIMainMenuType fOptions = UIMainMenuType_All);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync 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; }
83ee0b9fd6aa227bf4276f9d41af7ef59c03e8eevboxsync bool isRunning() const { return machineState() == KMachineState_Running ||
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync machineState() == KMachineState_LiveSnapshotting; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isFirstTimeStarted() const { return m_fIsFirstTimeStarted; }
e99106e1706f8e87456f34b22c40becae61e1ed0vboxsync bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRuntimeMediumsChanging; }
e99106e1706f8e87456f34b22c40becae61e1ed0vboxsync bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isSeamlessModeRequested() const { return m_fIsSeamlessModeRequested; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isAutoCaptureDisabled() const { return m_fIsAutoCaptureDisabled; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Guest additions state getters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isGuestAdditionsActive() const { return (m_ulGuestAdditionsRunLevel > AdditionsRunLevelType_None); }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync bool isGuestSupportsGraphics() const { return isGuestAdditionsActive() && m_fIsGuestSupportsGraphics; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync 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; }
770da3dbb247278c98d1b21d2e11a0a7769131a4vboxsync /* 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; }
83ee0b9fd6aa227bf4276f9d41af7ef59c03e8eevboxsync bool isHidingHostPointer() const { return m_fIsHidingHostPointer; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common setters: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; }
24ecfcc82c2eecb44373198021e69229e1c66490vboxsync void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; }
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setAutoCaptureDisabled(bool fIsAutoCaptureDisabled) { m_fIsAutoCaptureDisabled = fIsAutoCaptureDisabled; }
ddfcbd0a2ee61ce75ecc10a6001d5d834893bf8fvboxsync /* Keyboard setters: */
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync void setNumLockAdaptionCnt(uint uNumLockAdaptionCnt) { m_uNumLockAdaptionCnt = uNumLockAdaptionCnt; }
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync void setCapsLockAdaptionCnt(uint uCapsLockAdaptionCnt) { m_uCapsLockAdaptionCnt = uCapsLockAdaptionCnt; }
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync /* Mouse setters: */
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync void setMouseCaptured(bool fIsMouseCaptured) { m_fIsMouseCaptured = fIsMouseCaptured; }
40b38a663dc0fd3003f7cdb0a69a01959d79b1f0vboxsync void setMouseIntegrated(bool fIsMouseIntegrated) { m_fIsMouseIntegrated = fIsMouseIntegrated; }
ddfcbd0a2ee61ce75ecc10a6001d5d834893bf8fvboxsync /* Screen visibility status: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void setScreenVisible(ulong uScreenId, bool fIsMonitorVisible);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Returns existing framebuffer for the given screen-number;
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync * Returns 0 (asserts) if screen-number attribute is out of bounds: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Sets framebuffer for the given screen-number;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * Ignores (asserts) if screen-number attribute is out of bounds: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void setFrameBuffer(ulong uScreenId, UIFrameBuffer* pFrameBuffer);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Console callback signals: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigNetworkAdapterChange(const CNetworkAdapter &networkAdapter);
374979da4e9440f386798bce28aa9165f3fb5e3avboxsync void sigMediumChange(const CMediumAttachment &mediumAttachment);
d9d070cfd2c99624fe6974842b7ad4a30d5b71e7vboxsync void sigUSBDeviceStateChange(const CUSBDevice &device, bool bIsAttached, const CVirtualBoxErrorInfo &error);
24ecfcc82c2eecb44373198021e69229e1c66490vboxsync void sigRuntimeError(bool bIsFatal, const QString &strErrorId, const QString &strMessage);
0019a5195e700f7380e64717fcb10e1ce0fcfd91vboxsync#endif /* RT_OS_DARWIN */
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync /* Session signals: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sltInstallGuestAdditionsFrom(const QString &strSource);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Close uisession handler: */
83fd17a3a00dc7bf6a36e23bbd2393dfc953da06vboxsync /* Console events slots */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void sltMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative, bool fNeedsHostCursor);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void sltKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
83fd17a3a00dc7bf6a36e23bbd2393dfc953da06vboxsync /* Private getters: */
d9d070cfd2c99624fe6974842b7ad4a30d5b71e7vboxsync UIMachine* uimachine() const { return m_pMachine; }
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Prepare helpers: */
ddfcbd0a2ee61ce75ecc10a6001d5d834893bf8fvboxsync /* Cleanup helpers: */
72bb582308f9b6953c65b8b8807597dbef848b16vboxsync //void cleanupSession() {}
ddfcbd0a2ee61ce75ecc10a6001d5d834893bf8fvboxsync /* Common helpers: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void setPointerShape(const uchar *pShapeData, bool fHasAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync static void signalHandlerSIGUSR1(int sig, siginfo_t *pInfo, void *pSecret);
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync#endif /* VBOX_GUI_WITH_KEYS_RESET_HANDLER */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Private variables: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Screen visibility vector: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Frame-buffers vector: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common variables: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync /* Common flags: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Guest additions flags: */