1 // Copyright 2014 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_IME_INPUT_METHOD_CONTEXT_IMPL_WAYLAND_H_
6 #define OZONE_UI_IME_INPUT_METHOD_CONTEXT_IMPL_WAYLAND_H_
10 #include "ozone/platform/ozone_export_wayland.h"
11 #include "ozone/ui/events/ime_change_observer.h"
12 #include "ui/base/ime/linux/linux_input_method_context.h"
13 #include "ui/gfx/rect.h"
17 // An implementation of LinuxInputMethodContext for IME support on Ozone
18 // platform using Wayland.
19 class OZONE_WAYLAND_EXPORT InputMethodContextImplWayland
20 : public LinuxInputMethodContext,
21 public IMEChangeObserver {
23 explicit InputMethodContextImplWayland(
24 ui::LinuxInputMethodContextDelegate* delegate);
25 virtual ~InputMethodContextImplWayland();
27 // overriden from ui::LinuxInputMethodContext
28 bool DispatchKeyEvent(const ui::KeyEvent& key_event) override;
29 void Reset() override;
30 void OnTextInputTypeChanged(ui::TextInputType text_input_type) override;
31 void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override;
33 // overriden from ui::IMEChangeObserver
34 void OnPreeditChanged(unsigned handle,
35 const std::string& text,
36 const std::string& commit) override;
37 void OnCommit(unsigned handle, const std::string& text) override;
41 LinuxInputMethodContextDelegate* delegate_;
42 DISALLOW_COPY_AND_ASSIGN(InputMethodContextImplWayland);
47 #endif // OZONE_UI_IME_INPUT_METHOD_CONTEXT_IMPL_WAYLAND_H_