Qt API | Qtopia API | Qtopia Documentation | ![]() |
The TodayPluginInterface class provides an interface for the Qtopia Today application. More...
#include <qtopia/todayplugininterface.h>
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
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.
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.
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)
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.
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.
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.
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 , copyright © 1995-2002 Trolltech, all rights reserved.
Copyright © 2001-2002 Trolltech | Trademarks | Qtopia version 1.7.0
|