EvolutionContactSource Class Reference

#include <EvolutionContactSource.h>

Inheritance diagram for EvolutionContactSource:

Inheritance graph
[legend]
Collaboration diagram for EvolutionContactSource:

Collaboration graph
[legend]

List of all members.

Classes

class  extensions
class  unique

Public Member Functions

 EvolutionContactSource (const EvolutionSyncSourceParams &params, EVCardFormat vcardFormat=EVC_FORMAT_VCARD_30)
 EvolutionContactSource (const EvolutionContactSource &other)
virtual ~EvolutionContactSource ()
string preparseVCard (SyncItem &item)
virtual Databases getDatabases ()
virtual void open ()
virtual void close ()
virtual void exportData (ostream &out)
virtual string fileSuffix () const
virtual const char * getMimeType () const
virtual const char * getMimeVersion () const
virtual const char * getSupportedTypes () const
virtual SyncItem * createItem (const string &uid)

Protected Member Functions

virtual void beginSyncThrow (bool needAll, bool needPartial, bool deleteLocal)
virtual void endSyncThrow ()
virtual void setItemStatusThrow (const char *key, int status)
virtual int addItemThrow (SyncItem &item)
virtual int updateItemThrow (SyncItem &item)
virtual int deleteItemThrow (SyncItem &item)
virtual void logItem (const string &uid, const string &info, bool debug=false)
virtual void logItem (const SyncItem &item, const string &info, bool debug=false)


Detailed Description

Implements access to Evolution address books.

Definition at line 33 of file EvolutionContactSource.h.


Constructor & Destructor Documentation

EvolutionContactSource::EvolutionContactSource ( const EvolutionSyncSourceParams params,
EVCardFormat  vcardFormat = EVC_FORMAT_VCARD_30 
)

Definition at line 62 of file EvolutionContactSource.cpp.

EvolutionContactSource::EvolutionContactSource ( const EvolutionContactSource other  ) 

Definition at line 69 of file EvolutionContactSource.cpp.

virtual EvolutionContactSource::~EvolutionContactSource (  )  [inline, virtual]

Definition at line 39 of file EvolutionContactSource.h.

References close().


Member Function Documentation

int EvolutionContactSource::addItemThrow ( SyncItem &  item  )  [protected, virtual]

void EvolutionContactSource::beginSyncThrow ( bool  needAll,
bool  needPartial,
bool  deleteLocal 
) [protected, virtual]

source specific part of beginSync() - throws exceptions in case of error

Parameters:
needAll fill m_allItems
needPartial fill m_new/deleted/modifiedItems
deleteLocal erase all items

Implements EvolutionSyncSource.

Definition at line 196 of file EvolutionContactSource.cpp.

References EvolutionSyncSource::Items::addItem(), logItem(), EvolutionSyncSource::m_allItems, EvolutionSyncSource::m_changeId, EvolutionSyncSource::m_deletedItems, EvolutionSyncSource::m_newItems, EvolutionSyncSource::m_updatedItems, eptr< T, base, R >::set(), and EvolutionSyncSource::throwError().

void EvolutionContactSource::close (  )  [virtual]

closes the data source so that it can be reopened

Just as open() it should not affect the state of the database unless some previous action requires it.

Implements EvolutionSyncSource.

Definition at line 322 of file EvolutionContactSource.cpp.

References endSyncThrow().

Referenced by ~EvolutionContactSource().

SyncItem * EvolutionContactSource::createItem ( const string &  uid  )  [virtual]

Extract information for the item identified by UID and store it in a new SyncItem. The caller must free that item. May throw exceptions.

The information that has to be set in the new item is:

  • content
  • UID
  • mime type

Parameters:
uid identifies the item

Implements EvolutionSyncSource.

Definition at line 349 of file EvolutionContactSource.cpp.

References eptr< T, base, R >::get(), getMimeType(), logItem(), EvolutionSyncSource::throwError(), and runtests::type.

int EvolutionContactSource::deleteItemThrow ( SyncItem &  item  )  [protected, virtual]

void EvolutionContactSource::endSyncThrow (  )  [protected, virtual]

void EvolutionContactSource::exportData ( ostream &  out  )  [virtual]

Dump all data from source unmodified into the given stream.

Implements EvolutionSyncSource.

Definition at line 328 of file EvolutionContactSource.cpp.

References EvolutionSyncSource::throwError().

virtual string EvolutionContactSource::fileSuffix (  )  const [inline, virtual]

file suffix for database files

Implements EvolutionSyncSource.

Definition at line 51 of file EvolutionContactSource.h.

EvolutionSyncSource::Databases EvolutionContactSource::getDatabases (  )  [virtual]

returns a list of all know data sources for the kind of items supported by this sync source

Implements EvolutionSyncSource.

Definition at line 75 of file EvolutionContactSource.cpp.

References eptr< T, base, R >::get(), and EvolutionSyncSource::throwError().

const char * EvolutionContactSource::getMimeType (  )  const [virtual]

Returns the preferred mime type of the items handled by the sync source. Example: "text/x-vcard"

Implements EvolutionSyncSource.

Definition at line 822 of file EvolutionContactSource.cpp.

Referenced by createItem().

const char * EvolutionContactSource::getMimeVersion (  )  const [virtual]

Returns the version of the mime type used by client. Example: "2.1"

Implements EvolutionSyncSource.

Definition at line 835 of file EvolutionContactSource.cpp.

virtual const char* EvolutionContactSource::getSupportedTypes (  )  const [inline, virtual]

A string representing the source types (with versions) supported by the SyncSource. The string must be formatted as a sequence of "type:version" separated by commas ','. For example: "text/x-vcard:2.1,text/vcard:3.0". The version can be left empty, for example: "text/x-s4j-sifc:". Supported types will be sent as part of the DevInf.

Implements EvolutionSyncSource.

Definition at line 54 of file EvolutionContactSource.h.

void EvolutionContactSource::logItem ( const SyncItem &  item,
const string &  info,
bool  debug = false 
) [protected, virtual]

Implements EvolutionSyncSource.

Definition at line 885 of file EvolutionContactSource.cpp.

References EvolutionSyncSource::getName().

void EvolutionContactSource::logItem ( const string &  uid,
const string &  info,
bool  debug = false 
) [protected, virtual]

Implements EvolutionSyncSource.

Definition at line 848 of file EvolutionContactSource.cpp.

References EvolutionSyncSource::getName().

Referenced by beginSyncThrow(), and createItem().

void EvolutionContactSource::open (  )  [virtual]

Actually opens the data source specified in the constructor, will throw the normal exceptions if that fails. Should not modify the state of the sync source: that can be deferred until the server is also ready and beginSync() is called.

Implements EvolutionSyncSource.

Definition at line 121 of file EvolutionContactSource.cpp.

References EvolutionSyncClient::fatalError(), EvolutionSyncSourceConfig::getDatabaseID(), EvolutionSyncSource::getName(), EvolutionSyncSourceConfig::getPassword(), EvolutionSyncSourceConfig::getUser(), eptr< T, base, R >::set(), and EvolutionSyncSource::throwError().

string EvolutionContactSource::preparseVCard ( SyncItem &  item  ) 

Definition at line 504 of file EvolutionContactSource.cpp.

References EvolutionSyncSource::throwError(), and runtests::type.

Referenced by addItemThrow(), and updateItemThrow().

void EvolutionContactSource::setItemStatusThrow ( const char *  key,
int  status 
) [protected, virtual]

Reimplemented from EvolutionSyncSource.

Definition at line 692 of file EvolutionContactSource.cpp.

References EvolutionSyncSource::getName().

int EvolutionContactSource::updateItemThrow ( SyncItem &  item  )  [protected, virtual]


The documentation for this class was generated from the following files:

Generated on Sat Oct 18 17:17:04 2008 for SyncEvolution and Funambol by  doxygen 1.5.7.1