summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimnotify.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimnotify.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimnotify.h67
1 files changed, 36 insertions, 31 deletions
diff --git a/libopie2/opiepim/core/opimnotify.h b/libopie2/opiepim/core/opimnotify.h
index fed3970..d0e40ca 100644
--- a/libopie2/opiepim/core/opimnotify.h
+++ b/libopie2/opiepim/core/opimnotify.h
@@ -23,20 +23,22 @@
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB. 24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29#ifndef OPIE_PIM_NOTIFY_H
30#define OPIE_PIM_NOTIFY_H
31 29
30#ifndef OPIMNOTIFY_H
31#define OPIMNOTIFY_H
32
33/* QT */
32#include <qdatetime.h> 34#include <qdatetime.h>
33#include <qvaluelist.h> 35#include <qvaluelist.h>
34 36
35 37namespace Opie
36namespace Opie { 38{
37/** 39/**
38 * This is the base class of Notifiers. Possible 40 * This is the base class of Notifiers. Possible
39 * notifiers would be Alarms, Reminders 41 * notifiers would be Alarms, Reminders
40 * What they share is that they have 42 * What they share is that they have
41 * A DateTime, Type, Duration 43 * A DateTime, Type, Duration
42 * This is what this base class takes care of 44 * This is what this base class takes care of
@@ -44,50 +46,52 @@ namespace Opie {
44 */ 46 */
45/* 47/*
46 * TALK to eilers: have a class OPimDuration which sets the Duration 48 * TALK to eilers: have a class OPimDuration which sets the Duration
47 * given on the Due/Start Date? -zecke 49 * given on the Due/Start Date? -zecke
48 * discuss: do we need a uid for the notify? -zecke 50 * discuss: do we need a uid for the notify? -zecke
49 */ 51 */
50class OPimNotify { 52class OPimNotify
51public: 53{
54
55 public:
52 typedef QValueList<OPimNotify> ValueList; 56 typedef QValueList<OPimNotify> ValueList;
53 OPimNotify( const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); 57 OPimNotify( const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 );
54 OPimNotify( const OPimNotify& ); 58 OPimNotify( const OPimNotify& );
55 virtual ~OPimNotify(); 59 virtual ~OPimNotify();
56 60
57 OPimNotify &operator=(const OPimNotify& ); 61 OPimNotify &operator=( const OPimNotify& );
58 bool operator==( const OPimNotify& ); 62 bool operator==( const OPimNotify& );
59 63
60 virtual QString type()const = 0; 64 virtual QString type() const = 0;
61 65
62 /** start date */ 66 /** start date */
63 QDateTime dateTime()const; 67 QDateTime dateTime() const;
64 QString service()const; 68 QString service() const;
65 69
66 /** 70 /**
67 * RETURN the parent uid 71 * RETURN the parent uid
68 */ 72 */
69 int parent()const; 73 int parent() const;
70 74
71 /** 75 /**
72 * in Seconds 76 * in Seconds
73 */ 77 */
74 int duration()const; 78 int duration() const;
75 79
76 /** 80 /**
77 * Start Time + Duration 81 * Start Time + Duration
78 */ 82 */
79 QDateTime endTime()const; 83 QDateTime endTime() const;
80 84
81 void setDateTime( const QDateTime& ); 85 void setDateTime( const QDateTime& );
82 void setDuration( int dur ); 86 void setDuration( int dur );
83 void setParent(int uid ); 87 void setParent( int uid );
84 void setService( const QString& ); 88 void setService( const QString& );
85 89
86 90
87private: 91 private:
88 inline void copyIntern(); 92 inline void copyIntern();
89 void deref(); 93 void deref();
90 struct Data; 94 struct Data;
91 Data* data; 95 Data* data;
92 96
93 /* d-pointer */ 97 /* d-pointer */
@@ -97,31 +101,32 @@ private:
97}; 101};
98/** 102/**
99 * An alarm is a sound/mail/buzzer played/send 103 * An alarm is a sound/mail/buzzer played/send
100 * at a given time to inform about 104 * at a given time to inform about
101 * an Event 105 * an Event
102 */ 106 */
103class OPimAlarm : public OPimNotify { 107class OPimAlarm : public OPimNotify
104public: 108{
105 enum Sound{Loud=1, Silent=0, Custom=2 }; 109 public:
110 enum Sound{Loud = 1, Silent = 0, Custom = 2 };
106 OPimAlarm( int sound = Silent, const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 ); 111 OPimAlarm( int sound = Silent, const QDateTime& start = QDateTime(), int duration = 0, int parent = 0 );
107 OPimAlarm( const OPimAlarm& ); 112 OPimAlarm( const OPimAlarm& );
108 ~OPimAlarm(); 113 ~OPimAlarm();
109 114
110 OPimAlarm &operator=( const OPimAlarm& ); 115 OPimAlarm &operator=( const OPimAlarm& );
111 bool operator==( const OPimAlarm& ); 116 bool operator==( const OPimAlarm& );
112 QString type()const; 117 QString type() const;
113 118
114 int sound()const; 119 int sound() const;
115 QString file()const; 120 QString file() const;
116 121
117 void setSound( int ); 122 void setSound( int );
118 /* only when sound is custom... */ 123 /* only when sound is custom... */
119 void setFile( const QString& sound ); 124 void setFile( const QString& sound );
120 125
121private: 126 private:
122 void deref(); 127 void deref();
123 void copyIntern(); 128 void copyIntern();
124 struct Data; 129 struct Data;
125 Data * data; 130 Data * data;
126 131
127 class Private; 132 class Private;
@@ -132,39 +137,39 @@ private:
132/** 137/**
133 * A Reminder will be put into the 138 * A Reminder will be put into the
134 * datebook 139 * datebook
135 * Note that the returned dateTime() may be not valid. 140 * Note that the returned dateTime() may be not valid.
136 * In these cases one must resolve the uid and get the OEvent 141 * In these cases one must resolve the uid and get the OEvent
137 */ 142 */
138class OPimReminder : public OPimNotify { 143class OPimReminder : public OPimNotify
139public: 144{
140 145 public:
141 /** 146 /**
142 * c'tor of a reminder 147 * c'tor of a reminder
143 * @param uid The uid of the Record inside the Datebook 148 * @param uid The uid of the Record inside the Datebook
144 * @param start the StartDate invalid for all day... 149 * @param start the StartDate invalid for all day...
145 * @param duration The duration of the event ( -1 for all day ) 150 * @param duration The duration of the event ( -1 for all day )
146 * @param parent The 'parent' record of this reminder 151 * @param parent The 'parent' record of this reminder
147 */ 152 */
148 OPimReminder( int uid = 0, const QDateTime& start = QDateTime(), 153 OPimReminder( int uid = 0, const QDateTime& start = QDateTime(),
149 int duration = 0, int parent = 0 ); 154 int duration = 0, int parent = 0 );
150 OPimReminder( const OPimReminder& ); 155 OPimReminder( const OPimReminder& );
151 OPimReminder &operator=(const OPimReminder& ); 156 OPimReminder &operator=( const OPimReminder& );
152 157
153 QString type()const; 158 QString type() const;
154 159
155 bool operator==( const OPimReminder& ); 160 bool operator==( const OPimReminder& );
156 161
157 /** 162 /**
158 * the uid of the alarm 163 * the uid of the alarm
159 * inside the 'datebook' application 164 * inside the 'datebook' application
160 */ 165 */
161 int recordUid()const; 166 int recordUid() const;
162 void setRecordUid( int uid ); 167 void setRecordUid( int uid );
163 168
164private: 169 private:
165 void deref(); 170 void deref();
166 void copyIntern(); 171 void copyIntern();
167 172
168 struct Data; 173 struct Data;
169 Data* data; 174 Data* data;
170 class Private; 175 class Private;