Buteo Synchronization Framework: Buteo::SyncPluginBase Class Reference

Buteo Synchronization Framework

Classes | Public Slots | Signals | Public Member Functions | Protected Attributes | List of all members
Buteo::SyncPluginBase Class Referenceabstract

Base class for client and server plugins. More...

`#include <SyncPluginBase.h>`

Inheritance diagram for Buteo::SyncPluginBase:

## Classes
struct | ReceivedItemDetails

## Public Slots
virtual void | connectivityStateChanged (Sync::ConnectivityType aType, bool aState)=0
| Slot that is invoked by sync framework when changes occur in connectivity domains. More...

## Signals
void | transferProgress (const QString &aProfileName, Sync::TransferDatabase aDatabase, Sync::TransferType aType, const QString &aMimeType, int aCommittedItems)
| Emitted when progress has been made in synchronization in transferring items between local and remote database. More...
void | error (const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode)
| Emitted when error has occurred in synchronization and it cannot be continued. More...
void | success (const QString &aProfileName, const QString &aMessage)
| Emitted when synchronization has been finished successfully. More...
void | accquiredStorage (const QString &aMimeType)
| Emitted when a storage is requested and accquired. More...
void | syncProgressDetail (const QString &aProfileName, int aProgressDetail)
| Emitted during Sync Progress to indicate the detail of the current ongoing sync. More...

## Public Member Functions
| SyncPluginBase (const QString &aPluginName, const QString &aProfileName, PluginCbInterface *aCbInterface)
| Constructor. More...
QString | getPluginName () const
| Returns the name of this plugin. More...
QString | getProfileName () const
| Returns profile name. More...
virtual bool | init ()=0
| Initializes the plugin. More...
virtual bool | uninit ()=0
| Uninitializes the plugin. More...
virtual void | abortSync (Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
| Aborts synchronization. More...
virtual bool | cleanUp ()=0
| Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted. More...
virtual SyncResults | getSyncResults () const
| Gets the results of the last completed sync session. More...

## Protected Attributes
PluginCbInterface * | iCbInterface
| Pointer to synchronizer.
QMap< QString, ReceivedItemDetails > | receivedItems
ButeoPluginIface * | iOopPluginIface

## Detailed Description

Base class for client and server plugins.

## Constructor & Destructor Documentation

## ◆ SyncPluginBase()

SyncPluginBase::SyncPluginBase | ( | const QString & | aPluginName,
|  | const QString & | aProfileName,
|  | PluginCbInterface * | aCbInterface
| ) |  |

Constructor.

Parameters

  aPluginName | Name of this plugin
  aProfileName | Profile name
  aCbInterface | Pointer to the callback interface

## Member Function Documentation

## ◆ abortSync()

virtual void Buteo::SyncPluginBase::abortSync | ( | Sync::SyncStatus | aStatus = `Sync::SYNC_ABORTED` | ) |
| inlinevirtual

Aborts synchronization.

Derived plug-in should implement this function and abort the sync session that is in progress when this function is called. A final signal (success or error) is still expected from the aborted session before it terminates.

Reimplemented in Buteo::OOPClientPlugin.

## ◆ accquiredStorage

void Buteo::SyncPluginBase::accquiredStorage | ( | const QString & | aMimeType | ) |
| signal

Emitted when a storage is requested and accquired.

Parameters

  aMimeType | Mime type of the processed item

## ◆ cleanUp()

virtual bool Buteo::SyncPluginBase::cleanUp | ( |  | ) |
| pure virtual

Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted.

Derived plug-in should implement this function and perform any cleanup operations if required when the profile is deleted

Implemented in Buteo::OOPServerPlugin, and Buteo::OOPClientPlugin.

## ◆ connectivityStateChanged

virtual void Buteo::SyncPluginBase::connectivityStateChanged | ( | Sync::ConnectivityType | aType,
|  | bool | aState
| ) |  |
| pure virtualslot

Slot that is invoked by sync framework when changes occur in connectivity domains.

Parameters

  aType | Connectivity domain
  aState | True if connectivity domain is now available, otherwise false

## ◆ error

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

Emitted when error has occurred in synchronization and it cannot be continued.

Parameters

  aProfileName | Name of the profile being synchronized
  aMessage | Message data related to error event
  aErrorCode | Error code

## ◆ getPluginName()

QString SyncPluginBase::getPluginName | ( |  | ) | const

Returns the name of this plugin.

Returns
  Name of the plugin

## ◆ getProfileName()

QString SyncPluginBase::getProfileName | ( |  | ) | const

Returns profile name.

Returns
  Profile

## ◆ getSyncResults()

SyncResults SyncPluginBase::getSyncResults | ( |  | ) | const
| virtual

Gets the results of the last completed sync session.

This function should be called only after the sync session has finished, after an error or success signal has been emitted. The default implementation returns empty results, so derived plug-in should implement this function.

Returns
  Sync results.

Reimplemented in Buteo::OOPClientPlugin.

## ◆ init()

virtual bool Buteo::SyncPluginBase::init | ( |  | ) |
| pure virtual

Initializes the plugin.

It is recommended that the plugin should do not do any thread insecure initializations inside constructor, instead it should be done inside this method.

Returns
  True on success, otherwise false

Implemented in Buteo::OOPServerPlugin, and Buteo::OOPClientPlugin.

## ◆ success

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

Emitted when synchronization has been finished successfully.

Parameters

  aProfileName | Name of the profile being synchronized
  aMessage | Message data related to finish event

## ◆ syncProgressDetail

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

Emitted during Sync Progress to indicate the detail of the current ongoing sync.

Parameters

  aProfileName | Profile Name
  aProgressDetail | Progress in Detail

See also
  Sync::SyncProgressDetail

## ◆ transferProgress

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

Emitted when progress has been made in synchronization in transferring items between local and remote database.

Parameters

  aProfileName | Name of the profile being synchronized
  aDatabase | Indicates if progress has been made to local or remote database
  aType | Type of progress made (item added, modified or deleted)
  aMimeType | Mime type of the processed item
  aCommittedItems | No. of items committed for this operation

## ◆ uninit()

virtual bool Buteo::SyncPluginBase::uninit | ( |  | ) |
| pure virtual

Uninitializes the plugin.

Returns
  True on success, otherwise false

Implemented in Buteo::OOPServerPlugin, and Buteo::OOPClientPlugin.

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

- SyncPluginBase.h
- moc_SyncPluginBase.cpp
- SyncPluginBase.cpp