| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 [DartPackage="mojo_services"] | |
| 6 module keyboard; | |
| 7 | |
| 8 struct CompletionData { | |
| 9 int64 id; | |
| 10 int32 position; | |
| 11 string text; | |
| 12 string label; | |
| 13 }; | |
| 14 | |
| 15 struct CorrectionData { | |
| 16 int32 offset; | |
| 17 string old_text; | |
| 18 string new_text; | |
| 19 }; | |
| 20 | |
| 21 interface KeyboardClient { | |
| 22 CommitCompletion(CompletionData completion); | |
| 23 CommitCorrection(CorrectionData correction); | |
| 24 CommitText(string text, int32 newCursorPosition); | |
| 25 DeleteSurroundingText(int32 beforeLength, int32 afterLength); | |
| 26 SetComposingRegion(int32 start, int32 end); | |
| 27 SetComposingText(string text, int32 newCursorPosition); | |
| 28 SetSelection(int32 start, int32 end); | |
| 29 }; | |
| 30 | |
| 31 // Loosely modeled on Android InputType: | |
| 32 // http://developer.android.com/reference/android/text/InputType.html | |
| 33 enum KeyboardType { | |
| 34 TEXT, | |
| 35 NUMBER, | |
| 36 PHONE, | |
| 37 DATETIME, | |
| 38 }; | |
| 39 | |
| 40 interface KeyboardService { | |
| 41 Show(KeyboardClient client, KeyboardType type); | |
| 42 ShowByRequest(); | |
| 43 Hide(); | |
| 44 }; | |
| OLD | NEW |