kitchensync
KSync::Syncee Class Reference
#include <syncee.h>
Inheritance diagram for KSync::Syncee:

Detailed Description
A data set to be synced.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..
Definition at line 71 of file syncee.h.
Public Member Functions | |
Syncee (Merger *merger) | |
virtual | ~Syncee () |
virtual void | reset () |
virtual SyncEntry * | firstEntry ()=0 |
virtual SyncEntry * | nextEntry ()=0 |
QString | type () const |
virtual SyncEntry * | findEntry (const QString &id) |
virtual void | addEntry (SyncEntry *)=0 |
virtual void | removeEntry (SyncEntry *)=0 |
void | replaceEntry (SyncEntry *oldEntry, SyncEntry *newEntry) |
void | setIdentifier (const QString &identifier) |
QString | identifier () const |
virtual bool | isValid () |
virtual int | modificationState (SyncEntry *entry) const |
virtual SyncEntry::PtrList | added () |
virtual SyncEntry::PtrList | modified () |
virtual SyncEntry::PtrList | removed () |
void | insertId (const QString &type, const QString &konnectorId, const QString &kdeId) |
virtual QString | generateNewId () const |
Kontainer::ValueList | ids (const QString &type) const |
QMap< QString, Kontainer::ValueList > | ids () const |
Merger * | merger () const |
void | setMerger (Merger *merger=0) |
void | setTitle (const QString &src) |
QString | title () const |
virtual bool | trustIdsOnFirstSync () const |
virtual bool | writeBackup (const QString &filename)=0 |
virtual bool | restoreBackup (const QString &filename)=0 |
Protected Member Functions | |
void | setType (const QString &type) |
SyncEntry::PtrList | find (int state) |
Constructor & Destructor Documentation
Syncee::Syncee | ( | Merger * | merger | ) |
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, KSync::CalendarSyncee, KSync::OpieDesktopSyncee, and KSync::UnknownSyncee.
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, KSync::CalendarSyncee, KSync::OpieDesktopSyncee, and KSync::UnknownSyncee.
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, and KSync::UnknownSyncee.
Definition at line 163 of file syncee.cpp.
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
Definition at line 59 of file syncee.cpp.
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, KSync::CalendarSyncee, KSync::OpieDesktopSyncee, and KSync::UnknownSyncee.
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, KSync::CalendarSyncee, KSync::OpieDesktopSyncee, and KSync::UnknownSyncee.
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.
Definition at line 71 of file syncee.cpp.
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.
Definition at line 49 of file syncee.cpp.
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.
Definition at line 45 of file syncee.cpp.
bool Syncee::isValid | ( | ) | [virtual] |
int Syncee::modificationState | ( | SyncEntry * | entry | ) | const [virtual] |
Returns if hasChanged and the state of change Undefined, Added, Modified,Removed.
Definition at line 81 of file syncee.cpp.
SyncEntry::PtrList Syncee::added | ( | ) | [virtual] |
What was added? This uses firstEntry() nextEntry internally be aware of it.
Definition at line 86 of file syncee.cpp.
SyncEntry::PtrList Syncee::modified | ( | ) | [virtual] |
What was modified? This uses firstEntry() nextEntry internally be aware of it.
Definition at line 90 of file syncee.cpp.
SyncEntry::PtrList Syncee::removed | ( | ) | [virtual] |
What was removed? This uses firstEntry() nextEntry internally be aware of it.
Definition at line 94 of file syncee.cpp.
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
Definition at line 98 of file syncee.cpp.
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.
Definition at line 132 of file syncee.cpp.
Kontainer::ValueList Syncee::ids | ( | const QString & | type | ) | const |
- Parameters:
-
type The type for the ids to returned
- Returns:
- the ids as QValueList
Definition at line 113 of file syncee.cpp.
QMap< QString, Kontainer::ValueList > Syncee::ids | ( | ) | const |
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
Definition at line 137 of file syncee.cpp.
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)
Definition at line 142 of file syncee.cpp.
void Syncee::setTitle | ( | const QString & | src | ) |
Set the source of this Syncee.
The string may be presented to the user by the conflict resolver
Definition at line 147 of file syncee.cpp.
QString Syncee::title | ( | ) | const |
Returns the source of this syncee or QString::null if not set.
Definition at line 152 of file syncee.cpp.
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
Definition at line 127 of file syncee.cpp.
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
Definition at line 158 of file syncee.cpp.
The documentation for this class was generated from the following files: