Buteo Synchronization Framework
Public Types | Public Member Functions | Properties | List of all members
Buteo::TargetResults Class Reference

Sync results for one target. More...

#include <TargetResults.h>

Public Types

enum  ItemOperation { ITEM_ADDED , ITEM_DELETED , ITEM_MODIFIED }
 
enum  ItemOperationStatus { ITEM_OPERATION_SUCCEEDED , ITEM_OPERATION_FAILED }
 

Public Member Functions

 TargetResults (const TargetResults &aSource)
 Copy constructor. More...
 
 TargetResults (const QString &aTargetName, ItemCounts aLocalItems=ItemCounts(), ItemCounts aRemoteItems=ItemCounts())
 Constructor. More...
 
 TargetResults (const QDomElement &aRoot)
 Constructs TargetResults from XML. More...
 
 ~TargetResults ()
 Destructor.
 
TargetResultsoperator= (const TargetResults &aRhs)
 Assignment operator. More...
 
QDomElement toXml (QDomDocument &aDoc) const
 Exports the target results to XML. More...
 
QString targetName () const
 Gets the target name. More...
 
ItemCounts localItems () const
 Gets the counts of items added, deleted and modified locally. More...
 
ItemCounts remoteItems () const
 Gets the counts of items added, deleted and modified at remote. More...
 
void addLocalDetails (const QString &aUid, ItemOperation aOperation, ItemOperationStatus aStatus=ITEM_OPERATION_SUCCEEDED, const QString &aMessage=QString())
 Add some details on the local changes done during the sync process. More...
 
void addRemoteDetails (const QString &aUid, ItemOperation aOperation, ItemOperationStatus aStatus=ITEM_OPERATION_SUCCEEDED, const QString &aMessage=QString())
 Add some details on the remote changes done during the sync process. More...
 
QList< QString > localDetails (ItemOperation aOperation, ItemOperationStatus aStatus) const
 Gets the details, if any for changes done local during a sync process. More...
 
Q_INVOKABLE QString localMessage (const QString &aUid) const
 Gets a possible message related to the a given item. More...
 
QList< QString > remoteDetails (ItemOperation aOperation, ItemOperationStatus aStatus) const
 Gets the details, if any for changes done remote during a sync process. More...
 
Q_INVOKABLE QString remoteMessage (const QString &aUid) const
 Gets a possible message related to the a given item. More...
 

Properties

Q_GADGETQString target
 
Buteo::ItemCounts local
 
Buteo::ItemCounts remote
 
QStringList localAdditions
 
QStringList localDeletions
 
QStringList localModifications
 
QStringList localFailures
 
QStringList remoteAdditions
 
QStringList remoteDeletions
 
QStringList remoteModifications
 
QStringList remoteFailures
 

Detailed Description

Sync results for one target.

TargetResults contains information about how many items were added, deleted and modified in a specific sync target during the sync session.

Constructor & Destructor Documentation

◆ TargetResults() [1/3]

TargetResults::TargetResults ( const TargetResults aSource)

Copy constructor.

Parameters
aSourceCopy source.

◆ TargetResults() [2/3]

TargetResults::TargetResults ( const QString &  aTargetName,
ItemCounts  aLocalItems = ItemCounts(),
ItemCounts  aRemoteItems = ItemCounts() 
)

Constructor.

Parameters
aTargetNameName of the target.
aLocalItemsCounts of local items.
aRemoteItemsCounts of remote items.

◆ TargetResults() [3/3]

TargetResults::TargetResults ( const QDomElement &  aRoot)
explicit

Constructs TargetResults from XML.

Parameters
aRootRoot element of the XML representation.

Member Function Documentation

◆ addLocalDetails()

void TargetResults::addLocalDetails ( const QString &  aUid,
ItemOperation  aOperation,
ItemOperationStatus  aStatus = ITEM_OPERATION_SUCCEEDED,
const QString &  aMessage = QString() 
)

Add some details on the local changes done during the sync process.

Provide additional information per item basis on the local changes done during the sync process. If the operation succeeded, the associated item count is increase by one.

Parameters
aUidA way for a sync plugin to identify the changed item.
aOperationThe operation done on the item (addition, deletion or modification).
aStatusParticular status for this item sync operation.
aMessageAdditional information related to this item operation.

◆ addRemoteDetails()

void TargetResults::addRemoteDetails ( const QString &  aUid,
ItemOperation  aOperation,
ItemOperationStatus  aStatus = ITEM_OPERATION_SUCCEEDED,
const QString &  aMessage = QString() 
)

Add some details on the remote changes done during the sync process.

Provide additional information per item basis on the remote changes done during the sync process. If the operation succeeded, the associated item count is increase by one.

Parameters
aUidA way for a sync plugin to identify the changed item.
aOperationThe operation done on the item (addition, deletion or modification).
aStatusParticular status for this item sync operation.
aMessageAdditional information related to this item operation.

◆ localDetails()

QList< QString > TargetResults::localDetails ( ItemOperation  aOperation,
ItemOperationStatus  aStatus 
) const

Gets the details, if any for changes done local during a sync process.

Parameters
aOperationThe operation the details are related to (addition, deletion or modification).
aStatusThe kind of status for the operation (success or failure).
Returns
A list of UIDs that correspond to this operation and status. The meaning of these UIDs is defined by the SyncPlugin which generated the log.

◆ localItems()

ItemCounts TargetResults::localItems ( ) const

Gets the counts of items added, deleted and modified locally.

Returns
Item counts.

◆ localMessage()

QString TargetResults::localMessage ( const QString &  aUid) const

Gets a possible message related to the a given item.

Parameters
aUidA UID as returned by localDetails().
Returns
A message stored in the log related to this particular item.

◆ operator=()

TargetResults & TargetResults::operator= ( const TargetResults aRhs)

Assignment operator.

Parameters
aRhsSource.

◆ remoteDetails()

QList< QString > TargetResults::remoteDetails ( ItemOperation  aOperation,
ItemOperationStatus  aStatus 
) const

Gets the details, if any for changes done remote during a sync process.

Parameters
aOperationThe operation the details are related to (addition, deletion or modification).
aStatusThe kind of status for the operation (success or failure).
Returns
A list of UIDs that correspond to this operation and status. The meaning of these UIDs is defined by the SyncPlugin which generated the log.

◆ remoteItems()

ItemCounts TargetResults::remoteItems ( ) const

Gets the counts of items added, deleted and modified at remote.

Returns
Item counts.

◆ remoteMessage()

QString TargetResults::remoteMessage ( const QString &  aUid) const

Gets a possible message related to the a given item.

Parameters
aUidA UID as returned by remoteDetails().
Returns
A message stored in the log related to this particular item.

◆ targetName()

QString TargetResults::targetName ( ) const

Gets the target name.

Returns
Target name.

◆ toXml()

QDomElement TargetResults::toXml ( QDomDocument &  aDoc) const

Exports the target results to XML.

Parameters
aDocParent document for the created XML elements. The created elements are not inserted to the document by this function, but the document is still required for creating the elements.
Returns
Root element of the created XML.

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