Bluetooth Transfer 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(), this takes a path to the XML file that describes the service, bluetoothtransferservice.xml. Writing the PluginTo implement a plugin it is necessary to create a new plugin class derived from QObject and QServicePluginInterface. The function QServicePluginInterface::createInstance() is implemented to return the appropriate instantiated object based on the interface name passed into the function. Since there is only one interface name for this example there is no test involved, so we can simply create the object implementing the service and return its pointer. return new BluetoothTransfer(this); The implementation of the service BluetoothTransfer is simply a test function for this example. The BluetoothTransfer class is very simple, with only an empty constructor and the sendFile() function void BluetoothTransfer::sendFile(const QString &path) { qDebug() << "BluetoothTransfer::sendFile()" << path; } © 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
|