OpenAB
1.0.1
|
#include <EDSContactsStorage.hpp>
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::StorageItemIterator * | newStorageItemIterator () |
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 } |
EDSContactsStorage::EDSContactsStorage | ( | const std::string & | db | ) |
EDSContactsStorage::~EDSContactsStorage | ( | ) |
|
virtual |
Adds a new contact to the ContactsStorage.
[in] | vCard | vCard of contact to should added. |
[out] | newId | The newly added contact ID. |
[out] | revision | The revision of newly added contact - can be empty if revisions are not supported. |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Adds new contacts to the ContactsStorage.
[in] | vCards | The vector of contacts' vCards that should be added. |
[out] | newIds | The newly added contacts ID in the same order as provided vCards. |
[out] | revisions | The revisions of newly added contacts (in the same order as provided vCards). Can be empty if revisions are not supported. |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should return eGetItemRetError status.
Implements OpenAB_Source::Source.
|
virtual |
Gets revisions of items changed since Storage was in state identified by token.
[in] | token | database token since changes should be returned (getLatestSyncToken()) |
[out] | revisions | revisions map containing items IDs and their current revisions |
[out] | removed | IDs vector of removed items |
Implements OpenAB_Storage::Storage.
|
virtual |
Get the contact from the Storage.
[in] | id | The ID of the contact that must be retrieved. |
[out] | item | The OpenAB::PIMContactItem that was retrieved. |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Get the contacts from the Storage.
[in] | id | The IDs of the contacts that must be retrieved. |
[out] | items | The OpenAB::PIMContactItem that was retrieved. |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled.
[out] | item | item received from Source |
Implements OpenAB_Storage::Storage.
|
virtual |
If storage supports tracking of items changes, it returns latest status identifier of the storage.
[out] | token | latest status identifier |
Implements OpenAB_Storage::Storage.
|
virtual |
Gets revision of the items from the Storage.
[out] | revisions | map containing items IDs and their current revisions. |
Implements OpenAB_Storage::Storage.
|
virtual |
Returns total count of items available from Source, if such information is available.
Implements OpenAB_Source::Source.
|
virtual |
|
virtual |
Modifies contact in the ContactsStorage.
[in] | vCard | vCard of contact that should be modified. |
[in] | id | The ID of the item that should be modified. |
[out] | revision | The updated revision of modified contact. |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Modifies contacts in the ContactsStorage.
[in] | vCards | The vector of contact's vCards that should be modified. |
[in] | ids | The vector of ID of the contacts that must be modified (in the same order as provided vCards). |
[out] | revisions | The updated revisions of modified contacts (in the same order as provided vCards). |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Retrieve an new Iterator to quickly parse the list of items.
Implements OpenAB_Storage::Storage.
|
virtual |
Removes contact from the ContactsStorage.
[in] | id | The ID of the contact that must be removed. |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Removes contacts from the ContactsStorage.
[in] | ids | The vector of ID of the contacts that must be removed. |
Implements OpenAB_Storage::ContactsStorage.
|
virtual |
Resumes Source, if such operation is supported.
Implements OpenAB_Source::Source.
|
virtual |
Suspends Source, if such operation is supported.
Implements OpenAB_Source::Source.