RegisterSyncSource Class Reference

#include <EvolutionSyncSource.h>

Collaboration diagram for RegisterSyncSource:

Collaboration graph
[legend]

List of all members.

Public Types

typedef EvolutionSyncSource *(* Create_t )(const EvolutionSyncSourceParams &params)

Public Member Functions

 RegisterSyncSource (const string &shortDescr, bool enabled, Create_t create, const string &typeDescr, const Values &typeValues)

Public Attributes

const string m_shortDescr
const bool m_enabled
const Create_t m_create
const string m_typeDescr
const Values m_typeValues

Static Public Attributes

static EvolutionSyncSource *const InactiveSource = (EvolutionSyncSource *)1


Detailed Description

The SyncEvolution core has no knowledge of existing SyncSource implementations. Implementations have to register themselves by instantiating this class exactly once with information about themselves.

It is also possible to add configuration options. For that define a derived class. In its constructor use EvolutionSyncSourceConfig::getRegistry() resp. EvolutionSyncConfig::getRegistry() to define new configuration properties. The advantage of registering them is that the user interface will automatically handle them like the predefined ones. The namespace of these configuration options is shared by all sources and the core.

For properties with arbitrary names use the SyncSourceNodes::m_trackingNode.

Definition at line 105 of file EvolutionSyncSource.h.


Member Typedef Documentation

Users select a SyncSource and its data format via the "type" config property. Backends have to add this kind of function to the SourceRegistry_t in order to be considered by the SyncSource creation mechanism.

The function will be called to check whether the backend was meant by the user. It should return a new instance which will be freed by the caller or NULL if it does not support the selected type.

Inactive sources should return the special InactiveSource pointer value if they recognize without a doubt that the user wanted to instantiate them: for example, an inactive EvolutionContactSource will return NULL for "addressbook" but InactiveSource for "evolution-contacts".


Constructor & Destructor Documentation

RegisterSyncSource::RegisterSyncSource ( const string &  shortDescr,
bool  enabled,
Create_t  create,
const string &  typeDescr,
const Values typeValues 
)

Parameters:
shortDescr a few words identifying the data to be synchronized, e.g. "Evolution Calendar"
enabled true if the sync source can be instantiated, false if it was not enabled during compilation or is otherwise not functional
create factory function for sync sources of this type
typeDescr multiple lines separated by
which get appended to the the description of the type property, e.g. "Evolution Memos = memo = evolution-memo\n" " plain text in UTF-8 (default) = text/plain\n" " iCalendar 2.0 = text/calendar\n" " The later format is not tested because none of the\n" " supported SyncML servers accepts it.\n"
typeValues the config accepts multiple names for the same internal type string; this list here is added to that list of aliases. It should contain at least one unique string the can be used to pick this sync source among all SyncEvolution sync sources (testing, listing backends, ...). Example: Values() + (Aliases("Evolution Memos") + "evolution-memo")

Definition at line 107 of file EvolutionSyncSource.cpp.

References EvolutionSyncSource::getSourceRegistry().


Member Data Documentation

special return value of Create_t, not a real sync source!

Definition at line 128 of file EvolutionSyncSource.h.

Definition at line 159 of file EvolutionSyncSource.h.

Referenced by EvolutionSyncSource::createSource().

Definition at line 158 of file EvolutionSyncSource.h.

Referenced by SyncEvolutionCmdline::run().

Definition at line 157 of file EvolutionSyncSource.h.

Referenced by EvolutionSyncSource::createSource().

Definition at line 160 of file EvolutionSyncSource.h.

Definition at line 161 of file EvolutionSyncSource.h.

Referenced by SyncEvolutionCmdline::run().


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

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