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

Side by Side Diff: views/ime/input_method.h

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor X2Event handling, nix Windows InputMethodDelegate, etc. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 VIEWS_IME_INPUT_METHOD_H_ 5 #ifndef VIEWS_IME_INPUT_METHOD_H_
6 #define VIEWS_IME_INPUT_METHOD_H_ 6 #define VIEWS_IME_INPUT_METHOD_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Called when the top-level NativeWidget loses keyboard focus. It should only 50 // Called when the top-level NativeWidget loses keyboard focus. It should only
51 // be called by the top-level NativeWidget which owns this InputMethod 51 // be called by the top-level NativeWidget which owns this InputMethod
52 // instance. 52 // instance.
53 virtual void OnBlur() = 0; 53 virtual void OnBlur() = 0;
54 54
55 // Dispatch a key event to the input method. The key event will be dispatched 55 // Dispatch a key event to the input method. The key event will be dispatched
56 // back to the caller via InputMethodDelegate::DispatchKeyEventPostIME(), once 56 // back to the caller via InputMethodDelegate::DispatchKeyEventPostIME(), once
57 // it's processed by the input method. It should only be called by the 57 // it's processed by the input method. It should only be called by the
58 // top-level NativeWidget which owns this InputMethod instance, or other 58 // top-level NativeWidget which owns this InputMethod instance, or other
59 // related platform dependent code, such as a message dispatcher. 59 // related platform dependent code, such as a message dispatcher.
60 virtual void DispatchKeyEvent(const KeyEvent& key) = 0; 60 // Returns true if the event was handled, or no further handling is required.
61 virtual bool OnKeyEvent(const KeyEvent& key) = 0;
61 62
62 // Called by the focused |view| whenever its text input type is changed. 63 // Called by the focused |view| whenever its text input type is changed.
63 // Before calling this method, the focused |view| must confirm or clear 64 // Before calling this method, the focused |view| must confirm or clear
64 // existing composition text and call InputMethod::CancelComposition() when 65 // existing composition text and call InputMethod::CancelComposition() when
65 // necessary. Otherwise unexpected behavior may happen. This method has no 66 // necessary. Otherwise unexpected behavior may happen. This method has no
66 // effect if the |view| is not focused. 67 // effect if the |view| is not focused.
67 virtual void OnTextInputTypeChanged(View* view) = 0; 68 virtual void OnTextInputTypeChanged(View* view) = 0;
68 69
69 // Called by the focused |view| whenever its caret bounds is changed. 70 // Called by the focused |view| whenever its caret bounds is changed.
70 // This method has no effect if the |view| is not focused. 71 // This method has no effect if the |view| is not focused.
(...skipping 29 matching lines...) Expand all
100 // Gets the text input type of the focused text input client. Returns 101 // Gets the text input type of the focused text input client. Returns
101 // ui::TEXT_INPUT_TYPE_NONE if there is no focused text input client. 102 // ui::TEXT_INPUT_TYPE_NONE if there is no focused text input client.
102 virtual ui::TextInputType GetTextInputType() const = 0; 103 virtual ui::TextInputType GetTextInputType() const = 0;
103 104
104 // TODO(suzhe): Support mouse/touch event. 105 // TODO(suzhe): Support mouse/touch event.
105 }; 106 };
106 107
107 } // namespace views 108 } // namespace views
108 109
109 #endif // VIEWS_IME_INPUT_METHOD_H_ 110 #endif // VIEWS_IME_INPUT_METHOD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698