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 "mojo/common/text_direction.mojom"; |
7 import "ui/events/mojo/event.mojom"; | 8 import "ui/events/mojo/event.mojom"; |
8 import "ui/gfx/geometry/mojo/geometry.mojom"; | 9 import "ui/gfx/geometry/mojo/geometry.mojom"; |
9 import "ui/gfx/range/mojo/range.mojom"; | 10 import "ui/gfx/range/mojo/range.mojom"; |
10 | 11 |
11 // Represents an underlined segment of text currently composed by IME. | 12 // Represents an underlined segment of text currently composed by IME. |
12 // Corresponds to ui::CompositionUnderline. | 13 // Corresponds to ui::CompositionUnderline. |
13 struct CompositionUnderline { | 14 struct CompositionUnderline { |
14 uint32 start_offset; | 15 uint32 start_offset; |
15 uint32 end_offset; | 16 uint32 end_offset; |
16 bool thick; | 17 bool thick; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 FULL_WIDTH_LATIN, | 58 FULL_WIDTH_LATIN, |
58 KANA, | 59 KANA, |
59 KANA_NAME, | 60 KANA_NAME, |
60 KATAKANA, | 61 KATAKANA, |
61 NUMERIC, | 62 NUMERIC, |
62 TEL, | 63 TEL, |
63 EMAIL, | 64 EMAIL, |
64 URL, | 65 URL, |
65 }; | 66 }; |
66 | 67 |
| 68 // Parameters needed to start an IME session. |
| 69 struct StartSessionDetails { |
| 70 TextInputClient client; |
| 71 InputMethod& input_method_request; |
| 72 |
| 73 // Initial details about |client| required by IMEDriver. |
| 74 TextInputType text_input_type; |
| 75 TextInputMode text_input_mode; |
| 76 mojo.common.mojom.TextDirection text_direction; |
| 77 int32 text_input_flags; |
| 78 gfx.mojom.Rect caret_bounds; |
| 79 }; |
| 80 |
67 // A service which provides the IMEDriver interface is responsible for doing | 81 // A service which provides the IMEDriver interface is responsible for doing |
68 // the composition logic. After starting a session, it receives events from | 82 // the composition logic. After starting a session, it receives events from |
69 // the client via the InputMethod interface, and sends composition events to | 83 // the client via the InputMethod interface, and sends composition events to |
70 // the client via the TextInputClient. | 84 // the client via the TextInputClient. |
71 interface IMEDriver { | 85 interface IMEDriver { |
72 // session_id is unique and generated by Mus. | 86 // session_id is unique and generated by Mus. |
73 StartSession(int32 session_id, TextInputClient client, | 87 StartSession(int32 session_id, StartSessionDetails details); |
74 InputMethod& input_method); | |
75 CancelSession(int32 session_id); | 88 CancelSession(int32 session_id); |
76 }; | 89 }; |
77 | 90 |
78 // Clients use IME using the IMEServer interface which is provided by Mus. Mus | 91 // Clients use IME using the IMEServer interface which is provided by Mus. Mus |
79 // does minimal processing and mostly just acts as lightweight proxy between | 92 // does minimal processing and mostly just acts as lightweight proxy between |
80 // the client app and the registered IME driver. | 93 // the client app and the registered IME driver. |
81 interface IMEServer { | 94 interface IMEServer { |
82 StartSession(TextInputClient client, | 95 StartSession(StartSessionDetails details); |
83 InputMethod& input_method); | |
84 }; | 96 }; |
85 | 97 |
86 // An IME driver register should register itself to Mus using the IMERegistrar | 98 // An IME driver register should register itself to Mus using the IMERegistrar |
87 // interface. | 99 // interface. |
88 interface IMERegistrar { | 100 interface IMERegistrar { |
89 RegisterDriver(IMEDriver driver); | 101 RegisterDriver(IMEDriver driver); |
90 }; | 102 }; |
91 | 103 |
92 // A client sends updates to the IME driver using the InputMethod interface. | 104 // A client sends updates to the IME driver using the InputMethod interface. |
93 // This interface is provided by IME drivers, and also by Mus as a lightweight | 105 // This interface is provided by IME drivers, and also by Mus as a lightweight |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // the character is not processed. See ui::TextInputClient::InsertChar() | 145 // the character is not processed. See ui::TextInputClient::InsertChar() |
134 // for more details. | 146 // for more details. |
135 InsertChar(ui.mojom.Event event); | 147 InsertChar(ui.mojom.Event event); |
136 | 148 |
137 // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for: | 149 // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for: |
138 // - Input context information | 150 // - Input context information |
139 // - Document content operations | 151 // - Document content operations |
140 // - Miscellaneous functions | 152 // - Miscellaneous functions |
141 // crbug.com/631527. | 153 // crbug.com/631527. |
142 }; | 154 }; |
OLD | NEW |