Qtopia library API Documentation

CategoryMenu Class Reference

The CategoryMenu widget aids in filtering records or files by Category. More...

Inheritance diagram for CategoryMenu:

Inheritance graph
[legend]
Collaboration diagram for CategoryMenu:

Collaboration graph
[legend]
List of all members.

Public Slots

void reload ()

Signals

void categoryChange ()

Public Member Functions

 CategoryMenu (const QString &appName, bool, QWidget *parent=0, const char *name=0)
 ~CategoryMenu ()
bool isSelected (const QArray< int > &cUids) const
void setCurrentCategory (int newCatUid)
void setCurrentCategoryAll ()
void setCurrentCategoryUnfiled ()

Detailed Description

The CategoryMenu widget aids in filtering records or files by Category.

The CategoryMenu widget provides a popup menu that will make filtering records or files by category much easier. The widget will lookup the available categories for an application, populate the menu, and keep a track of which categories are being filtered against. A set of categories can be tested by the isSelected() function to see if a record or file containing those categories would be allowed through by the filter.

Warning:
Currently this class is not suitable for extending.

Definition at line 30 of file categorymenu.h.


Constructor & Destructor Documentation

CategoryMenu::CategoryMenu const QString n,
bool  ig = TRUE,
QWidget parent = 0,
const char *  name = 0
 

Creates a new CategoryMenu with parent and name. The menu will be populated with the available categories for application.

If globals is TRUE then it will also poplulate the menu with the global categories.

Definition at line 56 of file categorymenu.cpp.

References QPopupMenu::activated(), QObject::connect(), and reload().

CategoryMenu::~CategoryMenu  ) 
 

Destroys a CategoryMenu.

Definition at line 70 of file categorymenu.cpp.


Member Function Documentation

bool CategoryMenu::isSelected const QArray< int > &  cUids  )  const
 

Returns TRUE if a record or file with the set of category ids cUids is allowed by the current selection in the CategoryMenu. Otherwise returns FALSE.

Definition at line 123 of file categorymenu.cpp.

References QArray::contains(), and QArray::count().

void CategoryMenu::setCurrentCategory int  newCatUid  ) 
 

Sets the menu to have newCatUid as the currently selected Category.

Definition at line 140 of file categorymenu.cpp.

References QMap< int, int >::contains().

void CategoryMenu::setCurrentCategoryAll  ) 
 

Sets the menu to allow all category sets.

Definition at line 151 of file categorymenu.cpp.

void CategoryMenu::setCurrentCategoryUnfiled  ) 
 

Sets the menu to allow only empty category sets.

Definition at line 159 of file categorymenu.cpp.

void CategoryMenu::categoryChange  )  [signal]
 

This signal is emitted when the user selects a different category in the menu, hence changing what records or files should be selected.

void CategoryMenu::reload  )  [slot]
 

Repopulates the widget's list of available categories.

Definition at line 77 of file categorymenu.cpp.

References QValueList::begin(), QPopupMenu::clear(), QValueList::end(), Categories::id(), QMap< int, int >::insert(), QPopupMenu::insertItem(), Categories::labels(), Categories::load(), QPopupMenu::setItemChecked(), and QObject::tr().

Referenced by CategoryMenu().


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:14 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001