KCal Library
Go to the documentation of this file.
47 class KCal::CalFilter::Private
52 mCompletedTimeSpan( 0 ),
56 QStringList mCategoryList;
57 QStringList mEmailList;
59 int mCompletedTimeSpan;
82 return d->mName == filter.d->mName &&
83 d->mCriteria == filter.d->mCriteria &&
84 d->mCategoryList == filter.d->mCategoryList &&
85 d->mEmailList == filter.d->mEmailList &&
86 d->mCompletedTimeSpan == filter.d->mCompletedTimeSpan;
95 Event::List::Iterator it = eventList->begin();
96 while ( it != eventList->end() ) {
98 it = eventList->erase( it );
108 if ( !d->mEnabled ) {
112 Todo::List::Iterator it = todoList->begin();
113 while ( it != todoList->end() ) {
115 it = todoList->erase( it );
124 if ( !d->mEnabled ) {
128 Journal::List::Iterator it = journalList->begin();
129 while ( it != journalList->end() ) {
131 it = journalList->erase( it );
140 if ( !d->mEnabled ) {
144 Todo *todo =
dynamic_cast<Todo *
>( incidence );
148 if ( todo->
completed().addDays( d->mCompletedTimeSpan ) <
149 KDateTime::currentUtcDateTime() ) {
156 KDateTime::currentUtcDateTime() < todo->
dtStart() ) ||
162 bool iAmOneOfTheAttendees =
false;
165 Attendee::List::ConstIterator it;
166 for ( it = attendees.begin(); it != attendees.end(); ++it ) {
167 if ( d->mEmailList.contains( (*it)->email() ) ) {
168 iAmOneOfTheAttendees =
true;
174 iAmOneOfTheAttendees =
true;
176 if ( !iAmOneOfTheAttendees ) {
183 if ( incidence->
recurs() ) {
189 for ( QStringList::ConstIterator it = d->mCategoryList.constBegin();
190 it != d->mCategoryList.constEnd(); ++it ) {
191 QStringList incidenceCategories = incidence->
categories();
192 for ( QStringList::ConstIterator it2 = incidenceCategories.constBegin();
193 it2 != incidenceCategories.constEnd(); ++it2 ) {
194 if ( (*it) == (*it2) ) {
201 for ( QStringList::ConstIterator it = d->mCategoryList.constBegin();
202 it != d->mCategoryList.constEnd(); ++it ) {
203 QStringList incidenceCategories = incidence->
categories();
204 for ( QStringList::ConstIterator it2 = incidenceCategories.constBegin();
205 it2 != incidenceCategories.constEnd(); ++it2 ) {
206 if ( (*it) == (*it2) ) {
229 d->mEnabled = enabled;
254 return d->mCategoryList;
264 return d->mEmailList;
269 d->mCompletedTimeSpan = timespan;
274 return d->mCompletedTimeSpan;
QStringList emailList() const
Returns the email list for this filter.
void setEmailList(const QStringList &emailList)
Sets the list of email addresses to be considered when filtering incidences according ot the HideNoMa...
void setCompletedTimeSpan(int timespan)
Sets the number of days for the HideCompletedTodos criteria.
int completedTimeSpan() const
Returns the completed time span for this filter.
@ HideCompletedTodos
Remove completed to-dos.
int criteria() const
Returns the inclusive filter criteria.
bool filterIncidence(Incidence *incidence) const
Applies the filter criteria to the specified Incidence.
KDateTime completed() const
Returns date and time when todo was completed.
virtual KDateTime dtStart() const
QStringList categories() const
Returns the incidence categories as a list of strings.
Provides a filter for calendars.
QString name() const
Returns the filter name.
bool isCompleted() const
Returns true if the todo is 100% completed, otherwise return false.
@ HideRecurring
Remove incidences that recur.
CalFilter()
Constructs an empty filter – a filter without a name or criteria.
Provides a To-do in the sense of RFC2445.
@ ShowCategories
Show incidences with at least one matching category.
bool operator==(const CalFilter &filter)
Compares this with filter for equality.
QStringList categoryList() const
Returns the category list for this filter.
@ HideInactiveTodos
Remove to-dos that haven't started yet.
void setCriteria(int criteria)
Sets the criteria which must be fulfilled for an Incidence to pass the filter.
This class provides a template for lists of pointers.
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
const Attendee::List & attendees() const
Returns a list of incidence attendees.
void apply(Event::List *eventList) const
Applies the filter to a list of Events.
~CalFilter()
Destroys this filter.
void setName(const QString &name)
Sets the filter name.
void setEnabled(bool enabled)
Enables or disables the filter.
bool hasStartDate() const
Returns true if the todo has a start date, otherwise return false.
@ HideNoMatchingAttendeeTodos
Remove to-dos without a matching attendee.
bool isEnabled() const
Returns whether the filter is enabled or not.
void setCategoryList(const QStringList &categoryList)
Sets the list of categories to be considered when filtering incidences according to the ShowCategorie...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jan 29 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.