Home · All Classes · Grouped Classes · Annotated · Functions

QSoftMenuBarProvider Class Reference

The QSoftMenuBarProvider class provides the backend for the QSoftMenuBar API. More...

    #include <QSoftMenuBarProvider>

Inherits QObject.

Public Types

Public Functions

Signals

Additional Inherited Members


Detailed Description

The QSoftMenuBarProvider class provides the backend for the QSoftMenuBar API.

The QSoftMenuBar class allows applications to control a context specific soft key bar. The QSoftMenuBarProvider manages the state of the soft bar on behalf of a specific UI implementation.

Internally the QSoftMenuBar class sends QCop messages to communicate with the QSoftMenuBarProvider instance. The "context specific" aspects of the bar are managed in the QSoftMenuBar instance and messages are only sent when the bar UI needs to update. Three QCop messages are used on the QPE/QSoftMenuBar channel.

MessageDescription
setLabelText(int,int,QString)setLabelText(int winId, int key, QString text)

Sets the button bound to key to text. winId is the integer identifier of the active window from the application's perspective. This is to resolve the race condition where application A sends an update, application B becomes active and sends its update but the provider receives application A's update after application B's incorrectly applying it. The label will only be updated if winId is equal to the currently active windows id.

setLabelPixmap(int,int,QString)setLabelPixmap(int winId, int key, QString pixmapName)

Sets the button for key to display the given pixmapName. winId is used to resolve the race condition outlined above. The pixmap returned from MenuButton::pixmap() will be resolved as ":icon/" + pixmapName.

clearLabel(int,int)clearLabel(int winId, int key)

Clears the button for key. The button text will be set to a null string, and the image a null image. winId is used to resolve the race condition outlined above.

The soft keys available on a device are configured in the SoftKeys group of the defaultbuttons.conf configuration file. For example, the following snippet configures three softkeys - Context1, Select and Back.

    [SoftKeys]
    Count=3
    Key0=Context1
    Key1=Select
    Key2=Back

Valid key entries are those understood by the QKeySequence class. The QSoftMenuBarProvider class will only respond to keys configured in this way.

This class is part of the Qtopia server and cannot be used by other Qtopia applications.


Member Function Documentation

QSoftMenuBarProvider::QSoftMenuBarProvider ( QObject * parent = 0 )

Create a new QSoftMenuBarProvider instance, with the specified parent.

QSoftMenuBarProvider::~QSoftMenuBarProvider ()   [virtual]

Destroys the QSoftMenuBarProvider instance.

MenuButton QSoftMenuBarProvider::key ( int index ) const

Returns a key description for the index 'th key. index must be less than keyCount().

void QSoftMenuBarProvider::keyChanged ( const QSoftMenuBarProvider::MenuButton & button )   [signal]

Emitted whenever the text or image for button has changed.

void QSoftMenuBarProvider::keyChanged ( int key )   [signal]

This is an overloaded member function, provided for convenience.

Emitted when the text or image mapped to the Qt::Key key has changed.

int QSoftMenuBarProvider::keyCount () const

Returns the number of configured keys.

QList<MenuButton> QSoftMenuBarProvider::keys () const

Returns a list of key descriptions for all configured keys.


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3