VBoxConsoleView.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* VBoxConsoleView class declaration
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung GmbH
*
* 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 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef __VBoxConsoleView_h__
#define __VBoxConsoleView_h__
#include "COMDefs.h"
#include "VBoxDefs.h"
#include "VMGlobalSettings.h"
#include <qdatetime.h>
#include <qscrollview.h>
#include <qpixmap.h>
#include <qimage.h>
#include <qkeysequence.h>
{
enum {
MouseCaptured = 0x01,
MouseAbsolute = 0x02,
MouseAbsoluteDisabled = 0x04,
MouseNeedsHostCursor = 0x08,
KeyboardCaptured = 0x01,
HostKeyPressed = 0x02,
};
~VBoxConsoleView();
void attach();
void detach();
void normalizeGeometry (bool adjustPosition = false);
void setMouseIntegrationEnabled (bool enabled);
bool isMouseAbsolute() const { return mouse_absolute; }
void setAutoresizeGuest (bool on);
void onFullscreenChange (bool on);
void keyboardStateChanged (int state);
void mouseStateChanged (int state);
// events
#if defined(Q_WS_WIN32)
#endif
// flags for keyEvent()
enum {
KeyExtended = 0x01,
KeyPressed = 0x02,
KeyPause = 0x04,
KeyPrint = 0x08,
};
void focusEvent (bool focus);
void emitKeyboardStateChanged() {
(kbd_captured ? KeyboardCaptured : 0) |
(hostkey_pressed ? HostKeyPressed : 0));
}
void emitMouseStateChanged() {
(mouse_absolute ? MouseAbsolute : 0) |
(!mouse_integration ? MouseAbsoluteDisabled : 0));
}
// IConsoleCallback event handlers
void doRefresh();
void viewportPaintEvent( QPaintEvent * );
#ifdef VBOX_GUI_USE_REFRESH_TIMER
void timerEvent( QTimerEvent * );
#endif
void releaseAllKeysPressed (bool release_hostkey = true);
void saveKeyStates();
void sendChangedKeyStates();
void updateMouseClipping();
void doResizeHint();
void normalizeGeo() { normalizeGeometry(); }
const VMGlobalSettings &gs;
bool attached : 1;
bool kbd_captured : 1;
bool mouse_captured : 1;
bool mouse_absolute : 1;
bool mouse_integration : 1;
bool hostkey_pressed : 1;
bool hostkey_alone : 1;
/** kbd_captured value during the the last host key press or release */
bool hostkey_in_capture : 1;
bool ignore_mainwnd_resize : 1;
bool autoresize_guest : 1;
#if defined (VBOX_GUI_USE_REFRESH_TIMER)
int tid; /**< Timer id */
#endif
#if defined (Q_WS_WIN32)
#endif
};
#endif // __VBoxConsoleView_h__