Qt Mobility Reference Documentation

QLandmarkCategory Class Reference

The QLandmarkCategory class designates a grouping of landmarks of similar type. More...

 #include <QLandmarkCategory>

Public Functions

QLandmarkCategory ()
QLandmarkCategory ( const QLandmarkCategory & other )
~QLandmarkCategory ()
QVariant attribute ( const QString & key, const QVariant & defaultValue = QVariant() ) const
QStringList attributeKeys () const
QLandmarkCategoryId categoryId () const
void clear ()
QString description () const
QUrl iconUrl () const
QString name () const
void setAttribute ( const QString & key, const QVariant & value )
void setCategoryId ( const QLandmarkCategoryId & id )
void setDescription ( const QString & description )
void setIconUrl ( const QUrl & url )
void setName ( const QString & name )
bool operator!= ( const QLandmarkCategory & other ) const
QLandmarkCategory & operator= ( const QLandmarkCategory & other )
bool operator== ( const QLandmarkCategory & other ) const

Detailed Description

The QLandmarkCategory class designates a grouping of landmarks of similar type.

Landmarks of similar type may be grouped together into categories, e.g. restaurants, accommodation etc. A QLandmarkCategory object represents one of these and allows access to category properties such as description and icon url.

More than one category can be assigned to a landmark. Assignment of a category to a landmark is achieved by using the QLandmark class in conjunction with the QLandmarkCategoryId class.

Some categories may be designated as read-only. Typically these are intended to be "global" categories that are the same across landmark stores. In practicality, not all landmark stores may necessarily have the same set of global categories. Localization is only possible for categories that are read-only. If the landmark store supports localization, the locale may be set through a QLandmarkManager's parameters and whenever categories are retrieved, the translated names are used. The QLandmarkManager::isReadOnly(const QLandmarkCategoryId &) function may be used to determine if a category is read-only.

A QLandmarkCategory instance is an in memory representation and may not reflect the state of the category found in persistent storage, until the appropriate synchronization method is called on the QLandmarkManager(e.g.saveCategory(), removeCategory()).


Member Function Documentation

QLandmarkCategory::QLandmarkCategory ()

Constructs an empty category.

A new category will be assigned an invalid QLandmarkCategoryId.

QLandmarkCategory::QLandmarkCategory ( const QLandmarkCategory & other )

Constructs a copy of other.

QLandmarkCategory::~QLandmarkCategory ()

Destroys the category.

QVariant QLandmarkCategory::attribute ( const QString & key, const QVariant & defaultValue = QVariant() ) const

Returns the value of the attribute corresponding to key. If the attribute does not exist, returns defaultValue.

If no default value is specified, a default QVariant is returned.

See also setAttribute().

QStringList QLandmarkCategory::attributeKeys () const

Returns a list of attribute keys.

See also attribute() and setAttribute().

QLandmarkCategoryId QLandmarkCategory::categoryId () const

Returns the identifier of the category.

See also setCategoryId().

void QLandmarkCategory::clear ()

Clears all the data fields of the category.

QString QLandmarkCategory::description () const

Returns the description of the category.

See also setDescription().

QUrl QLandmarkCategory::iconUrl () const

Returns the url of the category's icon.

See also setIconUrl().

QString QLandmarkCategory::name () const

Returns the name of the category.

See also setName().

void QLandmarkCategory::setAttribute ( const QString & key, const QVariant & value )

Sets the value of the attribute corresponding to key.

See also attribute().

void QLandmarkCategory::setCategoryId ( const QLandmarkCategoryId & id )

Sets the id of the category.

Note that saving a new category using a QLandmarkManager will automatically assign the category a valid identifier.

See also categoryId().

void QLandmarkCategory::setDescription ( const QString & description )

Sets the description of the category

See also description().

void QLandmarkCategory::setIconUrl ( const QUrl & url )

Sets the url of the category's icon

See also iconUrl().

void QLandmarkCategory::setName ( const QString & name )

Sets the name of the category.

See also name().

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

Returns true if this category is not equal to other, otherwise returns false.

See also operator==().

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

Assigns other to this category and returns a reference to this category.

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

Returns true if this category is equal to other, otherwise returns false.

See also operator!=().


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