Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CategorySelect Class Reference

The CategorySelect widget allows users to select Categories with a combobox interface. More...

#include </home/clem/local/src/opie/library/categoryselect.h>

Collaboration diagram for CategorySelect:

Collaboration graph
[legend]
List of all members.

Public Slots

void slotNewCat (int id)

Signals

void signalSelected (int)

Public Member Functions

 CategorySelect (QWidget *parent=0, const char *name=0)
 CategorySelect (QWidget *parent, const char *name, int width)
 CategorySelect (const QArray< int > &vlCats, const QString &appName, QWidget *parent=0, const char *name=0, int width=0)
 CategorySelect (const QArray< int > &vlCats, const QString &appName, const QString &visibleName, QWidget *parent=0, const char *name=0, int width=0)
 ~CategorySelect ()
const QArray< int > & currentCategories () const
int currentCategory () const
void setCurrentCategory (int newCatUid)
QString setCategories (const QArray< int > &vlCats, const QString &appName)
QString setCategories (const QArray< int > &vlCats, const QString &appName, const QString &visibleName)
void setRemoveCategoryEdit (bool remove)
void setAllCategories (bool add)
void setFixedWidth (int width)

Private Slots

void slotDialog ()

Private Member Functions

void init (int width=0)

Private Attributes

QString mStrAppName
CategoryCombocmbCat
QToolButton * cmdCat
CategorySelectPrivated

Detailed Description

The CategorySelect widget allows users to select Categories with a combobox interface.

CategorySelect is useful to provide a QComboBox of Categories for filtering (such as in the Contacts table view) or to allow the user to select multiple Categories. The allCategories variable sets whether the CategorySelect is in filtering or selecting mode.

In filtering mode, the All and Unfiled categories are added. The

In selecting mode, the CategorySelect may either be a QComboBox and a QToolButton or a QListView with checkable items depending on the screen size.

CategorySelect automatically updates itself if Categories has been changed elsewhere in the environment.

Signals and slots are provided to notify the application of the users selections. A QToolButton is also provided so that users can edit the Categories manually.

Definition at line 67 of file categoryselect.h.


Constructor & Destructor Documentation

CategorySelect::CategorySelect QWidget *  parent = 0,
const char *  name = 0
 

Constructs a category selector with parent parent, name name.

This constructor is provided to make Opie compatible with Sharp ROM.

Definition at line 330 of file categoryselect.cpp.

References d, and init().

CategorySelect::CategorySelect QWidget *  parent,
const char *  name,
int  width
 

Constructs a category selector with parent parent, name name and fixed width width.

This constructor is provided to make integration with Qt Designer easier.

Definition at line 345 of file categoryselect.cpp.

References d, and init().

CategorySelect::CategorySelect const QArray< int > &  vl,
const QString appName,
QWidget *  parent = 0,
const char *  name = 0,
int  width = 0
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This constructor accepts an array vl of integers representing Categories. appName is used as the visible name string.

Definition at line 360 of file categoryselect.cpp.

References d, init(), and setCategories().

CategorySelect::CategorySelect const QArray< int > &  vl,
const QString appName,
const QString visibleName,
QWidget *  parent = 0,
const char *  name = 0,
int  width = 0
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This constructor accepts an array vl of integers representing Categories. visibleName is the string used when the name of this widget is required to be displayed. width is an integer used as the fixed width of the widget.

Definition at line 379 of file categoryselect.cpp.

References d, init(), and setCategories().

CategorySelect::~CategorySelect  ) 
 

Destructs a CategorySelect widget.

Definition at line 393 of file categoryselect.cpp.

References d.


Member Function Documentation

const QArray< int > & CategorySelect::currentCategories  )  const
 

Returns a shallow copy of the categories in this CategorySelect.

Definition at line 520 of file categoryselect.cpp.

References d, and CategorySelectPrivate::mRec.

Referenced by TaskEditorOverView::save(), ContactEditor::saveEntry(), and AbEditor::saveEntry().

int CategorySelect::currentCategory  )  const
 

Return the value of the currently selected category.

Definition at line 506 of file categoryselect.cpp.

References cmbCat, and CategoryCombo::currentCategory().

Referenced by TaskEditorOverView::save(), slotNewCat(), and LauncherView::updateTools().

void CategorySelect::init int  width = 0  )  [private]
 

Definition at line 489 of file categoryselect.cpp.

References cmbCat, cmdCat, FALSE, slotDialog(), slotNewCat(), and TabFocus.

Referenced by CategorySelect().

void CategorySelect::setAllCategories bool  add  ) 
 

Changes this CategorySelect to the All category if all is TRUE.

Definition at line 542 of file categoryselect.cpp.

References cmbCat, d, tr, and CategorySelectPrivate::usingAll.

Referenced by FileSelector::FileSelector(), LauncherView::updateTools(), and Doc_DirLister::widget().

QString CategorySelect::setCategories const QArray< int > &  rec,
const QString appName,
const QString visibleName
 

Resets the CategorySelect to select the vlCats for the Categories assoicated with appName and displays the visibleName if the user is selecting and therefore editing new Categories.

Definition at line 479 of file categoryselect.cpp.

References cmbCat, d, Qtopia::Record::idsToString(), CategoryCombo::initComboWithRefind(), CategorySelectPrivate::mRec, mStrAppName, and CategorySelectPrivate::mVisibleName.

QString CategorySelect::setCategories const QArray< int > &  rec,
const QString appName
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Resets the CategorySelect to select the vlCats for the Categories assoicated with appName.

This function should only be called if filtering on Categories and not selecting and therefore possibly allowing the user to edit Categories.

Definition at line 467 of file categoryselect.cpp.

Referenced by CategorySelect(), FileSelector::FileSelector(), TaskEditorOverView::load(), ContactEditor::setEntry(), AbEditor::setEntry(), LauncherView::updateTools(), and Doc_DirLister::widget().

void CategorySelect::setCurrentCategory int  newCatUid  ) 
 

Definition at line 512 of file categoryselect.cpp.

References cmbCat, and CategoryCombo::setCurrentCategory().

Referenced by LauncherView::updateTools().

void CategorySelect::setFixedWidth int  width  ) 
 

Sets the fixed width of the widget to width.

Definition at line 556 of file categoryselect.cpp.

References cmbCat, and cmdCat.

void CategorySelect::setRemoveCategoryEdit bool  remove  ) 
 

Hides the edit section of the CategorySelect widget if remove is TRUE.

Definition at line 528 of file categoryselect.cpp.

References cmdCat, FALSE, and TRUE.

Referenced by FileSelector::FileSelector(), LauncherView::updateTools(), and Doc_DirLister::widget().

void CategorySelect::signalSelected int   )  [signal]
 

Referenced by slotNewCat().

void CategorySelect::slotDialog  )  [private, slot]
 

This slot is called when the user pushes the button to edit Categories.

Definition at line 401 of file categoryselect.cpp.

References categoryEdittingFileName(), QFile::close(), cmbCat, d, QFile::exists(), f, CategoryCombo::initCombo(), IO_WriteOnly, CategorySelectPrivate::mRec, mStrAppName, CategorySelectPrivate::mVisibleName, CategoryWidget::newCategories(), QFile::open(), QFile::remove(), tr, TRUE, and warning().

Referenced by init().

void CategorySelect::slotNewCat int  newUid  )  [slot]
 

This slot is called when a new Category is available.

Definition at line 438 of file categoryselect.cpp.

References currentCategory(), d, CategorySelectPrivate::mRec, and signalSelected().

Referenced by init().


Member Data Documentation

CategoryCombo* CategorySelect::cmbCat [private]
 

Definition at line 118 of file categoryselect.h.

Referenced by currentCategory(), init(), setAllCategories(), setCategories(), setCurrentCategory(), setFixedWidth(), and slotDialog().

QToolButton* CategorySelect::cmdCat [private]
 

Definition at line 119 of file categoryselect.h.

Referenced by init(), setFixedWidth(), and setRemoveCategoryEdit().

CategorySelectPrivate* CategorySelect::d [private]
 

Definition at line 120 of file categoryselect.h.

Referenced by CategorySelect(), currentCategories(), setAllCategories(), setCategories(), slotDialog(), slotNewCat(), and ~CategorySelect().

QString CategorySelect::mStrAppName [private]
 

Definition at line 117 of file categoryselect.h.

Referenced by setCategories(), and slotDialog().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:28:13 2005 for OPIE by  doxygen 1.4.2