Search for usage in LXR

KCalendarCore::CalFilter Class Reference

#include <calfilter.h>

Public Types

enum  Criteria {
  HideRecurring = 1, HideCompletedTodos = 2, ShowCategories = 4, HideInactiveTodos = 8,
  HideNoMatchingAttendeeTodos = 16

Public Member Functions

 CalFilter ()
 CalFilter (const QString &name)
 ~CalFilter ()
void apply (Event::List *eventList) const
void apply (Journal::List *journalList) const
void apply (Todo::List *todoList) const
QStringList categoryList () const
int completedTimeSpan () const
int criteria () const
QStringList emailList () const
bool filterIncidence (const Incidence::Ptr &incidence) const
bool isEnabled () const
QString name () const
bool operator== (const CalFilter &filter) const
void setCategoryList (const QStringList &categoryList)
void setCompletedTimeSpan (int timespan)
void setCriteria (int criteria)
void setEmailList (const QStringList &emailList)
void setEnabled (bool enabled)
void setName (const QString &name)

Detailed Description

Provides a filter for calendars.

This class provides a means for filtering calendar incidences by a list of email addresses, a list of categories, or other Criteria.

The following Criteria are available:

Definition at line 42 of file calfilter.h.

Member Enumeration Documentation

◆ Criteria

Filtering Criteria.


Remove incidences that recur.


Remove completed to-dos.


Show incidences with at least one matching category.


Remove to-dos that haven't started yet.


Remove to-dos without a matching attendee.

Definition at line 48 of file calfilter.h.

Constructor & Destructor Documentation

◆ CalFilter() [1/2]

CalFilter::CalFilter ( )

Constructs an empty filter – a filter without a name or criteria.

Private class that helps to provide binary compatibility between releases.

Definition at line 47 of file calfilter.cpp.

◆ CalFilter() [2/2]

CalFilter::CalFilter ( const QString name)

Constructs a filter with name.

nameis the name of this filter.

Definition at line 52 of file calfilter.cpp.

◆ ~CalFilter()

CalFilter::~CalFilter ( )

Destroys this filter.

Definition at line 58 of file calfilter.cpp.

Member Function Documentation

◆ apply() [1/3]

void CalFilter::apply ( Event::List eventList) const

Applies the filter to a list of Events.

All events not matching the filter criteria are removed from the list.

eventListis a list of Events to filter.

Definition at line 69 of file calfilter.cpp.

◆ apply() [2/3]

void KCalendarCore::CalFilter::apply ( Journal::List journalList) const

Applies the filter to a list of Journals.

All journals not matching the filter criteria are removed from the list.

journalListis a list of Journals to filter.

◆ apply() [3/3]

void KCalendarCore::CalFilter::apply ( Todo::List todoList) const

Applies the filter to a list of To-dos.

All to-dos not matching the filter criteria are removed from the list.

todoListis a list of To-dos to filter.

◆ categoryList()

QStringList CalFilter::categoryList ( ) const

Returns the category list for this filter.

See also

Definition at line 195 of file calfilter.cpp.

◆ completedTimeSpan()

int CalFilter::completedTimeSpan ( ) const

Returns the completed time span for this filter.

See also

Definition at line 215 of file calfilter.cpp.

◆ criteria()

int CalFilter::criteria ( ) const

Returns the inclusive filter criteria.

See also

Definition at line 185 of file calfilter.cpp.

◆ emailList()

QStringList CalFilter::emailList ( ) const

Returns the email list for this filter.

See also

Definition at line 205 of file calfilter.cpp.

◆ filterIncidence()

bool CalFilter::filterIncidence ( const Incidence::Ptr incidence) const

Applies the filter criteria to the specified Incidence.

incidenceis the Incidence to filter.
true if the Incidence passes the criteria; false otherwise.

Definition at line 106 of file calfilter.cpp.

◆ isEnabled()

bool CalFilter::isEnabled ( ) const

Returns whether the filter is enabled or not.

See also

Definition at line 175 of file calfilter.cpp.

◆ name()

QString CalFilter::name ( ) const

Returns the filter name.

See also

Definition at line 165 of file calfilter.cpp.

◆ operator==()

bool KCalendarCore::CalFilter::operator== ( const CalFilter filter) const

Compares this with filter for equality.

filterthe CalFilter to compare.

Definition at line 63 of file calfilter.cpp.

◆ setCategoryList()

void CalFilter::setCategoryList ( const QStringList categoryList)

Sets the list of categories to be considered when filtering incidences according to the ShowCategories criteria.

categoryListis a QStringList of categories.
See also

Definition at line 190 of file calfilter.cpp.

◆ setCompletedTimeSpan()

void CalFilter::setCompletedTimeSpan ( int  timespan)

Sets the number of days for the HideCompletedTodos criteria.

If a to-do has been completed within the recent timespan days, then that to-do will be removed during filtering. If a time span is not specified in the filter, then all completed to-dos will be removed if the HideCompletedTodos criteria is set.

timespanis an integer representing a time span in days.
See also

Definition at line 210 of file calfilter.cpp.

◆ setCriteria()

void CalFilter::setCriteria ( int  criteria)

Sets the criteria which must be fulfilled for an Incidence to pass the filter.

criteriais a combination of Criteria.
See also

Definition at line 180 of file calfilter.cpp.

◆ setEmailList()

void CalFilter::setEmailList ( const QStringList emailList)

Sets the list of email addresses to be considered when filtering incidences according to the HideNoMatchingAttendeeTodos criteria.

emailListis a QStringList of email addresses.
See also

Definition at line 200 of file calfilter.cpp.

◆ setEnabled()

void CalFilter::setEnabled ( bool  enabled)

Enables or disables the filter.

enabledis true if the filter is to be enabled; false otherwise.
See also

Definition at line 170 of file calfilter.cpp.

◆ setName()

void CalFilter::setName ( const QString name)

Sets the filter name.

nameis the name of this filter.
See also

Definition at line 160 of file calfilter.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 03:57:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.