Documentation for class CardDAVHelper.
More...
#include <CardDAVHelper.hpp>
|
| CardDAVHelper (const std::string &serverUrl, OpenAB::HttpSession *httpSession, OpenAB::HttpAuthorizer *httpAuthorizer) |
| Constructor. More...
|
|
virtual | ~CardDAVHelper () |
| Destructor, virtual by default. More...
|
|
bool | findPrincipalUrl () |
| Query principal url. More...
|
|
bool | findAddressbookSet () |
| Query address book set. More...
|
|
bool | findAddressbooks () |
| Query address books. More...
|
|
bool | queryAddressbookMetadata () |
| Query address book metadata (current revision and sync token). After calling this function sync token can be obtained by using getSyncToken(). More...
|
|
bool | queryContactsMetadata () |
| Query contacts metadata (list of IDs and revisions). After calling this function metadata can be obtained by using getContactsMetadata() and getTotalCount(). More...
|
|
bool | queryChangedContactsMetadata (const std::string &syncToken, std::vector< OpenAB::PIMItem::ID > &removed) |
| Query contacts metadta only of contact that were modified since sync token. After calling this function metadata can be obtained by using getContactsMetadata() and getTotalCount(). More...
|
|
bool | downloadVCards (unsigned int offset, unsigned int size, std::vector< std::string > &vcards) |
| Download vCards of contacts from metadata. More...
|
|
bool | downloadVCards (std::vector< std::string > &uris, std::vector< std::string > &vcards) |
| Download vCards of given contacts. More...
|
|
bool | addContact (const std::string &vcard, std::string &uri, std::string &etag) |
| Uploads contact. More...
|
|
bool | removeContact (const std::string &uri, const std::string &etag="") |
| Removes contact. More...
|
|
bool | modifyContact (const std::string &uri, const std::string &vcard, std::string &etag) |
| Modifies contact. More...
|
|
unsigned int | getTotalCount () const |
| Returns total count of contacts metadata downlaoded by queryContactsMetadata or queryChangedContactsMetadata. More...
|
|
std::string | getSyncToken () const |
| Returns sync token queried by queryAddressbookMetadata(). More...
|
|
ContactsMetadata | getContactsMetadata () const |
| Returns contacts metadata downlaoded by queryContactsMetadata or queryChangedContactsMetadata. More...
|
|
Documentation for class CardDAVHelper.
CardDAVHelper::~CardDAVHelper |
( |
| ) |
|
|
virtual |
Destructor, virtual by default.
bool CardDAVHelper::addContact |
( |
const std::string & |
vcard, |
|
|
std::string & |
uri, |
|
|
std::string & |
etag |
|
) |
| |
Uploads contact.
- Parameters
-
[in] | vcard | vcard to be uploaded |
[out] | uri | of newly created contact. |
[out] | etag | revision of newly created contact. |
- Returns
- true if contact were created successfully.
bool CardDAVHelper::downloadVCards |
( |
unsigned int |
offset, |
|
|
unsigned int |
size, |
|
|
std::vector< std::string > & |
vcards |
|
) |
| |
Download vCards of contacts from metadata.
- Parameters
-
[in] | offset | offset of contact in metadata. |
[in] | size | number of contacts to be downloaded. |
[out] | vcards | downloaded list of vcards in the same order as contacts in metadata. |
- Note
- before calling this either queryContactsMetadata or queryChangedContactsMetadata needs to be called to populate metadata information.
- Returns
- true if contacts were downloaded successfully.
bool CardDAVHelper::downloadVCards |
( |
std::vector< std::string > & |
uris, |
|
|
std::vector< std::string > & |
vcards |
|
) |
| |
Download vCards of given contacts.
- Parameters
-
[in] | uris | list of contact ids to be downloaded. |
[out] | vcards | downloaded list of vcards in the same order as provided ids. |
- Returns
- true if contacts were downloaded successfully.
bool CardDAVHelper::findAddressbooks |
( |
| ) |
|
bool CardDAVHelper::findAddressbookSet |
( |
| ) |
|
Query address book set.
- Note
- : Should be called after findPrincipalUrl and before findAddressbooks.
- Returns
- true if address book set was found successfully, false otherwise.
bool CardDAVHelper::findPrincipalUrl |
( |
| ) |
|
Query principal url.
- Note
- Needs to be called before calling other functions from this class.
- Returns
- true if principal URL was found successfully, false otherwise.
std::string CardDAVHelper::getSyncToken |
( |
| ) |
const |
|
inline |
unsigned int CardDAVHelper::getTotalCount |
( |
| ) |
const |
|
inline |
bool CardDAVHelper::modifyContact |
( |
const std::string & |
uri, |
|
|
const std::string & |
vcard, |
|
|
std::string & |
etag |
|
) |
| |
Modifies contact.
- Parameters
-
[in] | uri | id of contact to be updated. |
[in] | vcard | vcard to be uploaded |
[out] | etag | new revision of updated contact. |
- Returns
- true if contact were modified successfully.
bool CardDAVHelper::queryAddressbookMetadata |
( |
| ) |
|
Query address book metadata (current revision and sync token). After calling this function sync token can be obtained by using getSyncToken().
- Returns
- true if address book metadata was queried successfully, false otherwise.
bool CardDAVHelper::queryChangedContactsMetadata |
( |
const std::string & |
syncToken, |
|
|
std::vector< OpenAB::PIMItem::ID > & |
removed |
|
) |
| |
Query contacts metadta only of contact that were modified since sync token. After calling this function metadata can be obtained by using getContactsMetadata() and getTotalCount().
- Returns
- true if contacts metadata was queried successfully, false otherwise.
bool CardDAVHelper::queryContactsMetadata |
( |
| ) |
|
Query contacts metadata (list of IDs and revisions). After calling this function metadata can be obtained by using getContactsMetadata() and getTotalCount().
- Returns
- true if contacts metadata was queried successfully, false otherwise.
bool CardDAVHelper::removeContact |
( |
const std::string & |
uri, |
|
|
const std::string & |
etag = "" |
|
) |
| |
Removes contact.
- Parameters
-
[in] | uri | id of contact to be removed. |
[in] | etag | revision of contact to be removed, if revision of given contact does not match on the servers, removal will fail (not all servers supports that). |
- Returns
- true if contact were removed successfully.
The documentation for this class was generated from the following files: