NativeWebKeyboardEvent.h [plain text]
#ifndef NativeWebKeyboardEvent_h
#define NativeWebKeyboardEvent_h
#include "WebEvent.h"
#if USE(APPKIT)
#include <wtf/RetainPtr.h>
OBJC_CLASS NSView;
namespace WebCore {
struct KeypressCommand;
}
#endif
#if PLATFORM(EFL)
#include <Evas.h>
#endif
#if PLATFORM(GTK)
#include "InputMethodFilter.h"
#include <WebCore/CompositionResults.h>
#include <WebCore/GUniquePtrGtk.h>
typedef union _GdkEvent GdkEvent;
#endif
#if PLATFORM(IOS)
#include <wtf/RetainPtr.h>
OBJC_CLASS WebIOSEvent;
#endif
namespace WebKit {
class NativeWebKeyboardEvent : public WebKeyboardEvent {
public:
#if USE(APPKIT)
NativeWebKeyboardEvent(NSEvent *, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&);
#elif PLATFORM(GTK)
NativeWebKeyboardEvent(const NativeWebKeyboardEvent&);
NativeWebKeyboardEvent(GdkEvent*, const WebCore::CompositionResults&, InputMethodFilter::EventFakedForComposition, Vector<String>&& commands);
#elif PLATFORM(EFL)
NativeWebKeyboardEvent(const Evas_Event_Key_Down*, bool);
NativeWebKeyboardEvent(const Evas_Event_Key_Up*);
#elif PLATFORM(IOS)
NativeWebKeyboardEvent(WebIOSEvent *);
#endif
#if USE(APPKIT)
NSEvent *nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(GTK)
GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
const WebCore::CompositionResults& compositionResults() const { return m_compositionResults; }
bool isFakeEventForComposition() const { return m_fakeEventForComposition; }
#elif PLATFORM(EFL)
const void* nativeEvent() const { return m_nativeEvent; }
bool isFiltered() const { return m_isFiltered; }
#elif PLATFORM(IOS)
WebIOSEvent* nativeEvent() const { return m_nativeEvent.get(); }
#endif
private:
#if USE(APPKIT)
RetainPtr<NSEvent> m_nativeEvent;
#elif PLATFORM(GTK)
GUniquePtr<GdkEvent> m_nativeEvent;
WebCore::CompositionResults m_compositionResults;
bool m_fakeEventForComposition;
#elif PLATFORM(EFL)
const void* m_nativeEvent;
bool m_isFiltered;
#elif PLATFORM(IOS)
RetainPtr<WebIOSEvent> m_nativeEvent;
#endif
};
}
#endif // NativeWebKeyboardEvent_h