Files:
This example shows how to write a service plugin for the Service Framework.
The service can be registered by using the function addService() which takes a path to the XML file that describes the service, filemanagerservice.xml.
A Service plug-in is made by deriving a new plugin class from the QServicePluginInterface class then implementing the function QServicePluginInterface::createInstance().
The FileManager plugin example has a simple createInstance(). It only needs to create the appropriate object based on the interface name and return a pointer to it.
if (descriptor.interfaceName() == "com.nokia.qt.examples.FileStorage") return new FileManagerStorage(this); else if (descriptor.interfaceName() == "com.nokia.qt.examples.FileTransfer") return new FileManagerTransfer(this); else return 0;
The functionality of the FileManager and the FileTransfer classes are in the separate classes FileManagerStorage and FileManagerTransfer respectively. The existing functions are merely test stubs to demonstrate the concept.