Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: ui/base/ime/linux/linux_input_method_context.h

Issue 1068093002: Refactoring for InputMethodAuraLinux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed interactive_ui_tests failure. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_H_ 5 #ifndef UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_H_
6 #define UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_H_ 6 #define UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_H_
7 7
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "ui/base/ime/text_input_type.h" 9 #include "ui/base/ime/text_input_type.h"
10 #include "ui/base/ime/ui_base_ime_export.h" 10 #include "ui/base/ime/ui_base_ime_export.h"
(...skipping 11 matching lines...) Expand all
22 // GNU/Linux and likes. 22 // GNU/Linux and likes.
23 class UI_BASE_IME_EXPORT LinuxInputMethodContext { 23 class UI_BASE_IME_EXPORT LinuxInputMethodContext {
24 public: 24 public:
25 virtual ~LinuxInputMethodContext() {} 25 virtual ~LinuxInputMethodContext() {}
26 26
27 // Dispatches the key event to an underlying IME. Returns true if the key 27 // Dispatches the key event to an underlying IME. Returns true if the key
28 // event is handled, otherwise false. A client must set the text input type 28 // event is handled, otherwise false. A client must set the text input type
29 // before dispatching a key event. 29 // before dispatching a key event.
30 virtual bool DispatchKeyEvent(const ui::KeyEvent& key_event) = 0; 30 virtual bool DispatchKeyEvent(const ui::KeyEvent& key_event) = 0;
31 31
32 // Tells the system IME for the cursor rect which is relative to the
33 // client window rect.
34 virtual void SetCursorLocation(const gfx::Rect& rect) = 0;
35
32 // Resets the context. A client needs to call OnTextInputTypeChanged() again 36 // Resets the context. A client needs to call OnTextInputTypeChanged() again
33 // before calling DispatchKeyEvent(). 37 // before calling DispatchKeyEvent().
34 virtual void Reset() = 0; 38 virtual void Reset() = 0;
35 39
36 // Notifies the context that the text input type has changed. 40 // Focuses the context.
37 virtual void OnTextInputTypeChanged(TextInputType text_input_type) = 0; 41 virtual void Focus() = 0;
38 42
39 // Notifies the context that the caret bounds have changed. |caret_bounds| is 43 // Blurs the context.
40 // relative to screen coordinates. 44 virtual void Blur() = 0;
41 virtual void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) = 0;
42 }; 45 };
43 46
44 // An interface of callback functions called from LinuxInputMethodContext. 47 // An interface of callback functions called from LinuxInputMethodContext.
45 class UI_BASE_IME_EXPORT LinuxInputMethodContextDelegate { 48 class UI_BASE_IME_EXPORT LinuxInputMethodContextDelegate {
46 public: 49 public:
47 virtual ~LinuxInputMethodContextDelegate() {} 50 virtual ~LinuxInputMethodContextDelegate() {}
48 51
49 // Commits the |text| to the text input client. 52 // Commits the |text| to the text input client.
50 virtual void OnCommit(const base::string16& text) = 0; 53 virtual void OnCommit(const base::string16& text) = 0;
51 54
52 // Sets the composition text to the text input client. 55 // Sets the composition text to the text input client.
53 virtual void OnPreeditChanged(const CompositionText& composition_text) = 0; 56 virtual void OnPreeditChanged(const CompositionText& composition_text) = 0;
54 57
55 // Cleans up a composition session and makes sure that the composition text is 58 // Cleans up a composition session and makes sure that the composition text is
56 // cleared. 59 // cleared.
57 virtual void OnPreeditEnd() = 0; 60 virtual void OnPreeditEnd() = 0;
58 61
59 // Prepares things for a new composition session. 62 // Prepares things for a new composition session.
60 virtual void OnPreeditStart() = 0; 63 virtual void OnPreeditStart() = 0;
61 }; 64 };
62 65
63 } // namespace ui 66 } // namespace ui
64 67
65 #endif // UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_H_ 68 #endif // UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_H_
OLDNEW
« no previous file with comments | « ui/base/ime/linux/fake_input_method_context_factory.cc ('k') | ui/base/ime/linux/linux_input_method_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698