kaddressbook Library API Documentation

Filter Class Reference

Filter for AddressBook related objects (Addressees). More...

#include <filter.h>

List of all members.

Public Types

typedef QValueList< FilterList
enum  MatchRule { Matching = 0, NotMatching = 1 }

Public Member Functions

 Filter (const Filter &)
 Filter (const QString &name)
Filteroperator= (const Filter &)
void setName (const QString &name)
 Set the name of the filter.

const QStringname () const
void apply (KABC::Addressee::List &addresseeList)
 Apply the filter to the addressee list.

bool filterAddressee (const KABC::Addressee &a)
 Apply the filter to the addressee.

void setEnabled (bool on)
 Enable or disable the filter.

bool isEnabled () const
void setCategories (const QStringList &list)
 Set the list of categories.

const QStringListcategories () const
void save (KConfig *config)
 Saves the filter to the config file.

void restore (KConfig *config)
 Loads the filter from the config file.

void setMatchRule (MatchRule rule)
 Sets the filter rule.

MatchRule matchRule () const

Static Public Member Functions

void save (KConfig *config, QString baseGroup, Filter::List &list)
 Saves a list of filters to the config file.

Filter::List restore (KConfig *config, QString baseGroup)
 Restores a list of filters from a config file.


Detailed Description

Filter for AddressBook related objects (Addressees).

:

Definition at line 39 of file filter.h.


Member Function Documentation

void Filter::setName const QString name  )  [inline]
 

Set the name of the filter.

Definition at line 55 of file filter.h.

const QString& Filter::name  )  const [inline]
 

Returns:
The name of the filter.

Definition at line 59 of file filter.h.

Referenced by ViewManager::modifyView(), ViewManager::setActiveView(), and ViewManager::writeConfig().

void Filter::apply KABC::Addressee::List &  addresseeList  ) 
 

Apply the filter to the addressee list.

All addressees not passing the filter criterias will be removed from the list.

If the MatchRule is NotMatch, then all the addressees matching the filter will be removed from the list.

Definition at line 65 of file filter.cpp.

References filterAddressee().

bool Filter::filterAddressee const KABC::Addressee &  a  ) 
 

Apply the filter to the addressee.

Returns:
True if the addressee passes the criteria, false otherwise. The return values are opposite if the MatchRule is NotMatch.

Definition at line 77 of file filter.cpp.

Referenced by KAddressBookView::addressees(), and apply().

void Filter::setEnabled bool  on  )  [inline]
 

Enable or disable the filter.

Definition at line 78 of file filter.h.

bool Filter::isEnabled  )  const [inline]
 

Returns:
True if this filter is enabled, false otherwise.

Definition at line 82 of file filter.h.

void Filter::setCategories const QStringList list  )  [inline]
 

Set the list of categories.

This list is used to filter addressees.

Definition at line 86 of file filter.h.

const QStringList& Filter::categories  )  const [inline]
 

Returns:
The list of categories.

Definition at line 90 of file filter.h.

void Filter::save KConfig *  config  ) 
 

Saves the filter to the config file.

The group should already be set.

Definition at line 94 of file filter.cpp.

Referenced by ViewManager::modifyView(), and ViewManager::writeConfig().

void Filter::restore KConfig *  config  ) 
 

Loads the filter from the config file.

The group should already be set

Definition at line 102 of file filter.cpp.

Referenced by ViewManager::readConfig(), and restore().

void Filter::save KConfig *  config,
QString  baseGroup,
Filter::List list
[static]
 

Saves a list of filters to the config file.

Parameters:
config The config file to use
baseGroup The base groupname to use. The number of filters will be written to this group, then a _1, _2, etc will be append for each filter saved.
list The list of filters to be saved.

Definition at line 110 of file filter.cpp.

References QValueList::begin(), QValueList::count(), and QValueList::end().

Filter::List Filter::restore KConfig *  config,
QString  baseGroup
[static]
 

Restores a list of filters from a config file.

Parameters:
config The config file to read from.
baseGroup The base group name to be used to find the filters
Returns:
The list of filters.

Definition at line 136 of file filter.cpp.

References QValueList::append(), and restore().

void Filter::setMatchRule MatchRule  rule  )  [inline]
 

Sets the filter rule.

If the rule is Filter::Matching (default), then the filter will return true on items that match the filter. If the rule is Filter::NotMatching, then the filter will return true on items that do not match the filter.

Definition at line 126 of file filter.h.

MatchRule Filter::matchRule  )  const [inline]
 

Returns:
The current match rule

Definition at line 130 of file filter.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:10 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001