summaryrefslogtreecommitdiff
path: root/libopie/todoevent.h
authorzecke <zecke>2003-02-21 16:52:49 (UTC)
committer zecke <zecke>2003-02-21 16:52:49 (UTC)
commit0bb9d0f9e7da80f0ae3b91d4ebbb7aab4d2b9df7 (patch) (unidiff)
treef3ce9c9441a1073762f3e0c61cc85f0d5a1fd81d /libopie/todoevent.h
parenta298235aa1489937e7657079e6352adfc8746acf (diff)
downloadopie-0bb9d0f9e7da80f0ae3b91d4ebbb7aab4d2b9df7.zip
opie-0bb9d0f9e7da80f0ae3b91d4ebbb7aab4d2b9df7.tar.gz
opie-0bb9d0f9e7da80f0ae3b91d4ebbb7aab4d2b9df7.tar.bz2
-Remove old Todo classes they're deprecated and today I already using the
new API -Guard against self assignment in OTodo -Add test apps for OPIM -Opiefied Event classes -Added TimeZone handling and pinning of TimeZones to OEvent -Adjust ORecur and the widget to better timezone behaviour
Diffstat (limited to 'libopie/todoevent.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.h191
1 files changed, 0 insertions, 191 deletions
diff --git a/libopie/todoevent.h b/libopie/todoevent.h
deleted file mode 100644
index b55a39b..0000000
--- a/libopie/todoevent.h
+++ b/dev/null
@@ -1,191 +0,0 @@
1
2#ifndef todoevent_h
3#define todoevent_h
4
5
6#include <qarray.h>
7#include <qmap.h>
8#include <qregexp.h>
9#include <qstringlist.h>
10#include <qdatetime.h>
11
12
13class ToDoEvent {
14 friend class ToDoDB;
15 public:
16 // priorities from Very low to very high
17 enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW };
18 /* Constructs a new ToDoEvent
19 @param completed Is the TodoEvent completed
20 @param priority What is the priority of this ToDoEvent
21 @param category Which category does it belong( uid )
22 @param summary A small summary of the todo
23 @param description What is this ToDoEvent about
24 @param hasDate Does this Event got a deadline
25 @param date what is the deadline?
26 @param uid what is the UUID of this Event
27 **/
28 ToDoEvent( bool completed = false, int priority = NORMAL,
29 const QStringList &category = QStringList(),
30 const QString &summary = QString::null ,
31 const QString &description = QString::null,
32 ushort progress = 0,
33 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 );
34 /* Copy c'tor
35
36 **/
37 ToDoEvent(const ToDoEvent & );
38
39 /*
40 Is this event completed?
41 **/
42 bool isCompleted() const;
43
44 /*
45 Does this Event have a deadline
46 **/
47 bool hasDate() const;
48
49 /*
50 What is the priority?
51 **/
52 int priority()const ;
53
54 /**
55 * progress as ushort 0, 20, 40, 60, 80 or 100%
56 */
57 ushort progress() const;
58 /*
59 All category numbers as QString in a List
60 **/
61 QStringList allCategories()const;
62
63 /*
64 * Same as above but with QArray<int>
65 */
66 QArray<int> categories() const;
67
68 /**
69 * The end Date
70 */
71 QDate date()const;
72
73 /**
74 * The description of the todo
75 */
76 QString description()const;
77
78 /**
79 * A small summary of the todo
80 */
81 QString summary() const;
82
83 /**
84 * Return this todoevent in a RichText formatted QString
85 */
86 QString richText() const;
87
88 /**
89 * Returns the UID of the Todo
90 */
91 int uid()const { return m_uid;};
92
93
94 QString extra(const QString& )const;
95
96 /**
97 * returns a list of apps which have related items
98 */
99 QStringList relatedApps()const;
100
101 /**
102 * returns all relations for one app
103 */
104 QArray<int> relations( const QString& app )const;
105 /**
106 * Set if this Todo is completed
107 */
108 void setCompleted(bool completed );
109
110 /**
111 * set if this todo got an end data
112 */
113 void setHasDate( bool hasDate );
114 // if the category doesn't exist we will create it
115 // this sets the the Category after this call category will be the only category
116 void setCategory( const QString &category );
117 // adds a category to the Categories of this event
118 void insertCategory(const QString &category );
119
120 /**
121 * Removes this event from all categories
122 */
123 void clearCategories();
124
125 /**
126 * This todo belongs to xxx categories
127 */
128 void setCategories(const QStringList& );
129
130 /**
131 * Set the priority of the Todo
132 */
133 void setPriority(int priority );
134
135 /**
136 * Set the progress.
137 */
138 void setProgress( ushort progress );
139
140 /**
141 * add related function it replaces too ;)
142 */
143 void addRelated( const QString& app, int id );
144
145 /**
146 * add related
147 */
148 void addRelated( const QString& app, QArray<int> ids );
149
150 /**
151 * clear relations for one app
152 */
153 void clearRelated(const QString& app);
154
155 /**
156 * set the end date
157 */
158 void setDate( QDate date );
159 void setDescription(const QString& );
160 void setSummary(const QString& );
161 void setExtra( const QString&, const QString& );
162 bool isOverdue();
163
164 bool match( const QRegExp &r )const;
165
166 void setUid(int id) {m_uid = id; };
167 bool operator<(const ToDoEvent &toDoEvent )const;
168 bool operator<=(const ToDoEvent &toDoEvent )const;
169 bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); };
170 bool operator>(const ToDoEvent &toDoEvent )const;
171 bool operator>=(const ToDoEvent &toDoEvent)const;
172 bool operator==(const ToDoEvent &toDoEvent )const;
173 ToDoEvent &operator=(const ToDoEvent &toDoEvent );
174 private:
175 class ToDoEventPrivate;
176 ToDoEventPrivate *d;
177 QDate m_date;
178 bool m_isCompleted:1;
179 bool m_hasDate:1;
180 int m_priority;
181 QStringList m_category;
182 QString m_desc;
183 QString m_sum;
184 QMap<QString, QString> m_extra;
185 QMap<QString, QArray<int> > m_relations;
186 int m_uid;
187 ushort m_prog;
188};
189
190
191#endif