Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.service.textclassifier; |
| 18 | |
Tony Mak | 9920dbb | 2019-01-23 19:49:30 +0000 | [diff] [blame] | 19 | import android.service.textclassifier.ITextClassifierCallback; |
Tony Mak | 0be540b | 2018-11-09 16:58:35 +0000 | [diff] [blame] | 20 | import android.view.textclassifier.ConversationActions; |
Abodunrinwa Toki | ad52f4b | 2018-02-06 23:32:41 +0000 | [diff] [blame] | 21 | import android.view.textclassifier.SelectionEvent; |
Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 22 | import android.view.textclassifier.TextClassification; |
Abodunrinwa Toki | 080c854 | 2018-03-27 00:04:06 +0100 | [diff] [blame] | 23 | import android.view.textclassifier.TextClassificationContext; |
| 24 | import android.view.textclassifier.TextClassificationSessionId; |
Abodunrinwa Toki | 37ccedc | 2018-12-11 00:35:11 +0000 | [diff] [blame] | 25 | import android.view.textclassifier.TextClassifierEvent; |
Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 26 | import android.view.textclassifier.TextLinks; |
Tony Mak | 0be540b | 2018-11-09 16:58:35 +0000 | [diff] [blame] | 27 | import android.view.textclassifier.TextLanguage; |
Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 28 | import android.view.textclassifier.TextSelection; |
| 29 | |
| 30 | /** |
| 31 | * TextClassifierService binder interface. |
Abodunrinwa Toki | 080c854 | 2018-03-27 00:04:06 +0100 | [diff] [blame] | 32 | * See TextClassifier for interface documentation. |
Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 33 | * {@hide} |
| 34 | */ |
| 35 | oneway interface ITextClassifierService { |
| 36 | |
| 37 | void onSuggestSelection( |
Abodunrinwa Toki | 080c854 | 2018-03-27 00:04:06 +0100 | [diff] [blame] | 38 | in TextClassificationSessionId sessionId, |
| 39 | in TextSelection.Request request, |
Tony Mak | 9920dbb | 2019-01-23 19:49:30 +0000 | [diff] [blame] | 40 | in ITextClassifierCallback callback); |
Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 41 | |
| 42 | void onClassifyText( |
Abodunrinwa Toki | 080c854 | 2018-03-27 00:04:06 +0100 | [diff] [blame] | 43 | in TextClassificationSessionId sessionId, |
| 44 | in TextClassification.Request request, |
Tony Mak | 9920dbb | 2019-01-23 19:49:30 +0000 | [diff] [blame] | 45 | in ITextClassifierCallback callback); |
Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 46 | |
| 47 | void onGenerateLinks( |
Abodunrinwa Toki | 080c854 | 2018-03-27 00:04:06 +0100 | [diff] [blame] | 48 | in TextClassificationSessionId sessionId, |
| 49 | in TextLinks.Request request, |
Tony Mak | 9920dbb | 2019-01-23 19:49:30 +0000 | [diff] [blame] | 50 | in ITextClassifierCallback callback); |
Abodunrinwa Toki | ad52f4b | 2018-02-06 23:32:41 +0000 | [diff] [blame] | 51 | |
Abodunrinwa Toki | 37ccedc | 2018-12-11 00:35:11 +0000 | [diff] [blame] | 52 | // TODO: Remove |
Abodunrinwa Toki | 080c854 | 2018-03-27 00:04:06 +0100 | [diff] [blame] | 53 | void onSelectionEvent( |
| 54 | in TextClassificationSessionId sessionId, |
| 55 | in SelectionEvent event); |
| 56 | |
Abodunrinwa Toki | 37ccedc | 2018-12-11 00:35:11 +0000 | [diff] [blame] | 57 | void onTextClassifierEvent( |
| 58 | in TextClassificationSessionId sessionId, |
| 59 | in TextClassifierEvent event); |
| 60 | |
Abodunrinwa Toki | 080c854 | 2018-03-27 00:04:06 +0100 | [diff] [blame] | 61 | void onCreateTextClassificationSession( |
| 62 | in TextClassificationContext context, |
| 63 | in TextClassificationSessionId sessionId); |
| 64 | |
| 65 | void onDestroyTextClassificationSession( |
| 66 | in TextClassificationSessionId sessionId); |
Tony Mak | 0be540b | 2018-11-09 16:58:35 +0000 | [diff] [blame] | 67 | |
| 68 | void onDetectLanguage( |
| 69 | in TextClassificationSessionId sessionId, |
| 70 | in TextLanguage.Request request, |
Tony Mak | 9920dbb | 2019-01-23 19:49:30 +0000 | [diff] [blame] | 71 | in ITextClassifierCallback callback); |
Tony Mak | 0be540b | 2018-11-09 16:58:35 +0000 | [diff] [blame] | 72 | |
| 73 | void onSuggestConversationActions( |
| 74 | in TextClassificationSessionId sessionId, |
| 75 | in ConversationActions.Request request, |
Tony Mak | 9920dbb | 2019-01-23 19:49:30 +0000 | [diff] [blame] | 76 | in ITextClassifierCallback callback); |
Abodunrinwa Toki | d32906c | 2018-01-18 04:34:44 -0800 | [diff] [blame] | 77 | } |