Home · API Reference · Modules
Public Slots | Signals | Public Member Functions | List of all members
MAbstractInputMethodHost Class Referenceabstract
Inheritance diagram for MAbstractInputMethodHost:
Inheritance graph
[legend]

Public Slots

virtual void sendPreeditString (const QString &string, const QList< Maliit::PreeditTextFormat > &preeditFormats, int replacementStart=0, int replacementLength=0, int cursorPos=-1)=0
 
virtual void sendCommitString (const QString &string, int replaceStart=0, int replaceLength=0, int cursorPos=-1)=0
 
virtual void sendKeyEvent (const QKeyEvent &keyEvent, Maliit::EventRequestType requestType=Maliit::EventRequestBoth)=0
 
virtual void notifyImInitiatedHiding ()=0
 
virtual void invokeAction (const QString &action, const QKeySequence &sequence)=0
 
virtual void setRedirectKeys (bool enabled)=0
 
virtual void setDetectableAutoRepeat (bool enabled)=0
 
virtual void setGlobalCorrectionEnabled (bool enabled)=0
 
virtual void setInputModeIndicator (Maliit::InputModeIndicator mode)=0
 
virtual void switchPlugin (Maliit::SwitchDirection direction)=0
 
virtual void switchPlugin (const QString &pluginName)=0
 
virtual void setScreenRegion (const QRegion &region)=0
 
virtual void setInputMethodArea (const QRegion &region)=0
 
virtual void setSelection (int start, int length)=0
 
virtual void setOrientationAngleLocked (bool lock)=0
 

Signals

void pluginsChanged ()
 

Public Member Functions

 MAbstractInputMethodHost (QObject *parent=0)
 
virtual ~MAbstractInputMethodHost ()
 
virtual int contentType (bool &valid)=0
 
virtual bool correctionEnabled (bool &valid)=0
 
virtual bool predictionEnabled (bool &valid)=0
 
virtual bool autoCapitalizationEnabled (bool &valid)=0
 
virtual bool surroundingText (QString &text, int &cursorPosition)=0
 
virtual bool hasSelection (bool &valid)=0
 
virtual int inputMethodMode (bool &valid)=0
 
virtual QRect preeditRectangle (bool &valid)=0
 
virtual QRect cursorRectangle (bool &valid)=0
 
virtual int anchorPosition (bool &valid)=0
 
virtual bool hiddenText (bool &valid)
 
virtual QString selection (bool &valid)=0
 
QPixmap background () const
 
virtual QList< MImPluginDescriptionpluginDescriptions (Maliit::HandlerState state) const =0
 
virtual int preeditClickPos (bool &valid) const
 
virtual QList< MImSubViewDescriptionsurroundingSubViewDescriptions (Maliit::HandlerState state) const
 
virtual void setLanguage (const QString &language)
 
virtual Maliit::Plugins::AbstractSurfaceFactorysurfaceFactory ()=0
 
virtual Maliit::Plugins::AbstractPluginSettingregisterPluginSetting (const QString &key, const QString &description, Maliit::SettingEntryType type, const QVariantMap &attributes)=0
 

Detailed Description

Provides an interface for input method instances to connect to the environment.

MAbstractInputMethodHost provides methods MAbstractInputMethod instances can use for interacting with the application that is using input method services and the input method framework state itself.

Note
this is not meant to be derived by the input method framework users; the concrete implementations are provided by the framework.

Constructor & Destructor Documentation

MAbstractInputMethodHost::MAbstractInputMethodHost ( QObject *  parent = 0)
explicit
MAbstractInputMethodHost::~MAbstractInputMethodHost ( )
virtual

Member Function Documentation

virtual int MAbstractInputMethodHost::anchorPosition ( bool &  valid)
pure virtual

returns the position of the selection anchor.

This may be less or greater than cursor position, depending on which side of selection the cursor is. If there is no selection, it returns the same as cursor position.

virtual bool MAbstractInputMethodHost::autoCapitalizationEnabled ( bool &  valid)
pure virtual

returns input method auto-capitalization hint if output parameter valid is true.

QPixmap MAbstractInputMethodHost::background ( ) const

returns a pixmap that needs to be drawn as the background of the input method. Pixmap contains the application's window contents.

virtual int MAbstractInputMethodHost::contentType ( bool &  valid)
pure virtual

returns content type for focused widget if output parameter valid is true, value matches enum M::TextContentType

virtual bool MAbstractInputMethodHost::correctionEnabled ( bool &  valid)
pure virtual

returns input method correction hint if output parameter valid is true.

virtual QRect MAbstractInputMethodHost::cursorRectangle ( bool &  valid)
pure virtual

get cursor rectangle

virtual bool MAbstractInputMethodHost::hasSelection ( bool &  valid)
pure virtual

returns true if there is selecting text

bool MAbstractInputMethodHost::hiddenText ( bool &  valid)
virtual

true if text input is being made hidden, e.g. with password fields

virtual int MAbstractInputMethodHost::inputMethodMode ( bool &  valid)
pure virtual

get input method mode

virtual void MAbstractInputMethodHost::invokeAction ( const QString &  action,
const QKeySequence &  sequence 
)
pure virtualslot

calls actions like "copy" or "paste" on the focused text entry.

Parameters
actionThe action to call
sequenceThe fall-back key sequence when action is not available
virtual void MAbstractInputMethodHost::notifyImInitiatedHiding ( )
pure virtualslot

Notifies about hiding initiated by the input method.

virtual QList<MImPluginDescription> MAbstractInputMethodHost::pluginDescriptions ( Maliit::HandlerState  state) const
pure virtual

Return information about loaded input method plugins which could work in specified state.

See also
MImPluginDesription
void MAbstractInputMethodHost::pluginsChanged ( )
signal

This signal is emitted when input method plugins are loaded or unloaded.

virtual bool MAbstractInputMethodHost::predictionEnabled ( bool &  valid)
pure virtual

returns input method word prediction hint if output parameter valid is true.

virtual int MAbstractInputMethodHost::preeditClickPos ( bool &  valid) const
inlinevirtual

returns the current cursor position within the preedit region

virtual QRect MAbstractInputMethodHost::preeditRectangle ( bool &  valid)
pure virtual

get preedit rectangle

virtual Maliit::Plugins::AbstractPluginSetting* MAbstractInputMethodHost::registerPluginSetting ( const QString &  key,
const QString &  description,
Maliit::SettingEntryType  type,
const QVariantMap &  attributes 
)
pure virtual

Register a new plugin setting.

Parameters
keyname for the entry
typevalue type
attributesattribute map, the same used in SettingsEntry

Returns an object (owned by the plugin) that can be used to manipulate the setting entry.

See also
Maliit::SettingEntryAttributes
Maliit::SettingsEntry
virtual QString MAbstractInputMethodHost::selection ( bool &  valid)
pure virtual

returns the selecting text

virtual void MAbstractInputMethodHost::sendCommitString ( const QString &  string,
int  replaceStart = 0,
int  replaceLength = 0,
int  cursorPos = -1 
)
pure virtualslot

Updates commit string in the application widget, and set cursor position.

Parameters
stringThe string to be committed
replaceStartThe position at which characters are to be replaced relative from the start of the preedit string.
replaceLengthThe number of characters to be replaced in the preedit string.
cursorPosThe cursor position to be set. the cursorPos is the position relative to commit string start. Negative values are used as commit string end position. Cursor position is applied AFTER committing text. This means the position might be different than intended because of active validators etc.
virtual void MAbstractInputMethodHost::sendKeyEvent ( const QKeyEvent &  keyEvent,
Maliit::EventRequestType  requestType = Maliit::EventRequestBoth 
)
pure virtualslot

Sends key event to the application.

This method is used to deliver the key event to active widget. A MInputMethodState::keyPress or MInputMethodState::keyRelease event is also emitted. Depending on the value of requestType parameter, a Qt::KeyEvent and/or a signal is emitted.

Parameters
keyEventThe event to send
signalOnlyonly the signal should be emitted.
virtual void MAbstractInputMethodHost::sendPreeditString ( const QString &  string,
const QList< Maliit::PreeditTextFormat > &  preeditFormats,
int  replacementStart = 0,
int  replacementLength = 0,
int  cursorPos = -1 
)
pure virtualslot

Updates pre-edit string in the application widget.

Parameters
stringThe new pre-edit string
preeditFormatsSelects visual stylings for each part of preedit
replacementStartThe position at which characters are to be replaced relative from the start of the preedit string.
replacementLengthThe number of characters to be replaced in the preedit string.
cursorPosThe cursur position inside preedit
virtual void MAbstractInputMethodHost::setDetectableAutoRepeat ( bool  enabled)
pure virtualslot

Set detectable autorepeat for X on/off.

Detectable autorepeat means that instead of press, release, press, release, press, release... sequence of key events you get press, press, press, release key events when a key is repeated. The setting is X client specific. This is intended to be used when key event redirection is enabled with setRedirectKeys.

virtual void MAbstractInputMethodHost::setGlobalCorrectionEnabled ( bool  enabled)
pure virtualslot

set global correction option enable/disable

virtual void MAbstractInputMethodHost::setInputMethodArea ( const QRegion &  region)
pure virtualslot

Sets part of the screen area covered by the input method that should be avoided by the application receiving input in order not to be obscured.

For now this region must be so simple that its bounding box can be effectively used as the avoidance area.

Parameters
regionthe new region
virtual void MAbstractInputMethodHost::setInputModeIndicator ( Maliit::InputModeIndicator  mode)
pure virtualslot

Sets input mode indicator state.

Parameters
modeInput mode indicator state.
See also
InputModeIndicator.
void MAbstractInputMethodHost::setLanguage ( const QString &  language)
virtual

Sets current input method language.

Parameters
languageICU format locale ID string

This can be used as a hint to determine text direction in input fields, for example.

virtual void MAbstractInputMethodHost::setOrientationAngleLocked ( bool  lock)
pure virtualslot

Locks application orientation.

Deprecated:
Not implemented
virtual void MAbstractInputMethodHost::setRedirectKeys ( bool  enabled)
pure virtualslot

Set if the input method wants to process all raw key events from hardware keyboard (via processKeyEvent calls).

virtual void MAbstractInputMethodHost::setScreenRegion ( const QRegion &  region)
pure virtualslot

Reserves screen area for input method. Mouse events on top of this area do not fall through to the application

Parameters
regionthe new region
virtual void MAbstractInputMethodHost::setSelection ( int  start,
int  length 
)
pure virtualslot

Sets selection text from start with length in the application widget.

virtual Maliit::Plugins::AbstractSurfaceFactory* MAbstractInputMethodHost::surfaceFactory ( )
pure virtual
QList< MImSubViewDescription > MAbstractInputMethodHost::surroundingSubViewDescriptions ( Maliit::HandlerState  state) const
virtual

Return information about enabled subviews which are neighbors (previous and next) of current active subview.

Previous subview is described by first list item, next subview is defined by last list item. Returned list is empty if there is exactly one enabled subview.

See also
MImSubViewDescription
virtual bool MAbstractInputMethodHost::surroundingText ( QString &  text,
int &  cursorPosition 
)
pure virtual

get surrounding text and cursor position information

virtual void MAbstractInputMethodHost::switchPlugin ( Maliit::SwitchDirection  direction)
pure virtualslot

Asks environment to change active plugin according to direction.

virtual void MAbstractInputMethodHost::switchPlugin ( const QString &  pluginName)
pure virtualslot

Asks environment to change active plugin to specified one.

Parameters
pluginNameName for plugin which will be activated

Copyright © 2011 Nokia Corporation
Maliit