kmail Library API Documentation

KMFilterActionWidget Class Reference

This widgets allows to edit a single KMFilterAction (in fact any derived class that is registered in KMFilterActionDict). A widget to edit a single KMFilterAction. More...

#include <kmfilterdlg.h>

Inheritance diagram for KMFilterActionWidget:

QHBox List of all members.

Public Methods

 KMFilterActionWidget (QWidget *parent=0, const char *name=0)
void setAction (const KMFilterAction *aAction)
KMFilterActionaction ()

Detailed Description

This widgets allows to edit a single KMFilterAction (in fact any derived class that is registered in KMFilterActionDict). A widget to edit a single KMFilterAction.

It consists of a combo box which allows to select the type of actions this widget should act upon and a QWidgetStack, which holds the parameter widgets for the different rule types.

You can load a KMFilterAction into this widget with setAction, and retrieve the result of user action with action. The widget will copy it's setting into the corresponding parameter widget. For that, it internally creates an instance of every KMFilterAction in KMFilterActionDict and asks each one to create a parameter widget. The parameter widgets are put on the widget stack and are raised when their corresponding action type is selected in the combo box.

Author:
Marc Mutz <Marc@Mutz.com>
See also:
KMFilterAction KMFilter KMFilterActionWidgetLister

Definition at line 165 of file kmfilterdlg.h.


Constructor & Destructor Documentation

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

Constructor.

Creates a filter action widget with no type selected.

Definition at line 774 of file kmfilterdlg.cpp.

References QWidgetStack::addWidget(), QPtrList< KMFilterAction >::append(), QComboBox::count(), KMFilterAction::createParamWidget(), QPtrListIterator::current(), QComboBox::insertItem(), QWidgetStack::raiseWidget(), QPtrList< KMFilterAction >::setAutoDelete(), QComboBox::setCurrentItem(), QComboBox::setSizeLimit(), QHBox::setSpacing(), and QPtrListIterator::toFirst().


Member Function Documentation

void KMFilterActionWidget::setAction const KMFilterAction   aAction
 

Set an action.

The action's type is determined and the corresponding widget it loaded with aAction's parameters and then raised. If @ aAction is 0, the widget is cleared.

Definition at line 820 of file kmfilterdlg.cpp.

References QPtrList< KMFilterAction >::at(), QComboBox::count(), KMFilterAction::label(), QWidgetStack::raiseWidget(), QComboBox::setCurrentItem(), KMFilterAction::setParamWidgetValue(), QComboBox::text(), and QWidgetStack::widget().

KMFilterAction * KMFilterActionWidget::action  
 

Retrieve the action.

This method is necessary because the type of actions can change during editing. Therefore the widget always creates a new action object from the data in the combo box and the widget stack and returns that.

Definition at line 848 of file kmfilterdlg.cpp.

References KMFilterAction::applyParamWidgetValue(), KMFilterActionDesc::create, QComboBox::currentText(), and QWidgetStack::visibleWidget().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:36 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003