OpenAB
1.0.1
|
#include <CalDAVStorage.hpp>
Public Member Functions | |
CalDAVStorage (const std::string &url, const std::string &login, const OpenAB::SecureString &password, const std::string &calendarURL, const std::string &calendarName, OpenAB::PIMItemType type) | |
Constructor. More... | |
CalDAVStorage (const std::string &url, const std::string &clientId, const OpenAB::SecureString &clientSecret, const OpenAB::SecureString &refreshToken, const std::string &calendarURL, const std::string &calendarName, OpenAB::PIMItemType type) | |
Constructor. More... | |
virtual | ~CalDAVStorage () |
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 &token) |
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::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 } |
CalDAVStorage::CalDAVStorage | ( | const std::string & | url, |
const std::string & | login, | ||
const OpenAB::SecureString & | password, | ||
const std::string & | calendarURL, | ||
const std::string & | calendarName, | ||
OpenAB::PIMItemType | type | ||
) |
Constructor.
[in] | url | server url |
[in] | login | user login |
[in] | password | user password |
[in] | calendarURL | direct calendar url |
[in] | calendarName | optional name of calendar to be used |
[in] | type | type of items to use (either OpenAB::eEvent or OpenAB::eTask) |
CalDAVStorage::CalDAVStorage | ( | const std::string & | url, |
const std::string & | clientId, | ||
const OpenAB::SecureString & | clientSecret, | ||
const OpenAB::SecureString & | refreshToken, | ||
const std::string & | calendarURL, | ||
const std::string & | calendarName, | ||
OpenAB::PIMItemType | type | ||
) |
Constructor.
[in] | url | server url |
[in] | clientId | OAuth2 application id |
[in] | clientSecret | OAuth2 application secret |
[in] | refreshToken | OAuth2 user refresh token |
[in] | calendarURL | direct calendar url |
[in] | calendarName | optional name of calendar to be used |
[in] | type | type of items to use (either OpenAB::eEvent or OpenAB::eTask) |
|
virtual |
|
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::CalendarStorage.
|
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::CalendarStorage.
|
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::CalendarStorage.
|
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::CalendarStorage.
|
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 |
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::CalendarStorage.
|
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::CalendarStorage.
|
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::CalendarStorage.
|
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::CalendarStorage.
|
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::CalendarStorage.
|
virtual |
Removes contacts from the ContactsStorage.
[in] | ids | The vector of ID of the contacts that must be removed. |
Implements OpenAB_Storage::CalendarStorage.
|
virtual |
Resumes Source, if such operation is supported.
Implements OpenAB_Source::Source.
|
virtual |
Suspends Source, if such operation is supported.
Implements OpenAB_Source::Source.