Home · All Classes · All Functions ·

QVersitProperty Class Reference

The QVersitProperty class stores the name, value, groups and parameters of a Versit property. More...

    #include <QVersitProperty>

This class is under development and is subject to change.


Public Functions

QVersitProperty ()
QVersitProperty ( const QVersitProperty & other )
~QVersitProperty ()
void clear ()
QStringList groups () const
void insertParameter ( const QString & name, const QString & value )
bool isEmpty () const
QString name () const
QMultiHash<QString, QString> parameters () const
void removeParameter ( const QString & name, const QString & value )
void removeParameters ( const QString & name )
void setGroups ( const QStringList & groups )
void setName ( const QString & name )
void setParameters ( const QMultiHash<QString, QString> & parameters )
void setValue ( const QVariant & value )
QString value () const
T value () const
QVariant variantValue () const
bool operator!= ( const QVersitProperty & other ) const
QVersitProperty & operator= ( const QVersitProperty & other )
bool operator== ( const QVersitProperty & other ) const

Detailed Description

The QVersitProperty class stores the name, value, groups and parameters of a Versit property.

For example a vCard can be presented as a QVersitDocument that consists of a number of properties such as a name (N), a telephone number (TEL) and an email address (EMAIL) to name a few. Each of these properties is stored as an instance of a QVersitProperty in a QVersitDocument.

QVersitProperty supports implicit sharing. The property name and parameters of a QVersitProperty are converted to upper-case when they are stored to a QVersitProperty.

The value of a QVersitProperty is stored as a QVariant and should always be one of three types: QString for textual values, QByteArray for binary data (eg. images), or QVersitDocument for nested documents. The QVersitReader will parse Versit properties and assign the correct type of object to the property value. The QVersitWriter will serialise objects of these types correctly into the (text-based) Versit format.

See also QVersitDocument.


Member Function Documentation

QVersitProperty::QVersitProperty ()

Constructs a new empty property

QVersitProperty::QVersitProperty ( const QVersitProperty & other )

Constructs a property that is a copy of other

QVersitProperty::~QVersitProperty ()

Frees the memory used by the property

void QVersitProperty::clear ()

Clears the contents of this property.

QStringList QVersitProperty::groups () const

Gets the groups of the property.

See also setGroups().

void QVersitProperty::insertParameter ( const QString & name, const QString & value )

Adds a new parameter with name and value. Both the name and the value are converted to upper-case.

bool QVersitProperty::isEmpty () const

Returns true if the property is empty.

QString QVersitProperty::name () const

Gets the name of the property in upper-case.

See also setName().

QMultiHash<QString, QString> QVersitProperty::parameters () const

Return a copy of the contained list of parameters. Note that actual the parameters cannot be modified using the copy.

See also setParameters().

void QVersitProperty::removeParameter ( const QString & name, const QString & value )

Removes a parameter with name and value.

See also removeParameters().

void QVersitProperty::removeParameters ( const QString & name )

Removes all parameters with the given name.

See also removeParameter().

void QVersitProperty::setGroups ( const QStringList & groups )

Sets the groups in the property to the given list of groups.

See also groups().

void QVersitProperty::setName ( const QString & name )

Sets the name of the property. The name is converted to upper-case.

See also name().

void QVersitProperty::setParameters ( const QMultiHash<QString, QString> & parameters )

Replaces all the parameters with parameters. The parameters are converted to upper-case.

See also parameters().

void QVersitProperty::setValue ( const QVariant & value )

Sets the property value to value.

See also value().

QString QVersitProperty::value () const

Returns the value of the property as a string if possible, otherwise return an empty string. If the property is stored as a QByteArray, it is decoded using the charset specified in the property's parameters.

See also setValue() and QVariant::toString().

T QVersitProperty::value () const

This is an overloaded function.

Returns the value of the property as a T. This function is actually const but because of a problem with qdoc, it doesn't appear to be in the generated documentation.

QVariant QVersitProperty::variantValue () const

Returns the value of the property.

bool QVersitProperty::operator!= ( const QVersitProperty & other ) const

Returns true if this is not equal to other; false otherwise.

QVersitProperty & QVersitProperty::operator= ( const QVersitProperty & other )

Assigns this property to other

bool QVersitProperty::operator== ( const QVersitProperty & other ) const

Returns true if this is equal to other; false otherwise.


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