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 arc.mojom; | 5 module arc.mojom; |
6 | 6 |
7 // Represents the type of text input field currently focused. | 7 // Represents the type of text input field currently focused. |
8 [Extensible] | 8 [Extensible] |
9 enum TextInputType { | 9 enum TextInputType { |
10 NONE, | 10 NONE, |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Represents a single segment of text currently composed by IME. | 31 // Represents a single segment of text currently composed by IME. |
32 struct CompositionSegment { | 32 struct CompositionSegment { |
33 // Start offset of the segment in UTF-16 index. | 33 // Start offset of the segment in UTF-16 index. |
34 uint32 start_offset; | 34 uint32 start_offset; |
35 // End offset of the segment in UTF-16 index. | 35 // End offset of the segment in UTF-16 index. |
36 uint32 end_offset; | 36 uint32 end_offset; |
37 // Indicates that this segment should be emphasized. | 37 // Indicates that this segment should be emphasized. |
38 bool emphasized; | 38 bool emphasized; |
39 }; | 39 }; |
40 | 40 |
| 41 // Next MinVersion: 3 |
41 interface ImeHost { | 42 interface ImeHost { |
42 // Notifies Chrome that the text input focus is changed. | 43 // Notifies Chrome that the text input focus is changed. |
43 OnTextInputTypeChanged(TextInputType type); | 44 OnTextInputTypeChanged(TextInputType type); |
44 | 45 |
45 // Notifies Chrome that the cursor poisition has changed. | 46 // Notifies Chrome that the cursor poisition has changed. |
46 OnCursorRectChanged(CursorRect rect); | 47 OnCursorRectChanged(CursorRect rect); |
47 | 48 |
48 // Notifies Chrome that the current composition is canceled. | 49 // Notifies Chrome that the current composition is canceled. |
49 [MinVersion=1] OnCancelComposition(); | 50 [MinVersion=1] OnCancelComposition(); |
| 51 |
| 52 // Show virtual keyboard of Chrome OS if needed. |
| 53 [MinVersion=2] ShowImeIfNeeded(); |
50 }; | 54 }; |
51 | 55 |
52 interface ImeInstance { | 56 interface ImeInstance { |
53 Init(ImeHost host_ptr); | 57 Init(ImeHost host_ptr); |
54 | 58 |
55 // Sets composition text and attributes requested by the host IME. | 59 // Sets composition text and attributes requested by the host IME. |
56 SetCompositionText(string text, array<CompositionSegment> segments); | 60 SetCompositionText(string text, array<CompositionSegment> segments); |
57 | 61 |
58 // Commits the last set composition text and clears the composition. | 62 // Commits the last set composition text and clears the composition. |
59 ConfirmCompositionText(); | 63 ConfirmCompositionText(); |
60 | 64 |
61 // Commits the specified text and clears the composition. | 65 // Commits the specified text and clears the composition. |
62 InsertText(string text); | 66 InsertText(string text); |
63 }; | 67 }; |
OLD | NEW |