QWSInputMethod(3qt)

NAME
QWSInputMethod - International input methods for Qt/Embedded

#include <qwindowsystem_qws.h>

Inherits QObject.

  Public Members
QWSInputMethod ()
virtual ~QWSInputMethod ()
virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )
virtual void reset ()
virtual void setMicroFocus ( int x, int y )
virtual void mouseHandler ( int, int )
QFont font () const
QRect inputRect () const

  Protected Members
void sendIMEvent ( QWSServer::IMState state, const QString & txt, int cpos, int selLen = 0 )

DESCRIPTION
The QWSInputMethod class provides international input methods for Qt/Embedded.

Subclass this to implement your own input method

An input methods consists of a keyboard filter and optionally a graphical interface. The keyboard filter intercepts key events from physical or virtual keyboards by implementing the filter() function.

Use sendIMEvent() to send composition events. Composition starts with the input method sending the first IMCompose event. This can be followed by a number of IMCompose events and ending with an IMEnd event.

The function setMicroFocus() is called when the focus widget changes its cursor position.

The functions font() and inputRect() provide more information about the state of the focus widget.

Use QWSServer::setCurrentInputMethod() to install an input method.

MEMBER FUNCTION DOCUMENTATION

QWSInputMethod::QWSInputMethod ()
Constructs a new input method.

QWSInputMethod::~QWSInputMethod () [virtual]
Destructs the input method uninstalling it if it is currently installed.

bool QWSInputMethod::filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) [virtual]
Must be implemented in subclasses to handle key input from physical or virtual keyboards. Returning TRUE will block the event from further processing.

All normal key events should be blocked while in compose mode (between IMCompose and IMEnd).

QFont QWSInputMethod::font () const
Returns the font of the current input widget.

QRect QWSInputMethod::inputRect () const
Returns the input rectangle of the current input widget. The input rectangle covers the width of the input widget, and may extend below it. This can be used to determine the geometry of an input widget for over-the-spot input methods.

void QWSInputMethod::mouseHandler ( int x, int state ) [virtual]
Implemented in subclasses to handle mouse presses/releases within the on-the-spot text. The parameter x is the offset within the string that was sent with the IMCompose event. state is either QWSServer::MousePress or QWSServer::MouseRelease

void QWSInputMethod::reset () [virtual]
Implemented in subclasses to reset the state of the input method.

void QWSInputMethod::sendIMEvent ( QWSServer::IMState state, const QString & txt, int cpos, int selLen = 0 ) [protected]
Causes a QIMEvent to be sent to the focus widget. state may be either QWSServer::IMCompose or QWSServer::IMEnd.

txt is the text being composed (or the finished text if state is IMEnd). cpos is the current cursor position.

If state is IMCompose, selLen is the number of characters in the composition string ( starting at cpos ) that should be marked as selected by the input widget receiving the event.

void QWSInputMethod::setMicroFocus ( int x, int y ) [virtual]
Implemented in subclasses to handle microFocusHint changes in the focus widget. x and y are the global coordinates of the cursor position.

SEE ALSO
http://doc.trolltech.com/qwsinputmethod.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qwsinputmethod.3qt) and the Qt version (2.3.10).