summaryrefslogtreecommitdiff
path: root/libopie/todoevent.h
authorzecke <zecke>2002-04-23 12:04:28 (UTC)
committer zecke <zecke>2002-04-23 12:04:28 (UTC)
commit367304a610dd618ad45ddce8256ba4d7d8ded442 (patch) (unidiff)
treec73838ac2bb496f6233ac6b793d5b17c867efbdb /libopie/todoevent.h
parent3197bbef89e9001929d826a8cbe39d675bcf7917 (diff)
downloadopie-367304a610dd618ad45ddce8256ba4d7d8ded442.zip
opie-367304a610dd618ad45ddce8256ba4d7d8ded442.tar.gz
opie-367304a610dd618ad45ddce8256ba4d7d8ded442.tar.bz2
ToDoEvent::richText() added
this patch came from Stefan Eilers is that the right place for it or does it belong into the todo app itself?
Diffstat (limited to 'libopie/todoevent.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libopie/todoevent.h b/libopie/todoevent.h
index 0d477fd..40d8f0b 100644
--- a/libopie/todoevent.h
+++ b/libopie/todoevent.h
@@ -1,56 +1,83 @@
1 1
2#ifndef todoevent_h 2#ifndef todoevent_h
3#define todoevent_h 3#define todoevent_h
4 4
5#include <qstringlist.h> 5#include <qstringlist.h>
6#include <qdatetime.h> 6#include <qdatetime.h>
7 7
8class ToDoEvent { 8class ToDoEvent {
9 friend class ToDoDB; 9 friend class ToDoDB;
10 public: 10 public:
11 // priorities from Very low to very high
11 enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW }; 12 enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW };
13 /* Constructs a new ToDoEvent
14 @param completed Is the TodoEvent completed
15 @param priority What is the priority of this ToDoEvent
16 @param category Which category does it belong( uid )
17 @param description What is this ToDoEvent about
18 @param hasDate Does this Event got a deadline
19 @param date what is the deadline?
20 @param uid what is the UUID of this Event
21 **/
12 ToDoEvent( bool completed = false, int priority = NORMAL, 22 ToDoEvent( bool completed = false, int priority = NORMAL,
13 const QStringList &category = QStringList(), 23 const QStringList &category = QStringList(),
14 const QString &description = QString::null , 24 const QString &description = QString::null ,
15 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 ); 25 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 );
26 /* Copy c'tor
27
28 **/
16 ToDoEvent(const ToDoEvent & ); 29 ToDoEvent(const ToDoEvent & );
30
31 /*
32 Is this event completed?
33 **/
17 bool isCompleted() const; 34 bool isCompleted() const;
35
36 /*
37 Does this Event have a deadline
38 **/
18 bool hasDate() const; 39 bool hasDate() const;
40
41 /*
42 What is the priority?
43 **/
19 int priority()const ; 44 int priority()const ;
20 QStringList allCategories()const; 45 QStringList allCategories()const;
21 QArray<int> categories() const; 46 QArray<int> categories() const;
22 QDate date()const; 47 QDate date()const;
23 QString description()const; 48 QString description()const;
24 49
50 QString richText() const;
51
25 int uid()const { return m_uid;}; 52 int uid()const { return m_uid;};
26 void setCompleted(bool completed ); 53 void setCompleted(bool completed );
27 void setHasDate( bool hasDate ); 54 void setHasDate( bool hasDate );
28 // if the category doesn't exist we will create it 55 // if the category doesn't exist we will create it
29 // this sets the the Category after this call category will be the only category 56 // this sets the the Category after this call category will be the only category
30 void setCategory( const QString &category ); 57 void setCategory( const QString &category );
31 // adds a category to the Categories of this event 58 // adds a category to the Categories of this event
32 void insertCategory(const QString &category ); 59 void insertCategory(const QString &category );
33 void clearCategories(); 60 void clearCategories();
34 void setCategories(const QStringList& ); 61 void setCategories(const QStringList& );
35 62
36 void setPriority(int priority ); 63 void setPriority(int priority );
37 void setDate( QDate date ); 64 void setDate( QDate date );
38 void setDescription(const QString& ); 65 void setDescription(const QString& );
39 bool isOverdue(); 66 bool isOverdue();
40 67
41 bool match( const QRegExp &r )const; 68 bool match( const QRegExp &r )const;
42 69
43 void setUid(int id) {m_uid = id; }; 70 void setUid(int id) {m_uid = id; };
44 bool operator<(const ToDoEvent &toDoEvent )const; 71 bool operator<(const ToDoEvent &toDoEvent )const;
45 bool operator<=(const ToDoEvent &toDoEvent )const; 72 bool operator<=(const ToDoEvent &toDoEvent )const;
46 bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); }; 73 bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); };
47 bool operator>(const ToDoEvent &toDoEvent )const; 74 bool operator>(const ToDoEvent &toDoEvent )const;
48 bool operator>=(const ToDoEvent &toDoEvent)const; 75 bool operator>=(const ToDoEvent &toDoEvent)const;
49 bool operator==(const ToDoEvent &toDoEvent )const; 76 bool operator==(const ToDoEvent &toDoEvent )const;
50 ToDoEvent &operator=(const ToDoEvent &toDoEvent ); 77 ToDoEvent &operator=(const ToDoEvent &toDoEvent );
51 private: 78 private:
52 class ToDoEventPrivate; 79 class ToDoEventPrivate;
53 ToDoEventPrivate *d; 80 ToDoEventPrivate *d;
54 QDate m_date; 81 QDate m_date;
55 bool m_isCompleted:1; 82 bool m_isCompleted:1;
56 bool m_hasDate:1; 83 bool m_hasDate:1;