Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# ExtInputMethodInterface Class Reference

The ExtInputMethodInterface class provides an extended interface for Qtopia input methods. It allows implementing both Popup Input Methods and Composing Input Methods. More...

`#include <qtopia/inputmethodinterface.h>`

List of all member functions.

## Public Members

- virtual QString name () = 0
- virtual QPixmap * icon () = 0
- virtual void resetState () = 0
- virtual QWidget * keyboardWidget ( QWidget * parent, Qt::WFlags f ) = 0
- virtual QStringList compatible () = 0
- virtual QWSInputMethod * inputMethod () = 0
- virtual QWidget * statusWidget ( QWidget * parent, Qt::WFlags f ) = 0

## Detailed Description

The ExtInputMethodInterface class provides an extended interface for Qtopia input methods. It allows implementing both Popup Input Methods and Composing Input Methods.

Popup Input Methods must supply a QWidget that will be shown on the screen and emit a signal when a key is Pressed. They can also be implemented using InputMethodInterface. The advantage to using the ExtInputMethodInterface to implement a Popup Input method is access to the Qtopia 1.6 input method API. To create a Popup Input Method implement keyboardWidget(). There is no `onKeyPress` method; use QWSServer::sendKeyEvent() to send key events when a key is pressed.

Composing Input Methods modify input from a separate keyboard (real or virtual). In this case, implement inputMethod() and statusWidget(). Composing input methods are mainly intended for languages such as Chinese, Japanese and Korean, however can be used to expand the capability of any text input, include that from Popup Input Methods.

There may be dependencies between specific Popup Input Methods and Composing Input Methods. This can be specified by implementing compatible().

Input methods may be added to Qtopia via plugins. In order to write an input method plugin you must create an interface to your input method by deriving from the ExtInputMethodInterface class and implementing the pure virtual functions.

See also: Input Method Tutorial

## Member Function Documentation

### QStringList ExtInputMethodInterface::compatible ()`[pure virtual]`

Returns a list of plugin library filenames that are compatible with this input method. An empty list means that there are no restrictions; it is compatible with anything.

### QPixmap * ExtInputMethodInterface::icon ()`[pure virtual]`

The icon() function returns the icon for the input method. This will be displayed in the taskbar when the input method is selected.

### QWSInputMethod * ExtInputMethodInterface::inputMethod ()`[pure virtual]`

If this is a Composing Input Method, this function returns the input method object, which is a subclass of QWSInputMethod.

Returns 0 for a virtual keyboard.

### QWidget * ExtInputMethodInterface::keyboardWidget ( QWidget * parent, Qt::WFlags f )`[pure virtual]`

For a virtual keyboard, creates keyboard widget (if not already created) and returns the keyboard widget. Returns 0 for a composing input method.

parent is the parent of the widget. f contains the flags to pass to the widget.

This widget will be display just above the task bar when the user needs to input text. You should always return the same widget if this function is called multiple times.

### QString ExtInputMethodInterface::name ()`[pure virtual]`

The name() function returns the name of the input method. This will be displayed in the popup list of available input methods.

### void ExtInputMethodInterface::resetState ()`[pure virtual]`

The resetState() function should return the input method to its default state.

### QWidget * ExtInputMethodInterface::statusWidget ( QWidget * parent, Qt::WFlags f )`[pure virtual]`

For a composing input method, this function returns a widget to be shown in the taskbar. parent and f are the standard QWidget parameters.

This file is part of the Qtopia platform, copyright © 1995-2004 Trolltech, all rights reserved.