kitchensync
KSync::Merger Class Reference
#include <merger.h>
Inheritance diagram for KSync::Merger:

Detailed Description
Small class to help in not losing attributes.The idea of this class is the need for not losing attributes between syncs where two parties do not support the same amount of attributes. One party can create a specialised Merger and set it on the Syncee to allow merging attributes from a different SyncEntry into one belonging to the Syncee of the party.
Your specialised class just need to implement the merge function. and call setSynceeType
Definition at line 47 of file merger.h.
Public Member Functions | |
Merger () | |
virtual | ~Merger () |
virtual bool | merge (SyncEntry *entry, SyncEntry *other)=0 |
QString | synceeType () const |
Protected Member Functions | |
void | setSynceeType (const QString &s) |
bool | sameType (SyncEntry *e1, SyncEntry *e2) |
bool | sameType (SyncEntry *e1, SyncEntry *e2, const QString &wished) |
template<class M> | |
M * | otherMerger (SyncEntry *) |
Protected Attributes | |
QBitArray | mBitArray |
QString | mString |
Member Function Documentation
Ask the interface to do the merge.
This asks to merge 'other's additional attributes into entry. This will alter entry and 'other' should not be changed. If other does not have a merger treat it as every attribute is supported. You might at least want to merge all custom attributes.
- Returns:
- success or failure of merge
Implemented in KSync::AddressBookMerger, and KSync::CalendarMerger.
QString KSync::Merger::synceeType | ( | ) | const |
Return which Syncee corresspondends to the actual implementation of the interface.
Normally the Attributes of the records heavily depend on it.
- Returns:
- The Type of the Syncee.
Definition at line 33 of file merger.cpp.
void KSync::Merger::setSynceeType | ( | const QString & | s | ) | [protected] |
Normally the actual implementation will already do that.
- Parameters:
-
s The Type of the Syncee
Definition at line 38 of file merger.cpp.
Convience method when implementing 'merge'.
- Returns:
- If the two entries are of the same type
- Parameters:
-
e1 The first sync entry e2 The second sync entry
Definition at line 43 of file merger.cpp.
M * KSync::Merger::otherMerger | ( | SyncEntry * | ) | [protected] |
The documentation for this class was generated from the following files: