summaryrefslogtreecommitdiffabout
path: root/libkcal/calfilter.h
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /libkcal/calfilter.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'libkcal/calfilter.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calfilter.h128
1 files changed, 128 insertions, 0 deletions
diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h
new file mode 100644
index 0000000..d6d4717
--- a/dev/null
+++ b/libkcal/calfilter.h
@@ -0,0 +1,128 @@
1/*
2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#ifndef _CALFILTER_H
22#define _CALFILTER_H
23
24#include <qstring.h>
25#include <qptrlist.h>
26
27#include "event.h"
28#include "todo.h"
29
30namespace KCal {
31
32/**
33 Filter for calendar objects.
34*/
35class CalFilter {
36 public:
37 /** Construct filter. */
38 CalFilter();
39 /** Construct filter with name */
40 CalFilter(const QString &name);
41 /** Destruct filter. */
42 ~CalFilter();
43
44 /**
45 Set name of filter.
46 */
47 void setName(const QString &name) { mName = name; }
48 /**
49 Return name of filter.
50 */
51 QString name() const { return mName; }
52
53 /**
54 Apply filter to eventlist, all events not matching filter criterias are
55 removed from the list.
56 */
57 void apply(QPtrList<Event> *eventlist);
58
59 /**
60 Apply filter to todolist, all todos not matching filter criterias are
61 removed from the list.
62 */
63 void apply(QPtrList<Todo> *todolist);
64
65 /**
66 Apply filter criteria on the specified event. Return true, if event passes
67 criteria, otherwise return false.
68 */
69 bool filterEvent(Event *);
70
71 /**
72 Apply filter criteria on the specified todo. Return true, if event passes
73 criteria, otherwise return false.
74 */
75 bool filterTodo(Todo *);
76
77 /**
78 Apply filter criteria on the specified incidence. Return true, if event passes
79 criteria, otherwise return false.
80 */
81 bool filterIncidence(Incidence *);
82
83 /**
84 Enable or disable filter.
85 */
86 void setEnabled(bool);
87 /**
88 Return wheter the filter is enabled or not.
89 */
90 bool isEnabled();
91 bool showCategories();
92 int getSecrecy();
93 /**
94 Set list of categories, which is used for showing/hiding categories of
95 events.
96 See related functions.
97 */
98 void setCategoryList(const QStringList &);
99 /**
100 Return category list, used for showing/hiding categories of events.
101 See related functions.
102 */
103 QStringList categoryList();
104
105 enum { HideRecurring = 1, HideCompleted = 2, ShowCategories = 4 ,ShowPublic = 8, ShowPrivate = 16, ShowConfidential = 32 };
106
107 /**
108 Set criteria, which have to be fulfilled by events passing the filter.
109 */
110 void setCriteria(int);
111 /**
112 Get inclusive filter criteria.
113 */
114 int criteria();
115
116 private:
117 QString mName;
118
119 int mCriteria;
120
121 bool mEnabled;
122
123 QStringList mCategoryList;
124};
125
126}
127
128#endif /* _CALFILTER_H */