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
17package jp.co.omronsoft.openwnn;
18
19import android.view.View;
20import android.content.SharedPreferences;
21import android.view.inputmethod.EditorInfo;
22
23/**
24 * The interface of input view manager used by OpenWnn.
25 *
26 * @author Copyright (C) 2009-2011 OMRON SOFTWARE CO., LTD.  All Rights Reserved.
27 */
28public interface InputViewManager {
29    /**
30     * Initialize the input view.
31     *
32     * @param parent    The OpenWnn object
33     * @param width     The width of the display
34     * @param height    The height of the display
35     *
36     * @return      The input view created in the initialize process; {@code null} if cannot create a input view.
37     */
38    public View initView(OpenWnn parent, int width, int height);
39
40    /**
41     * Get the input view being used currently.
42     *
43     * @return  The input view; {@code null} if no input view is used currently.
44     */
45    public View getCurrentView();
46
47    /**
48     * Notification of updating parent's state.
49     *
50     * @param parent    The OpenWnn object using this manager
51     */
52    public void onUpdateState(OpenWnn parent);
53
54    /**
55     * Reflect the preferences in the input view.
56     *
57     * @param pref    The preferences
58     * @param editor  The information about the editor
59     */
60    public void setPreferences(SharedPreferences pref, EditorInfo editor);
61
62    /**
63     * Close the input view.
64     */
65    public void closing();
66
67    /**
68     * Show the input view.
69     */
70    public void showInputView();
71
72    /**
73     * Hide the input view.
74     */
75    public void hideInputView();
76
77}
78