| 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 | 96 // Called to process a key event. The callback function will be called to |
| 97 // notify the client of the resulting composition events (there might be none) | 97 // notify the client if the event was handled or not. A handled event may |
| 98 // by calling TextInputClient::OnCompositionEvent(). If the event is not | 98 // generate zero or more composition events which will be sent to the client |
| 99 // handled by InputMethod, TextInputClient::OnUnhandledEvent() is called. | 99 // by calling TextInputClient::OnCompositionEvent(). |
| 100 ProcessKeyEvent(ui.mojom.Event key_event); | 100 ProcessKeyEvent(ui.mojom.Event key_event) => (bool handled); |
| 101 | 101 |
| 102 CancelComposition(); | 102 CancelComposition(); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 // IME drivers send updates to clients using the TextInputClient interface. | 105 // IME drivers send updates to clients using the TextInputClient interface. |
| 106 interface TextInputClient { | 106 interface TextInputClient { |
| 107 // 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. | 108 // See comments for InputMethod::ProcessKeyEvent() for when this is called. |
| 109 OnCompositionEvent(CompositionEvent event); | 109 OnCompositionEvent(CompositionEvent event); |
| 110 | 110 |
| 111 // See comments for InputMethod::ProcessKeyEvent() for when this is called. | |
| 112 OnUnhandledEvent(ui.mojom.Event key_event); | |
| 113 | |
| 114 // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for: | 111 // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for: |
| 115 // - Input text confirmation | 112 // - Input text confirmation |
| 116 // - Document content operations | 113 // - Document content operations |
| 117 // - Miscellaneous functions | 114 // - Miscellaneous functions |
| 118 // crbug.com/631527. | 115 // crbug.com/631527. |
| 119 }; | 116 }; |
| OLD | NEW |