Home · All Classes · Annotated · Functions

QtopiaInputMethod Class Reference

The QtopiaInputMethod class describes the minimum interface that an input method plug-in must provide. More...

#include <QtopiaInputMethod>

Inherits QObject.

Public Types

Public Functions

Public Slots

Signals

Additional Inherited Members


Detailed Description

The QtopiaInputMethod class describes the minimum interface that an input method plug-in must provide.

Input Methods may be added to Qtopia via plug-ins. In order to write an input method plug-in you must create an interface for your plug-in by deriving from the QtopiaInputMethod class.

At a minimum you will need to provide the methods name(), identifier(), version(), state(), properties(), icon() and reset().

Pop-up input methods that need to show a widget on the screen can do so by overriding inputWidget().

Filtering input methods that need to filter application pen or keyboard events can do so by overriding inputModifier()


Member Type Documentation

enum QtopiaInputMethod::Properties

The Properties flags describe how the input method behaves and under what conditions it should be loaded.

ConstantValueDescription
QtopiaInputMethod::RequireMouse0x0001The input method should not be loaded if no pen input is available.
QtopiaInputMethod::RequireKeypad0x0002The input method should not be loaded if no phone keypad is available. A phone keypad consists of 0-9, * and # keys.
QtopiaInputMethod::InputModifier0x0004The input method can filter device pen and key events.
QtopiaInputMethod::InputWidget0x0010The input method has provides a popup widget receive input
QtopiaInputMethod::InteractiveIcon0x0008The icon representing the input method is interactive. It can be clicked or will animate to show the mode of the input method.

enum QtopiaInputMethod::State

This enum describe the state of the input method.

ConstantValueDescription
QtopiaInputMethod::Sleeping0The input method is not able to provide input for the current input method hint.
QtopiaInputMethod::Ready1The input method is able to provide input for the current input method hint.


Member Function Documentation

QtopiaInputMethod::QtopiaInputMethod ( QObject * parent )

Constructs an input method with the parent set to parent.

QtopiaInputMethod::~QtopiaInputMethod ()   [virtual]

Destroys the input method.

void QtopiaInputMethod::clicked ()   [virtual slot]

This function is called when the user clicks on the status icon of the input method. It is only called doesn't provide its own status widget.

See also statusWidget().

QIcon QtopiaInputMethod::icon () const   [pure virtual]

Returns the icon associated with this input method.

QString QtopiaInputMethod::identifier () const   [pure virtual]

Returns the indentifier of the input method. This is used to identify the input method in code.

QWSInputMethod * QtopiaInputMethod::inputModifier ()   [virtual]

Returns the input modifier for the input method.

The input modifer is installed as the current input method for the QWSServer when selected. This allows the input method to work by filtering pen movements on the screen or filterying device keys. Returning 0 indicates no input modifier is provided and that the input method uses some other method for the user to generated text.

The base class returns 0.

QWidget * QtopiaInputMethod::inputWidget ( QWidget * parent = 0 )   [virtual]

Returns the input widget for the input method. On the first call of this function it should create the widget with the given parent.

The widget is used for input methods that have the InputWidget property. It is shown when the user requests it to provide input or even simply provide additional keys. Returning 0 indicates no input widget is provided and that the input method uses some other method for the user to generate text.

The base class returns 0.

QString QtopiaInputMethod::name () const   [pure virtual]

Returns the name of the input method. This is a end user visible string and should be translated to the users locale.

int QtopiaInputMethod::properties () const   [pure virtual]

Returns the capability property flags for the input method.

See also Properties.

void QtopiaInputMethod::reset ()   [pure virtual]

Resets the input method to its initial state.

bool QtopiaInputMethod::restrictedToHint () const   [virtual]

Returns true if the current input method is restricted to providing input suitable for the current hint.

void QtopiaInputMethod::setHint ( const QString & hint, bool restricted )   [virtual]

Sets the hint describing the sort of input the current input widget requires to hint. If restricted is true the widget only accepts one kind of input and input method should disable any mode switching. For example, the home screen Qtopia might set the hint to be restricted to phone numbers.

Example hints are words - Dictonary words such as some notes text - Names, passwords etc. extended - text with extensions for additional character sets number - 0-9 phone - Phone numbers, 0-9 plus phone control codes such as 'p' 'x' or 'w'.

Application may also define custom hints, such as email to describe an email address. Input methods should provide reasonable default behavior for hints they do not recognize.

State QtopiaInputMethod::state () const   [pure virtual]

Returns the current state of the input method.

void QtopiaInputMethod::stateChanged ( int state )   [signal]

This signal is emitted when the input method state changes to state.

See also state().

QWidget * QtopiaInputMethod::statusWidget ( QWidget * parent = 0 )   [virtual]

Returns the status widget for the input method. On the first call of this function it should create the widget with the given parent.

The status widget is displayed when the input method is selected and not in the Sleeping state. If no status widget is provided a label with the icon returned from icon() will be used instead.

The base class returns 0.

bool QtopiaInputMethod::testProperty ( int p ) const

Returns true if the property flag p is set to true for this input method. Otherwise returns false.

QString QtopiaInputMethod::version () const   [pure virtual]

Returns the version string of the input method.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7