1 // Copyright 2013 The Chromium Authors. 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 UI_BASE_IME_INPUT_METHOD_AURALINUX_H_
6 #define UI_BASE_IME_INPUT_METHOD_AURALINUX_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/base/ime/input_method_base.h"
10 #include "ui/base/ime/linux/linux_input_method_context.h"
14 // A ui::InputMethod implementation for Aura on Linux platforms. The
15 // implementation details are separated to ui::LinuxInputMethodContext
17 class InputMethodAuraLinux
: public InputMethodBase
,
18 public LinuxInputMethodContextDelegate
{
20 explicit InputMethodAuraLinux(internal::InputMethodDelegate
* delegate
);
21 virtual ~InputMethodAuraLinux();
23 // Overriden from InputMethod.
24 virtual void Init(bool focused
) OVERRIDE
;
25 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent
& event
,
26 NativeEventResult
* result
) OVERRIDE
;
27 virtual bool DispatchKeyEvent(const ui::KeyEvent
& event
) OVERRIDE
;
28 virtual void OnTextInputTypeChanged(const TextInputClient
* client
) OVERRIDE
;
29 virtual void OnCaretBoundsChanged(const TextInputClient
* client
) OVERRIDE
;
30 virtual void CancelComposition(const TextInputClient
* client
) OVERRIDE
;
31 virtual void OnInputLocaleChanged() OVERRIDE
;
32 virtual std::string
GetInputLocale() OVERRIDE
;
33 virtual bool IsActive() OVERRIDE
;
34 virtual bool IsCandidatePopupOpen() const OVERRIDE
;
36 // Overriden from ui::LinuxInputMethodContextDelegate
37 virtual void OnCommit(const base::string16
& text
) OVERRIDE
;
38 virtual void OnPreeditChanged(const CompositionText
& composition_text
)
40 virtual void OnPreeditEnd() OVERRIDE
;
41 virtual void OnPreeditStart() OVERRIDE
;
44 // Overridden from InputMethodBase.
45 virtual void OnDidChangeFocusedClient(TextInputClient
* focused_before
,
46 TextInputClient
* focused
) OVERRIDE
;
48 scoped_ptr
<LinuxInputMethodContext
> input_method_context_
;
50 DISALLOW_COPY_AND_ASSIGN(InputMethodAuraLinux
);
55 #endif // UI_BASE_IME_INPUT_METHOD_AURALINUX_H_