kitchensync
KSync::Konnector Class Reference
#include <konnector.h>
Inheritance diagram for KSync::Konnector:

Detailed Description
This class provides the interface for a Konnector.A Konnector is a class responsible for communication with a certain kind of PIM data source. It does the actual transport of the data and conversion of data is needed. It provides the PIM data in a generic way using the KSyncee class which is suitable for further processing within KDE, e.g. for syncing or being accessed by a kioslave.
Definition at line 53 of file konnector.h.
Public Types | |
enum | FilterMode { FilterBeforeSync, FilterAfterSync } |
typedef QPtrList< Konnector > | List |
Signals | |
void | synceesRead (KSync::Konnector *) |
void | synceeReadError (KSync::Konnector *) |
void | synceesWritten (KSync::Konnector *) |
void | synceeWriteError (KSync::Konnector *) |
void | storagePathChanged (const QString &path) |
Public Member Functions | |
Konnector (const KConfig *config) | |
void | initDefaultFilters () |
virtual | ~Konnector () |
void | writeConfig (KConfig *config) |
virtual SynceeList | syncees ()=0 |
virtual void | appendSyncee (Syncee *ap) |
virtual bool | readSyncees ()=0 |
virtual bool | writeSyncees ()=0 |
QString | storagePath () const |
void | setStoragePath (const QString &path) |
KPIM::ProgressItem * | progressItem (const QString &msg) |
virtual bool | connectDevice ()=0 |
virtual bool | disconnectDevice ()=0 |
bool | isConnected () const |
virtual KonnectorInfo | info () const=0 |
virtual void | add (const QString &res) |
virtual void | remove (const QString &res) |
virtual QStringList | resources () const |
virtual QStringList | builtIn () const |
virtual QStringList | supportedFilterTypes () const=0 |
void | addFilter (KSync::Filter *) |
void | removeFilter (KSync::Filter *) |
KSync::Filter::List | filters () const |
KSync::Filter * | filter (const QString &type) |
void | applyFilters (FilterMode) |
Static Public Member Functions | |
static QString | generateMD5Sum (const QString &) |
static void | purgeRemovedEntries (Syncee *) |
Protected Slots | |
void | progressItemCanceled (KPIM::ProgressItem *) |
Constructor & Destructor Documentation
Konnector::Konnector | ( | const KConfig * | config | ) |
Konnector::~Konnector | ( | ) | [virtual] |
Member Function Documentation
QString Konnector::generateMD5Sum | ( | const QString & | base | ) | [static] |
Generate a MD5SUM from a QString.
The intended use is with with storagePath() + "/" + generateMD5Sum(path) + "some_name.log" to really have unique identifiers
- Returns:
- a MD5SUM for the name
Definition at line 147 of file konnector.cpp.
void Konnector::purgeRemovedEntries | ( | Syncee * | sync | ) | [static] |
Remove SyncEntry::wasRemoved() itrems from the Syncee.
- Parameters:
-
sync The Syncee to manipulate
Definition at line 160 of file konnector.cpp.
void Konnector::initDefaultFilters | ( | ) |
Is called by KonnectorManager to initialize the default filters of the Konnector.
Definition at line 54 of file konnector.cpp.
void Konnector::writeConfig | ( | KConfig * | config | ) |
Write configuration to config file.
Reimplemented in KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, and KSync::RemoteKonnector.
Definition at line 66 of file konnector.cpp.
virtual SynceeList KSync::Konnector::syncees | ( | ) | [pure virtual] |
Get list of Syncees used by this Konnector.
It will contain a Syncee for each supported data type. If readSyncees() hasn't be called before, the Syncees will be empty.
Implemented in KSync::DummyKonnector, KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, KSync::RemoteKonnector, and Threaded::ThreadedPlugin.
void Konnector::appendSyncee | ( | Syncee * | ap | ) | [virtual] |
Append the Syncee to the internal list of Syncees.
If the Konnector implements this method and can handle the format it will upload the Syncee on writeSyncees. The ownership of
- ap is transfered to the Konnector.
- The default implementation deletes
- ap.
- Parameters:
-
ap The Syncee to append to the list of Syncees
- See also:
- writeSyncees
Reimplemented in KSync::QtopiaKonnector.
Definition at line 134 of file konnector.cpp.
virtual bool KSync::Konnector::readSyncees | ( | ) | [pure virtual] |
Request list of Syncee objects containing PIM data from connected entity.
The response is sent with the signal synceesRead(). If an error occurs during read the signal synceeReadError() is emitted.
- Returns:
- true, if request could successfully be started, false otherwise.
Implemented in KSync::DummyKonnector, KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, KSync::RemoteKonnector, and Threaded::ThreadedPlugin.
virtual bool KSync::Konnector::writeSyncees | ( | ) | [pure virtual] |
Request to write back data contained in Syncee objects hold by the connected entity.
The end of the write operation is signalled with synceesWritten(). If an error occurs during write the signal synceeWriteError() is emitted.
- Returns:
- true, if request could successfully be started, false otherwise.
Implemented in KSync::DummyKonnector, KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, KSync::RemoteKonnector, and Threaded::ThreadedPlugin.
QString Konnector::storagePath | ( | ) | const |
If a Konnector needs to store permanent data, such as timestamps using the KSync::SyncHistory it'll use this path as base.
- Returns:
- Return the Base-Path to be used for permanent storage
- Todo:
- FIXME verb in name
Definition at line 96 of file konnector.cpp.
void Konnector::setStoragePath | ( | const QString & | path | ) |
Set the path to where the Konnector should save its data to restore the SyncHistory on next sync.
This is normally set by the part that does the syncing
Definition at line 101 of file konnector.cpp.
KPIM::ProgressItem * Konnector::progressItem | ( | const QString & | msg | ) |
Returns a progress item with the given msg.
The item is already connected to the progressItemCanceled() slot. You can reimplement this slot for special needs. Note that msg
will be interpreted as rich text, so it might have to be escaped.
- Parameters:
-
msg The label of the progress item.
Definition at line 107 of file konnector.cpp.
virtual bool KSync::Konnector::connectDevice | ( | ) | [pure virtual] |
Connect device.
Return true, if device could be connected.
Implemented in KSync::DummyKonnector, KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, KSync::RemoteKonnector, and Threaded::ThreadedPlugin.
virtual bool KSync::Konnector::disconnectDevice | ( | ) | [pure virtual] |
Disconnect device.
Implemented in KSync::DummyKonnector, KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, KSync::RemoteKonnector, and Threaded::ThreadedPlugin.
bool Konnector::isConnected | ( | ) | const |
virtual KonnectorInfo KSync::Konnector::info | ( | ) | const [pure virtual] |
Return meta information about this Konnector.
Implemented in KSync::DummyKonnector, KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, KSync::RemoteKonnector, and Threaded::ThreadedPlugin.
QStringList Konnector::builtIn | ( | ) | const [virtual] |
virtual QStringList KSync::Konnector::supportedFilterTypes | ( | ) | const [pure virtual] |
Returns a list of supported filter types.
Implemented in KSync::KABCKonnector, KSync::KCalKonnector, KSync::LocalKonnector, KSync::QtopiaKonnector, and KSync::RemoteKonnector.
void Konnector::addFilter | ( | KSync::Filter * | ) |
Add a Filter to the list of filters ownership is transfered to the Konnector.
Definition at line 175 of file konnector.cpp.
void Konnector::removeFilter | ( | KSync::Filter * | ) |
remove a Filter of the list of filters the ownership of the filter is transfered back to the caller
Definition at line 180 of file konnector.cpp.
KSync::Filter::List Konnector::filters | ( | ) | const |
KSync::Filter * Konnector::filter | ( | const QString & | type | ) |
void Konnector::applyFilters | ( | FilterMode | ) |
apply the filter to the synceeList()
- See also:
- synceeList()
Definition at line 203 of file konnector.cpp.
void KSync::Konnector::synceesRead | ( | KSync::Konnector * | ) | [signal] |
Emitted when Syncee list becomes available as response to requestSyncees().
void KSync::Konnector::synceeReadError | ( | KSync::Konnector * | ) | [signal] |
Emitted when an error occurs during read.
void KSync::Konnector::synceesWritten | ( | KSync::Konnector * | ) | [signal] |
Emitted when Syncee list was successfully written back to connected entity.
void KSync::Konnector::synceeWriteError | ( | KSync::Konnector * | ) | [signal] |
Emitted when an error occurs during write.
void KSync::Konnector::storagePathChanged | ( | const QString & | path | ) | [signal] |
Emitted when the sourcePath was changed.
The documentation for this class was generated from the following files: