OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
EDSCalendarStorage Class Reference

#include <EDSCalendarStorage.hpp>

Inheritance diagram for EDSCalendarStorage:
Collaboration diagram for EDSCalendarStorage:

Public Member Functions

 EDSCalendarStorage (const std::string &sourceName, OpenAB::PIMItemType type)
 Constructor. More...
 
 ~EDSCalendarStorage ()
 
enum OpenAB_Source::Source::eInit init ()
 Initializes Source. More...
 
enum
OpenAB_Source::Source::eGetItemRet 
getItem (OpenAB::SmartPtr< OpenAB::PIMItem > &item)
 Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled. More...
 
enum
OpenAB_Source::Source::eSuspendRet 
suspend ()
 Suspends Source, if such operation is supported. More...
 
enum
OpenAB_Source::Source::eResumeRet 
resume ()
 Resumes Source, if such operation is supported. More...
 
enum
OpenAB_Source::Source::eCancelRet 
cancel ()
 Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should return eGetItemRetError status. More...
 
int getTotalCount () const
 Returns total count of items available from Source, if such information is available. More...
 
enum eAddItem addObject (const std::string &iCal, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)
 Adds a new contact to the ContactsStorage. More...
 
enum eAddItem addObjects (const std::vector< std::string > &iCals, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)
 Adds new contacts to the ContactsStorage. More...
 
enum eModifyItem modifyObject (const std::string &iCal, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)
 Modifies contact in the ContactsStorage. More...
 
enum eModifyItem modifyObjects (const std::vector< std::string > &iCals, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)
 Modifies contacts in the ContactsStorage. More...
 
enum eRemoveItem removeObject (const OpenAB::PIMItem::ID &id)
 Removes contact from the ContactsStorage. More...
 
enum eRemoveItem removeObjects (const OpenAB::PIMItem::IDs &ids)
 Removes contacts from the ContactsStorage. More...
 
enum eGetItem getEvent (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > &item)
 Get the contact from the Storage. More...
 
enum eGetItem getEvents (const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > > &items)
 Get the contacts from the Storage. More...
 
enum eGetItem getTask (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > &item)
 Get the contact from the Storage. More...
 
enum eGetItem getTasks (const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > > &items)
 Get the contacts from the Storage. More...
 
enum
OpenAB_Storage::Storage::eGetRevisions 
getRevisions (std::map< std::string, std::string > &revisions)
 Gets revision of the items from the Storage. More...
 
enum
OpenAB_Storage::Storage::eGetRevisions 
getChangedRevisions (const std::string &token, std::map< std::string, std::string > &revisions, std::vector< OpenAB::PIMItem::ID > &removed)
 Gets revisions of items changed since Storage was in state identified by token. More...
 
enum
OpenAB_Storage::Storage::eGetSyncToken 
getLatestSyncToken (std::string &)
 If storage supports tracking of items changes, it returns latest status identifier of the storage. More...
 
OpenAB_Storage::StorageItemIteratornewStorageItemIterator ()
 Retrieve an new Iterator to quickly parse the list of items. More...
 
- Public Member Functions inherited from OpenAB_Storage::CalendarStorage
 CalendarStorage (OpenAB::PIMItemType type)
 Constructor. More...
 
virtual ~CalendarStorage ()
 Destructor, virtual by default. More...
 
enum Storage::eAddItem addItem (const OpenAB::SmartPtr< OpenAB::PIMItem > &item, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)
 Adds a new item (OpenAB::PIMItem) to the Storage. More...
 
enum Storage::eAddItem addItems (const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)
 Adds new items (OpenAB::PIMItem) to the Storage. More...
 
enum Storage::eModifyItem modifyItem (const OpenAB::SmartPtr< OpenAB::PIMItem > &item, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)
 Modifies item (OpenAB::PIMItem) in the Storage. More...
 
enum Storage::eModifyItem modifyItems (const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)
 Modifies items (OpenAB::PIMItem) in the Storage. More...
 
enum Storage::eRemoveItem removeItem (const OpenAB::PIMItem::ID &id)
 Removes item from the Storage. More...
 
enum Storage::eRemoveItem removeItems (const OpenAB::PIMItem::IDs &ids)
 Removes items from the Storage. More...
 
enum Storage::eGetItem getItem (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMItem > &item)
 Get the item from the Storage. More...
 
enum Storage::eGetItem getItems (const OpenAB::PIMItem::IDs &id, std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &item)
 Get the items from the Storage. More...
 
- Public Member Functions inherited from OpenAB_Storage::Storage
 Storage (OpenAB::PIMItemType t)
 Constructor. More...
 
virtual ~Storage ()
 Destructor, virtual by default. More...
 
- Public Member Functions inherited from OpenAB_Source::Source
 Source (OpenAB::PIMItemType t)
 Constructor. More...
 
virtual ~Source ()
 Destructor, virtual by default. More...
 
OpenAB::PIMItemType getItemType () const
 Returns type of PIM Item supported by Source. More...
 

Additional Inherited Members

- Public Types inherited from OpenAB_Storage::Storage
enum  eAddItem { eAddItemOk, eAddItemFail }
 
enum  eModifyItem { eModifyItemOk, eModifyItemFail }
 
enum  eRemoveItem { eRemoveItemOk, eRemoveItemFail }
 
enum  eGetItem { eGetItemOk, eGetItemFail }
 
enum  eGetSyncToken { eGetSyncTokenOk, eGetSyncTokenFail }
 
enum  eGetRevisions { eGetRevisionsOk, eGetRevisionsFail }
 
- Public Types inherited from OpenAB_Source::Source
enum  eInit { eInitOk, eInitFail }
 
enum  eSuspendRet { eSuspendRetOk, eSuspendRetFail, eSuspendRetNotSupported }
 
enum  eResumeRet { eResumeRetOk, eResumeRetFail, eResumeRetNotSupported }
 
enum  eCancelRet { eCancelRetOk, eCancelRetFail, eCancelRetNotSupported }
 
enum  eGetItemRet { eGetItemRetOk, eGetItemRetEnd, eGetItemRetError }
 

Constructor & Destructor Documentation

EDSCalendarStorage::EDSCalendarStorage ( const std::string &  sourceName,
OpenAB::PIMItemType  type 
)

Constructor.

Parameters
[in]sourceNamename of EDS's source to use
[in]typetype of items to use (either OpenAB::eEvent or OpenAB::eTask)
EDSCalendarStorage::~EDSCalendarStorage ( )

Member Function Documentation

enum OpenAB_Storage::Storage::eAddItem EDSCalendarStorage::addObject ( const std::string &  iCal,
OpenAB::PIMItem::ID newId,
OpenAB::PIMItem::Revision revision 
)
virtual

Adds a new contact to the ContactsStorage.

Parameters
[in]vCardvCard of contact to should added.
[out]newIdThe newly added contact ID.
[out]revisionThe revision of newly added contact - can be empty if revisions are not supported.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eAddItem EDSCalendarStorage::addObjects ( const std::vector< std::string > &  iCals,
OpenAB::PIMItem::IDs newIds,
OpenAB::PIMItem::Revisions revisions 
)
virtual

Adds new contacts to the ContactsStorage.

Parameters
[in]vCardsThe vector of contacts' vCards that should be added.
[out]newIdsThe newly added contacts ID in the same order as provided vCards.
[out]revisionsThe revisions of newly added contacts (in the same order as provided vCards). Can be empty if revisions are not supported.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Source::Source::eCancelRet EDSCalendarStorage::cancel ( )
virtual

Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should return eGetItemRetError status.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Storage::Storage::eGetRevisions EDSCalendarStorage::getChangedRevisions ( const std::string &  token,
std::map< std::string, std::string > &  revisions,
std::vector< OpenAB::PIMItem::ID > &  removed 
)
virtual

Gets revisions of items changed since Storage was in state identified by token.

Parameters
[in]tokendatabase token since changes should be returned (getLatestSyncToken())
[out]revisionsrevisions map containing items IDs and their current revisions
[out]removedIDs vector of removed items
Returns
the status code

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetItem EDSCalendarStorage::getEvent ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > &  item 
)
virtual

Get the contact from the Storage.

Parameters
[in]idThe ID of the contact that must be retrieved.
[out]itemThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eGetItem EDSCalendarStorage::getEvents ( const OpenAB::PIMItem::IDs ids,
std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > > &  items 
)
virtual

Get the contacts from the Storage.

Parameters
[in]idThe IDs of the contacts that must be retrieved.
[out]itemsThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Source::Source::eGetItemRet EDSCalendarStorage::getItem ( OpenAB::SmartPtr< OpenAB::PIMItem > &  item)
virtual

Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled.

Parameters
[out]itemitem received from Source
Returns
the status code
Note
item is returned as smart pointer, its contents will be deleted automatically when no more references to it will exist, it's not advised to dereference and use direct pointer

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetSyncToken EDSCalendarStorage::getLatestSyncToken ( std::string &  token)
virtual

If storage supports tracking of items changes, it returns latest status identifier of the storage.

Parameters
[out]tokenlatest status identifier
Returns
eGetSyncTokenFail if storage does not supports changes tracking, eGetSyncTokenOk otherwise.

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetRevisions EDSCalendarStorage::getRevisions ( std::map< std::string, std::string > &  revisions)
virtual

Gets revision of the items from the Storage.

Parameters
[out]revisionsmap containing items IDs and their current revisions.
Returns
the status code

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetItem EDSCalendarStorage::getTask ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > &  item 
)
virtual

Get the contact from the Storage.

Parameters
[in]idThe ID of the contact that must be retrieved.
[out]itemThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eGetItem EDSCalendarStorage::getTasks ( const OpenAB::PIMItem::IDs ids,
std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > > &  items 
)
virtual

Get the contacts from the Storage.

Parameters
[in]idThe IDs of the contacts that must be retrieved.
[out]itemsThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

int EDSCalendarStorage::getTotalCount ( ) const
virtual

Returns total count of items available from Source, if such information is available.

Returns
total count of items available or -1 if such information is unavailable

Implements OpenAB_Source::Source.

enum OpenAB_Storage::Storage::eInit EDSCalendarStorage::init ( )
virtual

Initializes Source.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Storage::Storage::eModifyItem EDSCalendarStorage::modifyObject ( const std::string &  iCal,
const OpenAB::PIMItem::ID id,
OpenAB::PIMItem::Revision revision 
)
virtual

Modifies contact in the ContactsStorage.

Parameters
[in]vCardvCard of contact that should be modified.
[in]idThe ID of the item that should be modified.
[out]revisionThe updated revision of modified contact.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eModifyItem EDSCalendarStorage::modifyObjects ( const std::vector< std::string > &  iCals,
const OpenAB::PIMItem::IDs ids,
OpenAB::PIMItem::Revisions revisions 
)
virtual

Modifies contacts in the ContactsStorage.

Parameters
[in]vCardsThe vector of contact's vCards that should be modified.
[in]idsThe vector of ID of the contacts that must be modified (in the same order as provided vCards).
[out]revisionsThe updated revisions of modified contacts (in the same order as provided vCards).
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

OpenAB_Storage::StorageItemIterator * EDSCalendarStorage::newStorageItemIterator ( )
virtual

Retrieve an new Iterator to quickly parse the list of items.

Returns
the new Iterator for this Storage

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eRemoveItem EDSCalendarStorage::removeObject ( const OpenAB::PIMItem::ID id)
virtual

Removes contact from the ContactsStorage.

Parameters
[in]idThe ID of the contact that must be removed.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eRemoveItem EDSCalendarStorage::removeObjects ( const OpenAB::PIMItem::IDs ids)
virtual

Removes contacts from the ContactsStorage.

Parameters
[in]idsThe vector of ID of the contacts that must be removed.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Source::Source::eResumeRet EDSCalendarStorage::resume ( )
virtual

Resumes Source, if such operation is supported.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Source::Source::eSuspendRet EDSCalendarStorage::suspend ( )
virtual

Suspends Source, if such operation is supported.

Returns
the status code

Implements OpenAB_Source::Source.


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