OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB_Storage::ContactsStorage Class Referenceabstract

Documentation for ContactsStorage interface. Provides functionalities specific to Storage of OpenAB::eContact items. More...

#include <ContactsStorage.hpp>

Inheritance diagram for OpenAB_Storage::ContactsStorage:
Collaboration diagram for OpenAB_Storage::ContactsStorage:

Public Member Functions

 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...
 
virtual enum Storage::eAddItem addContact (const std::string &vCard, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)=0
 Adds a new contact to the ContactsStorage. More...
 
virtual enum Storage::eAddItem addContacts (const std::vector< std::string > &vCards, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)=0
 Adds new contacts to the ContactsStorage. More...
 
virtual enum Storage::eModifyItem modifyContact (const std::string &vCard, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)=0
 Modifies contact in the ContactsStorage. More...
 
virtual enum Storage::eModifyItem modifyContacts (const std::vector< std::string > &vCards, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)=0
 Modifies contacts in the ContactsStorage. More...
 
virtual enum Storage::eRemoveItem removeContact (const OpenAB::PIMItem::ID &id)=0
 Removes contact from the ContactsStorage. More...
 
virtual enum Storage::eRemoveItem removeContacts (const OpenAB::PIMItem::IDs &ids)=0
 Removes contacts from the ContactsStorage. More...
 
virtual enum Storage::eGetItem getContact (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMContactItem > &item)=0
 Get the contact from the Storage. More...
 
virtual enum eGetItem getContacts (const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMContactItem > > &items)=0
 Get the contacts 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...
 
virtual enum eGetItemRet getItem (OpenAB::SmartPtr< OpenAB::PIMItem > &item)=0
 Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled. More...
 
virtual
OpenAB_Storage::Storage::eGetSyncToken 
getLatestSyncToken (std::string &token)=0
 If storage supports tracking of items changes, it returns latest status identifier of the storage. More...
 
virtual
OpenAB_Storage::Storage::eGetRevisions 
getRevisions (std::map< std::string, std::string > &revisions)=0
 Gets revision of the items from the Storage. More...
 
virtual
OpenAB_Storage::Storage::eGetRevisions 
getChangedRevisions (const std::string &token, std::map< std::string, std::string > &revisions, std::vector< OpenAB::PIMItem::ID > &removed)=0
 Gets revisions of items changed since Storage was in state identified by token. More...
 
virtual StorageItemIteratornewStorageItemIterator ()=0
 Retrieve an new Iterator to quickly parse the list of items. More...
 
- Public Member Functions inherited from OpenAB_Source::Source
 Source (OpenAB::PIMItemType t)
 Constructor. More...
 
virtual ~Source ()
 Destructor, virtual by default. More...
 
virtual enum eInit init ()=0
 Initializes Source. More...
 
virtual enum eSuspendRet suspend ()=0
 Suspends Source, if such operation is supported. More...
 
virtual enum eResumeRet resume ()=0
 Resumes Source, if such operation is supported. More...
 
virtual enum eCancelRet cancel ()=0
 Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should return eGetItemRetError status. More...
 
virtual int getTotalCount () const =0
 Returns total count of items available from Source, if such information is available. 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 }
 

Detailed Description

Documentation for ContactsStorage interface. Provides functionalities specific to Storage of OpenAB::eContact items.

Todo:

extend interface (locale handling, search queries etc)

define new return codes for contact specific operations.

Constructor & Destructor Documentation

OpenAB_Storage::ContactsStorage::ContactsStorage ( )

Constructor.

OpenAB_Storage::ContactsStorage::~ContactsStorage ( )
virtual

Destructor, virtual by default.

Member Function Documentation

virtual enum Storage::eAddItem OpenAB_Storage::ContactsStorage::addContact ( const std::string &  vCard,
OpenAB::PIMItem::ID newId,
OpenAB::PIMItem::Revision revision 
)
pure 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

Implemented in CardDAVStorage, and EDSContactsStorage.

virtual enum Storage::eAddItem OpenAB_Storage::ContactsStorage::addContacts ( const std::vector< std::string > &  vCards,
OpenAB::PIMItem::IDs newIds,
OpenAB::PIMItem::Revisions revisions 
)
pure 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

Implemented in CardDAVStorage, and EDSContactsStorage.

enum Storage::eAddItem OpenAB_Storage::ContactsStorage::addItem ( const OpenAB::SmartPtr< OpenAB::PIMItem > &  item,
OpenAB::PIMItem::ID newId,
OpenAB::PIMItem::Revision revision 
)
virtual

Adds a new item (OpenAB::PIMItem) to the Storage.

Parameters
[in]itemPIMItem that should be added (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[out]newIdThe newly added item ID.
[out]revisionThe revision of newly added item - can be empty if revisions are not supported.
Returns
the status code

Implements OpenAB_Storage::Storage.

enum Storage::eAddItem OpenAB_Storage::ContactsStorage::addItems ( const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &  items,
OpenAB::PIMItem::IDs newIds,
OpenAB::PIMItem::Revisions revisions 
)
virtual

Adds new items (OpenAB::PIMItem) to the Storage.

Parameters
[in]itemsThe vector of items that should be added. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[out]newIdsThe newly added items ID in the same order as provided items.
[out]revisionsThe revisions of newly added items (in the same order as provided items).
Returns
the status code

Implements OpenAB_Storage::Storage.

virtual enum Storage::eGetItem OpenAB_Storage::ContactsStorage::getContact ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMContactItem > &  item 
)
pure 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

Implemented in CardDAVStorage, and EDSContactsStorage.

virtual enum eGetItem OpenAB_Storage::ContactsStorage::getContacts ( const OpenAB::PIMItem::IDs ids,
std::vector< OpenAB::SmartPtr< OpenAB::PIMContactItem > > &  items 
)
pure 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

Implemented in CardDAVStorage, and EDSContactsStorage.

enum Storage::eGetItem OpenAB_Storage::ContactsStorage::getItem ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMItem > &  item 
)
virtual

Get the item from the Storage.

Parameters
[in]idThe ID of the item that must be retrieved.
[out]itemThe item that was retrieved.
Returns
the status code
Todo:
find more elegant way to take ownership of pointer.

Implements OpenAB_Storage::Storage.

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

Get the items from the Storage.

Parameters
[in]idsThe IDs of the items that must be retrieved.
[out]itemsThe items that was retrieved.
Returns
the status code

find more elegant way to take ownership of pointer.

Implements OpenAB_Storage::Storage.

virtual enum Storage::eModifyItem OpenAB_Storage::ContactsStorage::modifyContact ( const std::string &  vCard,
const OpenAB::PIMItem::ID id,
OpenAB::PIMItem::Revision revision 
)
pure 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

Implemented in CardDAVStorage, and EDSContactsStorage.

virtual enum Storage::eModifyItem OpenAB_Storage::ContactsStorage::modifyContacts ( const std::vector< std::string > &  vCards,
const OpenAB::PIMItem::IDs ids,
OpenAB::PIMItem::Revisions revisions 
)
pure 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

Implemented in CardDAVStorage, and EDSContactsStorage.

enum Storage::eModifyItem OpenAB_Storage::ContactsStorage::modifyItem ( const OpenAB::SmartPtr< OpenAB::PIMItem > &  item,
const OpenAB::PIMItem::ID id,
OpenAB::PIMItem::Revision revision 
)
virtual

Modifies item (OpenAB::PIMItem) in the Storage.

Parameters
[in]itemThe item that should be modified. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[in]idThe ID of the item that should be modified.
[out]revisionThe updated revision of modified items.
Returns
the status code

Implements OpenAB_Storage::Storage.

enum Storage::eModifyItem OpenAB_Storage::ContactsStorage::modifyItems ( const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &  items,
const OpenAB::PIMItem::IDs ids,
OpenAB::PIMItem::Revisions revisions 
)
virtual

Modifies items (OpenAB::PIMItem) in the Storage.

Parameters
[in]itemsThe vector of items to be modified. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[in]idsThe vector of ID of the items that must be modified (in the same order as provided items).
[out]revisionsThe updated revisions of modified items (in the same order as provided items).
Returns
the status code

Implements OpenAB_Storage::Storage.

virtual enum Storage::eRemoveItem OpenAB_Storage::ContactsStorage::removeContact ( const OpenAB::PIMItem::ID id)
pure virtual

Removes contact from the ContactsStorage.

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

Implemented in CardDAVStorage, and EDSContactsStorage.

virtual enum Storage::eRemoveItem OpenAB_Storage::ContactsStorage::removeContacts ( const OpenAB::PIMItem::IDs ids)
pure virtual

Removes contacts from the ContactsStorage.

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

Implemented in CardDAVStorage, and EDSContactsStorage.

enum Storage::eRemoveItem OpenAB_Storage::ContactsStorage::removeItem ( const OpenAB::PIMItem::ID id)
virtual

Removes item from the Storage.

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

Implements OpenAB_Storage::Storage.

enum Storage::eRemoveItem OpenAB_Storage::ContactsStorage::removeItems ( const OpenAB::PIMItem::IDs ids)
virtual

Removes items from the Storage.

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

Implements OpenAB_Storage::Storage.


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