author | zautrix <zautrix> | 2004-08-30 07:47:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-30 07:47:56 (UTC) |
commit | b36bcd92b643c87ee5e2bfc39076ea56abf4c7d2 (patch) (unidiff) | |
tree | 99223dd8edf0e00a4f060610ea0642f915cf4703 /libkcal/incidence.h | |
parent | 78f44f13835e3fa501997f485b505b193bd474f5 (diff) | |
download | kdepimpi-b36bcd92b643c87ee5e2bfc39076ea56abf4c7d2.zip kdepimpi-b36bcd92b643c87ee5e2bfc39076ea56abf4c7d2.tar.gz kdepimpi-b36bcd92b643c87ee5e2bfc39076ea56abf4c7d2.tar.bz2 |
Changes in gammu connection
-rw-r--r-- | libkcal/incidence.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index d1972cb..7dc6f10 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -56,243 +56,243 @@ class Incidence : public IncidenceBase | |||
56 | public: | 56 | public: |
57 | /** Destruct Incidence::Visitor */ | 57 | /** Destruct Incidence::Visitor */ |
58 | virtual ~Visitor() {} | 58 | virtual ~Visitor() {} |
59 | 59 | ||
60 | /** | 60 | /** |
61 | Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions | 61 | Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions |
62 | on an Event object. | 62 | on an Event object. |
63 | */ | 63 | */ |
64 | virtual bool visit(Event *) { return false; } | 64 | virtual bool visit(Event *) { return false; } |
65 | /** | 65 | /** |
66 | Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions | 66 | Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions |
67 | on an Todo object. | 67 | on an Todo object. |
68 | */ | 68 | */ |
69 | virtual bool visit(Todo *) { return false; } | 69 | virtual bool visit(Todo *) { return false; } |
70 | /** | 70 | /** |
71 | Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions | 71 | Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions |
72 | on an Journal object. | 72 | on an Journal object. |
73 | */ | 73 | */ |
74 | virtual bool visit(Journal *) { return false; } | 74 | virtual bool visit(Journal *) { return false; } |
75 | 75 | ||
76 | protected: | 76 | protected: |
77 | /** Constructor is protected to prevent direct creation of visitor base class. */ | 77 | /** Constructor is protected to prevent direct creation of visitor base class. */ |
78 | Visitor() {} | 78 | Visitor() {} |
79 | }; | 79 | }; |
80 | 80 | ||
81 | /** | 81 | /** |
82 | This class implements a visitor for adding an Incidence to a resource | 82 | This class implements a visitor for adding an Incidence to a resource |
83 | supporting addEvent(), addTodo() and addJournal() calls. | 83 | supporting addEvent(), addTodo() and addJournal() calls. |
84 | */ | 84 | */ |
85 | template<class T> | 85 | template<class T> |
86 | class AddVisitor : public Visitor | 86 | class AddVisitor : public Visitor |
87 | { | 87 | { |
88 | public: | 88 | public: |
89 | AddVisitor( T *r ) : mResource( r ) {} | 89 | AddVisitor( T *r ) : mResource( r ) {} |
90 | bool visit( Event *e ) { return mResource->addEvent( e ); } | 90 | bool visit( Event *e ) { return mResource->addEvent( e ); } |
91 | bool visit( Todo *t ) { return mResource->addTodo( t ); } | 91 | bool visit( Todo *t ) { return mResource->addTodo( t ); } |
92 | bool visit( Journal *j ) { return mResource->addJournal( j ); } | 92 | bool visit( Journal *j ) { return mResource->addJournal( j ); } |
93 | 93 | ||
94 | private: | 94 | private: |
95 | T *mResource; | 95 | T *mResource; |
96 | }; | 96 | }; |
97 | 97 | ||
98 | /** enumeration for describing an event's secrecy. */ | 98 | /** enumeration for describing an event's secrecy. */ |
99 | enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; | 99 | enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; |
100 | typedef ListBase<Incidence> List; | 100 | typedef ListBase<Incidence> List; |
101 | Incidence(); | 101 | Incidence(); |
102 | Incidence(const Incidence &); | 102 | Incidence(const Incidence &); |
103 | ~Incidence(); | 103 | ~Incidence(); |
104 | 104 | ||
105 | /** | 105 | /** |
106 | Accept IncidenceVisitor. A class taking part in the visitor mechanism has to | 106 | Accept IncidenceVisitor. A class taking part in the visitor mechanism has to |
107 | provide this implementation: | 107 | provide this implementation: |
108 | <pre> | 108 | <pre> |
109 | bool accept(Visitor &v) { return v.visit(this); } | 109 | bool accept(Visitor &v) { return v.visit(this); } |
110 | </pre> | 110 | </pre> |
111 | */ | 111 | */ |
112 | virtual bool accept(Visitor &) { return false; } | 112 | virtual bool accept(Visitor &) { return false; } |
113 | 113 | ||
114 | virtual Incidence *clone() = 0; | 114 | virtual Incidence *clone() = 0; |
115 | 115 | ||
116 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; | 116 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; |
117 | void setReadOnly( bool ); | 117 | void setReadOnly( bool ); |
118 | 118 | ||
119 | /** | 119 | /** |
120 | Recreate event. The event is made a new unique event, but already stored | 120 | Recreate event. The event is made a new unique event, but already stored |
121 | event information is preserved. Sets uniquie id, creation date, last | 121 | event information is preserved. Sets uniquie id, creation date, last |
122 | modification date and revision number. | 122 | modification date and revision number. |
123 | */ | 123 | */ |
124 | void recreate(); | 124 | void recreate(); |
125 | 125 | ||
126 | /** set creation date */ | 126 | /** set creation date */ |
127 | void setCreated(QDateTime); | 127 | void setCreated(QDateTime); |
128 | /** return time and date of creation. */ | 128 | /** return time and date of creation. */ |
129 | QDateTime created() const; | 129 | QDateTime created() const; |
130 | 130 | ||
131 | /** set the number of revisions this event has seen */ | 131 | /** set the number of revisions this event has seen */ |
132 | void setRevision(int rev); | 132 | void setRevision(int rev); |
133 | /** return the number of revisions this event has seen */ | 133 | /** return the number of revisions this event has seen */ |
134 | int revision() const; | 134 | int revision() const; |
135 | 135 | ||
136 | /** Set starting date/time. */ | 136 | /** Set starting date/time. */ |
137 | virtual void setDtStart(const QDateTime &dtStart); | 137 | virtual void setDtStart(const QDateTime &dtStart); |
138 | /** Return the incidence's ending date/time as a QDateTime. */ | 138 | /** Return the incidence's ending date/time as a QDateTime. */ |
139 | virtual QDateTime dtEnd() const { return QDateTime(); } | 139 | virtual QDateTime dtEnd() const { return QDateTime(); } |
140 | 140 | ||
141 | /** sets the event's lengthy description. */ | 141 | /** sets the event's lengthy description. */ |
142 | void setDescription(const QString &description); | 142 | void setDescription(const QString &description); |
143 | /** returns a reference to the event's description. */ | 143 | /** returns a reference to the event's description. */ |
144 | QString description() const; | 144 | QString description() const; |
145 | 145 | ||
146 | /** sets the event's short summary. */ | 146 | /** sets the event's short summary. */ |
147 | void setSummary(const QString &summary); | 147 | void setSummary(const QString &summary); |
148 | /** returns a reference to the event's summary. */ | 148 | /** returns a reference to the event's summary. */ |
149 | QString summary() const; | 149 | QString summary() const; |
150 | 150 | ||
151 | /** set event's applicable categories */ | 151 | /** set event's applicable categories */ |
152 | void setCategories(const QStringList &categories); | 152 | void setCategories(const QStringList &categories); |
153 | /** set event's categories based on a comma delimited string */ | 153 | /** set event's categories based on a comma delimited string */ |
154 | void setCategories(const QString &catStr); | 154 | void setCategories(const QString &catStr); |
155 | /** return categories in a list */ | 155 | /** return categories in a list */ |
156 | QStringList categories() const; | 156 | QStringList categories() const; |
157 | /** return categories as a comma separated string */ | 157 | /** return categories as a comma separated string */ |
158 | QString categoriesStr(); | 158 | QString categoriesStr(); |
159 | 159 | ||
160 | /** point at some other event to which the event relates. This function should | 160 | /** point at some other event to which the event relates. This function should |
161 | * only be used when constructing a calendar before the related Event | 161 | * only be used when constructing a calendar before the related Event |
162 | * exists. */ | 162 | * exists. */ |
163 | void setRelatedToUid(const QString &); | 163 | void setRelatedToUid(const QString &); |
164 | /** what event does this one relate to? This function should | 164 | /** what event does this one relate to? This function should |
165 | * only be used when constructing a calendar before the related Event | 165 | * only be used when constructing a calendar before the related Event |
166 | * exists. */ | 166 | * exists. */ |
167 | QString relatedToUid() const; | 167 | QString relatedToUid() const; |
168 | /** point at some other event to which the event relates */ | 168 | /** point at some other event to which the event relates */ |
169 | void setRelatedTo(Incidence *relatedTo); | 169 | void setRelatedTo(Incidence *relatedTo); |
170 | /** what event does this one relate to? */ | 170 | /** what event does this one relate to? */ |
171 | Incidence *relatedTo() const; | 171 | Incidence *relatedTo() const; |
172 | /** All events that are related to this event */ | 172 | /** All events that are related to this event */ |
173 | QPtrList<Incidence> relations() const; | 173 | QPtrList<Incidence> relations() const; |
174 | /** Add an event which is related to this event */ | 174 | /** Add an event which is related to this event */ |
175 | void addRelation(Incidence *); | 175 | void addRelation(Incidence *); |
176 | /** Remove event that is related to this event */ | 176 | /** Remove event that is related to this event */ |
177 | void removeRelation(Incidence *); | 177 | void removeRelation(Incidence *); |
178 | 178 | ||
179 | /** returns the list of dates which are exceptions to the recurrence rule */ | 179 | /** returns the list of dates which are exceptions to the recurrence rule */ |
180 | DateList exDates() const; | 180 | DateList exDates() const; |
181 | /** sets the list of dates which are exceptions to the recurrence rule */ | 181 | /** sets the list of dates which are exceptions to the recurrence rule */ |
182 | void setExDates(const DateList &_exDates); | 182 | void setExDates(const DateList &_exDates); |
183 | void setExDates(const char *dates); | 183 | void setExDates(const char *dates); |
184 | /** Add a date to the list of exceptions of the recurrence rule. */ | 184 | /** Add a date to the list of exceptions of the recurrence rule. */ |
185 | void addExDate(const QDate &date); | 185 | void addExDate(const QDate &date); |
186 | 186 | ||
187 | /** returns true if there is an exception for this date in the recurrence | 187 | /** returns true if there is an exception for this date in the recurrence |
188 | rule set, or false otherwise. */ | 188 | rule set, or false otherwise. */ |
189 | bool isException(const QDate &qd) const; | 189 | bool isException(const QDate &qd) const; |
190 | 190 | ||
191 | /** add attachment to this event */ | 191 | /** add attachment to this event */ |
192 | void addAttachment(Attachment *attachment); | 192 | void addAttachment(Attachment *attachment); |
193 | /** remove and delete a specific attachment */ | 193 | /** remove and delete a specific attachment */ |
194 | void deleteAttachment(Attachment *attachment); | 194 | void deleteAttachment(Attachment *attachment); |
195 | /** remove and delete all attachments with this mime type */ | 195 | /** remove and delete all attachments with this mime type */ |
196 | void deleteAttachments(const QString& mime); | 196 | void deleteAttachments(const QString& mime); |
197 | /** return list of all associated attachments */ | 197 | /** return list of all associated attachments */ |
198 | QPtrList<Attachment> attachments() const; | 198 | QPtrList<Attachment> attachments() const; |
199 | /** find a list of attachments with this mime type */ | 199 | /** find a list of attachments with this mime type */ |
200 | QPtrList<Attachment> attachments(const QString& mime) const; | 200 | QPtrList<Attachment> attachments(const QString& mime) const; |
201 | 201 | ||
202 | /** sets the event's status the value specified. See the enumeration | 202 | /** sets the event's status the value specified. See the enumeration |
203 | * above for possible values. */ | 203 | * above for possible values. */ |
204 | void setSecrecy(int); | 204 | void setSecrecy(int); |
205 | /** return the event's secrecy. */ | 205 | /** return the event's secrecy. */ |
206 | int secrecy() const; | 206 | int secrecy() const; |
207 | /** return the event's secrecy in string format. */ | 207 | /** return the event's secrecy in string format. */ |
208 | QString secrecyStr() const; | 208 | QString secrecyStr() const; |
209 | /** return list of all availbale secrecy classes */ | 209 | /** return list of all availbale secrecy classes */ |
210 | static QStringList secrecyList(); | 210 | static QStringList secrecyList(); |
211 | /** return human-readable name of secrecy class */ | 211 | /** return human-readable name of secrecy class */ |
212 | static QString secrecyName(int); | 212 | static QString secrecyName(int); |
213 | 213 | ||
214 | /** returns TRUE if the date specified is one on which the event will | 214 | /** returns TRUE if the date specified is one on which the event will |
215 | * recur. */ | 215 | * recur. */ |
216 | bool recursOn(const QDate &qd) const; | 216 | bool recursOn(const QDate &qd) const; |
217 | 217 | ||
218 | // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?): | 218 | // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?): |
219 | 219 | ||
220 | /** set resources used, such as Office, Car, etc. */ | 220 | /** set resources used, such as Office, Car, etc. */ |
221 | void setResources(const QStringList &resources); | 221 | void setResources(const QStringList &resources); |
222 | /** return list of current resources */ | 222 | /** return list of current resources */ |
223 | QStringList resources() const; | 223 | QStringList resources() const; |
224 | 224 | ||
225 | /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ | 225 | /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ |
226 | void setPriority(int priority); | 226 | void setPriority(int priority); |
227 | /** get the event's priority */ | 227 | /** get the event's priority */ |
228 | int priority() const; | 228 | int priority() const; |
229 | 229 | ||
230 | /** All alarms that are associated with this incidence */ | 230 | /** All alarms that are associated with this incidence */ |
231 | QPtrList<Alarm> alarms() const; | 231 | QPtrList<Alarm> alarms() const; |
232 | /** Create a new alarm which is associated with this incidence */ | 232 | /** Create a new alarm which is associated with this incidence */ |
233 | Alarm* newAlarm(); | 233 | Alarm* newAlarm(); |
234 | /** Add an alarm which is associated with this incidence */ | 234 | /** Add an alarm which is associated with this incidence */ |
235 | void addAlarm(Alarm*); | 235 | void addAlarm(Alarm*); |
236 | /** Remove an alarm that is associated with this incidence */ | 236 | /** Remove an alarm that is associated with this incidence */ |
237 | void removeAlarm(Alarm*); | 237 | void removeAlarm(Alarm*); |
238 | /** Remove all alarms that are associated with this incidence */ | 238 | /** Remove all alarms that are associated with this incidence */ |
239 | void clearAlarms(); | 239 | void clearAlarms(); |
240 | /** return whether any alarm associated with this incidence is enabled */ | 240 | /** return whether any alarm associated with this incidence is enabled */ |
241 | bool isAlarmEnabled() const; | 241 | bool isAlarmEnabled() const; |
242 | 242 | ||
243 | /** | 243 | /** |
244 | Return the recurrence rule associated with this incidence. If there is | 244 | Return the recurrence rule associated with this incidence. If there is |
245 | none, returns an appropriate (non-0) object. | 245 | none, returns an appropriate (non-0) object. |
246 | */ | 246 | */ |
247 | Recurrence *recurrence() const; | 247 | Recurrence *recurrence() const; |
248 | 248 | void setRecurrence(Recurrence * r); | |
249 | /** | 249 | /** |
250 | Forward to Recurrence::doesRecur(). | 250 | Forward to Recurrence::doesRecur(). |
251 | */ | 251 | */ |
252 | ushort doesRecur() const; | 252 | ushort doesRecur() const; |
253 | 253 | ||
254 | /** set the event's/todo's location. Do _not_ use it with journal */ | 254 | /** set the event's/todo's location. Do _not_ use it with journal */ |
255 | void setLocation(const QString &location); | 255 | void setLocation(const QString &location); |
256 | /** return the event's/todo's location. Do _not_ use it with journal */ | 256 | /** return the event's/todo's location. Do _not_ use it with journal */ |
257 | QString location() const; | 257 | QString location() const; |
258 | /** returns TRUE or FALSE depending on whether the todo has a start date */ | 258 | /** returns TRUE or FALSE depending on whether the todo has a start date */ |
259 | bool hasStartDate() const; | 259 | bool hasStartDate() const; |
260 | /** sets the event's hasStartDate value. */ | 260 | /** sets the event's hasStartDate value. */ |
261 | void setHasStartDate(bool f); | 261 | void setHasStartDate(bool f); |
262 | QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const; | 262 | QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const; |
263 | bool cancelled() const; | 263 | bool cancelled() const; |
264 | void setCancelled( bool b ); | 264 | void setCancelled( bool b ); |
265 | 265 | ||
266 | protected: | 266 | protected: |
267 | QPtrList<Alarm> mAlarms; | 267 | QPtrList<Alarm> mAlarms; |
268 | private: | 268 | private: |
269 | int mRevision; | 269 | int mRevision; |
270 | bool mCancelled; | 270 | bool mCancelled; |
271 | 271 | ||
272 | // base components of jounal, event and todo | 272 | // base components of jounal, event and todo |
273 | QDateTime mCreated; | 273 | QDateTime mCreated; |
274 | QString mDescription; | 274 | QString mDescription; |
275 | QString mSummary; | 275 | QString mSummary; |
276 | QStringList mCategories; | 276 | QStringList mCategories; |
277 | Incidence *mRelatedTo; | 277 | Incidence *mRelatedTo; |
278 | QString mRelatedToUid; | 278 | QString mRelatedToUid; |
279 | QPtrList<Incidence> mRelations; | 279 | QPtrList<Incidence> mRelations; |
280 | DateList mExDates; | 280 | DateList mExDates; |
281 | QPtrList<Attachment> mAttachments; | 281 | QPtrList<Attachment> mAttachments; |
282 | QStringList mResources; | 282 | QStringList mResources; |
283 | bool mHasStartDate; // if todo has associated start date | 283 | bool mHasStartDate; // if todo has associated start date |
284 | 284 | ||
285 | int mSecrecy; | 285 | int mSecrecy; |
286 | int mPriority; // 1 = highest, 2 = less, etc. | 286 | int mPriority; // 1 = highest, 2 = less, etc. |
287 | 287 | ||
288 | //QPtrList<Alarm> mAlarms; | 288 | //QPtrList<Alarm> mAlarms; |
289 | Recurrence *mRecurrence; | 289 | Recurrence *mRecurrence; |
290 | 290 | ||
291 | QString mLocation; | 291 | QString mLocation; |
292 | }; | 292 | }; |
293 | 293 | ||
294 | bool operator==( const Incidence&, const Incidence& ); | 294 | bool operator==( const Incidence&, const Incidence& ); |
295 | 295 | ||
296 | } | 296 | } |
297 | 297 | ||
298 | #endif | 298 | #endif |