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:
Buteo::ClientPlugin Buteo::ServerPlugin Buteo::OOPClientPlugin Buteo::OOPServerPlugin

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

PluginCbInterfaceiCbInterface
 Pointer to synchronizer.
 
QMap< QString, ReceivedItemDetailsreceivedItems
 
ButeoPluginIfaceiOopPluginIface
 

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
aPluginNameName of this plugin
aProfileNameProfile name
aCbInterfacePointer 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
aMimeTypeMime 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::OOPClientPlugin, and Buteo::OOPServerPlugin.

◆ 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
aTypeConnectivity domain
aStateTrue 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
aProfileNameName of the profile being synchronized
aMessageMessage data related to error event
aErrorCodeError 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::OOPClientPlugin, and Buteo::OOPServerPlugin.

◆ success

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

Emitted when synchronization has been finished successfully.

Parameters
aProfileNameName of the profile being synchronized
aMessageMessage 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
aProfileNameProfile Name
aProgressDetailProgress 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
aProfileNameName of the profile being synchronized
aDatabaseIndicates if progress has been made to local or remote database
aTypeType of progress made (item added, modified or deleted)
aMimeTypeMime type of the processed item
aCommittedItemsNo. 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::OOPClientPlugin, and Buteo::OOPServerPlugin.


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