OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module ui.mojom; | 5 module ui.mojom; |
6 | 6 |
7 import "ui/events/mojo/event.mojom"; | 7 import "ui/events/mojo/event.mojom"; |
8 import "ui/gfx/geometry/mojo/geometry.mojom"; | 8 import "ui/gfx/geometry/mojo/geometry.mojom"; |
9 | 9 |
10 struct CompositionEvent { | 10 struct CompositionEvent { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // This interface is provided by IME drivers, and also by Mus as a lightweight | 86 // This interface is provided by IME drivers, and also by Mus as a lightweight |
87 // proxy between IME drivers and clients. | 87 // proxy between IME drivers and clients. |
88 interface InputMethod { | 88 interface InputMethod { |
89 OnTextInputModeChanged(TextInputMode text_input_mode); | 89 OnTextInputModeChanged(TextInputMode text_input_mode); |
90 OnTextInputTypeChanged(TextInputType text_input_type); | 90 OnTextInputTypeChanged(TextInputType text_input_type); |
91 | 91 |
92 // Client sends |caret_bounds| in focused window coordinates, | 92 // Client sends |caret_bounds| in focused window coordinates, |
93 // Mus translates it to global coordinates and sends it to IME app. | 93 // Mus translates it to global coordinates and sends it to IME app. |
94 OnCaretBoundsChanged(gfx.mojom.Rect caret_bounds); | 94 OnCaretBoundsChanged(gfx.mojom.Rect caret_bounds); |
95 | 95 |
| 96 // Called to process a key event. If InputMethod handles the event, it will |
| 97 // notify the client of the resulting composition events (there might be none) |
| 98 // by calling TextInputClient::OnCompositionEvent(). If the event is not |
| 99 // handled by InputMethod, TextInputClient::OnUnhandledEvent() is called. |
96 ProcessKeyEvent(ui.mojom.Event key_event); | 100 ProcessKeyEvent(ui.mojom.Event key_event); |
| 101 |
97 CancelComposition(); | 102 CancelComposition(); |
98 }; | 103 }; |
99 | 104 |
100 // IME drivers send updates to clients using the TextInputClient interface. | 105 // IME drivers send updates to clients using the TextInputClient interface. |
101 interface TextInputClient { | 106 interface TextInputClient { |
102 // Corresponds to "input method result" functions of ui::TextInputClient. | 107 // Corresponds to "input method result" functions of ui::TextInputClient. |
| 108 // See comments for InputMethod::ProcessKeyEvent() for when this is called. |
103 OnCompositionEvent(CompositionEvent event); | 109 OnCompositionEvent(CompositionEvent event); |
104 | 110 |
| 111 // See comments for InputMethod::ProcessKeyEvent() for when this is called. |
| 112 OnUnhandledEvent(ui.mojom.Event key_event); |
| 113 |
105 // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for: | 114 // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for: |
106 // - Input text confirmation | 115 // - Input text confirmation |
107 // - Document content operations | 116 // - Document content operations |
108 // - Miscellaneous functions | 117 // - Miscellaneous functions |
109 // crbug.com/631527. | 118 // crbug.com/631527. |
110 }; | 119 }; |
OLD | NEW |