ksync Library API Documentation

KSyncee Class Reference

A data set to be synced. More...

#include <ksyncer.h>

Inheritance diagram for KSyncee:

AddressBookSyncee BookmarkSyncee CalendarSyncee List of all members.

Public Methods

 KSyncee ()
virtual ~KSyncee ()
virtual KSyncEntryfirstEntry ()=0
virtual KSyncEntrynextEntry ()=0
virtual KSyncEntryfindEntry (const QString &id)
virtual void addEntry (KSyncEntry *)=0
virtual void removeEntry (KSyncEntry *)=0
void replaceEntry (KSyncEntry *oldEntry, KSyncEntry *newEntry)
void setFilename (const QString &)
QString filename ()
QString statusLogName ()
bool load ()
bool save ()
virtual bool read ()=0
virtual bool write ()=0
void writeLog ()
bool hasChanged (KSyncEntry *)

Detailed Description

A data set to be synced.

Author:
Cornelius Schumacher
See also:
KSyncEntry, KSyncer
This class represents a data set of KSyncEntries. During a syncing process, two or more KSyncees are synced. After syncing they should be equal, that means they should contain the same set of KSyncEntries. Choices by the user can lead to deviations from complete equality.

The KSyncee class provides an interface, which has to be implemented by concrete subclasses.

KSyncer operates on KSyncee objects.

Definition at line 108 of file ksyncer.h.


Member Function Documentation

virtual KSyncEntry* KSyncee::firstEntry   [pure virtual]
 

Return the first KSyncEntry object of the data set.

This function together with nextEntry() is used to iterate through all entries of a KSyncee data set.

Implemented in AddressBookSyncee, BookmarkSyncee, and CalendarSyncee.

Referenced by findEntry(), KSyncer::syncToTarget(), and writeLog().

virtual KSyncEntry* KSyncee::nextEntry   [pure virtual]
 

Return the next KSyncEntry object of the data set.

This function together with firstEntry() is used to iterate through all entries of a KSyncee data set.

Implemented in AddressBookSyncee, BookmarkSyncee, and CalendarSyncee.

Referenced by findEntry(), KSyncer::syncToTarget(), and writeLog().

KSyncEntry * KSyncee::findEntry const QString   id [virtual]
 

Find an entry identified by a unique id.

See KSyncEntry::id().

Definition at line 72 of file ksyncer.cpp.

References firstEntry(), KSyncEntry::id(), and nextEntry().

Referenced by KSyncer::syncToTarget().

virtual void KSyncee::addEntry KSyncEntry   [pure virtual]
 

Add a KSyncEntry object to this data set.

Ownership of the object remains with the caller.

Implemented in AddressBookSyncee, BookmarkSyncee, and CalendarSyncee.

Referenced by replaceEntry(), and KSyncer::syncToTarget().

virtual void KSyncee::removeEntry KSyncEntry   [pure virtual]
 

Remove a KSyncEntry.

The entry is removed from the data set, but the object is not deleted.

Implemented in AddressBookSyncee, BookmarkSyncee, and CalendarSyncee.

Referenced by replaceEntry().

void KSyncee::replaceEntry KSyncEntry   oldEntry,
KSyncEntry   newEntry
 

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 85 of file ksyncer.cpp.

References addEntry(), and removeEntry().

Referenced by KSyncer::syncToTarget().

void KSyncee::setFilename const QString  
 

Set the filename, the data set is read from and written to.

Definition at line 62 of file ksyncer.cpp.

QString KSyncee::filename  
 

Return the filename, the data set is read from and written to.

Definition at line 67 of file ksyncer.cpp.

Referenced by CalendarSyncee::read(), BookmarkSyncee::read(), statusLogName(), KSyncer::syncToTarget(), and CalendarSyncee::write().

QString KSyncee::statusLogName  
 

Return the name of a config file, which is used to store status information about the data set.

Definition at line 131 of file ksyncer.cpp.

References filename(), and QString::replace().

Referenced by load().

bool KSyncee::load  
 

Load the data set from the file with them name filename().

Returns:
true, if loading is successful, otherwise false.

Definition at line 101 of file ksyncer.cpp.

References read(), and statusLogName().

bool KSyncee::save  
 

Save the data set to the file with them name filename().

Returns:
true, if loading is successful, otherwise false.

Definition at line 109 of file ksyncer.cpp.

References write(), and writeLog().

Referenced by KSyncer::sync().

virtual bool KSyncee::read   [pure virtual]
 

Read the data set from disk from the file with the name filename().

This function has to be reimplemented by concrete subclasses to provide the actual reading from disk.

Returns:
true, if reading is successful, otherwise false.

Implemented in AddressBookSyncee, BookmarkSyncee, and CalendarSyncee.

Referenced by load().

virtual bool KSyncee::write   [pure virtual]
 

Write the data set to disk to the file with the name filename().

This function has to be reimplemented by concrete subclasses to provide the actual writing to disk.

Returns:
true, if writing is successful, otherwise false.

Implemented in AddressBookSyncee, BookmarkSyncee, and CalendarSyncee.

Referenced by save().

void KSyncee::writeLog  
 

Write the status log file with the name statusLogName().

Definition at line 120 of file ksyncer.cpp.

References firstEntry(), KSyncEntry::id(), KSyncEntry::name(), nextEntry(), and KSyncEntry::timestamp().

Referenced by save(), KSyncer::syncAllToTarget(), and KSyncer::syncToTarget().

bool KSyncee::hasChanged KSyncEntry  
 

Return, if the given KSyncEntry 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 91 of file ksyncer.cpp.

References KSyncEntry::id(), QString::isEmpty(), and KSyncEntry::timestamp().

Referenced by KSyncer::syncToTarget().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for ksync Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:37 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003