KCalCore Library
Go to the documentation of this file.
45 class KCalCore::CalFilter::Private
50 mCompletedTimeSpan(0),
54 QStringList mCategoryList;
55 QStringList mEmailList;
57 int mCompletedTimeSpan;
80 return d->mName == filter.d->mName &&
81 d->mCriteria == filter.d->mCriteria &&
82 d->mCategoryList == filter.d->mCategoryList &&
83 d->mEmailList == filter.d->mEmailList &&
84 d->mCompletedTimeSpan == filter.d->mCompletedTimeSpan;
93 Event::List::Iterator it = eventList->begin();
94 while (it != eventList->end()) {
96 it = eventList->erase(it);
110 Todo::List::Iterator it = todoList->begin();
111 while (it != todoList->end()) {
113 it = todoList->erase(it);
126 Journal::List::Iterator it = journalList->begin();
127 while (it != journalList->end()) {
129 it = journalList->erase(it);
146 if (todo->completed().addDays(d->mCompletedTimeSpan) <
147 KDateTime::currentUtcDateTime()) {
153 ((todo->hasStartDate() &&
154 KDateTime::currentUtcDateTime() < todo->dtStart()) ||
155 todo->isCompleted())) {
160 bool iAmOneOfTheAttendees =
false;
162 if (!todo->attendees().isEmpty()) {
163 Attendee::List::ConstIterator it;
164 for (it = attendees.begin(); it != attendees.end(); ++it) {
165 if (d->mEmailList.contains((*it)->email())) {
166 iAmOneOfTheAttendees =
true;
172 iAmOneOfTheAttendees =
true;
174 if (!iAmOneOfTheAttendees) {
181 if (incidence->recurs() || incidence->hasRecurrenceId()) {
187 for (QStringList::ConstIterator it = d->mCategoryList.constBegin();
188 it != d->mCategoryList.constEnd(); ++it) {
189 QStringList incidenceCategories = incidence->categories();
190 for (QStringList::ConstIterator it2 = incidenceCategories.constBegin();
191 it2 != incidenceCategories.constEnd(); ++it2) {
192 if ((*it) == (*it2)) {
199 for (QStringList::ConstIterator it = d->mCategoryList.constBegin();
200 it != d->mCategoryList.constEnd(); ++it) {
201 QStringList incidenceCategories = incidence->categories();
202 for (QStringList::ConstIterator it2 = incidenceCategories.constBegin();
203 it2 != incidenceCategories.constEnd(); ++it2) {
204 if ((*it) == (*it2)) {
227 d->mEnabled = enabled;
252 return d->mCategoryList;
262 return d->mEmailList;
267 d->mCompletedTimeSpan = timespan;
272 return d->mCompletedTimeSpan;
QVector< Ptr > List
List of journals.
@ HideInactiveTodos
Remove to-dos that haven't started yet.
QVector< Ptr > List
List of to-dos.
QString name() const
Returns the filter name.
bool operator==(const CalFilter &filter) const
Compares this with filter for equality.
Provides a To-do in the sense of RFC2445.
@ HideCompletedTodos
Remove completed to-dos.
@ HideNoMatchingAttendeeTodos
Remove to-dos without a matching attendee.
QSharedPointer< Incidence > Ptr
A shared pointer to an Incidence.
QStringList emailList() const
Returns the email list for this filter.
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
~CalFilter()
Destroys this filter.
@ ShowCategories
Show incidences with at least one matching category.
QStringList categoryList() const
Returns the category list for this filter.
void setCriteria(int criteria)
Sets the criteria which must be fulfilled for an Incidence to pass the filter.
void setEmailList(const QStringList &emailList)
Sets the list of email addresses to be considered when filtering incidences according ot the HideNoMa...
CalFilter()
Constructs an empty filter – a filter without a name or criteria.
QVector< Ptr > List
List of events.
int completedTimeSpan() const
Returns the completed time span for this filter.
@ HideRecurring
Remove incidences that recur.
Attendee::List attendees() const
Returns a list of incidence attendees.
void apply(Event::List *eventList) const
Applies the filter to a list of Events.
void setName(const QString &name)
Sets the filter name.
bool isEnabled() const
Returns whether the filter is enabled or not.
int criteria() const
Returns the inclusive filter criteria.
void setEnabled(bool enabled)
Enables or disables the filter.
void setCategoryList(const QStringList &categoryList)
Sets the list of categories to be considered when filtering incidences according to the ShowCategorie...
void setCompletedTimeSpan(int timespan)
Sets the number of days for the HideCompletedTodos criteria.
Provides a filter for calendars.
QVector< Ptr > List
List of attendees.
bool filterIncidence(Incidence::Ptr incidence) const
Applies the filter criteria to the specified Incidence.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 28 2020 00:00:00 by
doxygen 1.8.18 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.