CategoryGroup Class Reference
Helper class that is used by Categories. More...
#include <categories.h>
Collaboration diagram for CategoryGroup:

Public Member Functions | |
| CategoryGroup (const CategoryGroup &c) | |
| void | clear () |
| int | add (const QString &label) |
| bool | add (int uid, const QString &label) |
| bool | remove (const QString &label) |
| bool | remove (int uid) |
| bool | rename (int uid, const QString &newLabel) |
| bool | rename (const QString &oldLabel, const QString &newLabel) |
| bool | contains (int id) const |
| bool | contains (const QString &label) const |
| const QString & | label (int id) const |
| Returns label associated with the uid or QString::null if not found. | |
| int | id (const QString &label) const |
| Returns the uid associated with label or 0 if not found. | |
| QStringList | labels () const |
| Returns a sorted list of labels. | |
| QStringList | labels (const QArray< int > &catids) const |
| const QMap< int, QString > & | idMap () const |
Friends | |
| class | Categories |
Detailed Description
Helper class that is used by Categories.CategoryGroup is a group of categories that is associated with an application or global set. Mainly it defines a map of ids to category labels and category labels to ids. Lookups can be done with labels or unique idenifiers.
- Warning:
- Categories API will likely change between Qtopia 1.5 and Qtopia 3
Definition at line 43 of file categories.h.
Member Function Documentation
|
|
Add label and return the UID. If failure, then 0 is returned. Note that All and Unfiled are reserved labels. Definition at line 58 of file categories.cpp. References QMap< QString, int >::end(), QMap< QString, int >::find(), and QObject::tr(). Referenced by Categories::addCategory(), Categories::addGlobalCategory(), and Categories::load(). |
|
|
Returns TRUE if label was removed from the group, FALSE if not. Definition at line 98 of file categories.cpp. References QMap< QString, int >::end(), QMap< QString, int >::find(), QMap< QString, int >::remove(), and QMap< int, QString >::remove(). Referenced by Categories::removeCategory(), Categories::removeGlobalCategory(), and Categories::setGlobal(). |
|
|
Returns TRUE if uid was removed from the group, FALSE if not. Definition at line 113 of file categories.cpp. References QMap< int, QString >::end(), QMap< int, QString >::find(), QMap< int, QString >::remove(), and QMap< QString, int >::remove(). |
|
|
Returns TRUE if uid is stored in this group, FALSE if not. Definition at line 151 of file categories.cpp. References QMap< int, QString >::end(), and QMap< int, QString >::find(). Referenced by Categories::addCategory(), Categories::isGlobal(), Categories::label(), and Categories::setGlobal(). |
|
|
Returns TRUE if label is stored in this group, FALSE if not. Definition at line 157 of file categories.cpp. References QMap< QString, int >::end(), and QMap< QString, int >::find(). |
|
|
Returns label associated with the uid or QString::null if not found. Returns label associated with the uid or QString::null if not found Definition at line 165 of file categories.cpp. References QMap< int, QString >::end(), and QMap< int, QString >::find(). Referenced by Categories::label(). |
|
|
Returns the uid associated with label or 0 if not found. Returns the uid associated with label or 0 if not found Definition at line 174 of file categories.cpp. References QMap< QString, int >::end(), and QMap< QString, int >::find(). Referenced by Categories::id(), Categories::removeCategory(), Categories::removeGlobalCategory(), Categories::renameCategory(), and Categories::renameGlobalCategory(). |
|
|
Returns a sorted list of labels. Returns a list of all labels stored in this group. Definition at line 183 of file categories.cpp. References QMap< int, QString >::begin(), QMap< int, QString >::end(), and labels(). Referenced by Categories::dump(), Categories::labels(), and labels(). |
|
|
Returns a list of all labels associated with the catids Definition at line 195 of file categories.cpp. References QMap< int, QString >::begin(), QArray::count(), QMap< int, QString >::end(), QArray::find(), and labels(). |
|
|
Returns a const reference to the id to label QMap Definition at line 77 of file categories.h. Referenced by Categories::save(). |
The documentation for this class was generated from the following files:
