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
@@ -27,12 +27,14 @@
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
@@ -48,6 +50,8 @@ namespace Opie {
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 );
@@ -55,35 +59,35 @@ public:
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();
@@ -101,7 +105,8 @@ private:
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& );
@@ -110,8 +115,8 @@ public:
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 );
@@ -119,5 +124,5 @@ public:
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();
@@ -136,7 +141,7 @@ private:
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
@@ -146,10 +151,10 @@ public:
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& );
@@ -159,8 +164,8 @@ public:
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();