Home · All Classes · All Functions ·

QVersitContactImporter Class Reference

The QVersitContactImporter class creates QContacts from QVersitDocuments. More...

    #include <QVersitContactImporter>

Public Functions

QVersitContactImporter ()
~QVersitContactImporter ()
QString audioClipPath () const
QString imagePath () const
QContact importContact ( const QVersitDocument & versitDocument )
void setAudioClipPath ( const QString & path )
void setImagePath ( const QString & path )
QList<QVersitProperty> unknownVersitProperties ()

Detailed Description

The QVersitContactImporter class creates QContacts from QVersitDocuments.

The versit properties (QVersitProperty) that were not imported by QVersitContactImporter::importContact() can be fetched after importing by calling QVersitContactImporter::unknownVersitProperties(). For the returned properties, the client can perform the conversions from versit properties to contact details and add the converted details to the QContact.

    QVersitDocument document;
    QVersitProperty property;

    property.setName(QString::fromAscii("N"));
    property.setValue("Citizen;John;Q;;");
    document.addProperty(property);

    property.setName(QString::fromAscii("X-UNKNOWN-PROPERTY"));
    property.setValue("some value");
    document.addProperty(property);

    QVersitContactImporter importer;
    importer.setImagePath(QString::fromAscii("/my/image/path"));
    importer.setAudioClipPath(QString::fromAscii("my/audio_clip/path"));

    QContact contact = importer.importContact(document);
    // contact now contains the "N" property as a QContactName
    QList<QVersitProperty> unknownProperties = importer.unknownVersitProperties();
    // unknownProperties contains "X-UNKNOWN-PROPERTY"
    // that can be handled by the client itself

See also QVersitDocument and QVersitReader.


Member Function Documentation

QVersitContactImporter::QVersitContactImporter ()

Constructs a new importer

QVersitContactImporter::~QVersitContactImporter ()

Frees the memory used by the importer

QString QVersitContactImporter::audioClipPath () const

Returns the path where the contact related audio clips will be saved.

See also setAudioClipPath().

QString QVersitContactImporter::imagePath () const

Returns the path where the contact photos are saved.

See also setImagePath().

QContact QVersitContactImporter::importContact ( const QVersitDocument & versitDocument )

Creates a QContact from versitDocument.

void QVersitContactImporter::setAudioClipPath ( const QString & path )

Sets the path where the contact related audio clips will be saved. This function should be called before calling importContact(). If the audio clip path has not been set, the audio clips in the versit document will not be added to the contact. There is no default path for them.

See also audioClipPath().

void QVersitContactImporter::setImagePath ( const QString & path )

Sets the path where the contact photos will be saved. This function should be called before calling importContact(). If the image path has not been set, the images in the versit document will not be added to the contact. There is no default path for them.

See also imagePath().

QList<QVersitProperty> QVersitContactImporter::unknownVersitProperties ()

Returns the list of versit properties that were not imported by the most recent call of importContact().


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0 (Technical Preview)