Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ozone / ui / ime / input_method_context_impl_wayland.h
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.
4
5 #ifndef OZONE_UI_IME_INPUT_METHOD_CONTEXT_IMPL_WAYLAND_H_
6 #define OZONE_UI_IME_INPUT_METHOD_CONTEXT_IMPL_WAYLAND_H_
7
8 #include <string>
9
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"
14
15 namespace ui {
16
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 {
22  public:
23   explicit InputMethodContextImplWayland(
24       ui::LinuxInputMethodContextDelegate* delegate);
25   virtual ~InputMethodContextImplWayland();
26
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;
32
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;
38
39  private:
40   // Must not be NULL.
41   LinuxInputMethodContextDelegate* delegate_;
42   DISALLOW_COPY_AND_ASSIGN(InputMethodContextImplWayland);
43 };
44
45 }  // namespace ui
46
47 #endif  // OZONE_UI_IME_INPUT_METHOD_CONTEXT_IMPL_WAYLAND_H_