RecordConduit Class Reference
This is a base class for record-based conduits. More...
#include <recordConduit.h>
Inherits ConduitAction.
Inherited by VCalConduitBase.
Public Member Functions
- RecordConduit (QString name, KPilotDeviceLink *o, const char *n=0L, const QStringList &a=QStringList())
- virtual bool exec ()
Protected Types
- enum eqFlags { eqFlagsFlags = 0x01, eqFlagsCategory = 0x02, eqFlagsAll = 0xFFFF, eqFlagsAlmostAll = eqFlagsAll && ~(eqFlagsFlags|eqFlagsCategory) }
Protected Slots
- void slotPalmRecToPC ()
- void slotPCRecToPalm ()
- void slotDeletedRecord ()
- void slotDeleteUnsyncedPCRecords ()
- void slotDeleteUnsyncedHHRecords ()
- void slotCleanup ()
Protected Member Functions
- virtual PCData * initializePCData ()=0
- virtual QString dbName () const =0
- virtual PilotAppCategory * createPalmEntry (PilotRecord *rec)=0
- virtual void readConfig ()=0
- virtual unsigned char * doPackAppInfo (int *)
- virtual bool doUnpackAppInfo (unsigned char *, int)
- virtual QString category (int) const
- virtual bool _equal (const PilotAppCategory *palmEntry, const PCEntry *pcEntry, int flag=eqFlagsAll) const =0
- virtual bool _copy (PilotAppCategory *toPalmEntry, const PCEntry *fromPCEntry)=0
- virtual bool _copy (PCEntry *toPCEntry, const PilotAppCategory *fromPalmEntry)=0
- virtual bool smartMergeEntry (PCEntry *pcEntry, PilotAppCategory *backupEntry, PilotAppCategory *palmEntry)=0
- virtual bool doPrepare ()
- virtual const QStringList categories () const
- virtual int findFlags () const
- virtual void doPostSync ()
- QString getCatForHH (const QStringList cats, const QString curr) const
- void setCategory (PCEntry *pcEntry, QString cat)
- bool _prepare ()
- void _getAppInfo ()
- void _setAppInfo ()
- bool syncEntry (PCEntry *pcEntry, PilotAppCategory *backupEntry, PilotAppCategory *palmEntry)
- virtual bool pcCopyToPalm (PCEntry *pcEntry, PilotAppCategory *backupEntry, PilotAppCategory *palmEntry)
- virtual bool palmCopyToPC (PCEntry *pcEntry, PilotAppCategory *backupEntry, PilotAppCategory *palmEntry)
- bool palmSaveEntry (PilotAppCategory *palmEntry, PCEntry *pcEntry)
- bool backupSaveEntry (PilotAppCategory *backup)
- bool pcSaveEntry (PCEntry *pcEntry, PilotAppCategory *backupEntry, PilotAppCategory *palmEntry)
- bool pcDeleteEntry (PCEntry *pcEntry, PilotAppCategory *backupEntry, PilotAppCategory *palmEntry)
- PCEntry * findMatch (PilotAppCategory *palmEntry) const
Static Protected Member Functions
- static void setArchiveDeleted (bool archiveDeleted)
- static bool archiveDeleted ()
- static bool isDeleted (const PilotAppCategory *addr)
- static bool isArchived (const PilotAppCategory *addr)
- static bool isArchived (const PCEntry *addr)
- static int compareStr (const QString &str1, const QString &str2)
Protected Attributes
- PCData * mPCData
- PCData::Iterator mPCIter
- int mPalmIndex
- QMap< recordid_t, QString > mEntryMap
- RecordIDList mSyncedIds
- RecordIDList mAllIds
Static Protected Attributes
Classes
- class PCData
- This class is just a wrapper around the data on the PC, which provides a uniform interface for all different kinds of data like addressbook, calendar, todo list etc. More...
- This class is just a wrapper around the data on the PC, which provides a uniform interface for all different kinds of data like addressbook, calendar, todo list etc. More...
- class PCEntry
- This class is just a wrapper around an entry on the PC, which provides a uniform interface for all different kinds of entries like addressbook, calendar, todo, diary entries, etc. More...
- This class is just a wrapper around an entry on the PC, which provides a uniform interface for all different kinds of entries like addressbook, calendar, todo, diary entries, etc. More...
Detailed Description
This is a base class for record-based conduits.The data on the PC is represented by an object derived from the RecordConduit::PCData class, and each entry on the PC by an object derived from RecordConduit::PCEntry. Only very few methods of this class need to be implemented, mostly just the functions to copy a PC entry to a handheld entry and vice versa. All the sync logic is already present in this class and does not need to be implemented by child classes.
Member Enumeration Documentation
|
Flags for the _equal() method, that specify which parts of the record need to be checked. Flags and category are pre-defined, but each conduit can define its own flags and reimplement findFlags(). |
Member Function Documentation
|
Initialize the PC Data object, must be a child class of RecordConduit::PCData.
|
|
return the name of the databases synced by this conduit
|
|
Create a Palm entry from the raw palm record.
|
|
Read the config. You need to call at least setArchiveDeleted(bool) and setConflictResolution(SyncAction::ConflictResolution) |
|
Create a buffer for the appInfo and pack it inside. Also, remember to set appLen to the size of the buffer! By default, nothing is done, and the return value will be 0 (appinfo not supported by default, you need to implement this in your child class!).
|
|
Read the appInfo from the buffer provided to this method. By default, nothing is done, and the return value will be false (appinfo not supported by default, you need to implement this in your child class!).
|
|
Return the n-th category on the handheld. By default a null string will be returned. If you want your conduit to support categories, reimplement this method in your childclass!
|
|
Check if the entry from the Handheld matches the entry from the PC (but check only those fields of the records that are specified by the flag argument. By default, all fields should be checked, but in some cases (like finding an approximately equal entry, reimplement findFlags() to use different flags in that case) only some parts should be checked.
|
|
Copy all fields from the PC entry to the handheld entry.
|
|
Copy all fields from the handheld entry to the PC entry.
|
|
The entry on the pc and on the handheld were both changed, and an automatic conflict resolution is not possible, so do a suitable resolution (ask the user or apply some pre-defined method (e.g. one side always overrides etc). |
|
Do the preperations before the sync algorithm starts.
|
|
Return the list of category names on the handheld. The default implementation is slow, because it just calls category(n) for 0<n<16. This method should be reimplemented by child classes when a faster algorithm is available. For conduits that don't support categories at all, this might also reimplemented to automatically return an empty list. |
|
Specifies which parts of the record shall be checked when searching for matches of the handheld data in the PC data. By default, everything except flags and categories are checked. Child classes that desire other comparisons (i.e. compare just an enty date if only one entry per date is allowed, like for diaries, etc) should reimplement this method. |
|
Do some cleanup after the sync, e.g. write sync time to the config, write some version to the config, whatever you like in your conduit. |
|
_getCat returns the id of the category from the given categories list. If the address has no categories on the PC, QString::null is returned. If the current category exists in the list of cats, it is returned Otherwise the first cat in the list that exists on the HH is returned If none of the categories exists on the palm, QString::null is returned |
Member Data Documentation
|
mEntryMap maps record ids to IDs of Es. This is used to speed up searching the local addressbook |
The documentation for this class was generated from the following files:
- recordConduit.h
- recordConduit.cc