kpilot
RecordConduit Class Reference
#include <recordconduit.h>

Detailed Description
This is the base class for all record based conduits.Each of them should implement this class. All references in the form of (see x.x) refer to a section in the document "Use Case - Conduit Syncing.odt" which can be found in the design directory.
Definition at line 46 of file recordconduit.h.
Public Member Functions | |
| RecordConduit (KPilotLink *o, const QVariantList &a=QVariantList(), const QString &conduitName=QString("Conduit name not set."), const QString &databaseName=QString()) | |
| virtual | ~RecordConduit () |
Protected Member Functions | |
| virtual void | _copy (const HHRecord *from, Record *to)=0 |
| virtual void | _copy (const Record *from, HHRecord *to)=0 |
| bool | checkVolatility () |
| virtual void | copy (const HHRecord *from, Record *to) |
| virtual void | copy (const Record *from, HHRecord *to) |
| void | copyHHToPC () |
| void | copyPCToHH () |
| virtual HHRecord * | createHHRecord (const Record *pcRec)=0 |
| virtual Record * | createPCRecord (const HHRecord *hhRec)=0 |
| void | deleteRecords (Record *pcRecord, HHRecord *hhRecord) |
| virtual bool | equal (const Record *pcRec, const HHRecord *hhRec) const =0 |
| virtual bool | exec () |
| Record * | findMatch (HHRecord *rec) |
| void | firstSync () |
| void | hotOrFullSync () |
| virtual bool | initDataProxies ()=0 |
| virtual void | loadSettings ()=0 |
| void | solveConflict (Record *pcRecord, HHRecord *hhRecord) |
| void | syncConflictedRecords (Record *pcRecord, HHRecord *hhRecord, bool pcOverides) |
| void | syncRecords (Record *pcRecord, HHRecord *backupRecord, HHRecord *hhRecord) |
| virtual void | test ()=0 |
| void | updateBackupDatabase () |
Protected Attributes | |
| HHDataProxy * | fBackupDataProxy |
| QString | fDatabaseName |
| HHDataProxy * | fHHDataProxy |
| IDMapping | fMapping |
| DataProxy * | fPCDataProxy |
| QStringList * | fSyncedPcRecords |
Constructor & Destructor Documentation
| RecordConduit::RecordConduit | ( | KPilotLink * | o, | |
| const QVariantList & | a = QVariantList(), |
|||
| const QString & | conduitName = QString( "Conduit name not set." ), |
|||
| const QString & | databaseName = QString() | |||
| ) | [explicit] |
Definition at line 45 of file recordconduit.cc.
| RecordConduit::~RecordConduit | ( | ) | [virtual] |
Definition at line 57 of file recordconduit.cc.
Member Function Documentation
Copies the field values of from to to.
The method should only touch data that can be synced between the two records and leave the rest of the records data unchanged. After calling this method
RecordConduit::equal( pcRecord, hhRecord ) must return true.
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
Copies the field values of from to to.
The method should only touch data that can be synced between the two records and leave the rest of the records data unchanged. After calling this method
RecordConduit::equal( pcRecord, hhRecord ) must return true.
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
| bool RecordConduit::checkVolatility | ( | ) | [protected] |
Checks the number of changes (Creates, updates, deletes) as wel as the number of changes.
When one of these exceeds the configured values it will warn the user and return false if the user doesn't want to commit the changes to the data stores.
Definition at line 264 of file recordconduit.cc.
Copies the category of from to to.
Delegates the rest of the copying to the implementing classes.
RecordConduit::equal( pcRecord, hhRecord ) must return true.Definition at line 1024 of file recordconduit.cc.
Copies the categories of from to to.
Delegates the rest of the copying to the implementing classes.
RecordConduit::equal( pcRecord, hhRecord ) must return true.Definition at line 1014 of file recordconduit.cc.
| void RecordConduit::copyHHToPC | ( | ) | [protected] |
| void RecordConduit::copyPCToHH | ( | ) | [protected] |
Creates a new HHRecord object with the same data as pcRec.
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
Creates a new Record object with the same data as hhRec.
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
Deletes the mapping for those records and removes them from the proxies.
Definition at line 906 of file recordconduit.cc.
| virtual bool RecordConduit::equal | ( | const Record * | pcRec, | |
| const HHRecord * | hhRec | |||
| ) | const [protected, pure virtual] |
Compares pcRecord with hhRec and returns true if they are considered equal.
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
| bool RecordConduit::exec | ( | ) | [protected, virtual] |
This function starts the actual processing done by the conduit.
It should return false if the processing cannot be initiated, f.ex. because some parameters were not set or a needed library is missing. This will be reported to the user. It should return true if processing is started normally. If processing starts normally, it is the _conduit's_ responsibility to eventually emit syncDone(); if processing does not start normally (ie. exec() returns false) then the environment will deal with syncDone().
Implements SyncAction.
Definition at line 64 of file recordconduit.cc.
Iterates over the records from the pc data proxy and tries to find a matching record for rec.
If no matching record is found 0L is returned. The method makes use of the matchFields() method of Record.
Definition at line 693 of file recordconduit.cc.
| void RecordConduit::firstSync | ( | ) | [protected] |
| void RecordConduit::hotOrFullSync | ( | ) | [protected] |
Executes the HotSync or the FullSync flow (see 4.1 and 5.2).
What actualy is executed depends on syncMode().mode().
Definition at line 383 of file recordconduit.cc.
| virtual bool RecordConduit::initDataProxies | ( | ) | [protected, pure virtual] |
Initialize the data proxies that are needed during sync and makes sure that all records are loaded for each data proxy.
The following members should be initialized after the call:
- fLocalDatabase
- fDatastore
- fBackupdb
Returns false if one of the dataproxies could not be initialized.
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
| virtual void RecordConduit::loadSettings | ( | ) | [protected, pure virtual] |
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
Definition at line 925 of file recordconduit.cc.
| void RecordConduit::syncConflictedRecords | ( | Record * | pcRecord, | |
| HHRecord * | hhRecord, | |||
| bool | pcOverides | |||
| ) | [protected] |
Synchronizes the two conflicted records and lets one of the two overide.
Definition at line 856 of file recordconduit.cc.
| void RecordConduit::syncRecords | ( | Record * | pcRecord, | |
| HHRecord * | backupRecord, | |||
| HHRecord * | hhRecord | |||
| ) | [protected] |
Synchronizes the three records.
If one of the parameters is 0L we assume that either the record does not exist (and needs to be created), or it is deleted and should be deleted on the other side.
Definition at line 712 of file recordconduit.cc.
| virtual void RecordConduit::test | ( | ) | [protected, pure virtual] |
This method is called when the conduit is run in Test Mode.
The implementing class can do whatever it wants to do for test purposes.
Implemented in CalendarConduit, ContactsConduit, KeyringConduit, TodoConduit, and Contacts.
| void RecordConduit::updateBackupDatabase | ( | ) | [protected] |
Definition at line 329 of file recordconduit.cc.
Member Data Documentation
HHDataProxy* RecordConduit::fBackupDataProxy [protected] |
Definition at line 52 of file recordconduit.h.
QString RecordConduit::fDatabaseName [protected] |
Definition at line 49 of file recordconduit.h.
HHDataProxy* RecordConduit::fHHDataProxy [protected] |
Definition at line 51 of file recordconduit.h.
IDMapping RecordConduit::fMapping [protected] |
Definition at line 50 of file recordconduit.h.
DataProxy* RecordConduit::fPCDataProxy [protected] |
Definition at line 53 of file recordconduit.h.
QStringList* RecordConduit::fSyncedPcRecords [protected] |
Definition at line 54 of file recordconduit.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference