Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# TodayPluginInterface Class Reference

The TodayPluginInterface class provides an interface for the Qtopia Today application. More...

`#include <qtopia/todayplugininterface.h>`

List of all member functions.

## Public Members

- virtual QString name () const = 0
- virtual QPixmap icon () const = 0
- virtual QString html ( uint charWidth, uint lineHeight ) const = 0
- virtual bool configurable () const = 0
- virtual QWidget * widget ( QWidget * ) = 0
- virtual void accepted ( QWidget * ) const = 0
- virtual void itemSelected ( const QString & param ) const = 0

## Detailed Description

The TodayPluginInterface class provides an interface for the Qtopia Today application.

The interface relies on markup language for display and interaction in the Today application. A plugin can be informed of a link being clicked in its view by properly encoding the links as laid out in html() function.

The layout and format of the embedded html is entirely managed by each plugin. A plugin can inform the Today application to reload its contents by either emitting a reload() signal or sending a reload() qcop message to the Today application.

The tags that can be used in the returned text are limited to the capabilities of the default QStyleSheet

## Member Function Documentation

### void TodayPluginInterface::accepted ( QWidget * ) const`[pure virtual]`

This method is called if the user accepted any changes made to the configure options of your plugin. You can safely cast this QWidget back to the type you created in widget(QWidget *). Any state changes must be read and stored by your plugin within the scope of this function, as the Today application would normally delete the widget upon exit of this function.

If you do not wish to provide configurability there is no need to reimplement this method.

### bool TodayPluginInterface::configurable () const`[pure virtual]`

The configurable() function is used by the Today application for presenting a list of configurable plugins to the user. Reimplement this method to return TRUE if you want to provide a configurable widget for your plugin. You also need to reimplement both the widget(QWidget *) and accepted(QWidget *) functions if your plugin provides a configure option.

### QString TodayPluginInterface::html ( uint charWidth, uint lineHeight ) const`[pure virtual]`

The html() function should return the formatted text to be displayed in the Today application. The parameter charWidth is a size hint of the horizontal amount of characters (based on the default font) allocated to your plugin. Similarily the lineHeight is a size hint of the vertical amount of character lines allocated to your plugin. You may override these size hints, but please bear in mind that ultimately the user should, through configure options, decide what amount of screen space your plugin should be given.

Links can be embedded in the html in the following format:

raise:application (E.g. <a href="raise:datebook"> Launch Datebook </a> )

qcop:pluginName:parameters (E.g. <a href="qcop:myplugin:sendshowsignal"> View document </a> )

With the qcop command. the parameters would be passed to the itemSelected() function of your plugin (provided pluginName matches the name() function of your plugin)

### QPixmap TodayPluginInterface::icon () const`[pure virtual]`

The icon() function returns the pixmap associated with this plugin. This icon, along with the name() function, will identify the plugin in the configure option of the Today application.

### void TodayPluginInterface::itemSelected ( const QString & param ) const`[pure virtual]`

This function is called by the Today app when a user clicks on a link matching the qcop format described in the html() function.

The param is the parameters string embedded in the link encoding of the html() function.

### QString TodayPluginInterface::name () const`[pure virtual]`

The name() function returns the name of the Today plugin. This name, along with the icon() function, will identify the plugin in the configure option of the Today application.

### QWidget * TodayPluginInterface::widget ( QWidget * )`[pure virtual]`

This method is called to display the configure widget for your plugin. The caller assumes ownership of the returned widget(E.g. do not delete it).

If you do not wish to provide configurability there is no need to reimplement this method.

This file is part of the Qtopia platform, copyright © 1995-2004 Trolltech, all rights reserved.