EvolutionSyncClient Class Reference

#include <EvolutionSyncClient.h>

Inheritance diagram for EvolutionSyncClient:

Inheritance graph
[legend]
Collaboration diagram for EvolutionSyncClient:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 EvolutionSyncClient (const string &server, bool doLogging=false, const set< string > &sources=set< string >())
 ~EvolutionSyncClient ()
virtual string askPassword (const string &descr)
bool getQuiet ()
void setQuiet (bool quiet)
SyncMode getSyncMode ()
void setSyncMode (SyncMode syncMode)
int sync ()
void status ()
virtual AbstractSyncSourceConfiggetAbstractSyncSourceConfig (const char *name) const
virtual AbstractSyncSourceConfiggetAbstractSyncSourceConfig (unsigned int i) const
virtual unsigned int getAbstractSyncSourceConfigsCount () const
virtual void setConfigFilter (bool sync, const FilterConfigNode::ConfigFilter &filter)

Static Public Member Functions

static void throwError (const string &error)
static void throwError (const string &action, int error)
static void fatalError (void *object, const char *error)
static void startLoopThread ()

Protected Member Functions

virtual void prepare (SyncSource **sources)


Detailed Description

Definition at line 41 of file EvolutionSyncClient.h.


Constructor & Destructor Documentation

EvolutionSyncClient::EvolutionSyncClient ( const string &  server,
bool  doLogging = false,
const set< string > &  sources = set<string>() 
)

Parameters:
server identifies the server config to be used
syncMode setting this overrides the sync mode from the config
doLogging write additional log and datatbase files about the sync

Definition at line 47 of file EvolutionSyncClient.cpp.

EvolutionSyncClient::~EvolutionSyncClient (  ) 

Definition at line 59 of file EvolutionSyncClient.cpp.


Member Function Documentation

string EvolutionSyncClient::askPassword ( const string &  descr  )  [virtual]

A helper function which interactively asks the user for a certain password. May throw errors.

The default implementation uses stdin/stdout to communicate with the user.

Parameters:
descr A simple string explaining what the password is needed for, e.g. "SyncML server". Has to be unique and understandable by the user.
Returns:
entered password

Implements ConfigUserInterface.

Definition at line 588 of file EvolutionSyncClient.cpp.

References throwError().

void EvolutionSyncClient::fatalError ( void *  object,
const char *  error 
) [static]

An error handler which prints the error message and then stops the program. Never returns.

The API was chosen so that it can be used as libebook/libecal "backend-dies" signal handler.

Definition at line 628 of file EvolutionSyncClient.cpp.

References SourceList::syncDone().

Referenced by EvolutionContactSource::open(), EvolutionCalendarSource::open(), and throwError().

AbstractSyncSourceConfig * EvolutionSyncClient::getAbstractSyncSourceConfig ( unsigned int  i  )  const [virtual]

Reimplemented from EvolutionSyncConfig.

Definition at line 690 of file EvolutionSyncClient.cpp.

AbstractSyncSourceConfig * EvolutionSyncClient::getAbstractSyncSourceConfig ( const char *  name  )  const [virtual]

Reimplemented from EvolutionSyncConfig.

Definition at line 685 of file EvolutionSyncClient.cpp.

unsigned int EvolutionSyncClient::getAbstractSyncSourceConfigsCount (  )  const [virtual]

Reimplemented from EvolutionSyncConfig.

Definition at line 695 of file EvolutionSyncClient.cpp.

bool EvolutionSyncClient::getQuiet (  )  [inline]

Definition at line 79 of file EvolutionSyncClient.h.

SyncMode EvolutionSyncClient::getSyncMode (  )  [inline]

Definition at line 81 of file EvolutionSyncClient.h.

void EvolutionSyncClient::prepare ( SyncSource **  sources  )  [protected, virtual]

Callback for derived classes: called after setting up the client's and sources' configuration. Can be used to reconfigure before actually starting the synchronization.

Parameters:
sources a NULL terminated array of all active sources

Definition at line 868 of file EvolutionSyncClient.cpp.

Referenced by sync(), and TestEvolution::sync().

void EvolutionSyncClient::setConfigFilter ( bool  sync,
const FilterConfigNode::ConfigFilter filter 
) [virtual]

intercept config filters

This call removes the "sync" source property and remembers it separately because it has to be applied to only the active sync sources; the generic config handling code would apply it to all sources.

Reimplemented from EvolutionSyncConfig.

Definition at line 700 of file EvolutionSyncClient.cpp.

References EvolutionSyncSourceConfig::m_sourcePropSync.

Referenced by SyncEvolutionCmdline::run().

void EvolutionSyncClient::setQuiet ( bool  quiet  )  [inline]

Definition at line 80 of file EvolutionSyncClient.h.

Referenced by SyncEvolutionCmdline::run().

void EvolutionSyncClient::setSyncMode ( SyncMode  syncMode  )  [inline]

Definition at line 82 of file EvolutionSyncClient.h.

void EvolutionSyncClient::startLoopThread (  )  [static]

When using Evolution this function starts a background thread which drives the default event loop. Without that loop "backend-died" signals are not delivered. The problem with the thread is that it seems to interfere with gconf startup when added to the main() function of syncevolution. Therefore it is started by EvolutionSyncSource::beginSync() (for unit testing of sync sources) and EvolutionSyncClient::sync() (for normal operation).

Definition at line 672 of file EvolutionSyncClient.cpp.

Referenced by EvolutionSyncSource::beginSync(), and sync().

void EvolutionSyncClient::status (  ) 

int EvolutionSyncClient::sync (  ) 

void EvolutionSyncClient::throwError ( const string &  action,
int  error 
) [static]

throw an exception after an operation failed and remember that this instance has failed

output format: <action>: <error string>="">

action a string describing the operation or object involved

Parameters:
error the errno error code for the failure

Definition at line 623 of file EvolutionSyncClient.cpp.

References throwError().

void EvolutionSyncClient::throwError ( const string &  error  )  [static]

throws a runtime_error with the given string or (on the iPhone, where exception handling is not supported by the toolchain) prints an error directly and aborts

output format: <error>

Parameters:
error a string describing the error

Definition at line 608 of file EvolutionSyncClient.cpp.

References fatalError().

Referenced by askPassword(), PasswordConfigProperty::checkPassword(), SafeConfigNode::flush(), PrefixConfigNode::flush(), FilterConfigNode::flush(), FileConfigNode::flush(), isDir(), mkdir_p(), ReadDir::ReadDir(), FilterConfigNode::removeProperty(), rm_r(), SyncEvolutionCmdline::run(), LogDir::setLogdir(), FilterConfigNode::setProperty(), status(), sync(), throwError(), ConfigProperty::throwValueError(), and vCard2ABPerson::toPerson().


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