1 /* 2 * Copyright (C) 2008-2012 OMRON SOFTWARE Co., Ltd. 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 jp.co.omronsoft.openwnn; 18 19 import android.content.SharedPreferences; 20 21 /** 22 * The interface of pre-converter for input string used by OpenWnn. 23 * <br> 24 * This is a simple converter for Romaji-to-Kana input, Hangul input, etc. 25 * Before converting the input string by {@link WnnEngine}, {@link OpenWnn} invokes this converter. 26 * 27 * @author Copyright (C) 2009 OMRON SOFTWARE CO., LTD. All Rights Reserved. 28 */ 29 public interface LetterConverter { 30 /** 31 * Convert the layer #0 text(pressed key sequence) to layer #1 text(pre converted string). 32 * <br> 33 * This conversion is used for converting some key input to a character. 34 * For example, Latin capital letter conversion <it>(ex: "'"+"a" to "á")</it>", 35 * Romaji-to-Kana conversion in Japanese <it>(ex: "w"+"a" to "わ")</it>, 36 * Hangul conversion in Korean. 37 * 38 * @param text The text data includes input sequence(layer #0) and output area(layer #1) 39 * @return {@code true} if conversion is completed; {@code false} if not. 40 */ 41 public boolean convert(ComposingText text); 42 43 /** 44 * Reflect the preferences in the letter converter. 45 * 46 * @param pref The preferences 47 */ 48 public void setPreferences(SharedPreferences pref); 49 } 50