diff -r e6ad4ef83b23 -r b7da29130b0e src/hbcore/indicatorplugins/hbindicatorplugininterface.cpp --- a/src/hbcore/indicatorplugins/hbindicatorplugininterface.cpp Thu Sep 02 20:44:51 2010 +0300 +++ b/src/hbcore/indicatorplugins/hbindicatorplugininterface.cpp Fri Sep 17 08:32:10 2010 +0300 @@ -27,38 +27,69 @@ /*! \class HbIndicatorPluginInterface - \brief HbIndicatorPluginInterface is an abstract base class for indicator plugins. + \brief HbIndicatorPluginInterface is an abstract interface class for indicator plugins. + + Indicators are activated, deactivated and updated using HbIndicator class. Indicator + framework takes care of displaying indicators in satus bar and/or indicator menu. + + Indicator plugins contain implentation of indicators. Single pluging can implement + one or several indicators. HbIndicatorInterface defines functionality required from an + indicator implementation. - Indicators are displayed in the status indicator area and/or in universal indicator popup. - Applications can create own indicators by implementing this plugin interface and creating - at least one class inherited from HbIndicatorInterface. + Indicators are identified by a string. By convention the string should follow + inverted domain name format. For example com.nokia.hb.indicator.xxx/1.0. + Function indicatorTypes() returns a list of indicators the plugin implements. + + Appending version number into indicator type string enables versioning. + A plugin should handle versioning by returning indicator type string for all versions it + implements in indicatorTypes() and then in createIndicator() create an indicator + instance compatible with the version requested. This could always be the latest version if it + is backwards compatible with older versions. Indicator framework is unaware of version + numbers in type strings. It performs string comparison of the whole string when searching + for a plugin. - One plugin can implement one or more indicators. Indicators are identified by a type string. - The indicator types the plugin implements must be returned from the function - indicatorTypes(). The indicator is created, when requested by the client, - using createIndicator(). + Plugins are responsible for maintaining system security for their own part. If plugin + performs operations that may compromise security or want's to limit access to specific + clients, it should check client security credentials in accessAllowed() function. + Indicator framework calls this function before activating/deactivating indicators. + + \section _platform_hbindicatorplugin Platform-specific implementation notes for HbIndicatorPluginInterface + + \subsection _nonsymbian Non-Symbian + + Indicator plugins are loaded into client process. Plugin executables are searched from + application's current directory and HB_PLUGINS_DIR/indicators directory. - Indicator plugin may limit access to an indicator. Before activating or deactivating an - indicator, the framework calls accessAllowed() allowing the plugin to inspect client's security - credentials. By returning false, the plugin denies client access. + \subsection _symbian Symbian + + Plugins are run by a server with platform security capabilities ProtServ, SwEvent, + TrustedUI and ReadDeviceData. If a plugin doesn't have required platform security + capabilities it will not load. - Plugins are loaded by a Device Dialog server. For information on installing plugins, refer to - HbDeviceDialogPlugin documentation. + Device dialog plugin stubs (.qtplugin) are searched from /resource/plugins/indicators directory + and executables in /sys/bin directory in each drive. - here's an example of how to create a simple indicator plugin. - If plugin implements only one indicator, the pluginInterface class can also inherit from + \section _example_code Example code + + Below is an example of how to create a simple indicator plugin. + + If plugin implements only one indicator, plugin can also inherit from HbIndicatorInterface. Example header-file: - \snippet{unit\unittest_hbindicator\codesnippetplugin\hbcodesnippetplugin.h,1} + \snippet{tsrc\unit\unittest_hbindicator\codesnippetplugin\hbcodesnippetplugin.h,1} Example source-file: - \snippet{unit\unittest_hbindicator\codesnippetplugin\hbcodesnippetplugin.cpp,1} + \snippet{tsrc\unit\unittest_hbindicator\codesnippetplugin\hbcodesnippetplugin.cpp,1} + + If more than one indicators are implemented inside a plugin, plugin inherits from HbIndicatorPluginInterface. + + \snippet{tsrc\unit\unittest_hbindicator\codesnippetplugin\hbcodesnippetplugin.h,2} - If more than one indicators are implemented inside a plugin, createIndicator should create new object - based on HbIndicatorInterface. - \snippet{unit\unittest_hbindicator\codesnippetplugin\hbcodesnippetplugin.cpp,2} + And createIndicator should create new object based on indicator type. - \sa HbIndicator, HbIndicatorInterface, HbDeviceDialogPlugin + \snippet{tsrc\unit\unittest_hbindicator\codesnippetplugin\hbcodesnippetplugin.cpp,2} + + \sa HbIndicator, HbIndicatorInterface \stable \hbcore @@ -67,7 +98,7 @@ /*! \fn virtual QStringList HbIndicatorPluginInterface::indicatorTypes() const = 0 - Should return the indicator types this plugin implements. + Should return the indicator types the plugin implements. */ /*! @@ -88,12 +119,15 @@ /*! \fn virtual HbIndicatorInterface *HbIndicatorPluginInterface::createIndicator(const QString &indicatorType) = 0 - creates an indicator of type \a indicatorType. Ownership is passed to the caller. + + Creates an indicator of type \a indicatorType. Ownership is passed to the caller. + \sa HbIndicatorPluginInterface::indicatorTypes() */ /*! \fn virtual int HbIndicatorPluginInterface::error() const = 0 + Returns the last error code. The code is cleared when any other API function than error() is called. */