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.
Public Member Functions
- Syncee (Merger *merger)
- 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)
Detailed Description
A data set to be synced.
- Author:
- Cornelius Schumacher, zecke
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..
Constructor & Destructor Documentation
|
Normally firstSync is on.
|
Member Function Documentation
|
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. |
|
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. |
|
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. |
|
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. |
|
Find an entry identified by a unique id. See SyncEntry::id().
|
|
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.
Implemented in KSync::AddressBookSyncee, KSync::BookmarkSyncee, and KSync::CalendarSyncee. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
Returns if hasChanged and the state of change Undefined, Added, Modified,Removed.
|
|
What was added? This uses firstEntry() nextEntry internally be aware of it.
|
|
What was modified? This uses firstEntry() nextEntry internally be aware of it.
|
|
What was removed? This uses firstEntry() nextEntry internally be aware of it.
|
|
A SyncEntry is able to store the relative ids.
|
|
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. |
|
|
|
|
|
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.
|
|
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) |
|
Set the source of this Syncee. The string may be presented to the user by the conflict resolver |
|
Returns the source of this syncee or QString::null if not set.
|
|
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 |
|
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:
- syncee.h
- syncee.cpp