PlatformKeyboardEvent.h [plain text]
#ifndef PlatformKeyboardEvent_h
#define PlatformKeyboardEvent_h
#include "PlatformString.h"
#ifdef __OBJC__
@class NSEvent;
#else
class NSEvent;
#endif
#if WIN32
typedef struct HWND__ *HWND;
typedef unsigned WPARAM;
typedef long LPARAM;
#endif
#include <GraphicsServices/GSEvent.h>
#if PLATFORM(GDK)
typedef union _GdkEvent GdkEvent;
#endif
namespace WebCore {
class PlatformKeyboardEvent {
public:
String text() const { return m_text; }
String unmodifiedText() const { return m_unmodifiedText; }
String keyIdentifier() const { return m_keyIdentifier; }
bool isKeyUp() const { return m_isKeyUp; }
bool isAutoRepeat() const { return m_autoRepeat; }
int WindowsKeyCode() const { return m_WindowsKeyCode; }
bool isKeypad() const { return m_isKeypad; }
bool shiftKey() const { return m_shiftKey; }
bool ctrlKey() const { return m_ctrlKey; }
bool altKey() const { return m_altKey; }
bool metaKey() const { return m_metaKey; }
#ifdef __APPLE__
PlatformKeyboardEvent(GSEventRef, bool forceAutoRepeat = false);
#endif
#ifdef WIN32
PlatformKeyboardEvent(HWND, WPARAM, LPARAM);
#endif
#if PLATFORM(GDK)
PlatformKeyboardEvent(GdkEvent*);
#endif
private:
String m_text;
String m_unmodifiedText;
String m_keyIdentifier;
bool m_isKeyUp;
bool m_autoRepeat;
int m_WindowsKeyCode;
bool m_isKeypad;
bool m_shiftKey;
bool m_ctrlKey;
bool m_altKey;
bool m_metaKey;
};
}
#endif // PlatformKeyboardEvent_h