Buteo Synchronization Framework
|
Base class for running sync plug-ins. More...
#include <PluginRunner.h>
Public Types | |
enum | PluginType { PLUGIN_CLIENT , PLUGIN_SERVER } |
Plug-in type: client or server. | |
Signals | |
void | transferProgress (const QString &aProfileName, Sync::TransferDatabase aDatabase, Sync::TransferType aType, const QString &aMimeType, int aCommittedItems) |
void | error (const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode) |
void | success (const QString &aProfileName, const QString &aMessage) |
void | storageAccquired (const QString &aMimeType) |
void | syncProgressDetail (const QString &aProfileName, int aProgressDetail) |
void | done () |
Signal sent when the plug-in runner has finished. | |
void | newSession (const QString &aDestination) |
void | connectivityStateChanged (Sync::ConnectivityType aType, bool aState) |
Public Member Functions | |
PluginRunner (PluginType aPluginType, const QString &aPluginName, PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf, QObject *aParent=0) | |
Constructor. | |
virtual bool | init ()=0 |
Initializes the plug-in runner. | |
virtual bool | start ()=0 |
Starts running the plug-in. | |
virtual void | stop ()=0 |
Stops running the plug-in. | |
virtual void | abort (Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)=0 |
Aborts running the plug-in. | |
virtual SyncResults | syncResults ()=0 |
Gets the sync results from the plug-in. | |
virtual bool | cleanUp ()=0 |
Calls the cleanup for the plugin. | |
PluginType | pluginType () const |
Gets the plug-in type. | |
QString | pluginName () const |
Gets the plug-in name. | |
virtual SyncPluginBase * | plugin ()=0 |
Gets the plug-in associated with this plug-in runner. | |
Protected Attributes | |
bool | iInitialized |
Initialization status of the plugin. | |
PluginManager * | iPluginMgr |
pointer to an instance of plugin manager | |
PluginCbInterface * | iPluginCbIf |
pointer to an instance of synchronizer | |
PluginType | iType |
type of the plugin | |
QString | iPluginName |
name of the plugin | |
Base class for running sync plug-ins.
This class hides the details of thread/process handling when sync client and server plug-ins are run. Specific client and server plug-in runner classes are derived from this class.
PluginRunner::PluginRunner | ( | PluginType | aPluginType, |
const QString & | aPluginName, | ||
PluginManager * | aPluginMgr, | ||
PluginCbInterface * | aPluginCbIf, | ||
QObject * | aParent = 0 |
||
) |
Constructor.
aPluginType | Type of the plug-in to run |
aPluginName | Name of the plug-in to run |
aPluginMgr | PluginManager instance for creating and destroying plug-ins by name |
aPluginCbIf | Callback interface that the created plug-in can use |
aParent | Parent object |
|
pure virtual |
Aborts running the plug-in.
Status | error. The plug-in is requested to abort. This function will return when the abort request is sent, but the plug-in will continue running until it has gracefully aborted. |
Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.
|
pure virtual |
Calls the cleanup for the plugin.
The plug-in is requested to clean up.
Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.
|
signal |
|
signal |
Signal sent when the plug-in runner has finished.
Sent when the thread or process running the plug-in has exited
|
signal |
|
pure virtual |
Initializes the plug-in runner.
Creates the plug-in that will be run and a thread or process for running it.
Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.
|
signal |
|
pure virtual |
Gets the plug-in associated with this plug-in runner.
Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.
QString PluginRunner::pluginName | ( | ) | const |
Gets the plug-in name.
PluginRunner::PluginType PluginRunner::pluginType | ( | ) | const |
Gets the plug-in type.
|
pure virtual |
Starts running the plug-in.
Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.
|
pure virtual |
Stops running the plug-in.
Returns when the plug-in is stopped.
Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.
|
signal |
|
signal |
|
signal |
|
pure virtual |
Gets the sync results from the plug-in.
Should be called only after success or error signal is received from this class.
Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.
|
signal |