QtMobility Reference Documentation

QOrganizerCollection Class Reference

The QOrganizerCollection class represents a collection of items in a manager. More...

 #include <QOrganizerCollection>

This class was introduced in Qt Mobility 1.1.

Public Functions

QOrganizerCollection ()
QOrganizerCollection ( const QOrganizerCollection & other )
~QOrganizerCollection ()
QOrganizerCollectionId id () const
QVariantMap metaData () const
QVariant metaData ( const QString & key ) const
void setId ( const QOrganizerCollectionId & id )
void setMetaData ( const QVariantMap & metaData )
void setMetaData ( const QString & key, const QVariant & value )
bool operator!= ( const QOrganizerCollection & other ) const
QOrganizerCollection & operator= ( const QOrganizerCollection & other )
bool operator== ( const QOrganizerCollection & other ) const

Static Public Members

const QLatin1Constant KeyColor
const QLatin1Constant KeyDescription
const QLatin1Constant KeyImage
const QLatin1Constant KeyName

Detailed Description

The QOrganizerCollection class represents a collection of items in a manager.

A collection has an id and optionally some metadata, and contains zero or more items. Each different manager will have different requirements before a collection may be saved in it. Some managers do not allow collections to be saved at all, while others may require a collection to have some minimal amount of meta data defined in it prior to save. For example, most managers require a valid value for the QOrganizerCollection::KeyName meta data key to be set prior to save.

Every QOrganizerItem is contained within a collection when stored in a manager. To save an item in a collection, the client should call QOrganizerItem::setCollectionId() on the item, passing in the id of the destination collection as the argument, and then save the item in the manager. To move an item from one collection to another, the client must fetch the item from the manager, set the collection id in the item to the id of the collection to which the client wishes the item to be moved, and then resave the item in the manager. That is, the collection which an item is part of is treated as a property of the item.

Member Function Documentation

QOrganizerCollection::QOrganizerCollection ()

Constructs a new collection

QOrganizerCollection::QOrganizerCollection ( const QOrganizerCollection & other )

Constructs a new copy of the other collection

This function was introduced in Qt Mobility 1.1.

QOrganizerCollection::~QOrganizerCollection ()

Cleans up any memory in use by the collection

QOrganizerCollectionId QOrganizerCollection::id () const

Returns the complete id of the collection, which includes the manager uri and the manager id of the collection

This function was introduced in Qt Mobility 1.1.

See also setId().

QVariantMap QOrganizerCollection::metaData () const

Returns the meta data of the collection

This function was introduced in Qt Mobility 1.1.

See also setMetaData().

QVariant QOrganizerCollection::metaData ( const QString & key ) const

Returns the meta data of the collection for the given key

This function was introduced in Qt Mobility 1.1.

void QOrganizerCollection::setId ( const QOrganizerCollectionId & id )

Sets the id of the collection to id. If the id is set to a null (default-constructed) id, saving the collection will cause the manager to save the collection as a new collection (if it supports that operation).

This function was introduced in Qt Mobility 1.1.

See also id().

void QOrganizerCollection::setMetaData ( const QVariantMap & metaData )

Sets the meta data of the collection to metaData. Not all managers support arbitrary meta data for collections. You can see whether the meta data is compatible with the manager by calling QOrganizerManager::compatibleCollection(). Attempting to save a collection with unsupported meta data in a manager will cause an error in the operation.

This function was introduced in Qt Mobility 1.1.

See also metaData().

void QOrganizerCollection::setMetaData ( const QString & key, const QVariant & value )

Sets the meta data of the collection for the given key to the given value. Not all managers support all of the standard meta data keys (see QOrganizerCollection), and some will support extra or even arbitrary keys. Similarly, not all managers support all possible data types for the meta data value. Attempting to save a collection with unsupported meta data in a manager will cause an error in the operation.

This function was introduced in Qt Mobility 1.1.

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

Returns true if the id of the collection is not the same as that of the other collection. Does not check that the metadata of the collections is not equal.

This function was introduced in Qt Mobility 1.1.

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

Assigns this collection to be equal to the other collection

This function was introduced in Qt Mobility 1.1.

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

Returns true if the id of the collection is the same as that of the other collection. Does not check that the metadata of the collections is equal.

This function was introduced in Qt Mobility 1.1.

Member Variable Documentation

const QLatin1Constant QOrganizerCollection::KeyColor

The constant key value which identifies the color meta data of a collection.

const QLatin1Constant QOrganizerCollection::KeyDescription

The constant key value which identifies the description meta data of a collection.

const QLatin1Constant QOrganizerCollection::KeyImage

The constant key value which identifies the image meta data of a collection.

const QLatin1Constant QOrganizerCollection::KeyName

The constant key value which identifies the name meta data of a collection.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.