kmail Library API Documentation

KMSearchRuleWidget Class Reference

A widget to edit a single KMSearchRule. A widget to edit a single KMSearchRule. More...

#include <kmsearchpatternedit.h>

Inheritance diagram for KMSearchRuleWidget:

QHBox List of all members.

Signals

void fieldChanged (const QString &)
void contentsChanged (const QString &)

Public Methods

 KMSearchRuleWidget (QWidget *parent=0, KMSearchRule *aRule=0, const char *name=0, bool headersOnly=false, bool absoluteDates=false)
void setRule (KMSearchRule *aRule)
KMSearchRulerule () const
void reset ()

Protected Slots

void editRegExp ()
void functionChanged (int which)
void slotRuleChanged (int which)

Protected Methods

int indexOfRuleField (const QString &aName) const
int indexOfStatus (const QString &aStatus) const

Static Protected Methods

QCString ruleFieldToEnglish (const QString &i18nVal)
QCString statusToEnglish (const QString &i18nVal)

Detailed Description

A widget to edit a single KMSearchRule. A widget to edit a single KMSearchRule.

It consists of an editable QComboBox for the field, a read-only QComboBox for the function and a QLineEdit for the content or the pattern (in case of regexps). It manages the i18n itself, so field name should be in it's english form.

To use, you essentially give it the reference to a KMSearchRule and it does the rest. It will never delete the rule itself, as it assumes that something outside of it manages this.

Author:
Marc Mutz <Marc@Mutz.com>

Definition at line 41 of file kmsearchpatternedit.h.


Constructor & Destructor Documentation

KMSearchRuleWidget::KMSearchRuleWidget QWidget   parent = 0,
KMSearchRule   aRule = 0,
const char *    name = 0,
bool    headersOnly = false,
bool    absoluteDates = false
 

Constructor.

You can give a KMSearchRule as parameter, which will be used to initialize the widget.

Definition at line 31 of file kmsearchpatternedit.cpp.

References reset(), and setRule().


Member Function Documentation

void KMSearchRuleWidget::setRule KMSearchRule   aRule
 

Set the rule.

The rule is accepted regardless of the return value of KMSearchRule::isEmpty. This widget makes a shallow copy of aRule and operates directly on it. If aRule is 0, resets itself, taks user input, but does essentially nothing. If you pass 0, you should probably disable it.

Definition at line 103 of file kmsearchpatternedit.cpp.

References QComboBox::changeItem(), KMSearchRule::contents(), KMSearchRule::field(), KMSearchRule::function(), indexOfRuleField(), QWidgetStack::raiseWidget(), QComboBox::setCurrentItem(), and QLineEdit::setText().

Referenced by KMSearchRuleWidget().

KMSearchRule * KMSearchRuleWidget::rule   const
 

Return a reference to the currently worked-on KMSearchRule.

Definition at line 135 of file kmsearchpatternedit.cpp.

References KMSearchRule::createInstance(), QComboBox::currentItem(), QComboBox::currentText(), KMSearchRule::Function, ruleFieldToEnglish(), statusToEnglish(), and QLineEdit::text().

void KMSearchRuleWidget::reset  
 

Resets the rule currently worked on and updates the widget accordingly.

Definition at line 147 of file kmsearchpatternedit.cpp.

References QComboBox::changeItem(), QLineEdit::clear(), QWidgetStack::raiseWidget(), and QComboBox::setCurrentItem().

Referenced by KMSearchRuleWidget().

void KMSearchRuleWidget::fieldChanged const QString   [signal]
 

This signal is emitted whenever the user alters the field.

The pseudo-headers <...> are returned in their i18n form, but stored in their english form in the rule.

void KMSearchRuleWidget::contentsChanged const QString   [signal]
 

This signal is emitted whenever the user alters the contents/value of the rule.

QCString KMSearchRuleWidget::ruleFieldToEnglish const QString   i18nVal [static, protected]
 

Used internally to translate i18n-ized pseudo-headers back to english.

Definition at line 164 of file kmsearchpatternedit.cpp.

References QString::latin1().

Referenced by rule().

QCString KMSearchRuleWidget::statusToEnglish const QString   i18nVal [static, protected]
 

Used internally to translate i18n-ized status strings back to english.

Definition at line 175 of file kmsearchpatternedit.cpp.

References QString::latin1().

Referenced by rule().

int KMSearchRuleWidget::indexOfRuleField const QString   aName const [protected]
 

Used internally to find the corresponding index into the field ComboBox.

Returns the index if found or -1 if the search failed,

Definition at line 194 of file kmsearchpatternedit.cpp.

References QString::isEmpty(), and QString::latin1().

Referenced by setRule().


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:37 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003