KSync::Syncee Class Reference
A data set to be synced. More...
#include <syncee.h>
Inheritance diagram for KSync::Syncee:


Public Types | |
enum | SyncMode { MetaLess = 0, MetaMode = 2 } |
Public Member Functions | |
Syncee (uint supportSize=0) | |
virtual void | reset () |
virtual SyncEntry * | firstEntry ()=0 |
virtual SyncEntry * | nextEntry ()=0 |
virtual 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 () |
virtual bool | isValid () |
QString | statusLogName () |
bool | loadLog () |
bool | saveLog () |
bool | hasChanged (SyncEntry *) |
virtual int | modificationState (SyncEntry *entry) const |
virtual int | syncMode () const |
virtual void | setSyncMode (int mode=MetaLess) |
virtual void | setFirstSync (bool firstSync=true) |
virtual bool | firstSync () 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 | newId () const |
Kontainer::ValueList | ids (const QString &type) const |
QMap< QString, Kontainer::ValueList > | ids () const |
virtual void | setSupports (const QBitArray &) |
virtual QBitArray | bitArray () const |
void | setSource (const QString &src) |
QString | source () const |
bool | isSupported (uint Attribute) const |
virtual bool | trustIdsOnFirstSync () const |
virtual bool | writeBackup (const QString &filename)=0 |
virtual bool | restoreBackup (const QString &filename)=0 |
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 a Syncee can store a BitMap on what a 'Filler' of the Syncee supports. 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..
Syncer operates on Syncee objects.
Definition at line 68 of file syncee.h.
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. Referenced by findEntry(), and saveLog(). |
|
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. Referenced by findEntry(), and saveLog(). |
|
The type of the Syncee.
Reimplemented in KSync::AddressBookSyncee, KSync::BookmarkSyncee, and KSync::CalendarSyncee. Definition at line 103 of file syncee.h. Referenced by statusLogName(). |
|
Find an entry identified by a unique id. See SyncEntry::id().
Definition at line 57 of file syncee.cpp. References firstEntry(), KSync::SyncEntry::id(), and nextEntry(). |
|
Add a SyncEntry object to this data set. Ownership of the object remains with the caller. Implemented in KSync::AddressBookSyncee, KSync::BookmarkSyncee, and KSync::CalendarSyncee. Referenced by replaceEntry(). |
|
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. Referenced by replaceEntry(). |
|
Replace an entry of the data set by another. Ownership of the objects is handled as with the addEntry() and removeEntry() functions. Definition at line 70 of file syncee.cpp. References addEntry(), and removeEntry(). |
|
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 47 of file syncee.cpp. |
|
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 139 of file syncee.h. Referenced by isValid(), statusLogName(), and KSync::Syncer::sync(). |
|
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. Definition at line 52 of file syncee.cpp. References identifier(). Referenced by loadLog(). |
|
Return the name of a config file, which is used to store status information about the data set.
Definition at line 121 of file syncee.cpp. References identifier(), and type(). Referenced by loadLog(). |
|
Load the syncing log.
Definition at line 88 of file syncee.cpp. References isValid(), and statusLogName(). Referenced by KSync::Syncer::sync(). |
|
Save the status log file with the name statusLogName().
Definition at line 107 of file syncee.cpp. References firstEntry(), and nextEntry(). Referenced by KSync::Syncer::sync(), and KSync::Syncer::syncAllToTarget(). |
|
Return, if the given SyncEntry has changed since the last syncing. This information is retrieved by comparing the timestamps from the log file and the freshly read data set. Definition at line 76 of file syncee.cpp. References KSync::SyncEntry::id(), and KSync::SyncEntry::timestamp(). Referenced by KSync::AddressBookSyncee::addEntry(). |
|
Returns if hasChanged and the state of change Undefined, Added, Modified,Removed.
Definition at line 135 of file syncee.cpp. References KSync::SyncEntry::state(). |
|
Returns the syncMode of this Syncee. The syncMode determines the later used synchronisation algorithm for the best results. Definition at line 140 of file syncee.cpp. |
|
Sets the syncMode of this Syncee.
Definition at line 145 of file syncee.cpp. |
|
Set if it's syncing for the first time.
Definition at line 155 of file syncee.cpp. |
|
If it is syncing for the first time.
Definition at line 150 of file syncee.cpp. |
|
What was added?
Reimplemented in KSync::AddressBookSyncee, and KSync::CalendarSyncee. |
|
What was modified?
Reimplemented in KSync::AddressBookSyncee, and KSync::CalendarSyncee. |
|
What was removed?
Reimplemented in KSync::AddressBookSyncee, and KSync::CalendarSyncee. |
|
A KSyncEntry is able to store the relative ids.
Definition at line 160 of file syncee.cpp. |
|
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. Definition at line 194 of file syncee.cpp. |
|
Definition at line 175 of file syncee.cpp. |
|
Definition at line 184 of file syncee.cpp. |
|
Set what the Syncee supports.
Definition at line 199 of file syncee.cpp. |
|
Returns attributes supported by the Device.
Definition at line 206 of file syncee.cpp. |
|
Set the source of this Syncee. The string may be presented to the user by the conflict resolver Definition at line 217 of file syncee.cpp. |
|
Eeturns the source of this syncee or QString::null if not set.
Definition at line 222 of file syncee.cpp. |
|
Convenience function to figure if a specific attribute is supported.
Definition at line 211 of file syncee.cpp. |
|
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 189 of file syncee.cpp. |
The documentation for this class was generated from the following files: