1 // Copyright 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef OZONE_UI_EVENTS_EVENT_CONVERTER_OZONE_WAYLAND_H_
6 #define OZONE_UI_EVENTS_EVENT_CONVERTER_OZONE_WAYLAND_H_
10 #include "base/message_loop/message_loop.h"
11 #include "ozone/platform/ozone_export_wayland.h"
12 #include "ui/events/event_constants.h"
16 class WindowChangeObserver;
17 class OutputChangeObserver;
19 // In OzoneWayland, Chrome relies on Wayland protocol to recieve callback of
20 // any input/surface events. This class is responsible for the following:
21 // 1) Convert native input events to |ui::Event| and dispatching to aura.
22 // 2) Convert native events related to Window Activation and dispatch it to
23 // WindowChangeObserver
24 class OZONE_WAYLAND_EXPORT EventConverterOzoneWayland {
26 EventConverterOzoneWayland();
27 virtual ~EventConverterOzoneWayland();
29 virtual void MotionNotify(float x, float y) = 0;
30 virtual void ButtonNotify(unsigned handle,
35 virtual void AxisNotify(float x, float y, int xoffset, int yoffset) = 0;
36 virtual void PointerEnter(unsigned handle, float x, float y) = 0;
37 virtual void PointerLeave(unsigned handle, float x, float y) = 0;
38 virtual void KeyNotify(ui::EventType type,
40 unsigned modifiers) = 0;
41 virtual void TouchNotify(ui::EventType type,
45 uint32_t time_stamp) = 0;
47 virtual void OutputSizeChanged(unsigned width, unsigned height) = 0;
48 virtual void WindowResized(unsigned windowhandle,
51 virtual void CloseWidget(unsigned handle) = 0;
52 virtual void Commit(unsigned handle, const std::string& text) = 0;
53 virtual void PreeditChanged(unsigned handle, const std::string& text,
54 const std::string& commit) = 0;
55 virtual void PreeditEnd() = 0;
56 virtual void PreeditStart() = 0;
58 // Sets the window change observer. Ownership is retained by the caller.
59 virtual void SetWindowChangeObserver(WindowChangeObserver* observer);
60 // Sets the output change observer. Ownership is retained by the caller.
61 virtual void SetOutputChangeObserver(OutputChangeObserver* observer);
64 // Posts task to main loop of the thread on which Dispatcher was initialized.
65 virtual void PostTaskOnMainLoop(const base::Closure& task);
66 base::MessageLoop* loop_;
71 #endif // OZONE_UI_EVENTS_EVENT_CONVERTER_OZONE_WAYLAND_H_