Buteo::PluginRunner Class Referenceabstract

Base class for running sync plug-ins. More...

`#include <PluginRunner.h>`

Inheritance diagram for Buteo::PluginRunner:

## 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

## Detailed Description

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.

## Constructor & Destructor Documentation

## PluginRunner()

PluginRunner::PluginRunner | ( | PluginType | aPluginType,
|  | const QString & | aPluginName,
|  | PluginManager * | aPluginMgr,
|  | PluginCbInterface * | aPluginCbIf,
|  | QObject * | aParent = 0 )

Constructor.

Parameters

  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

## Member Function Documentation

## abort()

virtual void Buteo::PluginRunner::abort | ( | Sync::SyncStatus | aStatus = Sync::SYNC_ABORTED | ) |

pure virtual

Aborts running the plug-in.

Parameters

  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.

## cleanUp()

virtual bool Buteo::PluginRunner::cleanUp | ( |  | ) |

pure virtual

Calls the cleanup for the plugin.

The plug-in is requested to clean up.

Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.

## connectivityStateChanged

void Buteo::PluginRunner::connectivityStateChanged | ( | Sync::ConnectivityType | aType,
|  | bool | aState )

signal

See also
  SyncPluginBase::connectivityStateChanged

## done

void Buteo::PluginRunner::done | ( |  | ) |

signal

Signal sent when the plug-in runner has finished.

Sent when the thread or process running the plug-in has exited

## error

void Buteo::PluginRunner::error | ( | const QString & | aProfileName,
|  | const QString & | aMessage,
|  | SyncResults::MinorCode | aErrorCode )

signal

See also
  SyncPluginBase::error

## init()

virtual bool Buteo::PluginRunner::init | ( |  | ) |

pure virtual

Initializes the plug-in runner.

Creates the plug-in that will be run and a thread or process for running it.

Returns
  Success indicator

Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.

## newSession

void Buteo::PluginRunner::newSession | ( | const QString & | aDestination | ) |

signal

See also
  SyncPluginBase::newSession

## plugin()

virtual SyncPluginBase * Buteo::PluginRunner::plugin | ( |  | ) |

pure virtual

Gets the plug-in associated with this plug-in runner.

Returns
  Plug-in instance

Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.

## pluginName()

QString PluginRunner::pluginName | ( |  | ) | const

Gets the plug-in name.

Returns
  Plug-in name

## pluginType()

PluginRunner::PluginType PluginRunner::pluginType | ( |  | ) | const

Gets the plug-in type.

Returns
  Plug-in type

## start()

virtual bool Buteo::PluginRunner::start | ( |  | ) |

pure virtual

Starts running the plug-in.

Returns
  Success indicator.

Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.

## stop()

virtual void Buteo::PluginRunner::stop | ( |  | ) |

pure virtual

Stops running the plug-in.

Returns when the plug-in is stopped.

Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.

## storageAccquired

void Buteo::PluginRunner::storageAccquired | ( | const QString & | aMimeType | ) |

signal

See also
  SyncPluginBase::storageAcquired

## success

void Buteo::PluginRunner::success | ( | const QString & | aProfileName,
|  | const QString & | aMessage )

signal

See also
  SyncPluginBase::success

## syncProgressDetail

void Buteo::PluginRunner::syncProgressDetail | ( | const QString & | aProfileName,
|  | int | aProgressDetail )

signal

See also
  SyncPluginBase::syncProgressDetail

## syncResults()

virtual SyncResults Buteo::PluginRunner::syncResults | ( |  | ) |

pure virtual

Gets the sync results from the plug-in.

Should be called only after success or error signal is received from this class.

Returns
  Sync results

Implemented in Buteo::ClientPluginRunner, and Buteo::ServerPluginRunner.

## transferProgress

void Buteo::PluginRunner::transferProgress | ( | const QString & | aProfileName,
|  | Sync::TransferDatabase | aDatabase,
|  | Sync::TransferType | aType,
|  | const QString & | aMimeType,
|  | int | aCommittedItems )

signal

See also
  SyncPluginBase::transferProgress

The documentation for this class was generated from the following files:

- PluginRunner.h
- PluginRunner.cpp