ConsoleImpl.h revision 525cfe310305abf78e4fd4cb98bd0fa603694a65
/** @file
*
* VBox frontends: Basic Frontend (BFE):
* Declaration of Console class
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ____H_CONSOLEIMPL
#define ____H_CONSOLEIMPL
/*
* Host key handling.
*
* The golden rule is that host-key combinations should not be seen
* by the guest. For instance a CAD should not have any extra RCtrl down
* and RCtrl up around itself. Nor should a resume be followed by a Ctrl-P
* that could encourage applications to start printing.
*
* We must not confuse the hostkey processing into any release sequences
* either, the host key is supposed to be explicitly pressing one key.
*
* Quick state diagram:
*
* host key down alone
* (Normal) ---------------
* ^ ^ |
* | | v host combination key down
* | | (Host key down) ----------------
* | | host key up v | |
* | |-------------- | other key down v host combination key down
* | | (host key used) -------------
* | | | ^ |
* | (not host key)-- | |---------------
* | | | | |
* | | ---- other |
* | modifiers = 0 v v
* -----------------------------------------------
*/
typedef enum _HKEYSTATE
{
/** The initial and most common state, pass keystrokes to the guest.
* Next state: HKEYSTATE_DOWN
* Prev state: Any */
HKEYSTATE_NORMAL = 1,
/** The host key has been pressed down.
* Prev state: HKEYSTATE_NORMAL
* Next state: HKEYSTATE_NORMAL - host key up, capture toggle.
* Next state: HKEYSTATE_USED - host key combination down.
* Next state: HKEYSTATE_NOT_IT - non-host key combination down.
*/
/** A host key combination was pressed.
* Prev state: HKEYSTATE_DOWN
* Next state: HKEYSTATE_NORMAL - when modifiers are all 0
*/
/** A non-host key combination was attempted. Send hostkey down to the
* guest and continue until all modifiers have been released.
* Prev state: HKEYSTATE_DOWN
* Next state: HKEYSTATE_NORMAL - when modifiers are all 0
*/
} HKEYSTATE;
typedef enum _CONEVENT
{
} CONEVENT;
/**
* Checks the availability of the underlying VM device driver corresponding
* to the COM interface (IKeyboard, IMouse, IDisplay, etc.). When the driver is
* not available (NULL), sets error info and returns returns E_ACCESSDENIED.
* The translatable error message is defined in null context.
*
* Intended to used only within Console children (i.e. Keyboard, Mouse,
* Display, etc.).
*
* @param drv driver pointer to check (compare it with NULL)
*/
#define CHECK_CONSOLE_DRV(drv) \
do { \
if (!(drv)) \
} while (0)
{
Console()
{
mfInitialized = false;
mfInputGrab = false;
}
virtual void updateTitlebar() = 0;
virtual void inputGrabStart() = 0;
virtual void inputGrabEnd() = 0;
virtual void resetCursor() {}
bool fNeedsHostCursor) {}
bool initialized() { return mfInitialized; }
bool mfInitialized;
bool mfInputGrab;
};
#endif // ____H_CONSOLEIMPL