KDE PIM / Developers / API Docs / kitchensync

KSync::Syncee Class Reference

A data set to be synced. More...

#include <syncee.h>

Inherited by KSync::AddressBookSyncee, KSync::BookmarkSyncee, KSync::CalendarSyncee, KSync::OpieDesktopSyncee, and KSync::UnknownSyncee.

List of all members.

Public Member Functions

Protected Member Functions


Detailed Description

A data set to be synced.

Author:
Cornelius Schumacher, zecke
See also:
SyncEntry, Syncer
This class represents a data set of SyncEntries. During a syncing process, two or more Syncees are synced. After syncing they are equal, that means they should contain the same set of SyncEntries. Choices by the user can lead to deviations from complete equality.

The Syncee class provides an interface, which has to be implemented by concrete subclasses.

Further you can set a Merger on the Syncee to show which attributes are known to you. For example Device B got a todolist but has only 3 Attributes. Attribute 1: Description Attribute 2: Completed Attribute 3: DueDate

The KDE todolist got roughly 10-15 Attributes So when syncing B with KDE, where B would replace KDE Records would lead to loss of up to 12 attributes. This will be avoided by a merge before a replaceEntry operation. This way B will take presedence on the 3 Attributes but we won't lose the additional attributes. By default the support map of a Syncee is set to supports all..

See also:
Merger Syncer operates on Syncee objects.


Constructor & Destructor Documentation

Syncee::Syncee Merger merger  ) 
 

Normally firstSync is on.


Member Function Documentation

virtual void KSync::Syncee::reset  )  [inline, virtual]
 

Reset Syncee to initial state.

This is called when the data the Syncee operates on is changed externally, i.e. without using the Syncees addEntry() removeEntry(), replaceEntry() methods.

Reimplemented in KSync::AddressBookSyncee, and KSync::CalendarSyncee.

virtual SyncEntry* KSync::Syncee::firstEntry  )  [pure virtual]
 

Return the first SyncEntry object of the data set.

This function together with nextEntry() is used to iterate through all entries of a Syncee data set.

Implemented in KSync::AddressBookSyncee, KSync::BookmarkSyncee, and KSync::CalendarSyncee.

virtual SyncEntry* KSync::Syncee::nextEntry  )  [pure virtual]
 

Return the next SyncEntry object of the data set.

This function together with firstEntry() is used to iterate through all entries of a Syncee data set.

Implemented in KSync::AddressBookSyncee, KSync::BookmarkSyncee, and KSync::CalendarSyncee.

QString Syncee::type  )  const
 

The type of the Syncee.

Sometimes it is not possible to use dynamic_cast and this way a type is nice to have;

Reimplemented in KSync::AddressBookSyncee.

SyncEntry * Syncee::findEntry const QString &  id  )  [virtual]
 

Find an entry identified by a unique id.

See SyncEntry::id().

Parameters:
id the Id to be found

virtual void KSync::Syncee::addEntry SyncEntry  )  [pure virtual]
 

Add a SyncEntry object to this data set.

Ownership of the object is transfered and the SyncEntry now belongs to this Syncee. Use KSync::SyncEntry::clone() to create an exact copy of a KSync::SyncEntry.

See also:
KSync::SyncEntry::clone

Implemented in KSync::AddressBookSyncee, KSync::BookmarkSyncee, and KSync::CalendarSyncee.

virtual void KSync::Syncee::removeEntry SyncEntry  )  [pure virtual]
 

Remove a SyncEntry.

The entry is removed from the data set, but the object is not deleted.

Implemented in KSync::AddressBookSyncee, KSync::BookmarkSyncee, and KSync::CalendarSyncee.

void Syncee::replaceEntry SyncEntry oldEntry,
SyncEntry newEntry
 

Replace an entry of the data set by another.

Ownership of the objects is handled as with the addEntry() and the old entry will be deleted internally.

void Syncee::setIdentifier const QString &  identifier  ) 
 

Set identifier which can be used to uniquely identify the Syncee.

A Syncee with empty identifier is invalid. Without identifier the sync log can't be written.

QString Syncee::identifier  )  const
 

Return the identifier which can be used to uniquely identify the Syncee object.

As long as the identifier is empty the Syncee doesn't have valid data.

bool Syncee::isValid  )  [virtual]
 

Return if the Syncee is valid.

If a Syncee is invalid it means that it doesn't have any valid data, e.g. because the Konnector doesn't support this type of data.

By default the Syncee isn't valid if the identifier is empty.

int Syncee::modificationState SyncEntry entry  )  const [virtual]
 

Returns if hasChanged and the state of change Undefined, Added, Modified,Removed.

SyncEntry::PtrList Syncee::added  )  [virtual]
 

What was added? This uses firstEntry() nextEntry internally be aware of it.

SyncEntry::PtrList Syncee::modified  )  [virtual]
 

What was modified? This uses firstEntry() nextEntry internally be aware of it.

SyncEntry::PtrList Syncee::removed  )  [virtual]
 

What was removed? This uses firstEntry() nextEntry internally be aware of it.

void Syncee::insertId const QString &  type,
const QString &  konnectorId,
const QString &  kdeId
 

A SyncEntry is able to store the relative ids.

Parameters:
type The type of the id for example todo, kalendar...
konnectorId The original id of the Entry on konnector side
kdeId Is the id KDE native classes are assigning Example: type = todo konnector id = -1345678 KDE ID = KORG-234575464

QString Syncee::generateNewId  )  const [virtual]
 

When dealing with special uid Konnector- You might want a new uid to be generated.

To later find an Entry again you'll need this map

Reimplemented in KSync::AddressBookSyncee, and KSync::CalendarSyncee.

Kontainer::ValueList Syncee::ids const QString &  type  )  const
 

Parameters:
type The type for the ids to returned
Returns:
the ids as QValueList

QMap< QString, Kontainer::ValueList > Syncee::ids  )  const
 

Returns:
all ids

Merger * Syncee::merger  )  const
 

The Merger set in either the Constructor or by a call to setMerger.

Merger could be null, this normally indicates that all attributes are supported.

See also:
Merger

void Syncee::setMerger Merger merger = 0  ) 
 

Set the Merger.

Ownership is not transfered and you can use the same merger on many different Syncees. You can also unset it (passing 0l)

void Syncee::setTitle const QString &  src  ) 
 

Set the source of this Syncee.

The string may be presented to the user by the conflict resolver

QString Syncee::title  )  const
 

Returns the source of this syncee or QString::null if not set.

bool Syncee::trustIdsOnFirstSync  )  const [virtual]
 

When syncing two iCalendar the UIDs are garantuued to be global and you may not change these values at all.

But there are cases in firstSync where you would like to create a bound between one id and another

void Syncee::setType const QString &  type  )  [protected]
 

The Syncee Implementation can set the type of the Syncee.

This is needed to identify and cast the syncee


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