#include <EvolutionMemoSource.h>
Public Member Functions | |
EvolutionMemoSource (const EvolutionSyncSourceParams ¶ms) | |
virtual SyncItem * | createItem (const string &uid) |
virtual InsertItemResult | insertItem (const string &luid, const SyncItem &item) |
virtual const char * | getMimeType () const |
virtual const char * | getMimeVersion () const |
virtual const char * | getSupportedTypes () const |
Definition at line 32 of file EvolutionMemoSource.h.
EvolutionMemoSource::EvolutionMemoSource | ( | const EvolutionSyncSourceParams & | params | ) | [inline] |
Definition at line 35 of file EvolutionMemoSource.h.
SyncItem * EvolutionMemoSource::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.
uid | identifies the item |
Reimplemented from EvolutionCalendarSource.
Definition at line 31 of file EvolutionMemoSource.cpp.
References EvolutionCalendarSource::logItem(), and EvolutionCalendarSource::retrieveItem().
virtual const char* EvolutionMemoSource::getMimeType | ( | ) | const [inline, virtual] |
Returns the preferred mime type of the items handled by the sync source. Example: "text/x-vcard"
Reimplemented from EvolutionCalendarSource.
Definition at line 43 of file EvolutionMemoSource.h.
virtual const char* EvolutionMemoSource::getMimeVersion | ( | ) | const [inline, virtual] |
Returns the version of the mime type used by client. Example: "2.1"
Reimplemented from EvolutionCalendarSource.
Definition at line 44 of file EvolutionMemoSource.h.
virtual const char* EvolutionMemoSource::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.
Reimplemented from EvolutionCalendarSource.
Definition at line 45 of file EvolutionMemoSource.h.
EvolutionCalendarSource::InsertItemResult EvolutionMemoSource::insertItem | ( | const string & | uid, | |
const SyncItem & | item | |||
) | [virtual] |
Create or modify an item.
The sync source should be flexible: if the UID is non-empty, it shall modify the item referenced by the UID. If the UID is empty, the normal operation is to add it. But if the item already exists (e.g., a calendar event which was imported by the user manually), then the existing item should be updated also in the second case.
Passing a UID of an item which does not exist is an error. This error should be reported instead of covering it up by (re)creating the item.
Errors are signalled by throwing an exception. Returning empty strings in the result is an error which triggers an "item could not be stored" error.
uid | identifies the item to be modified, empty for creating | |
item | contains the new content of the item and its MIME type |
Reimplemented from EvolutionCalendarSource.
Definition at line 113 of file EvolutionMemoSource.cpp.
References EvolutionCalendarSource::getItemID(), EvolutionCalendarSource::getItemModTime(), EvolutionCalendarSource::ItemID::getLUID(), EvolutionCalendarSource::logItem(), EvolutionCalendarSource::m_calendar, eptr< T, base, R >::set(), EvolutionSyncSource::throwError(), and runtests::type.