kmail

KMSearchPatternEdit Class Reference

#include <kmsearchpatternedit.h>

Inherits TQGroupBox.

Public Slots

void reset ()
 

Signals

void maybeNameChanged ()
 

Public Member Functions

 KMSearchPatternEdit (TQWidget *parent=0, const char *name=0, bool headersOnly=false, bool absoluteDates=false)
 
 KMSearchPatternEdit (const TQString &title, TQWidget *parent=0, const char *name=0, bool headersOnly=false, bool absoluteDates=false)
 
void setSearchPattern (KMSearchPattern *aPattern)
 
void setHeadersOnly (bool headersOnly)
 
void updateSearchPattern ()
 

Detailed Description

This widget is intended to be used in the filter configuration as well as in the message search dialogs.

It consists of a frame, inside which there are placed two radio buttons entitled "Match {all,any} of the following", followed by a vertical stack of KMSearchRuleWidgets (initially two) and two buttons to add and remove, resp., additional KMSearchWidget 's.

To set the widget according to a given KMSearchPattern, use setSearchPattern; to initialize it (e.g. for a new, virgin rule), use setSearchPattern with a 0 argument. The widget operates directly on a shallow(!) copy of the search rule. So while you actually don't really need searchPattern, because you can always store a pointer to the current pattern yourself, you must not modify the currently-worked-on pattern yourself while this widget holds a reference to it. The only exceptions are:

  • If you edit a derived class, you can change aspects of the class that don't interfere with the KMSearchPattern part. An example is KMFilter, whose actions you can still edit while the KMSearchPattern part of it is being acted upon by this widget.
  • You can change the name of the pattern, but only using (this widget's) setName. You cannot change the pattern's name directly, although this widget in itself doesn't let the user change it. This is because it auto-names the pattern to "<$field>:$contents" iff the pattern begins with "<".

A widget which allows editing a set of KMSearchRule's.

Author
Marc Mutz Marc@.nosp@m.Mutz.nosp@m..com

Definition at line 167 of file kmsearchpatternedit.h.

Constructor & Destructor Documentation

◆ KMSearchPatternEdit() [1/2]

KMSearchPatternEdit::KMSearchPatternEdit ( TQWidget *  parent = 0,
const char *  name = 0,
bool  headersOnly = false,
bool  absoluteDates = false 
)

Constructor.

The parent and name parameters are passed to the underlying TQGroupBox, as usual.

Definition at line 393 of file kmsearchpatternedit.cpp.

◆ KMSearchPatternEdit() [2/2]

KMSearchPatternEdit::KMSearchPatternEdit ( const TQString &  title,
TQWidget *  parent = 0,
const char *  name = 0,
bool  headersOnly = false,
bool  absoluteDates = false 
)

Constructor.

This one allows you to set a title different from i18n("Search Criteria").

Definition at line 400 of file kmsearchpatternedit.cpp.

Member Function Documentation

◆ maybeNameChanged

void KMSearchPatternEdit::maybeNameChanged ( )
signal

This signal is emitted whenever the name of the processed search pattern may have changed.

◆ reset

void KMSearchPatternEdit::reset ( )
slot

Called when the widget should let go of the currently referenced filter and disable itself.

Definition at line 465 of file kmsearchpatternedit.cpp.

◆ setHeadersOnly()

void KMSearchPatternEdit::setHeadersOnly ( bool  headersOnly)

Set whether only header fields can be searched.

If is true only header fields can be searched otherwise <message> and <body> searches are available also.

Definition at line 460 of file kmsearchpatternedit.cpp.

◆ setSearchPattern()

void KMSearchPatternEdit::setSearchPattern ( KMSearchPattern aPattern)

Set the search pattern.

Rules are inserted regardless of the return value of each rules' KMSearchRule::isEmpty. This widget makes a shallow copy of aPattern and operates directly on it.

Definition at line 442 of file kmsearchpatternedit.cpp.

◆ updateSearchPattern()

void KMSearchPatternEdit::updateSearchPattern ( )
inline

Updates the search pattern according to the current widget values.

Definition at line 190 of file kmsearchpatternedit.h.


The documentation for this class was generated from the following files: