calfilter.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the kcalcore library. 00003 00004 Copyright (c) 2001,2003,2004 Cornelius Schumacher <schumacher@kde.org> 00005 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public License 00018 along with this library; see the file COPYING.LIB. If not, write to 00019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. 00021 */ 00031 #ifndef KCALCORE_CALFILTER_H 00032 #define KCALCORE_CALFILTER_H 00033 00034 #include "kcalcore_export.h" 00035 #include "event.h" 00036 #include "journal.h" 00037 #include "todo.h" 00038 00039 namespace KCalCore { 00040 00055 class KCALCORE_EXPORT CalFilter 00056 { 00057 public: 00061 enum Criteria { 00062 HideRecurring = 1, 00063 HideCompletedTodos = 2, 00064 ShowCategories = 4, 00065 HideInactiveTodos = 8, 00066 HideNoMatchingAttendeeTodos = 16 00067 }; 00068 00072 CalFilter(); 00073 00079 explicit CalFilter( const QString &name ); 00080 00084 ~CalFilter(); 00085 00092 void setName( const QString &name ); 00093 00098 QString name() const; 00099 00107 void setCriteria( int criteria ); 00108 00113 int criteria() const; 00114 00121 void apply( Event::List *eventList ) const; 00122 00129 void apply( Todo::List *todoList ) const; 00130 00137 void apply( Journal::List *journalList ) const; 00138 00145 bool filterIncidence( Incidence::Ptr incidence ) const; 00146 00153 void setEnabled( bool enabled ); 00154 00159 bool isEnabled() const; 00160 00168 void setCategoryList( const QStringList &categoryList ); 00169 00174 QStringList categoryList() const; 00175 00183 void setEmailList( const QStringList &emailList ); 00184 00189 QStringList emailList() const; 00190 00201 void setCompletedTimeSpan( int timespan ); 00202 00207 int completedTimeSpan() const; 00208 00214 bool operator==( const CalFilter &filter ) const; 00215 00216 private: 00217 //@cond PRIVATE 00218 Q_DISABLE_COPY( CalFilter ) 00219 class Private; 00220 Private *const d; 00221 //@endcond 00222 }; 00223 00224 } 00225 00226 #endif