UISession.h revision 374979da4e9440f386798bce28aa9165f3fb5e3a
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/** @file
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync *
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * VBox frontends: Qt GUI ("VirtualBox"):
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * UISession class declaration
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/*
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync * Copyright (C) 2010 Sun Microsystems, Inc.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync *
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 *
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.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync#ifndef ___UIConsole_h___
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync#define ___UIConsole_h___
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* Global includes */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync#include <QObject>
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* Local includes */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync#include "COMDefs.h"
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* Local forwards */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncclass UIMachine;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncclass UIConsoleCallback;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync/* CConsole callback event types: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncenum UIConsoleEventType
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync{
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_MousePointerShapeChange = QEvent::User + 1,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_MouseCapabilityChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_KeyboardLedsChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_StateChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_AdditionsStateChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_NetworkAdapterChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_SerialPortChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_ParallelPortChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_StorageControllerChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_MediumChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_CPUChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_VRDPServerChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_RemoteDisplayInfoChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_USBControllerChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_USBDeviceStateChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_SharedFolderChange,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_RuntimeError,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_CanShowWindow,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_ShowWindow,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleEventType_MAX
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync};
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncclass UISession : public QObject
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync{
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync Q_OBJECT;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncpublic:
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Machine session constructor/destructor: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UISession(UIMachine *pMachine, const CSession &session);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync virtual ~UISession();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Public getters: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync CSession& session() { return m_session; }
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncsignals:
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Console signals: */
374979da4e9440f386798bce28aa9165f3fb5e3avboxsync void sigMousePointerShapeChange(bool bIsVisible, bool bHasAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, const uchar *pShapeData);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigMouseCapabilityChange(bool bIsSupportsAbsolute, bool bNeedsHostCursor);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigKeyboardLedsChange(bool bNumLock, bool bCapsLock, bool bScrollLock);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigStateChange(KMachineState machineState);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigAdditionsStateChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigNetworkAdapterChange(const CNetworkAdapter &networkAdapter);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigSerialPortChange(const CSerialPort &serialPort);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigParallelPortChange(const CParallelPort &parallelPort);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigStorageControllerChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigMediumChange(const CMediumAttachment &mediumAttachment);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigCPUChange(ulong uCPU, bool bRemove);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigVRDPServerChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigRemoteDisplayInfoChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigUSBControllerChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigUSBDeviceStateChange(const CUSBDevice &device, bool bIsAttached, const CVirtualBoxErrorInfo &error);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sigSharedFolderChange();
374979da4e9440f386798bce28aa9165f3fb5e3avboxsync void sigRuntimeError(bool bIsFatal, const QString &strErrorId, const QString &strMessage);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncprivate:
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Private getters: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIMachine* machine() const { return m_pMachine; }
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Event handlers: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync bool event(QEvent *pEvent);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Helper routines: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync qulonglong winId() const;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Private variables: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIMachine *m_pMachine;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync CSession m_session;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync UIConsoleCallback *m_pCallback;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync const CConsoleCallback &m_callback;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync /* Friend classes: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync friend class UIConsoleCallback;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync};
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync#endif // !___UIConsole_h___
3488e51e244adfc756837287fbfbcc03eca8bf7avboxsync