ContactsBackend Class Reference

Harmattan Contact storage plugin backend interface class. More...

`#include <ContactsBackend.h>`

## Public Member Functions

| ContactsBackend (QVersitDocument::VersitType aVerType, const QString &syncTarget, const QString &originId)
| Constructor.
| ~ContactsBackend ()
| Destructor.
bool | init ()
| Searches for available storage plugins and sets the manager to that plugin.
bool | uninit ()
| releases the resources held.
QList< QContactLocalId > | getAllContactIds ()
| Return ids of all contacts retrieved from the backend.
QList< QContactLocalId > | getAllNewContactIds (const QDateTime &aTimeStamp)
| Return all new contacts ids in a QList of QStrings.
QList< QContactLocalId > | getAllModifiedContactIds (const QDateTime &aTimeStamp)
| Return all modified contact ids in a QList of QStrings.
QList< QContactLocalId > | getAllDeletedContactIds (const QDateTime &aTimeStamp)
| Return all deleted contacts ids in a QList of QStrings.
void | getContact (const QContactLocalId &aContactId, QContact &aContact)
| Get contact data for a given gontact ID as a QContact object.
void | getContacts (const QList< QContactLocalId > &aContactIDs, QMap< QString, QString > &aContactData)
| Get multiple contacts at once as vcards.
void | getContacts (const QList< QContactLocalId > &aContactIds, QList< QContact > &aContacts)
| Get multiple contacts at once as QContact objects.
bool | addContacts (const QStringList &aContactDataList, QMap< int, ContactsStatus > &aStatusMap)
| Batch addition of contacts.
QContactManager::Error | modifyContact (const QString &id, const QString &contactdata)
| Modify a contact that whose data and ID are given as Input.
QMap< int, ContactsStatus > | modifyContacts (const QStringList &aContactDataList, const QStringList &aContactsIdList)
| Batch modification.
QMap< int, ContactsStatus > | deleteContacts (const QStringList &aContactIDList)
| Batch deletion of contacts.
bool | batchUpdatesEnabled ()
| Tells if batch updates are enabled.
QDateTime | lastModificationTime (const QContactLocalId &aContactId)
| Returns the last time the contact was modified.
QDateTime | getCreationTime (const QContact &aContact)
| Return creation time of single contact.
QList< QDateTime > | getCreationTimes (const QList< QContactLocalId > &aContactIds)
| Returns creation times of the contacts.
QString | convertQContactToVCard (const QContact &aContact)
| Converts a QContact to a VCard.

## Detailed Description

Harmattan Contact storage plugin backend interface class.

This class interfaces with the backend implementation of contact manager on harmattan device

## Constructor & Destructor Documentation

## ContactsBackend()

ContactsBackend::ContactsBackend | ( | QVersitDocument::VersitType | aVerType,
|  | const QString & | syncTarget,
|  | const QString & | originId )

Constructor.

Parameters

  aVerType |

## Member Function Documentation

## addContacts()

bool ContactsBackend::addContacts | ( | const QStringList & | aContactDataList,
|  | QMap< int, ContactsStatus > & | aStatusMap )

Batch addition of contacts.

Parameters

  aContactDataList | Contact data
  aStatusMap | Returned status data

Returns
  Errors

## batchUpdatesEnabled()

bool ContactsBackend::batchUpdatesEnabled | ( |  | ) |

inline

Tells if batch updates are enabled.

Returns
  True if enabled, false if not

## convertQContactToVCard()

QString ContactsBackend::convertQContactToVCard | ( | const QContact & | aContact | ) |

Converts a QContact to a VCard.

Parameters

  aContact | Contact

Returns
  VCard

## deleteContacts()

QMap< int, ContactsStatus > ContactsBackend::deleteContacts | ( | const QStringList & | aContactIDList | ) |

Batch deletion of contacts.

Parameters

  aContactIDList | Contact IDs

Returns
  Errors

## getAllContactIds()

QList< QContactLocalId > ContactsBackend::getAllContactIds | ( |  | ) |

Return ids of all contacts retrieved from the backend.

Returns
  List of contact IDs

## getAllDeletedContactIds()

QList< QContactLocalId > ContactsBackend::getAllDeletedContactIds | ( | const QDateTime & | aTimeStamp | ) |

Return all deleted contacts ids in a QList of QStrings.

Parameters

  aTimeStamp | Timestamp of the oldest contact ID to be returned

Returns
  List of contact IDs

## getAllModifiedContactIds()

QList< QContactLocalId > ContactsBackend::getAllModifiedContactIds | ( | const QDateTime & | aTimeStamp | ) |

Return all modified contact ids in a QList of QStrings.

Parameters

  aTimeStamp | Timestamp of the oldest contact ID to be returned

Returns
  List of contact IDs

## getAllNewContactIds()

QList< QContactLocalId > ContactsBackend::getAllNewContactIds | ( | const QDateTime & | aTimeStamp | ) |

Return all new contacts ids in a QList of QStrings.

Parameters

  aTimeStamp | Timestamp of the oldest contact ID to be returned

Returns
  List of contact IDs

## getContact()

void ContactsBackend::getContact | ( | const QContactLocalId & | aContactId,
|  | QContact & | aContact )

Get contact data for a given gontact ID as a QContact object.

Parameters

  aContactId | The ID of the contact
  aContact | The returned data of the contact

## getContacts() [1/2]

void ContactsBackend::getContacts | ( | const QList< QContactLocalId > & | aContactIds,
|  | QList< QContact > & | aContacts )

Get multiple contacts at once as QContact objects.

Parameters

  aContactIds | List of contact IDs
  aContacts | List of returned contact data

## getContacts() [2/2]

void ContactsBackend::getContacts | ( | const QList< QContactLocalId > & | aContactIDs,
|  | QMap< QString, QString > & | aContactData )

Get multiple contacts at once as vcards.

Parameters

  aContactIDs | List of contact IDs to be returned
  aContactData | Returned contact data

## getCreationTime()

QDateTime ContactsBackend::getCreationTime | ( | const QContact & | aContact | ) |

Return creation time of single contact.

Parameters

  aContact | Contact

Returns
  Creation time

## getCreationTimes()

QList< QDateTime > ContactsBackend::getCreationTimes | ( | const QList< QContactLocalId > & | aContactIds | ) |

Returns creation times of the contacts.

Parameters

  aContactIds | Ids of the contacts

Returns
  Creation times

## init()

bool ContactsBackend::init | ( |  | ) |

Searches for available storage plugins and sets the manager to that plugin.

Returns

## lastModificationTime()

QDateTime ContactsBackend::lastModificationTime | ( | const QContactLocalId & | aContactId | ) |

Returns the last time the contact was modified.

Parameters

  aContactId | Id of the contact

Returns
  Timestamp of contact's last modification time

## modifyContact()

QContactManager::Error ContactsBackend::modifyContact | ( | const QString & | id,
|  | const QString & | contactdata )

Modify a contact that whose data and ID are given as Input.

Parameters

  id | Contact ID
  contactdata | Contact data

Returns
  Error

## modifyContacts()

QMap< int, ContactsStatus > ContactsBackend::modifyContacts | ( | const QStringList & | aContactDataList,
|  | const QStringList & | aContactsIdList )

Batch modification.

Parameters

  aContactDataList | Contact data
  aContactsIdList | Contact IDs

Returns
  Errors

## uninit()

bool ContactsBackend::uninit | ( |  | ) |

releases the resources held.

Returns

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

- ContactsBackend.h