1 /* 2 * Copyright (C) 2016 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.view.textservice; 18 19 import android.os.Bundle; 20 import android.view.textservice.SpellCheckerSession.SpellCheckerSessionListener; 21 22 import java.util.Locale; 23 24 /** 25 * A stub class of TextServicesManager for Layout-Lib. 26 */ 27 public final class TextServicesManager { 28 private static final TextServicesManager sInstance = new TextServicesManager(); 29 private static final SpellCheckerInfo[] EMPTY_SPELL_CHECKER_INFO = new SpellCheckerInfo[0]; 30 31 /** 32 * Retrieve the global TextServicesManager instance, creating it if it doesn't already exist. 33 * @hide 34 */ getInstance()35 public static TextServicesManager getInstance() { 36 return sInstance; 37 } 38 newSpellCheckerSession(Bundle bundle, Locale locale, SpellCheckerSessionListener listener, boolean referToSpellCheckerLanguageSettings)39 public SpellCheckerSession newSpellCheckerSession(Bundle bundle, Locale locale, 40 SpellCheckerSessionListener listener, boolean referToSpellCheckerLanguageSettings) { 41 return null; 42 } 43 44 /** 45 * @hide 46 */ getEnabledSpellCheckers()47 public SpellCheckerInfo[] getEnabledSpellCheckers() { 48 return EMPTY_SPELL_CHECKER_INFO; 49 } 50 51 /** 52 * @hide 53 */ getCurrentSpellChecker()54 public SpellCheckerInfo getCurrentSpellChecker() { 55 return null; 56 } 57 58 /** 59 * @hide 60 */ getCurrentSpellCheckerSubtype( boolean allowImplicitlySelectedSubtype)61 public SpellCheckerSubtype getCurrentSpellCheckerSubtype( 62 boolean allowImplicitlySelectedSubtype) { 63 return null; 64 } 65 66 /** 67 * @hide 68 */ isSpellCheckerEnabled()69 public boolean isSpellCheckerEnabled() { 70 return false; 71 } 72 } 73