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 switchPlugin (Maliit::SwitchDirection direction)=0
 
virtual void switchPlugin (const QString &pluginName)=0
 
virtual void setScreenRegion (const QRegion &region, QWindow *window=0)=0
 
virtual void setInputMethodArea (const QRegion &region, QWindow *window=0)=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
 
virtual void registerWindow (QWindow *window, Maliit::Position position)=0
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query, const QVariant &argument=QVariant()) const =0
 
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::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::MAbstractInputMethodHost ( QObject *  parent = 0)
explicit

◆ ~MAbstractInputMethodHost()

MAbstractInputMethodHost::~MAbstractInputMethodHost ( )
virtual

Member Function Documentation

◆ anchorPosition()

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.

Implemented in Maliit::StandaloneInputMethodHost.

◆ autoCapitalizationEnabled()

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

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ contentType()

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ correctionEnabled()

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

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ cursorRectangle()

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

get cursor rectangle

Implemented in Maliit::StandaloneInputMethodHost.

◆ hasSelection()

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

returns true if there is selecting text

Implemented in Maliit::StandaloneInputMethodHost.

◆ hiddenText()

bool MAbstractInputMethodHost::hiddenText ( bool &  valid)
virtual

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

Reimplemented in Maliit::StandaloneInputMethodHost.

◆ inputMethodMode()

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

get input method mode

Implemented in Maliit::StandaloneInputMethodHost.

◆ inputMethodQuery()

virtual QVariant MAbstractInputMethodHost::inputMethodQuery ( Qt::InputMethodQuery  query,
const QVariant &  argument = QVariant() 
) const
pure virtual

◆ invokeAction

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ notifyImInitiatedHiding

virtual void MAbstractInputMethodHost::notifyImInitiatedHiding ( )
pure virtualslot

Notifies about hiding initiated by the input method.

Implemented in Maliit::StandaloneInputMethodHost.

◆ pluginDescriptions()

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ pluginsChanged

void MAbstractInputMethodHost::pluginsChanged ( )
signal

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

◆ predictionEnabled()

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

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ preeditClickPos()

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

returns the current cursor position within the preedit region

◆ preeditRectangle()

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

get preedit rectangle

Implemented in Maliit::StandaloneInputMethodHost.

◆ registerPluginSetting()

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ registerWindow()

virtual void MAbstractInputMethodHost::registerWindow ( QWindow *  window,
Maliit::Position  position 
)
pure virtual

Registers a window in server.

Should be called for every QWindow created by plugin before calling create on it. Note that this function set some flags on the window, so be careful to not reset them by accident.

Implemented in Maliit::StandaloneInputMethodHost.

◆ selection()

virtual QString MAbstractInputMethodHost::selection ( bool &  valid)
pure virtual

returns the selecting text

Implemented in Maliit::StandaloneInputMethodHost.

◆ sendCommitString

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.

Implemented in Maliit::StandaloneInputMethodHost.

◆ sendKeyEvent

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.

Implemented in Maliit::StandaloneInputMethodHost.

◆ sendPreeditString

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

◆ setDetectableAutoRepeat

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.

Implemented in Maliit::StandaloneInputMethodHost.

◆ setGlobalCorrectionEnabled

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

set global correction option enable/disable

Implemented in Maliit::StandaloneInputMethodHost.

◆ setInputMethodArea

virtual void MAbstractInputMethodHost::setInputMethodArea ( const QRegion &  region,
QWindow *  window = 0 
)
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
windowwindow for which input method area applies. If zero, first registered window is used.

Implemented in Maliit::StandaloneInputMethodHost.

◆ setLanguage()

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.

Reimplemented in Maliit::StandaloneInputMethodHost.

◆ setOrientationAngleLocked

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

Locks application orientation.

Deprecated:
Not implemented

Implemented in Maliit::StandaloneInputMethodHost.

◆ setRedirectKeys

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).

Implemented in Maliit::StandaloneInputMethodHost.

◆ setScreenRegion

virtual void MAbstractInputMethodHost::setScreenRegion ( const QRegion &  region,
QWindow *  window = 0 
)
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
windowwindow for which region applies. If zero, first registered window is used.

Implemented in Maliit::StandaloneInputMethodHost.

◆ setSelection

virtual void MAbstractInputMethodHost::setSelection ( int  start,
int  length 
)
pure virtualslot

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ surroundingSubViewDescriptions()

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

◆ surroundingText()

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

get surrounding text and cursor position information

Implemented in Maliit::StandaloneInputMethodHost.

◆ switchPlugin [1/2]

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

Implemented in Maliit::StandaloneInputMethodHost.

◆ switchPlugin [2/2]

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

Asks environment to change active plugin according to direction.

Implemented in Maliit::StandaloneInputMethodHost.


Copyright © 2011 Nokia Corporation
Maliit