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

Contains information about a completed synchronization session. More...

#include <SyncResults.h>

Public Types

enum  MajorCode { SYNC_RESULT_INVALID = -1 , SYNC_RESULT_SUCCESS = 0 , SYNC_RESULT_FAILED , SYNC_RESULT_CANCELLED }
 enum value More...
 
enum  MinorCode {
  NO_ERROR = 0 , ITEM_FAILURES = 301 , INTERNAL_ERROR = 401 , AUTHENTICATION_FAILURE ,
  DATABASE_FAILURE , PLUGIN_ERROR , PLUGIN_TIMEOUT , ABORTED = 501 ,
  CONNECTION_ERROR , UNSUPPORTED_SYNC_TYPE , UNSUPPORTED_STORAGE_TYPE , LOW_BATTERY_POWER = 601 ,
  POWER_SAVING_MODE , OFFLINE_MODE , BACKUP_IN_PROGRESS , LOW_MEMORY
}
 enum value More...
 

Public Member Functions

 SyncResults ()
 Constructs an empty sync results object.
 
 SyncResults (const SyncResults &aSource)
 Copy constructor.
 
 SyncResults (QDateTime aTime, MajorCode aMajorCode, MinorCode aMinorCode)
 Constructs sync results, sets sync time and result code.
 
 SyncResults (const QDomElement &aRoot)
 Constructs sync results from XML.
 
 ~SyncResults ()
 Destructor.
 
SyncResultsoperator= (const SyncResults &aRhs)
 Assignment operator.
 
QDomElement toXml (QDomDocument &aDoc) const
 Exports the sync results to XML.
 
QString toString () const
 Exports the sync results to QString.
 
QList< TargetResultstargetResults () const
 Gets the results of all targets.
 
void addTargetResults (const TargetResults &aResults)
 Adds target results to this object.
 
QDateTime syncTime () const
 Gets the sync time.
 
MajorCode majorCode () const
 Gets the result code.
 
void setMajorCode (MajorCode aMajorCode)
 Sets the result code.
 
MinorCode minorCode () const
 Gets the failed reason.
 
void setMinorCode (MinorCode aMinorCode)
 Sets the failed Reason.
 
void setTargetId (const QString &aTargetId)
 Sets the remote target Id.
 
QString getTargetId () const
 Gets the remote target Id.
 
bool operator< (const SyncResults &aOther) const
 Compares two results objects by sync time.
 
void setScheduled (bool aScheduled)
 Sets if the results are from a scheduled sync.
 
bool isScheduled () const
 Checks if the results are from a scheduled sync.
 

Properties

QDateTime syncTime
 
MajorCode majorCode
 
MinorCode minorCode
 
bool scheduled
 
QString targetId
 
QVariantList results
 

Detailed Description

Contains information about a completed synchronization session.

SyncResults consists of the sync time/date, result code and one TargetResults object for each sync target/storage (calendar, bookmarks etc.).

Member Enumeration Documentation

◆ MajorCode

enum value

Used to set the major code in *.log.xml file for profile

◆ MinorCode

enum value

Used to set the minor code in *.log.xml file for profile

Constructor & Destructor Documentation

◆ SyncResults() [1/4]

SyncResults::SyncResults ( )

Constructs an empty sync results object.

Sync time is set to current time, result code should be set later by calling setMajorCode , setMinorCode.

◆ SyncResults() [2/4]

SyncResults::SyncResults ( const SyncResults & aSource)

Copy constructor.

Parameters
aSourceCopy source.

◆ SyncResults() [3/4]

SyncResults::SyncResults ( QDateTime aTime,
SyncResults::MajorCode aMajorCode,
SyncResults::MinorCode aMinorCode )

Constructs sync results, sets sync time and result code.

Parameters
aTimeSync time for the results.
aMajorCodeSync result code.
aMinorCodeSync Failed Reason.

◆ SyncResults() [4/4]

SyncResults::SyncResults ( const QDomElement & aRoot)
explicit

Constructs sync results from XML.

Parameters
aRootRoot element of the XML representation.

Member Function Documentation

◆ addTargetResults()

void SyncResults::addTargetResults ( const TargetResults & aResults)

Adds target results to this object.

Parameters
aResultsThe target results to add.

◆ isScheduled()

bool SyncResults::isScheduled ( ) const

Checks if the results are from a scheduled sync.

Returns
True if scheduled.

◆ majorCode()

SyncResults::MajorCode SyncResults::majorCode ( ) const

Gets the result code.

Returns
major code.

◆ minorCode()

SyncResults::MinorCode SyncResults::minorCode ( ) const

Gets the failed reason.

Returns
failed Reason.

◆ operator<()

bool SyncResults::operator< ( const SyncResults & aOther) const

Compares two results objects by sync time.

The object with earlier sync time is smaller.

Parameters
aOtherPoint of comparison.

◆ operator=()

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

Assignment operator.

Parameters
aRhsSource.

◆ setMajorCode()

void SyncResults::setMajorCode ( SyncResults::MajorCode aMajorCode)

Sets the result code.

Parameters
aMajorCodeThe result code.

◆ setMinorCode()

void SyncResults::setMinorCode ( SyncResults::MinorCode aMinorCode)

Sets the failed Reason.

Parameters
aMinorCode- minor code or the reason

◆ setScheduled()

void SyncResults::setScheduled ( bool aScheduled)

Sets if the results are from a scheduled sync.

Parameters
aScheduledTrue if this is a scheduled sync.

◆ setTargetId()

void SyncResults::setTargetId ( const QString & aTargetId)

Sets the remote target Id.

Parameters
aTargetIdThe remote device Id.

◆ syncTime()

QDateTime SyncResults::syncTime ( ) const

Gets the sync time.

Returns
Sync time.

◆ targetResults()

QList< TargetResults > SyncResults::targetResults ( ) const

Gets the results of all targets.

Returns
List of target results.

◆ toString()

QString SyncResults::toString ( ) const

Exports the sync results to QString.

Returns
return the Results as xml formatted string

◆ toXml()

QDomElement SyncResults::toXml ( QDomDocument & aDoc) const

Exports the sync 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: