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.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.