HarmattanSyncApplications
Public Member Functions | List of all members
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, ContactsStatusmodifyContacts (const QStringList &aContactDataList, const QStringList &aContactsIdList)
 Batch modification.
 
QMap< int, ContactsStatusdeleteContacts (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
aContactDataListContact data
aStatusMapReturned 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
aContactContact
Returns
VCard

◆ deleteContacts()

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

Batch deletion of contacts.

Parameters
aContactIDListContact 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
aTimeStampTimestamp 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
aTimeStampTimestamp 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
aTimeStampTimestamp 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
aContactIdThe ID of the contact
aContactThe 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
aContactIdsList of contact IDs
aContactsList 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
aContactIDsList of contact IDs to be returned
aContactDataReturned contact data

◆ getCreationTime()

QDateTime ContactsBackend::getCreationTime ( const QContact &  aContact)

Return creation time of single contact.

Parameters
aContactContact
Returns
Creation time

◆ getCreationTimes()

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

Returns creation times of the contacts.

Parameters
aContactIdsIds 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
aContactIdId 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
idContact ID
contactdataContact data
Returns
Error

◆ modifyContacts()

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

Batch modification.

Parameters
aContactDataListContact data
aContactsIdListContact IDs
Returns
Errors

◆ uninit()

bool ContactsBackend::uninit ( )

releases the resources held.

Returns

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