Home | History | Annotate | Download | only in wtk
      1 /*
      2  *  Licensed to the Apache Software Foundation (ASF) under one or more
      3  *  contributor license agreements.  See the NOTICE file distributed with
      4  *  this work for additional information regarding copyright ownership.
      5  *  The ASF licenses this file to You under the Apache License, Version 2.0
      6  *  (the "License"); you may not use this file except in compliance with
      7  *  the License.  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  */
     17 /**
     18  * @author Dmitry A. Durnev
     19  * @version $Revision$
     20  */
     21 package org.apache.harmony.awt.wtk;
     22 
     23 import java.awt.AWTEvent;
     24 import java.awt.AWTException;
     25 import java.awt.Image;
     26 import java.awt.Rectangle;
     27 import java.awt.im.spi.InputMethod;
     28 import java.awt.im.spi.InputMethodContext;
     29 import java.awt.im.spi.InputMethodDescriptor;
     30 import java.lang.Character.Subset;
     31 import java.util.Locale;
     32 
     33 /**
     34  * A cross-platform interface for native input
     35  * method sub-system functionality.
     36  */
     37 public abstract class NativeIM implements InputMethod, InputMethodDescriptor {
     38     protected InputMethodContext imc;
     39 
     40     public void activate() {
     41 
     42     }
     43 
     44     public void deactivate(boolean isTemporary) {
     45 
     46     }
     47 
     48     public void dispatchEvent(AWTEvent event) {
     49 
     50     }
     51 
     52     public void dispose() {
     53 
     54     }
     55 
     56     public void endComposition() {
     57 
     58     }
     59 
     60     public Object getControlObject() {
     61         return null;
     62     }
     63 
     64     public Locale getLocale() {
     65         return null;
     66     }
     67 
     68     public void hideWindows() {
     69 
     70     }
     71 
     72     public boolean isCompositionEnabled() {
     73         return false;
     74     }
     75 
     76     public void notifyClientWindowChange(Rectangle bounds) {
     77 
     78     }
     79 
     80     public void reconvert() {
     81 
     82     }
     83 
     84     public void removeNotify() {
     85 
     86     }
     87 
     88     public void setCharacterSubsets(Subset[] subsets) {
     89 
     90     }
     91 
     92     public void setCompositionEnabled(boolean enable) {
     93 
     94     }
     95 
     96     public void setInputMethodContext(InputMethodContext context) {
     97         imc = context;
     98     }
     99 
    100     public boolean setLocale(Locale locale) {
    101         return false;
    102     }
    103 
    104     public Locale[] getAvailableLocales() throws AWTException {
    105     	return new Locale[]{Locale.getDefault(), Locale.ENGLISH};
    106         //return new Locale[]{Locale.getDefault(), Locale.US};
    107     }
    108 
    109     public InputMethod createInputMethod() throws Exception {
    110         return this;
    111     }
    112 
    113     public String getInputMethodDisplayName(Locale inputLocale,
    114                                             Locale displayLanguage) {
    115         return "System input methods"; //$NON-NLS-1$
    116     }
    117 
    118     public Image getInputMethodIcon(Locale inputLocale) {
    119         return null;
    120     }
    121 
    122     public boolean hasDynamicLocaleList() {
    123         return false;
    124     }
    125 
    126     public abstract void disableIME();
    127 
    128 //    public abstract void disableIME(long id);
    129 
    130 }
    131