Chromium Code Reviews| Index: services/ui/public/interfaces/ime/ime.mojom |
| diff --git a/services/ui/public/interfaces/ime.mojom b/services/ui/public/interfaces/ime/ime.mojom |
| similarity index 74% |
| rename from services/ui/public/interfaces/ime.mojom |
| rename to services/ui/public/interfaces/ime/ime.mojom |
| index af86e21106fbd5a61000072b52704f35c104b457..c2a611ddfcc010bac189cac8e241f988fdb7c033 100644 |
| --- a/services/ui/public/interfaces/ime.mojom |
| +++ b/services/ui/public/interfaces/ime/ime.mojom |
| @@ -6,24 +6,24 @@ module ui.mojom; |
| import "ui/events/mojo/event.mojom"; |
| import "ui/gfx/geometry/mojo/geometry.mojom"; |
| - |
| -struct CompositionEvent { |
| - CompositionEventType type; |
| - |
| - // Used when |type| is INSERT_CHAR. See the comments for |
| - // ui::TextInputClient::InsertChar() for more information. |
| - Event? key_event; |
| - |
| - // TODO(moshayedi): crbug.com/631524. Add fields required for other types of |
| - // composition event. |
| +import "ui/gfx/range/mojo/range.mojom"; |
| + |
| +// Represents an underlined segment of text currently composed by IME. |
| +// Corresponds to ui::CompositionUnderline. |
| +struct CompositionUnderline { |
| + uint32 start_offset; |
| + uint32 end_offset; |
| + bool thick; |
| + uint32 color; |
| + uint32 background_color; |
| }; |
| -enum CompositionEventType { |
| - UPDATE, |
| - CONFIRM, |
| - CLEAR, |
| - INSERT_CHAR, |
| - INSERT_TEXT |
| +// Represents a text currently being composed by IME. Corresponds to |
| +// ui::CompositionText. |
| +struct CompositionText { |
| + string text; |
| + array<CompositionUnderline> underlines; |
| + gfx.mojom.Range selection; |
| }; |
| // See comments for ui::TextInputType for more details. |
| @@ -96,7 +96,7 @@ interface InputMethod { |
| // Called to process a key event. The callback function will be called to |
| // notify the client if the event was handled or not. A handled event may |
| // generate zero or more composition events which will be sent to the client |
| - // by calling TextInputClient::OnCompositionEvent(). |
| + // using the "input method result" functions of TextInputClient interface. |
| ProcessKeyEvent(ui.mojom.Event key_event) => (bool handled); |
| CancelComposition(); |
| @@ -104,12 +104,17 @@ interface InputMethod { |
| // IME drivers send updates to clients using the TextInputClient interface. |
| interface TextInputClient { |
| - // Corresponds to "input method result" functions of ui::TextInputClient. |
| - // See comments for InputMethod::ProcessKeyEvent() for when this is called. |
| - OnCompositionEvent(CompositionEvent event); |
| + // Functions corresponding to "input method result" functions of |
| + // ui::TextInputClient. See comments for InputMethod::ProcessKeyEvent() for |
| + // when these are called. |
| + SetCompositionText(CompositionText composition); |
| + ConfirmCompositionText(); |
|
sky
2016/11/30 21:55:41
Please add descriptions of all functions.
Hadi
2016/12/01 19:31:42
Done.
|
| + ClearCompositionText(); |
| + InsertText(string text); |
| + InsertChar(ui.mojom.Event event); |
|
sky
2016/11/30 21:55:41
Is there a reason to have both insert text and cha
Hadi
2016/12/01 19:31:42
Comments in ui/base/ime/text_input_client.h say th
|
| // TODO(moshayedi): Add functions corresponding to ui::TextInputClient for: |
| - // - Input text confirmation |
| + // - Input context information |
| // - Document content operations |
| // - Miscellaneous functions |
| // crbug.com/631527. |