• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kaddressbook

Filter Class Reference

#include <filter.h>

List of all members.


Detailed Description

Filter for AddressBook related objects (Addressees).

Todo:
This class should be switched to use shared data.

Definition at line 39 of file filter.h.


Public Types

typedef QList< Filter > List
enum  MatchRule { Matching = 0, NotMatching = 1 }

Public Member Functions

void apply (KABC::Addressee::List &addresseeList)
const QStringList & categories () const
 Filter (const QString &name)
 Filter ()
bool filterAddressee (const KABC::Addressee &a) const
bool isEmpty () const
bool isEnabled () const
bool isInternal () const
MatchRule matchRule () const
const QString & name () const
void restore (KConfigGroup &cfg)
void save (KConfigGroup &cfg)
void setCategories (const QStringList &list)
void setEnabled (bool on)
void setMatchRule (MatchRule rule)
void setName (const QString &name)
 ~Filter ()

Static Public Member Functions

static Filter::List restore (const KConfigBase *config, const QString &baseGroup)
static void save (KConfig *config, const QString &baseGroup, Filter::List &list)

Member Typedef Documentation

typedef QList<Filter> Filter::List

Definition at line 42 of file filter.h.


Member Enumeration Documentation

enum Filter::MatchRule

Enumerator:
Matching 
NotMatching 

Definition at line 44 of file filter.h.


Constructor & Destructor Documentation

Filter::Filter (  ) 

Definition at line 32 of file filter.cpp.

Filter::Filter ( const QString &  name  ) 

Definition at line 38 of file filter.cpp.

Filter::~Filter (  ) 

Definition at line 44 of file filter.cpp.


Member Function Documentation

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.

const QStringList & Filter::categories (  )  const

Returns:
The list of categories.

Definition at line 120 of file filter.cpp.

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

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 76 of file filter.cpp.

bool Filter::isEmpty (  )  const

Returns:
true if the category list is empty.

Definition at line 217 of file filter.cpp.

bool Filter::isEnabled (  )  const

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

Definition at line 108 of file filter.cpp.

bool Filter::isInternal (  )  const

Returns:
Whether the filter is an internal one.

Definition at line 60 of file filter.cpp.

Filter::MatchRule Filter::matchRule (  )  const

Returns:
The current match rule.

Definition at line 212 of file filter.cpp.

const QString & Filter::name (  )  const

Returns:
The name of the filter.

Definition at line 55 of file filter.cpp.

Filter::List Filter::restore ( const KConfigBase *  config,
const 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 170 of file filter.cpp.

void Filter::restore ( KConfigGroup &  cfg  ) 

Loads the filter from the config file.

Definition at line 133 of file filter.cpp.

void Filter::save ( KConfig *  config,
const 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 143 of file filter.cpp.

void Filter::save ( KConfigGroup &  cfg  ) 

Saves the filter to the config file.

Definition at line 125 of file filter.cpp.

void Filter::setCategories ( const QStringList &  list  ) 

Set the list of categories.

This list is used to filter addressees.

Definition at line 113 of file filter.cpp.

void Filter::setEnabled ( bool  on  ) 

Enable or disable the filter.

Definition at line 101 of file filter.cpp.

void Filter::setMatchRule ( MatchRule  rule  ) 

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 205 of file filter.cpp.

void Filter::setName ( const QString &  name  ) 

Set the name of the filter.

Definition at line 48 of file filter.cpp.


The documentation for this class was generated from the following files:
  • filter.h
  • filter.cpp

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal