• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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 com.android.systemui.inputmethod.data.model
18 
19 /**
20  * Models an input method editor (IME).
21  *
22  * @see android.view.inputmethod.InputMethodInfo
23  */
24 data class InputMethodModel(
25     /** A unique ID for this input method. */
26     val imeId: String,
27     /** The subtypes of this IME (may be empty). */
28     val subtypes: List<Subtype>,
29 ) {
30     /**
31      * A Subtype can describe locale (e.g. en_US, fr_FR...) and mode (e.g. voice, keyboard), and is
32      * used for IME switch and settings.
33      *
34      * @see android.view.inputmethod.InputMethodSubtype
35      */
36     data class Subtype(
37         /** A unique ID for this IME subtype. */
38         val subtypeId: Int,
39         /**
40          * Whether this subtype is auxiliary. An auxiliary subtype will not be shown in the list of
41          * enabled IMEs for choosing the current IME in Settings, but it will be shown in the list
42          * of IMEs in the IME switcher to allow the user to tentatively switch to this subtype while
43          * an IME is shown.
44          *
45          * The intent of this flag is to allow for IMEs that are invoked in a one-shot way as
46          * auxiliary input mode, and return to the previous IME once it is finished (e.g. voice
47          * input).
48          */
49         val isAuxiliary: Boolean,
50     )
51 }
52