File Manager Plugin ExampleFiles:
This example shows how to write a service plugin for the Service Framework. Registering the ServiceThe service can be registered by using the function addService() which takes a path to the XML file that describes the service, filemanagerservice.xml. Writing the Plug-InA 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-2010 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 X
|