summaryrefslogtreecommitdiff
path: root/libopie/todoevent.h
Unidiff
Diffstat (limited to 'libopie/todoevent.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.h67
1 files changed, 63 insertions, 4 deletions
diff --git a/libopie/todoevent.h b/libopie/todoevent.h
index 8a00f99..7454241 100644
--- a/libopie/todoevent.h
+++ b/libopie/todoevent.h
@@ -2,6 +2,7 @@
2#ifndef todoevent_h 2#ifndef todoevent_h
3#define todoevent_h 3#define todoevent_h
4 4
5#include <qmap.h>
5#include <qregexp.h> 6#include <qregexp.h>
6#include <qstringlist.h> 7#include <qstringlist.h>
7#include <qdatetime.h> 8#include <qdatetime.h>
@@ -15,14 +16,16 @@ class ToDoEvent {
15 @param completed Is the TodoEvent completed 16 @param completed Is the TodoEvent completed
16 @param priority What is the priority of this ToDoEvent 17 @param priority What is the priority of this ToDoEvent
17 @param category Which category does it belong( uid ) 18 @param category Which category does it belong( uid )
19 @param summary A small summary of the todo
18 @param description What is this ToDoEvent about 20 @param description What is this ToDoEvent about
19 @param hasDate Does this Event got a deadline 21 @param hasDate Does this Event got a deadline
20 @param date what is the deadline? 22 @param date what is the deadline?
21 @param uid what is the UUID of this Event 23 @param uid what is the UUID of this Event
22 **/ 24 **/
23 ToDoEvent( bool completed = false, int priority = NORMAL, 25 ToDoEvent( bool completed = false, int priority = NORMAL,
24 const QStringList &category = QStringList(), 26 const QStringList &category = QStringList(),
25 const QString &description = QString::null , 27 const QString &summary = QString::null ,
28 const QString &description = QString::null,
26 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 ); 29 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 );
27 /* Copy c'tor 30 /* Copy c'tor
28 31
@@ -43,27 +46,81 @@ class ToDoEvent {
43 What is the priority? 46 What is the priority?
44 **/ 47 **/
45 int priority()const ; 48 int priority()const ;
49
50 /*
51 All category numbers as QString in a List
52 **/
46 QStringList allCategories()const; 53 QStringList allCategories()const;
54
55 /*
56 * Same as above but with QArray<int>
57 */
47 QArray<int> categories() const; 58 QArray<int> categories() const;
59
60 /**
61 * The end Date
62 */
48 QDate date()const; 63 QDate date()const;
64
65 /**
66 * The description of the todo
67 */
49 QString description()const; 68 QString description()const;
50 69
70 /**
71 * A small summary of the todo
72 */
73 QString summary() const;
74
75 /**
76 * Return this todoevent in a RichText formatted QString
77 */
51 QString richText() const; 78 QString richText() const;
52 79
80 /**
81 * Returns the UID of the Todo
82 */
53 int uid()const { return m_uid;}; 83 int uid()const { return m_uid;};
84
85
86 QString extra(const QString& )const;
87 /**
88 * Set if this Todo is completed
89 */
54 void setCompleted(bool completed ); 90 void setCompleted(bool completed );
91
92 /**
93 * set if this todo got an end data
94 */
55 void setHasDate( bool hasDate ); 95 void setHasDate( bool hasDate );
56 // if the category doesn't exist we will create it 96 // if the category doesn't exist we will create it
57 // this sets the the Category after this call category will be the only category 97 // this sets the the Category after this call category will be the only category
58 void setCategory( const QString &category ); 98 void setCategory( const QString &category );
59 // adds a category to the Categories of this event 99 // adds a category to the Categories of this event
60 void insertCategory(const QString &category ); 100 void insertCategory(const QString &category );
101
102 /**
103 * Removes this event from all categories
104 */
61 void clearCategories(); 105 void clearCategories();
106
107 /**
108 * This todo belongs to xxx categories
109 */
62 void setCategories(const QStringList& ); 110 void setCategories(const QStringList& );
63 111
112 /**
113 * Set the priority of the Todo
114 */
64 void setPriority(int priority ); 115 void setPriority(int priority );
116
117 /**
118 * set the end date
119 */
65 void setDate( QDate date ); 120 void setDate( QDate date );
66 void setDescription(const QString& ); 121 void setDescription(const QString& );
122 void setSummary(const QString& );
123 void setExtra( const QString&, const QString& );
67 bool isOverdue(); 124 bool isOverdue();
68 125
69 bool match( const QRegExp &r )const; 126 bool match( const QRegExp &r )const;
@@ -85,6 +142,8 @@ class ToDoEvent {
85 int m_priority; 142 int m_priority;
86 QStringList m_category; 143 QStringList m_category;
87 QString m_desc; 144 QString m_desc;
145 QString m_sum;
146 QMap<QString, QString> m_extra;
88 int m_uid; 147 int m_uid;
89}; 148};
90 149