Qtopia library API Documentation

CategoryGroup Class Reference

Helper class that is used by Categories. More...

#include <categories.h>

Collaboration diagram for CategoryGroup:

Collaboration graph
[legend]
List of all members.

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 QStringlabel (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
See also:
Categories::appGroupMap(), Categories::globalGroup()

Definition at line 43 of file categories.h.


Member Function Documentation

int CategoryGroup::add const QString label  ) 
 

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().

bool CategoryGroup::remove const QString label  ) 
 

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().

bool CategoryGroup::remove int  uid  ) 
 

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().

bool CategoryGroup::contains int  uid  )  const
 

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().

bool CategoryGroup::contains const QString label  )  const
 

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().

const QString & CategoryGroup::label int  uid  )  const
 

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().

int CategoryGroup::id const QString label  )  const
 

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().

QStringList CategoryGroup::labels  )  const
 

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().

QStringList CategoryGroup::labels const QArray< int > &  catids  )  const
 

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().

const QMap< int, QString > & CategoryGroup::idMap  )  const [inline]
 

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:
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:13 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001