NativeWebKeyboardEvent.h [plain text]
#ifndef NativeWebKeyboardEvent_h
#define NativeWebKeyboardEvent_h
#include "WebEvent.h"
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
OBJC_CLASS NSView;
#elif PLATFORM(QT)
#include <QKeyEvent>
#elif PLATFORM(GTK)
#include <GOwnPtrGtk.h>
typedef union _GdkEvent GdkEvent;
#elif PLATFORM(EFL)
#include <Evas.h>
#endif
namespace WebKit {
class NativeWebKeyboardEvent : public WebKeyboardEvent {
public:
#if PLATFORM(MAC)
NativeWebKeyboardEvent(NSEvent *, NSView *);
#elif PLATFORM(WIN)
NativeWebKeyboardEvent(HWND, UINT message, WPARAM, LPARAM);
#elif PLATFORM(QT)
explicit NativeWebKeyboardEvent(QKeyEvent*);
#elif PLATFORM(GTK)
NativeWebKeyboardEvent(const NativeWebKeyboardEvent&);
NativeWebKeyboardEvent(GdkEvent*);
#elif PLATFORM(EFL)
NativeWebKeyboardEvent(const Evas_Event_Key_Down*);
NativeWebKeyboardEvent(const Evas_Event_Key_Up*);
#endif
#if PLATFORM(MAC)
NSEvent *nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(WIN)
const MSG* nativeEvent() const { return &m_nativeEvent; }
#elif PLATFORM(QT)
const QKeyEvent* nativeEvent() const { return &m_nativeEvent; }
#elif PLATFORM(GTK)
GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(EFL)
const void* nativeEvent() const { return m_nativeEvent; }
#endif
private:
#if PLATFORM(MAC)
RetainPtr<NSEvent> m_nativeEvent;
#elif PLATFORM(WIN)
MSG m_nativeEvent;
#elif PLATFORM(QT)
QKeyEvent m_nativeEvent;
#elif PLATFORM(GTK)
GOwnPtr<GdkEvent> m_nativeEvent;
#elif PLATFORM(EFL)
const void* m_nativeEvent;
#endif
};
}
#endif // NativeWebKeyboardEvent_h