VBoxConsoleView.h revision 94ab1be248c170bfa016aa33317d69e0487c3b18
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* VBoxConsoleView class declaration
*/
/*
* Copyright (C) 2006-2007 innotek 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 (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 __VBoxConsoleView_h__
#define __VBoxConsoleView_h__
#include "COMDefs.h"
#include "VBoxDefs.h"
#include "VBoxGlobalSettings.h"
/* Qt includes */
#include <QAbstractScrollArea>
#include <QScrollBar>
#if defined (Q_WS_PM)
#define UM_PREACCEL_CHAR WM_USER
#endif
#if defined (Q_WS_MAC)
# include "DarwinCursor.h"
#endif
{
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 mMouseAbsolute; }
void setAutoresizeGuest (bool on);
void onFullscreenChange (bool on);
void onViewOpened();
void toggleFSMode();
/* todo: This are some support functions for the qt4 port. Maybe we get rid
* of them some day. */
int contentsWidth() const;
int contentsHeight() const;
{
}
{
}
void updateSliders();
void keyboardStateChanged (int state);
void mouseStateChanged (int state);
void additionsStateChanged (const QString &, bool, bool);
void networkStateChange();
void usbStateChange();
void sharedFoldersChanged();
void resizeHintDone();
// events
#if defined(Q_WS_WIN32)
void darwinGrabKeyboardEvents (bool fGrab);
#endif
/** Flags for keyEvent(). */
enum {
KeyExtended = 0x01,
KeyPressed = 0x02,
KeyPause = 0x04,
KeyPrint = 0x08,
};
void emitKeyboardStateChanged()
{
(mKbdCaptured ? KeyboardCaptured : 0) |
(mIsHostkeyPressed ? HostKeyPressed : 0));
}
void emitMouseStateChanged() {
(mMouseAbsolute ? MouseAbsolute : 0) |
(!mMouseIntegration ? MouseAbsoluteDisabled : 0));
}
// IConsoleCallback event handlers
void doRefresh();
void resizeEvent (QResizeEvent *);
void paintEvent (QPaintEvent *);
void releaseAllPressedKeys (bool aReleaseHostKey = true);
void saveKeyStates();
void sendChangedKeyStates();
void updateMouseClipping();
void doResizeDesktop (int);
void sendInitialSizeHint(void);
void maybeRestrictMinimumSize();
const VBoxGlobalSettings &gs;
bool mAttached : 1;
bool mKbdCaptured : 1;
bool mMouseCaptured : 1;
bool mMouseAbsolute : 1;
bool mMouseIntegration : 1;
bool mDisableAutoCapture : 1;
bool mIsHostkeyPressed : 1;
bool mIsHostkeyAlone : 1;
/** mKbdCaptured value during the the last host key press or release */
bool hostkey_in_capture : 1;
bool mIgnoreMainwndResize : 1;
bool mAutoresizeGuest : 1;
bool mIsAdditionsActive : 1;
bool mNumLock : 1;
bool mScrollLock : 1;
bool mCapsLock : 1;
long muNumLockAdaptionCnt;
long muCapsLockAdaptionCnt;
#if defined(Q_WS_WIN)
#endif
#if defined(Q_WS_MAC)
# ifndef VBOX_WITH_HACKED_QT
/** Event handler reference. NULL if the handler isn't installed. */
# endif
/** The current modifier key mask. Used to figure out which modifier
* key was pressed when we get a kEventRawKeyModifiersChanged event. */
/** The darwin cursor handle (see DarwinCursor.h/.cpp). */
#endif
#if defined (Q_WS_WIN32)
# ifndef VBOX_WITH_HACKED_QT
# else /* VBOX_WITH_HACKED_QT */
# endif /* VBOX_WITH_HACKED_QT */
#endif
#if defined(Q_WS_MAC)
#endif
};
#endif // __VBoxConsoleView_h__