1 /* 2 * Copyright (C) 2011 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.internal.textservice; 18 19 import com.android.tools.layoutlib.annotations.LayoutlibDelegate; 20 21 import android.os.Bundle; 22 import android.os.IBinder; 23 import android.os.RemoteException; 24 import android.view.textservice.SpellCheckerInfo; 25 import android.view.textservice.SpellCheckerSubtype; 26 27 28 /** 29 * Delegate used to provide new implementation of a select few methods of 30 * {@link ITextServicesManager$Stub} 31 * 32 * Through the layoutlib_create tool, the original methods of Stub have been replaced 33 * by calls to methods of the same name in this delegate class. 34 * 35 */ 36 public class ITextServicesManager_Stub_Delegate { 37 38 @LayoutlibDelegate 39 public static ITextServicesManager asInterface(IBinder obj) { 40 // ignore the obj and return a fake interface implementation 41 return new FakeTextServicesManager(); 42 } 43 44 private static class FakeTextServicesManager implements ITextServicesManager { 45 46 @Override 47 public void finishSpellCheckerService(ISpellCheckerSessionListener arg0) 48 throws RemoteException { 49 // TODO Auto-generated method stub 50 51 } 52 53 @Override 54 public SpellCheckerInfo getCurrentSpellChecker(String arg0) throws RemoteException { 55 // TODO Auto-generated method stub 56 return null; 57 } 58 59 @Override 60 public SpellCheckerSubtype getCurrentSpellCheckerSubtype(String arg0, boolean arg1) 61 throws RemoteException { 62 // TODO Auto-generated method stub 63 return null; 64 } 65 66 @Override 67 public SpellCheckerInfo[] getEnabledSpellCheckers() throws RemoteException { 68 // TODO Auto-generated method stub 69 return null; 70 } 71 72 @Override 73 public void getSpellCheckerService(String arg0, String arg1, 74 ITextServicesSessionListener arg2, ISpellCheckerSessionListener arg3, Bundle arg4) 75 throws RemoteException { 76 // TODO Auto-generated method stub 77 78 } 79 80 @Override 81 public boolean isSpellCheckerEnabled() throws RemoteException { 82 // TODO Auto-generated method stub 83 return false; 84 } 85 86 @Override 87 public void setCurrentSpellChecker(String arg0, String arg1) throws RemoteException { 88 // TODO Auto-generated method stub 89 90 } 91 92 @Override 93 public void setCurrentSpellCheckerSubtype(String arg0, int arg1) throws RemoteException { 94 // TODO Auto-generated method stub 95 96 } 97 98 @Override 99 public void setSpellCheckerEnabled(boolean arg0) throws RemoteException { 100 // TODO Auto-generated method stub 101 102 } 103 104 @Override 105 public IBinder asBinder() { 106 // TODO Auto-generated method stub 107 return null; 108 } 109 110 } 111 } 112