Home ยท API Reference |
MAbstractInputMethod is a base class for input methods. More...
Classes | |
struct | MInputMethodSubView |
Signals | |
void | activeSubViewChanged (const QString &subViewId, MInputMethod::HandlerState state=MInputMethod::OnScreen) |
Inform that active subview is changed to subViewId for state. | |
Public Member Functions | |
MAbstractInputMethod (MAbstractInputMethodHost *host, QWidget *mainWindow) | |
virtual | ~MAbstractInputMethod () |
MAbstractInputMethodHost * | inputMethodHost () const |
Returns input method host. | |
virtual void | show () |
Show request. | |
virtual void | hide () |
Hide request. | |
virtual void | setPreedit (const QString &preeditString, int cursorPos) |
Notifies input method about predit string changes. | |
virtual void | update () |
State update notification. | |
virtual void | reset () |
Reset notification. | |
virtual void | handleMouseClickOnPreedit (const QPoint &pos, const QRect &preeditRect) |
Notifies input method about mouse click on the preedit string. | |
virtual void | handleFocusChange (bool focusIn) |
Notifies input method about focus changes on application side. | |
virtual void | handleVisualizationPriorityChange (bool priority) |
Notifies that the focus widget in application changed visualization priority. | |
virtual void | handleAppOrientationAboutToChange (int angle) |
Target application is about to change orientation. | |
virtual void | handleAppOrientationChanged (int angle) |
Target application already finish changing orientation. | |
virtual void | setToolbar (QSharedPointer< const MToolbarData > toolbar) |
Uses a custom toolbar which is defined by given parameter. | |
virtual void | processKeyEvent (QEvent::Type keyType, Qt::Key keyCode, Qt::KeyboardModifiers modifiers, const QString &text, bool autoRepeat, int count, quint32 nativeScanCode, quint32 nativeModifiers, unsigned long time) |
Process a key event redirected from hardware keyboard to input method. | |
virtual void | setState (const QSet< MInputMethod::HandlerState > &state) |
This method is called to inform about keyboard status changes. | |
virtual void | handleClientChange () |
This method is called when target client (application) has changed. | |
virtual void | switchContext (MInputMethod::SwitchDirection direction, bool enableAnimation) |
Switch context to given direction. | |
virtual QList < MInputMethodSubView > | subViews (MInputMethod::HandlerState state=MInputMethod::OnScreen) const |
Returns all subviews (IDs and titles) which are supported for state. | |
virtual void | showLanguageNotification () |
Show notification to user informing about current language/subview. | |
virtual void | setKeyOverrides (const QMap< QString, QSharedPointer< MKeyOverride > > &overrides) |
Uses custom key overrides which are defined by given parameter. | |
virtual bool | imExtensionEvent (MImExtensionEvent *event) |
handles extension event not covered by a dedicated method. |
MAbstractInputMethod is a base class for input methods.
It defines the interface which input method framework uses for passing commands received from the applications. Communication in the other direction, from the input method to the framework, is done using the MAbstractInputMethodHost object returned from inputMethodHost().
MAbstractInputMethod::MAbstractInputMethod | ( | MAbstractInputMethodHost * | host, | |
QWidget * | mainWindow | |||
) |
Constructor
Note: Currently the entire widget hierarchy must be built and added to mainWindow here.
host | serves as communication link to framework and application. Managed by framework. | |
mainWindow | should be used to install plugin's UI into it. Managed by framework. |
MAbstractInputMethod::~MAbstractInputMethod | ( | ) | [virtual] |
void MAbstractInputMethod::activeSubViewChanged | ( | const QString & | subViewId, | |
MInputMethod::HandlerState | state = MInputMethod::OnScreen | |||
) | [signal] |
Inform that active subview is changed to subViewId for state.
Must be emitted when plugin changes the active subview for specified state.
subViewId | the identifier of the new subview. | |
state | the state which subViewId belongs to. |
void MAbstractInputMethod::handleAppOrientationAboutToChange | ( | int | angle | ) | [virtual] |
Target application is about to change orientation.
The input method usually changes its own orientation according to this. Note that this method might not be called when the input method shown for the first time.
angle | The angle in degrees. Possible values: 0, 90, 180, 270. 0 is the normal orientation of the display server. |
void MAbstractInputMethod::handleAppOrientationChanged | ( | int | angle | ) | [virtual] |
Target application already finish changing orientation.
angle | The angle in degrees. Possible values: 0, 90, 180, 270. 0 is the normal orientation of the display server. |
void MAbstractInputMethod::handleClientChange | ( | ) | [virtual] |
This method is called when target client (application) has changed.
void MAbstractInputMethod::handleFocusChange | ( | bool | focusIn | ) | [virtual] |
Notifies input method about focus changes on application side.
Reimplementhing this method is optional.
focusIn | true - focus has entered a widget, false - focus has left a widget |
void MAbstractInputMethod::handleMouseClickOnPreedit | ( | const QPoint & | pos, | |
const QRect & | preeditRect | |||
) | [virtual] |
Notifies input method about mouse click on the preedit string.
Reimplementing this method is optional. It is used by Meego Keyboard.
void MAbstractInputMethod::handleVisualizationPriorityChange | ( | bool | priority | ) | [virtual] |
Notifies that the focus widget in application changed visualization priority.
This method is used by the framework to allow the input method to be dismissed while a widget is focused. Further calls to show() when priority is true should not show the input method. When priority is set to false again, and the input method is not in hidden state, the input method should be shown.
priority | If true, the application has priority, and the input method should not be shown. |
void MAbstractInputMethod::hide | ( | ) | [virtual] |
Hide request.
The input method must hide itself when this is called.
bool MAbstractInputMethod::imExtensionEvent | ( | MImExtensionEvent * | event | ) | [virtual] |
handles extension event not covered by a dedicated method.
Must return true if event is handled, otherwise false. Extensions can be registered on the application side, and will be passed through to the input method, allowing to add integration points between application and input method. Reimplementing this method is optional.
event | event to handle |
MAbstractInputMethodHost * MAbstractInputMethod::inputMethodHost | ( | ) | const |
Returns input method host.
void MAbstractInputMethod::processKeyEvent | ( | QEvent::Type | keyType, | |
Qt::Key | keyCode, | |||
Qt::KeyboardModifiers | modifiers, | |||
const QString & | text, | |||
bool | autoRepeat, | |||
int | count, | |||
quint32 | nativeScanCode, | |||
quint32 | nativeModifiers, | |||
unsigned long | time | |||
) | [virtual] |
Process a key event redirected from hardware keyboard to input method.
This is called only if one has enabled redirection by calling MInputContextConnection::setRedirectKeys.
Reimplementing this method is optional. It can be used to implement input methods that handle hardware keyboard.
void MAbstractInputMethod::reset | ( | ) | [virtual] |
Reset notification.
void MAbstractInputMethod::setKeyOverrides | ( | const QMap< QString, QSharedPointer< MKeyOverride > > & | overrides | ) | [virtual] |
Uses custom key overrides which are defined by given parameter.
Reimplementing this method is optional. It is used in Meego Keyboard to provide context aware keys that can be customized from the application side.
overrides | Pointer to key override definitions. |
void MAbstractInputMethod::setPreedit | ( | const QString & | preeditString, | |
int | cursorPos | |||
) | [virtual] |
Notifies input method about predit string changes.
This method informs the input method about preedit and the cursor position. The input method can fully control the preedit and the cursor inside it: whether and where to show cursor inside preedit, and how the preedit string should be styled.
preeditString | preedit string | |
cursorPos | the cursor position inside preedit. |
void MAbstractInputMethod::setState | ( | const QSet< MInputMethod::HandlerState > & | state | ) | [virtual] |
This method is called to inform about keyboard status changes.
For example: Hardware keyboard is opened or closed, BT keyboard is connected or disconnected.
state | set of current states for this plugin |
void MAbstractInputMethod::setToolbar | ( | QSharedPointer< const MToolbarData > | toolbar | ) | [virtual] |
Uses a custom toolbar which is defined by given parameter.
Reimplementing this method is optional. It is used by Meego Keyboard.
toolbar | Pointer to toolbar definition. |
void MAbstractInputMethod::show | ( | ) | [virtual] |
Show request.
The input method should normally show its UI on this call, unless handleVisualizationPriorityChange(bool) was called with a true value.
void MAbstractInputMethod::showLanguageNotification | ( | ) | [virtual] |
Show notification to user informing about current language/subview.
Reimplementing this method is optional.
QList< MAbstractInputMethod::MInputMethodSubView > MAbstractInputMethod::subViews | ( | MInputMethod::HandlerState | state = MInputMethod::OnScreen |
) | const [virtual] |
Returns all subviews (IDs and titles) which are supported for state.
Implement this function to return the subviews which are supported by this input method for the specified state. An input method must return at least one subview for a supported state.
void MAbstractInputMethod::switchContext | ( | MInputMethod::SwitchDirection | direction, | |
bool | enableAnimation | |||
) | [virtual] |
Switch context to given direction.
If the input method arranges the subviews horizontally (like Meego Keyboard does) it should first try to change its subviews in the direction indicated. If there are no more subviews in the given direction, MInputMethodHost::switchPlugin(MInputMethod::SwitchDirection ) should be called.
direction | Switching direction | |
enableAnimation | Contains true if swipe should be animated |
void MAbstractInputMethod::update | ( | ) | [virtual] |
State update notification.
General update notification. Called in addition to the specific methods.
Copyright © 2010 Nokia Corporation | MeeGo Touch |