Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QIMActionDescription Class Reference
[QtBaseModule]

The QIMActionDescription class provides a way to define a QAction for a QtopiaInputMethod in the QSoftMenuBar QMenu. More...

    #include <QIMActionDescription>

This class is under development and is subject to change.

Public Functions


Detailed Description

The QIMActionDescription class provides a way to define a QAction for a QtopiaInputMethod in the QSoftMenuBar QMenu.

The menu in which QtopiaInputMethod actions will eventually displayed will typically be in a different process from the input method itself (which runs in the server). In order to avoid confusion, the simple QIMActionDescription is used rather than QActions on this side.

The label attribute is used as the label of the final QAction.

the iconFileName argument is a QString, and is used to find the icon for the action. Note that the file name must be fully qualified, as it will not necessarily be called with the same environment as the inputmethod.

The id attribute will be passed back to the input method via menuActionActivated(), in order to differentiate different actions, so the id field must be unique for each action in an input-method.

Note: 0 is reserved for an unknown or unrecognised menu actions, and negative id values are reserved for system menus. Using these values is not recommended.

IMActionDescriptions should be created on the heap. The server expects lists of pointers to QIMActionDescriptions, and will delete them when it is finished with them. If constructing the QIMActionDescription is expensive, the copy constructor is very fast, and can be used safely.

See also QtopiaInputMethod and QIMActionDescription().


Member Function Documentation

QIMActionDescription::QIMActionDescription ( const QIMActionDescription & original )

Constructs a shallow copy of the given QIMActionDescription original. For more information about shallow copies, see the Implicitly Shared Classes Qt documentation.

QIMActionDescription::QIMActionDescription ( int id = 0, QString label = QString(), QString iconFileName = QString() )

The QIMActionDescription takes an id, a unique identifier used in notification to differentiate the menu icons. The iconFileName argument is a QString used to find the picture for the action. Note that the file name must be fully qualified, as it will not necessarily be called with the same environment as the inputmethod.

The default constructor creates an QIMActionDescription with id = 0 (), and empty QStrings for label and iconFileName

QIMActionDescription::~QIMActionDescription ()

Destroys the action description and cleans up

void QIMActionDescription::deserialize ( T & stream )

Convert data from stream to an action description. Used in converting QIMActionDescription from QVariant.

QString QIMActionDescription::iconFileName () const

Returns the fully-qualified file name used to create the icon for this menu item.

See also setIconFileName().

int QIMActionDescription::id () const

Returns the identifier for this menu action, used to differentiate actions in the one input method menu.

See also setId().

QString QIMActionDescription::label () const

Returns the user-visible label to be displayed by this menu action.

See also setLabel().

void QIMActionDescription::serialize ( T & stream ) const

Convert data from an action description to stream. Used in converting QIMActionDescription to QVariant.

void QIMActionDescription::setIconFileName ( const QString & string )

Sets the icon file name for the input method action to the given string. Note: the icon file name must be fully qualified, as the menu is likely to be created by a seperate process that will not necessarily share the same local address as the input method.

See also iconFileName().

void QIMActionDescription::setId ( const int id )

Sets the identifier for this menu action to the given id. This value is used to differentiate the actions in the input method menu.

See also id().

void QIMActionDescription::setLabel ( const QString & string )

Sets the user-visible label to be displayed by this menu action to the given string.

See also label().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3