Home · All Classes · Main Classes · Deprecated
Public Slots | Signals | Public Member Functions | Static Public Member Functions

MInputMethodState Class Reference

A mediator between MInputContext and applications/libmeegotouch that use it. More...

Inheritance diagram for MInputMethodState:
Inheritance graph
[legend]
Collaboration diagram for MInputMethodState:
Collaboration graph
[legend]

List of all members.

Public Slots

void setActiveWindowOrientationAngle (M::OrientationAngle newOrientation)
void setInputMethodArea (const QRect &newRegion)
int registerToolbar (const QString &fileName)
void unregisterToolbar (int id)
void setToolbarItemAttribute (int id, const QString &item, const QString &attribute, const QVariant &value)
QString toolbar (int id) const

Signals

void inputMethodAreaChanged (const QRect &region)
void activeWindowOrientationAngleChanged (M::OrientationAngle orientation)
void toolbarRegistered (int id, const QString &fileName)
void toolbarUnregistered (int id)
void toolbarItemAttributeChanged (int id, const QString &item, const QString &attribute, const QVariant &value)
void keyPress (const QKeyEvent &)
void keyRelease (const QKeyEvent &)

Public Member Functions

QRect inputMethodArea () const
M::OrientationAngle activeWindowOrientationAngle () const

Static Public Member Functions

static MInputMethodStateinstance ()
static void requestSoftwareInputPanel ()
static void closeSoftwareInputPanel ()

Detailed Description

A mediator between MInputContext and applications/libmeegotouch that use it.

This class allows MInputContext (technically other input contexts too) to communicate input method area on display to the application and application to communicate its active window's orientation and custom toolbar to the input context. The application can be a M application or a plain Qt application (which needs to link against libmeegotouch to get access to this class). The input method area can be used by the application to avoid obstructing the input method.

Definition at line 43 of file corelib/core/minputmethodstate.h.


Member Function Documentation

M::OrientationAngle MInputMethodState::activeWindowOrientationAngle (  )  const

Get the orientation of application's active window.

Returns:
orientation of application's active window

Definition at line 92 of file minputmethodstate.cpp.

{
    Q_D(const MInputMethodState);

    return d->orientation;
}

void MInputMethodState::activeWindowOrientationAngleChanged ( M::OrientationAngle  orientation  )  [signal]

Emitted when the orientation of application's active window is changed.

Parameters:
orientation new orientation angle
void MInputMethodState::closeSoftwareInputPanel (  )  [static]

Sends a request to the application's input context to close a software input panel.

See also:
requestSoftwareInputPanel

Definition at line 111 of file minputmethodstate.cpp.

{
    QInputContext *inputContext = qApp->inputContext();

    if (!inputContext) {
        return;
    }

    QEvent close(QEvent::CloseSoftwareInputPanel);
    inputContext->filterEvent(&close);
    inputContext->reset();
}

Here is the call graph for this function:

QRect MInputMethodState::inputMethodArea (  )  const

Get current input method area.

Returns:
current input method area

Definition at line 75 of file minputmethodstate.cpp.

{
    Q_D(const MInputMethodState);

    return d->region;
}

void MInputMethodState::inputMethodAreaChanged ( const QRect region  )  [signal]

Emitted when input method area is changed.

Parameters:
region new input method area
MInputMethodState * MInputMethodState::instance (  )  [static]

Get singleton instance.

Returns:
singleton instance

Definition at line 58 of file minputmethodstate.cpp.

{
    static MInputMethodState singleton;

    return &singleton;
}

void MInputMethodState::keyPress ( const QKeyEvent  )  [signal]

Can be emitted by input method to notify about raw key press event it receives.

void MInputMethodState::keyRelease ( const QKeyEvent  )  [signal]

Can be emitted by input method to notify about raw key release event it receives.

int MInputMethodState::registerToolbar ( const QString fileName  )  [slot]

Register an input method toolbar which is defined in fileName.

Parameters:
\a fileName is the absolute file name of a custom toolbar, or the relative file under /usr/share/meegotouch/imtoolbars/.
Returns:
the registered unique identifier of this toolbar.

Definition at line 148 of file minputmethodstate.cpp.

{
    Q_D(MInputMethodState);
    static int idCounter = 0;
    // generate an application local unique identifier for the toolbar.
    int newId = idCounter;
    idCounter++;
    d->toolbars.insert(newId, new ToolbarInfo(fileName));
    emit toolbarRegistered(newId, fileName);
    return newId;
}

Here is the call graph for this function:

void MInputMethodState::requestSoftwareInputPanel (  )  [static]

Sends a request to the application's input context to open a software input panel (e.g. the virtual keyboard). Warning: In order to gain more screen space, window decorations may be temporarily hidden while the input panel is up.

See also:
closeSoftwareInputPanel

Definition at line 99 of file minputmethodstate.cpp.

{
    QInputContext *inputContext = qApp->inputContext();

    if (!inputContext) {
        return;
    }

    QEvent request(QEvent::RequestSoftwareInputPanel);
    inputContext->filterEvent(&request);
}

Here is the call graph for this function:

void MInputMethodState::setActiveWindowOrientationAngle ( M::OrientationAngle  newOrientation  )  [slot]

Set the orientation of application's active window to newOrientation.

Definition at line 82 of file minputmethodstate.cpp.

{
    Q_D(MInputMethodState);

    if (d->orientation != newOrientation) {
        d->orientation = newOrientation;
        emit activeWindowOrientationAngleChanged(newOrientation);
    }
}

Here is the call graph for this function:

void MInputMethodState::setInputMethodArea ( const QRect newRegion  )  [slot]

Set input method area to newRegion.

Definition at line 65 of file minputmethodstate.cpp.

{
    Q_D(MInputMethodState);

    if (d->region != newRegion) {
        d->region = newRegion;
        emit inputMethodAreaChanged(d->region);
    }
}

Here is the call graph for this function:

void MInputMethodState::setToolbarItemAttribute ( int  id,
const QString item,
const QString attribute,
const QVariant value 
) [slot]

Set the attribute of the item in the input method toolbar which has the unique id to value.

Definition at line 168 of file minputmethodstate.cpp.

{
    Q_D(MInputMethodState);

    if (!d->toolbars.contains(id)) {
        return;
    }

    ToolbarInfo *toolbar = d->toolbars[id];
    toolbar->items[item][attribute] = value;
    emit toolbarItemAttributeChanged(id, item, attribute, value);
}

Here is the call graph for this function:

QString MInputMethodState::toolbar ( int  id  )  const [slot]

Returns the input method toolbar file name which is registered with the unique identifier .

Parameters:
id the unique identifier of a registered toolbar.
Returns:
the file name of toolbar, or empty QString if id is invalid.

Definition at line 182 of file minputmethodstate.cpp.

{
    Q_D(const MInputMethodState);

    ToolbarInfo *toolbar = d->toolbars.value(id);

    if (toolbar) {
        return toolbar->fileName;
    } else {
        return QString();
    }
}

void MInputMethodState::toolbarItemAttributeChanged ( int  id,
const QString item,
const QString attribute,
const QVariant value 
) [signal]

Emitted when input method toolbar item attribute is changed.

void MInputMethodState::toolbarRegistered ( int  id,
const QString fileName 
) [signal]

Emitted when an input method toolbar which is defined in fileName with an unique identifier id is registered.

void MInputMethodState::toolbarUnregistered ( int  id  )  [signal]

Emitted when an input method toolbar with an unique id is unregistered.

void MInputMethodState::unregisterToolbar ( int  id  )  [slot]

Unregister an input method toolbar which unique id id.

Parameters:
\a id is the unique identifier of the registered toolbar.

Definition at line 160 of file minputmethodstate.cpp.

{
    Q_D(MInputMethodState);
    delete d->toolbars[id];
    d->toolbars.remove(id);
    emit toolbarUnregistered(id);
}

Here is the call graph for this function:


Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:25 (PDT)
Doxygen 1.7.1
MeeGo Touch