![]() Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
![]() |
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 plug-in 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 plug-in. A plug-in 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 plug-in. 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 plug-in 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 plug-ins to the user. Reimplement this method to return TRUE if you want to provide a configurable widget for your plug-in. You also need to reimplement both the widget(QWidget *) and accepted(QWidget *) functions if your plug-in 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 plug-in. Similarily the lineHeight is a size hint of the vertical amount of character lines allocated to your plug-in. 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 plug-in 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 plug-in (provided pluginName matches the name() function of your plug-in)
The icon() function returns the pixmap associated with this plug-in. This icon, along with the name() function, will identify the plug-in 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 plug-in. This name, along with the icon() function, will identify the plug-in in the configure option of the Today application.
This method is called to display the configure widget for your plug-in. 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-2005 Trolltech, all rights reserved.
Copyright © 2005 Trolltech | Trademarks | Qtopia version 2.2.0
|