Buteo Synchronization Framework: Buteo::TargetResults Class Reference

Buteo Synchronization Framework

Public Types | Public Member Functions | 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.
TargetResults & | operator= (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...
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...
QString | remoteMessage (const QString &aUid) const
| Gets a possible message related to the a given item. More...

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

  aSource | Copy source.

## ◆ TargetResults() [2/3]

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

Constructor.

Parameters

  aTargetName | Name of the target.
  aLocalItems | Counts of local items.
  aRemoteItems | Counts of remote items.

## ◆ TargetResults() [3/3]

TargetResults::TargetResults | ( | const QDomElement & | aRoot | ) |
| explicit

Constructs TargetResults from XML.

Parameters

  aRoot | Root 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

  aUid | A way for a sync plugin to identify the changed item.
  aOperation | The operation done on the item (addition, deletion or modification).
  aStatus | Particular status for this item sync operation.
  aMessage | Additional 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

  aUid | A way for a sync plugin to identify the changed item.
  aOperation | The operation done on the item (addition, deletion or modification).
  aStatus | Particular status for this item sync operation.
  aMessage | Additional 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

  aOperation | The operation the details are related to (addition, deletion or modification).
  aStatus | The 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

  aUid | A 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

  aRhs | Source.

## ◆ remoteDetails()

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

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

Parameters

  aOperation | The operation the details are related to (addition, deletion or modification).
  aStatus | The 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

  aUid | A 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

  aDoc | Parent 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:

- TargetResults.h
- TargetResults.cpp