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

#include <EDSContactsStorage.hpp>

Inheritance diagram for EDSContactsStorage:
Collaboration diagram for EDSContactsStorage:

Public Member Functions

 EDSContactsStorage (const std::string &)
 
 ~EDSContactsStorage ()
 
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 addContact (const std::string &vCard, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)
 Adds a new contact to the ContactsStorage. More...
 
enum eAddItem addContacts (const std::vector< std::string > &vCards, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)
 Adds new contacts to the ContactsStorage. More...
 
enum eModifyItem modifyContact (const std::string &vCard, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)
 Modifies contact in the ContactsStorage. More...
 
enum eModifyItem modifyContacts (const std::vector< std::string > &vCard, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)
 Modifies contacts in the ContactsStorage. More...
 
enum eRemoveItem removeContact (const OpenAB::PIMItem::ID &id)
 Removes contact from the ContactsStorage. More...
 
enum eRemoveItem removeContacts (const OpenAB::PIMItem::IDs &ids)
 Removes contacts from the ContactsStorage. More...
 
enum eGetItem getContact (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMContactItem > &item)
 Get the contact from the Storage. More...
 
enum eGetItem getContacts (const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMContactItem > > &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::ContactsStorage
 ContactsStorage ()
 Constructor. More...
 
virtual ~ContactsStorage ()
 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

EDSContactsStorage::EDSContactsStorage ( const std::string &  db)
EDSContactsStorage::~EDSContactsStorage ( )

Member Function Documentation

enum OpenAB_Storage::Storage::eAddItem EDSContactsStorage::addContact ( const std::string &  vCard,
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::ContactsStorage.

enum OpenAB_Storage::Storage::eAddItem EDSContactsStorage::addContacts ( const std::vector< std::string > &  vCards,
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::ContactsStorage.

enum OpenAB_Source::Source::eCancelRet EDSContactsStorage::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 EDSContactsStorage::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 EDSContactsStorage::getContact ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMContactItem > &  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::ContactsStorage.

enum OpenAB_Storage::Storage::eGetItem EDSContactsStorage::getContacts ( const OpenAB::PIMItem::IDs ids,
std::vector< OpenAB::SmartPtr< OpenAB::PIMContactItem > > &  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::ContactsStorage.

enum OpenAB_Source::Source::eGetItemRet EDSContactsStorage::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 EDSContactsStorage::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 EDSContactsStorage::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.

int EDSContactsStorage::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 EDSContactsStorage::init ( )
virtual

Initializes Source.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Storage::Storage::eModifyItem EDSContactsStorage::modifyContact ( const std::string &  vCard,
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::ContactsStorage.

enum OpenAB_Storage::Storage::eModifyItem EDSContactsStorage::modifyContacts ( const std::vector< std::string > &  vCards,
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::ContactsStorage.

OpenAB_Storage::StorageItemIterator * EDSContactsStorage::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 EDSContactsStorage::removeContact ( 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::ContactsStorage.

enum OpenAB_Storage::Storage::eRemoveItem EDSContactsStorage::removeContacts ( 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::ContactsStorage.

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

Resumes Source, if such operation is supported.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Source::Source::eSuspendRet EDSContactsStorage::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: