author | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
commit | 6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (unidiff) | |
tree | 6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/backend/event.cpp | |
parent | d10cddb3c9ce75bc90b14add14bc133737fe35aa (diff) | |
download | opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2 |
Qtopia1-6 merge
still to test
bic changes to be resolved
more changes to be made?
-rw-r--r-- | library/backend/event.cpp | 501 |
1 files changed, 493 insertions, 8 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp index 50a663d..7110717 100644 --- a/library/backend/event.cpp +++ b/library/backend/event.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
@@ -22,5 +22,5 @@ | |||
22 | #include "qfiledirect_p.h" | 22 | #include "qfiledirect_p.h" |
23 | #include <qpe/timeconversion.h> | 23 | #include <qtopia/timeconversion.h> |
24 | #include <qpe/stringutil.h> | 24 | #include <qtopia/stringutil.h> |
25 | #include <qpe/recordfields.h> | 25 | #include <qtopia/private/recordfields.h> |
26 | #include <qbuffer.h> | 26 | #include <qbuffer.h> |
@@ -73,2 +73,251 @@ Qtopia::UidGen Event::sUidGen( Qtopia::UidGen::Qtopia ); | |||
73 | 73 | ||
74 | /*! | ||
75 | \class Event event.h | ||
76 | \brief The Event class holds the data of a calendar event. | ||
77 | |||
78 | This data includes descriptive data of the event and schedualing information. | ||
79 | |||
80 | \ingroup qtopiaemb | ||
81 | \ingroup qtopiadesktop | ||
82 | */ | ||
83 | |||
84 | /*! | ||
85 | \class Event::RepeatPattern | ||
86 | \class The Event::RepeatPattern class is internal. | ||
87 | \internal | ||
88 | */ | ||
89 | |||
90 | /*! | ||
91 | \enum Event::Days | ||
92 | \internal | ||
93 | */ | ||
94 | |||
95 | /*! | ||
96 | \enum Event::Type | ||
97 | \internal | ||
98 | */ | ||
99 | |||
100 | /*! | ||
101 | \enum Event::SoundTypeChoice | ||
102 | |||
103 | This enum type defines what kind of sound is made when an alarm occurs | ||
104 | for an event. The currently defined types are: | ||
105 | |||
106 | <ul> | ||
107 | <li>\c Silent - No sound is produced. | ||
108 | <li>\c Loud - A loud sound is produced. | ||
109 | </ul> | ||
110 | */ | ||
111 | |||
112 | /*! | ||
113 | \fn bool Event::operator<( const Event & ) const | ||
114 | \internal | ||
115 | */ | ||
116 | |||
117 | /*! | ||
118 | \fn bool Event::operator<=( const Event & ) const | ||
119 | \internal | ||
120 | */ | ||
121 | |||
122 | /*! | ||
123 | \fn bool Event::operator!=( const Event & ) const | ||
124 | \internal | ||
125 | */ | ||
126 | |||
127 | /*! | ||
128 | \fn bool Event::operator>( const Event & ) const | ||
129 | \internal | ||
130 | */ | ||
131 | |||
132 | /*! | ||
133 | \fn bool Event::operator>=( const Event & ) const | ||
134 | \internal | ||
135 | */ | ||
136 | |||
137 | /*! | ||
138 | \enum Event::RepeatType | ||
139 | |||
140 | This enum defines how a event will repeat, if at all. | ||
141 | |||
142 | <ul> | ||
143 | <li>\c NoRepeat - Event does not repeat. | ||
144 | <li>\c Daily - Event occurs every n days. | ||
145 | <li>\c Weekly - Event occurs every n weeks. | ||
146 | <li>\c MonthlyDay - Event occurs every n months. Event will always occur in | ||
147 | the same week and same day of week as the first event. | ||
148 | <li>\c MonthlyDate - Event occurs every n months. Event will always occur | ||
149 | on the same day of the month as the first event. | ||
150 | <li>\c Yearly - Event occurs every n years. | ||
151 | </ul> | ||
152 | */ | ||
153 | |||
154 | /*! | ||
155 | \fn bool Event::isAllDay() const | ||
156 | |||
157 | Returns TRUE if the event is an all day event. Otherwise returns FALSE. | ||
158 | */ | ||
159 | |||
160 | /*! | ||
161 | \fn void Event::setAllDay(bool allday) | ||
162 | |||
163 | If \a allday is TRUE, will set the event to be an all day event. | ||
164 | Otherwise sets the event to not be an all day event. | ||
165 | |||
166 | \warning This function may affect the start and end times of the event. | ||
167 | */ | ||
168 | |||
169 | /*! | ||
170 | \fn QDateTime Event::start() const | ||
171 | |||
172 | Returns the start date and time of the first occurance of the event. | ||
173 | */ | ||
174 | |||
175 | /*! | ||
176 | \fn QDateTime Event::end() const | ||
177 | |||
178 | Returns the end date and time of the first occurance of the event. | ||
179 | */ | ||
180 | |||
181 | /*! | ||
182 | \fn time_t Event::startTime() const | ||
183 | \internal | ||
184 | */ | ||
185 | |||
186 | /*! | ||
187 | \fn time_t Event::endTime() const | ||
188 | \internal | ||
189 | */ | ||
190 | |||
191 | /*! | ||
192 | \fn void Event::setAlarm(int delay, SoundTypeChoice s) | ||
193 | |||
194 | Sets the alarm delay of the event to \a delay and the sound type of the | ||
195 | alarm to \a s. | ||
196 | */ | ||
197 | |||
198 | /*! | ||
199 | \fn void Event::clearAlarm() | ||
200 | |||
201 | Clears the alarm for the event. | ||
202 | */ | ||
203 | |||
204 | /*! | ||
205 | \fn int Event::alarmDelay() const | ||
206 | |||
207 | Returns the delay in minutes between the alarm for an event and the | ||
208 | start of the event. | ||
209 | */ | ||
210 | |||
211 | /*! | ||
212 | \fn Event::RepeatType Event::repeatType() const | ||
213 | |||
214 | Returns the repeat pattern type for the event. | ||
215 | |||
216 | \sa frequency() | ||
217 | */ | ||
218 | |||
219 | /*! | ||
220 | \fn int Event::weekOffset() const | ||
221 | |||
222 | Returns the number of weeks from the start of the month that this event | ||
223 | occurs. | ||
224 | */ | ||
225 | |||
226 | /*! | ||
227 | \fn QDate Event::repeatTill() const | ||
228 | |||
229 | Returns the date that the event will continue to repeat until. If the event | ||
230 | repeats forever the value returned is undefined. | ||
231 | |||
232 | \sa repeatForever() | ||
233 | */ | ||
234 | |||
235 | /*! | ||
236 | \fn bool Event::repeatForever() const | ||
237 | |||
238 | Returns FALSE if there is a date set for the event to continue until. | ||
239 | Otherwise returns TRUE. | ||
240 | */ | ||
241 | |||
242 | /*! | ||
243 | \fn bool Event::doRepeat() const | ||
244 | \internal | ||
245 | */ | ||
246 | |||
247 | /*! | ||
248 | \fn bool Event::repeatOnWeekDay(int day) const | ||
249 | |||
250 | Returns TRUE if the event has a RepeatType of Weekly and is set to occur on | ||
251 | \a day each week. Otherwise returns FALSE. | ||
252 | |||
253 | \sa QDate::dayName() | ||
254 | */ | ||
255 | |||
256 | /*! | ||
257 | \fn void Event::setRepeatOnWeekDay(int day, bool enable) | ||
258 | |||
259 | If \a enable is TRUE then sets the event to occur on \a day each week. | ||
260 | Otherwise sets the event not to occur on \a day. | ||
261 | |||
262 | \warning this function is only relavent for a event with RepeatType of | ||
263 | Weekly. | ||
264 | |||
265 | \sa QDate::dayName() | ||
266 | */ | ||
267 | |||
268 | /*! | ||
269 | \fn int Event::frequency() const | ||
270 | |||
271 | Returns how often the event repeats. | ||
272 | |||
273 | \sa repeatType() | ||
274 | */ | ||
275 | |||
276 | /*! | ||
277 | \fn void Event::setRepeatType(RepeatType t) | ||
278 | |||
279 | Sets the repeat pattern type of the event to \a t. | ||
280 | |||
281 | \sa setFrequency() | ||
282 | */ | ||
283 | |||
284 | /*! | ||
285 | \fn void Event::setFrequency(int n) | ||
286 | |||
287 | Sets how often the event occurs with in its repeat pattern. | ||
288 | |||
289 | \sa setRepeatType() | ||
290 | */ | ||
291 | |||
292 | /*! | ||
293 | \fn void Event::setRepeatTill(const QDate &d) | ||
294 | |||
295 | Sets the event to repeat until \a d. | ||
296 | */ | ||
297 | |||
298 | /*! | ||
299 | \fn void Event::setRepeatForever(bool enable) | ||
300 | |||
301 | If \a enable is TRUE, sets the event to repeat forever. Otherwise | ||
302 | sets the event to stop repeating at some date. | ||
303 | |||
304 | \warning This function may affect the specific date the event will repeat | ||
305 | till. | ||
306 | */ | ||
307 | |||
308 | /*! | ||
309 | \fn bool Event::match(const QRegExp &r) const | ||
310 | |||
311 | Returns TRUE if the event matches the regular expression \a r. | ||
312 | Otherwise returns FALSE. | ||
313 | */ | ||
314 | |||
315 | /*! | ||
316 | \fn char Event::day(int) | ||
317 | \internal | ||
318 | */ | ||
319 | |||
320 | /*! | ||
321 | Creates a new, empty event. | ||
322 | */ | ||
74 | Event::Event() : Record() | 323 | Event::Event() : Record() |
@@ -85,2 +334,5 @@ Event::Event() : Record() | |||
85 | 334 | ||
335 | /*! | ||
336 | \internal | ||
337 | */ | ||
86 | Event::Event( const QMap<int, QString> &map ) | 338 | Event::Event( const QMap<int, QString> &map ) |
@@ -108,2 +360,5 @@ Event::Event( const QMap<int, QString> &map ) | |||
108 | 360 | ||
361 | /*! | ||
362 | Destroys an event. | ||
363 | */ | ||
109 | Event::~Event() | 364 | Event::~Event() |
@@ -112,2 +367,5 @@ Event::~Event() | |||
112 | 367 | ||
368 | /*! | ||
369 | \internal | ||
370 | */ | ||
113 | int Event::week( const QDate& date ) | 371 | int Event::week( const QDate& date ) |
@@ -126,2 +384,5 @@ int Event::week( const QDate& date ) | |||
126 | 384 | ||
385 | /*! | ||
386 | \internal | ||
387 | */ | ||
127 | int Event::occurrence( const QDate& date ) | 388 | int Event::occurrence( const QDate& date ) |
@@ -133,2 +394,5 @@ int Event::occurrence( const QDate& date ) | |||
133 | 394 | ||
395 | /*! | ||
396 | \internal | ||
397 | */ | ||
134 | int Event::dayOfWeek( char day ) | 398 | int Event::dayOfWeek( char day ) |
@@ -144,2 +408,5 @@ int Event::dayOfWeek( char day ) | |||
144 | 408 | ||
409 | /*! | ||
410 | \internal | ||
411 | */ | ||
145 | int Event::monthDiff( const QDate& first, const QDate& second ) | 412 | int Event::monthDiff( const QDate& first, const QDate& second ) |
@@ -150,2 +417,5 @@ int Event::monthDiff( const QDate& first, const QDate& second ) | |||
150 | 417 | ||
418 | /*! | ||
419 | \internal | ||
420 | */ | ||
151 | QMap<int, QString> Event::toMap() const | 421 | QMap<int, QString> Event::toMap() const |
@@ -153,7 +423,14 @@ QMap<int, QString> Event::toMap() const | |||
153 | QMap<int, QString> m; | 423 | QMap<int, QString> m; |
424 | |||
425 | if ( !description().isEmpty() ) | ||
154 | m.insert( DatebookDescription, description() ); | 426 | m.insert( DatebookDescription, description() ); |
427 | if ( !location().isEmpty() ) | ||
155 | m.insert ( Location, location() ); | 428 | m.insert ( Location, location() ); |
429 | if ( categories().count() ) | ||
156 | m.insert ( DatebookCategory, idsToString( categories() ) ); | 430 | m.insert ( DatebookCategory, idsToString( categories() ) ); |
431 | if ( !timeZone().isEmpty() ) | ||
157 | m.insert ( TimeZone, timeZone() ); | 432 | m.insert ( TimeZone, timeZone() ); |
433 | if ( !notes().isEmpty() ) | ||
158 | m.insert ( Note, notes() ); | 434 | m.insert ( Note, notes() ); |
435 | |||
159 | m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) ); | 436 | m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) ); |
@@ -176,2 +453,5 @@ QMap<int, QString> Event::toMap() const | |||
176 | 453 | ||
454 | /*! | ||
455 | \internal | ||
456 | */ | ||
177 | void Event::setRepeat( const RepeatPattern &p ) | 457 | void Event::setRepeat( const RepeatPattern &p ) |
@@ -181,2 +461,5 @@ void Event::setRepeat( const RepeatPattern &p ) | |||
181 | 461 | ||
462 | /*! | ||
463 | Sets the description of the event to \a s. | ||
464 | */ | ||
182 | void Event::setDescription( const QString &s ) | 465 | void Event::setDescription( const QString &s ) |
@@ -186,2 +469,5 @@ void Event::setDescription( const QString &s ) | |||
186 | 469 | ||
470 | /*! | ||
471 | Sets the location of the event to \a s. | ||
472 | */ | ||
187 | void Event::setLocation( const QString &s ) | 473 | void Event::setLocation( const QString &s ) |
@@ -196,2 +482,5 @@ void Event::setLocation( const QString &s ) | |||
196 | 482 | ||
483 | /*! | ||
484 | \internal | ||
485 | */ | ||
197 | void Event::setType( Type t ) | 486 | void Event::setType( Type t ) |
@@ -201,2 +490,6 @@ void Event::setType( Type t ) | |||
201 | 490 | ||
491 | /*! | ||
492 | Sets the start date and time of the first or only occurance of this event | ||
493 | to the date and time \a d. \a d should be in local time. | ||
494 | */ | ||
202 | void Event::setStart( const QDateTime &d ) | 495 | void Event::setStart( const QDateTime &d ) |
@@ -206,2 +499,5 @@ void Event::setStart( const QDateTime &d ) | |||
206 | 499 | ||
500 | /*! | ||
501 | \internal | ||
502 | */ | ||
207 | void Event::setStart( time_t time ) | 503 | void Event::setStart( time_t time ) |
@@ -211,2 +507,6 @@ void Event::setStart( time_t time ) | |||
211 | 507 | ||
508 | /*! | ||
509 | Sets the end date and time of the first or only occurance of this event | ||
510 | to the date and time \a d. \a d should be in local time. | ||
511 | */ | ||
212 | void Event::setEnd( const QDateTime &d ) | 512 | void Event::setEnd( const QDateTime &d ) |
@@ -216,2 +516,5 @@ void Event::setEnd( const QDateTime &d ) | |||
216 | 516 | ||
517 | /*! | ||
518 | \internal | ||
519 | */ | ||
217 | void Event::setEnd( time_t time ) | 520 | void Event::setEnd( time_t time ) |
@@ -221,2 +524,5 @@ void Event::setEnd( time_t time ) | |||
221 | 524 | ||
525 | /*! | ||
526 | \internal | ||
527 | */ | ||
222 | void Event::setTimeZone( const QString &z ) | 528 | void Event::setTimeZone( const QString &z ) |
@@ -226,2 +532,5 @@ void Event::setTimeZone( const QString &z ) | |||
226 | 532 | ||
533 | /*! | ||
534 | \internal | ||
535 | */ | ||
227 | void Event::setAlarm( bool b, int minutes, SoundTypeChoice s ) | 536 | void Event::setAlarm( bool b, int minutes, SoundTypeChoice s ) |
@@ -233,2 +542,5 @@ void Event::setAlarm( bool b, int minutes, SoundTypeChoice s ) | |||
233 | 542 | ||
543 | /*! | ||
544 | \internal | ||
545 | */ | ||
234 | void Event::setRepeat( bool b, const RepeatPattern &p ) | 546 | void Event::setRepeat( bool b, const RepeatPattern &p ) |
@@ -239,2 +551,5 @@ void Event::setRepeat( bool b, const RepeatPattern &p ) | |||
239 | 551 | ||
552 | /*! | ||
553 | Sets the notes for the event to \a n. | ||
554 | */ | ||
240 | void Event::setNotes( const QString &n ) | 555 | void Event::setNotes( const QString &n ) |
@@ -244,2 +559,5 @@ void Event::setNotes( const QString &n ) | |||
244 | 559 | ||
560 | /*! | ||
561 | Returns the description of the event. | ||
562 | */ | ||
245 | const QString &Event::description() const | 563 | const QString &Event::description() const |
@@ -249,2 +567,5 @@ const QString &Event::description() const | |||
249 | 567 | ||
568 | /*! | ||
569 | Returns the location of the event. | ||
570 | */ | ||
250 | const QString &Event::location() const | 571 | const QString &Event::location() const |
@@ -259,2 +580,5 @@ const QString &Event::location() const | |||
259 | 580 | ||
581 | /*! | ||
582 | \internal | ||
583 | */ | ||
260 | Event::Type Event::type() const | 584 | Event::Type Event::type() const |
@@ -264,2 +588,5 @@ Event::Type Event::type() const | |||
264 | 588 | ||
589 | /*! | ||
590 | \internal | ||
591 | */ | ||
265 | QDateTime Event::start( bool actual ) const | 592 | QDateTime Event::start( bool actual ) const |
@@ -276,2 +603,5 @@ QDateTime Event::start( bool actual ) const | |||
276 | 603 | ||
604 | /*! | ||
605 | \internal | ||
606 | */ | ||
277 | QDateTime Event::end( bool actual ) const | 607 | QDateTime Event::end( bool actual ) const |
@@ -288,2 +618,5 @@ QDateTime Event::end( bool actual ) const | |||
288 | 618 | ||
619 | /*! | ||
620 | \internal | ||
621 | */ | ||
289 | const QString &Event::timeZone() const | 622 | const QString &Event::timeZone() const |
@@ -293,2 +626,5 @@ const QString &Event::timeZone() const | |||
293 | 626 | ||
627 | /*! | ||
628 | \internal | ||
629 | */ | ||
294 | bool Event::hasAlarm() const | 630 | bool Event::hasAlarm() const |
@@ -298,2 +634,5 @@ bool Event::hasAlarm() const | |||
298 | 634 | ||
635 | /*! | ||
636 | \internal | ||
637 | */ | ||
299 | int Event::alarmTime() const | 638 | int Event::alarmTime() const |
@@ -303,2 +642,5 @@ int Event::alarmTime() const | |||
303 | 642 | ||
643 | /*! | ||
644 | Returns the sound type for the alarm of this event. | ||
645 | */ | ||
304 | Event::SoundTypeChoice Event::alarmSound() const | 646 | Event::SoundTypeChoice Event::alarmSound() const |
@@ -308,2 +650,5 @@ Event::SoundTypeChoice Event::alarmSound() const | |||
308 | 650 | ||
651 | /*! | ||
652 | \internal | ||
653 | */ | ||
309 | bool Event::hasRepeat() const | 654 | bool Event::hasRepeat() const |
@@ -313,2 +658,5 @@ bool Event::hasRepeat() const | |||
313 | 658 | ||
659 | /*! | ||
660 | \internal | ||
661 | */ | ||
314 | const Event::RepeatPattern &Event::repeatPattern() const | 662 | const Event::RepeatPattern &Event::repeatPattern() const |
@@ -318,2 +666,5 @@ const Event::RepeatPattern &Event::repeatPattern() const | |||
318 | 666 | ||
667 | /*! | ||
668 | \internal | ||
669 | */ | ||
319 | Event::RepeatPattern &Event::repeatPattern() | 670 | Event::RepeatPattern &Event::repeatPattern() |
@@ -323,2 +674,5 @@ Event::RepeatPattern &Event::repeatPattern() | |||
323 | 674 | ||
675 | /*! | ||
676 | Returns the notes for the event. | ||
677 | */ | ||
324 | const QString &Event::notes() const | 678 | const QString &Event::notes() const |
@@ -328,4 +682,9 @@ const QString &Event::notes() const | |||
328 | 682 | ||
683 | /*! | ||
684 | \internal | ||
685 | */ | ||
329 | bool Event::operator==( const Event &e ) const | 686 | bool Event::operator==( const Event &e ) const |
330 | { | 687 | { |
688 | if ( uid() && e.uid() == uid() ) | ||
689 | return TRUE; | ||
331 | return ( e.descript == descript && | 690 | return ( e.descript == descript && |
@@ -345,2 +704,6 @@ bool Event::operator==( const Event &e ) const | |||
345 | 704 | ||
705 | /*! | ||
706 | \internal | ||
707 | Appends the contact information to \a buf. | ||
708 | */ | ||
346 | void Event::save( QString& buf ) | 709 | void Event::save( QString& buf ) |
@@ -380,2 +743,5 @@ void Event::save( QString& buf ) | |||
380 | 743 | ||
744 | /*! | ||
745 | \internal | ||
746 | */ | ||
381 | bool Event::RepeatPattern::operator==( const Event::RepeatPattern &right ) const | 747 | bool Event::RepeatPattern::operator==( const Event::RepeatPattern &right ) const |
@@ -392,2 +758,24 @@ bool Event::RepeatPattern::operator==( const Event::RepeatPattern &right ) const | |||
392 | 758 | ||
759 | /*! | ||
760 | \class EffectiveEvent | ||
761 | \brief The EffectiveEvent class the data for a single occurance of an event. | ||
762 | |||
763 | This class describes the event for a single occurance of it. For example if | ||
764 | an Event occurs every week, the effective event might represent the third | ||
765 | occurance of this Event. | ||
766 | |||
767 | \ingroup qtopiaemb | ||
768 | \ingroup qtopiadesktop | ||
769 | \warning This class will be phased out in Qtopia 3.x | ||
770 | */ | ||
771 | |||
772 | /*! | ||
773 | \enum EffectiveEvent::Position | ||
774 | \internal | ||
775 | */ | ||
776 | |||
777 | /*! | ||
778 | \fn EffectiveEvent &EffectiveEvent::operator=(const EffectiveEvent &) | ||
779 | \internal | ||
780 | */ | ||
393 | 781 | ||
@@ -402,3 +790,5 @@ public: | |||
402 | 790 | ||
403 | 791 | /*! | |
792 | \internal | ||
793 | */ | ||
404 | EffectiveEvent::EffectiveEvent() | 794 | EffectiveEvent::EffectiveEvent() |
@@ -410,2 +800,5 @@ EffectiveEvent::EffectiveEvent() | |||
410 | 800 | ||
801 | /*! | ||
802 | \internal | ||
803 | */ | ||
411 | EffectiveEvent::EffectiveEvent( const Event &e, const QDate &date, Position pos ) | 804 | EffectiveEvent::EffectiveEvent( const Event &e, const QDate &date, Position pos ) |
@@ -426,2 +819,5 @@ EffectiveEvent::EffectiveEvent( const Event &e, const QDate &date, Position pos | |||
426 | 819 | ||
820 | /*! | ||
821 | \internal | ||
822 | */ | ||
427 | EffectiveEvent::~EffectiveEvent() | 823 | EffectiveEvent::~EffectiveEvent() |
@@ -431,2 +827,5 @@ EffectiveEvent::~EffectiveEvent() | |||
431 | 827 | ||
828 | /*! | ||
829 | \internal | ||
830 | */ | ||
432 | EffectiveEvent::EffectiveEvent( const EffectiveEvent &e ) | 831 | EffectiveEvent::EffectiveEvent( const EffectiveEvent &e ) |
@@ -463,2 +862,5 @@ EffectiveEvent& EffectiveEvent::operator=( const EffectiveEvent & e ) | |||
463 | 862 | ||
863 | /*! | ||
864 | Returns the description of the event for this effective event. | ||
865 | */ | ||
464 | const QString &EffectiveEvent::description( ) const | 866 | const QString &EffectiveEvent::description( ) const |
@@ -468,2 +870,5 @@ const QString &EffectiveEvent::description( ) const | |||
468 | 870 | ||
871 | /*! | ||
872 | \internal | ||
873 | */ | ||
469 | const QString &EffectiveEvent::location( ) const | 874 | const QString &EffectiveEvent::location( ) const |
@@ -473,2 +878,5 @@ const QString &EffectiveEvent::location( ) const | |||
473 | 878 | ||
879 | /*! | ||
880 | \internal | ||
881 | */ | ||
474 | const QString &EffectiveEvent::notes() const | 882 | const QString &EffectiveEvent::notes() const |
@@ -478,2 +886,5 @@ const QString &EffectiveEvent::notes() const | |||
478 | 886 | ||
887 | /*! | ||
888 | Returns the event associated with this effective event. | ||
889 | */ | ||
479 | const Event &EffectiveEvent::event() const | 890 | const Event &EffectiveEvent::event() const |
@@ -483,2 +894,5 @@ const Event &EffectiveEvent::event() const | |||
483 | 894 | ||
895 | /*! | ||
896 | \internal | ||
897 | */ | ||
484 | const QTime &EffectiveEvent::end() const | 898 | const QTime &EffectiveEvent::end() const |
@@ -488,2 +902,5 @@ const QTime &EffectiveEvent::end() const | |||
488 | 902 | ||
903 | /*! | ||
904 | \internal | ||
905 | */ | ||
489 | const QTime &EffectiveEvent::start() const | 906 | const QTime &EffectiveEvent::start() const |
@@ -493,2 +910,5 @@ const QTime &EffectiveEvent::start() const | |||
493 | 910 | ||
911 | /*! | ||
912 | Returns the date the effective event occurs on. | ||
913 | */ | ||
494 | const QDate &EffectiveEvent::date() const | 914 | const QDate &EffectiveEvent::date() const |
@@ -498,2 +918,5 @@ const QDate &EffectiveEvent::date() const | |||
498 | 918 | ||
919 | /*! | ||
920 | \internal | ||
921 | */ | ||
499 | int EffectiveEvent::length() const | 922 | int EffectiveEvent::length() const |
@@ -504,2 +927,5 @@ int EffectiveEvent::length() const | |||
504 | 927 | ||
928 | /*! | ||
929 | \internal | ||
930 | */ | ||
505 | void EffectiveEvent::setDate( const QDate &dt ) | 931 | void EffectiveEvent::setDate( const QDate &dt ) |
@@ -509,2 +935,5 @@ void EffectiveEvent::setDate( const QDate &dt ) | |||
509 | 935 | ||
936 | /*! | ||
937 | \internal | ||
938 | */ | ||
510 | void EffectiveEvent::setStart( const QTime &start ) | 939 | void EffectiveEvent::setStart( const QTime &start ) |
@@ -514,2 +943,5 @@ void EffectiveEvent::setStart( const QTime &start ) | |||
514 | 943 | ||
944 | /*! | ||
945 | \internal | ||
946 | */ | ||
515 | void EffectiveEvent::setEnd( const QTime &end ) | 947 | void EffectiveEvent::setEnd( const QTime &end ) |
@@ -519,2 +951,5 @@ void EffectiveEvent::setEnd( const QTime &end ) | |||
519 | 951 | ||
952 | /*! | ||
953 | \internal | ||
954 | */ | ||
520 | void EffectiveEvent::setEvent( Event e ) | 955 | void EffectiveEvent::setEvent( Event e ) |
@@ -524,2 +959,5 @@ void EffectiveEvent::setEvent( Event e ) | |||
524 | 959 | ||
960 | /*! | ||
961 | \internal | ||
962 | */ | ||
525 | bool EffectiveEvent::operator<( const EffectiveEvent &e ) const | 963 | bool EffectiveEvent::operator<( const EffectiveEvent &e ) const |
@@ -534,2 +972,5 @@ bool EffectiveEvent::operator<( const EffectiveEvent &e ) const | |||
534 | 972 | ||
973 | /*! | ||
974 | \internal | ||
975 | */ | ||
535 | bool EffectiveEvent::operator<=( const EffectiveEvent &e ) const | 976 | bool EffectiveEvent::operator<=( const EffectiveEvent &e ) const |
@@ -539,2 +980,5 @@ bool EffectiveEvent::operator<=( const EffectiveEvent &e ) const | |||
539 | 980 | ||
981 | /*! | ||
982 | \internal | ||
983 | */ | ||
540 | bool EffectiveEvent::operator==( const EffectiveEvent &e ) const | 984 | bool EffectiveEvent::operator==( const EffectiveEvent &e ) const |
@@ -547,2 +991,5 @@ bool EffectiveEvent::operator==( const EffectiveEvent &e ) const | |||
547 | 991 | ||
992 | /*! | ||
993 | \internal | ||
994 | */ | ||
548 | bool EffectiveEvent::operator!=( const EffectiveEvent &e ) const | 995 | bool EffectiveEvent::operator!=( const EffectiveEvent &e ) const |
@@ -552,2 +999,5 @@ bool EffectiveEvent::operator!=( const EffectiveEvent &e ) const | |||
552 | 999 | ||
1000 | /*! | ||
1001 | \internal | ||
1002 | */ | ||
553 | bool EffectiveEvent::operator>( const EffectiveEvent &e ) const | 1003 | bool EffectiveEvent::operator>( const EffectiveEvent &e ) const |
@@ -557,2 +1007,5 @@ bool EffectiveEvent::operator>( const EffectiveEvent &e ) const | |||
557 | 1007 | ||
1008 | /*! | ||
1009 | \internal | ||
1010 | */ | ||
558 | bool EffectiveEvent::operator>=(const EffectiveEvent &e) const | 1011 | bool EffectiveEvent::operator>=(const EffectiveEvent &e) const |
@@ -562,2 +1015,5 @@ bool EffectiveEvent::operator>=(const EffectiveEvent &e) const | |||
562 | 1015 | ||
1016 | /*! | ||
1017 | \internal | ||
1018 | */ | ||
563 | void EffectiveEvent::setEffectiveDates( const QDate &from, const QDate &to ) | 1019 | void EffectiveEvent::setEffectiveDates( const QDate &from, const QDate &to ) |
@@ -575,2 +1031,5 @@ void EffectiveEvent::setEffectiveDates( const QDate &from, const QDate &to ) | |||
575 | 1031 | ||
1032 | /*! | ||
1033 | \internal | ||
1034 | */ | ||
576 | QDate EffectiveEvent::startDate() const | 1035 | QDate EffectiveEvent::startDate() const |
@@ -585,2 +1044,5 @@ QDate EffectiveEvent::startDate() const | |||
585 | 1044 | ||
1045 | /*! | ||
1046 | \internal | ||
1047 | */ | ||
586 | QDate EffectiveEvent::endDate() const | 1048 | QDate EffectiveEvent::endDate() const |
@@ -595,2 +1057,5 @@ QDate EffectiveEvent::endDate() const | |||
595 | 1057 | ||
1058 | /*! | ||
1059 | \internal | ||
1060 | */ | ||
596 | int EffectiveEvent::size() const | 1061 | int EffectiveEvent::size() const |
@@ -742,11 +1207,19 @@ static Event parseVObject( VObject *obj ) | |||
742 | 1207 | ||
743 | 1208 | /*! | |
1209 | Writes the list of \a events as a set of VCards to the file \a filename. | ||
1210 | */ | ||
744 | void Event::writeVCalendar( const QString &filename, const QValueList<Event> &events) | 1211 | void Event::writeVCalendar( const QString &filename, const QValueList<Event> &events) |
745 | { | 1212 | { |
1213 | |||
746 | QFileDirect f( filename.utf8().data() ); | 1214 | QFileDirect f( filename.utf8().data() ); |
1215 | |||
747 | if ( !f.open( IO_WriteOnly ) ) { | 1216 | if ( !f.open( IO_WriteOnly ) ) { |
1217 | |||
748 | qWarning("Unable to open vcard write"); | 1218 | qWarning("Unable to open vcard write"); |
1219 | |||
749 | return; | 1220 | return; |
1221 | |||
750 | } | 1222 | } |
751 | 1223 | ||
1224 | |||
752 | QValueList<Event>::ConstIterator it; | 1225 | QValueList<Event>::ConstIterator it; |
@@ -758,2 +1231,3 @@ void Event::writeVCalendar( const QString &filename, const QValueList<Event> &ev | |||
758 | 1231 | ||
1232 | |||
759 | cleanStrTbl(); | 1233 | cleanStrTbl(); |
@@ -761,10 +1235,19 @@ void Event::writeVCalendar( const QString &filename, const QValueList<Event> &ev | |||
761 | 1235 | ||
1236 | /*! | ||
1237 | Writes \a event as a VCard to the file \a filename. | ||
1238 | */ | ||
762 | void Event::writeVCalendar( const QString &filename, const Event &event) | 1239 | void Event::writeVCalendar( const QString &filename, const Event &event) |
763 | { | 1240 | { |
1241 | |||
764 | QFileDirect f( filename.utf8().data() ); | 1242 | QFileDirect f( filename.utf8().data() ); |
1243 | |||
765 | if ( !f.open( IO_WriteOnly ) ) { | 1244 | if ( !f.open( IO_WriteOnly ) ) { |
1245 | |||
766 | qWarning("Unable to open vcard write"); | 1246 | qWarning("Unable to open vcard write"); |
1247 | |||
767 | return; | 1248 | return; |
1249 | |||
768 | } | 1250 | } |
769 | 1251 | ||
1252 | |||
770 | VObject *obj = createVObject( event ); | 1253 | VObject *obj = createVObject( event ); |
@@ -776,3 +1259,5 @@ void Event::writeVCalendar( const QString &filename, const Event &event) | |||
776 | 1259 | ||
777 | 1260 | /*! | |
1261 | Returns the set of events read as VCards from the file \a filename. | ||
1262 | */ | ||
778 | QValueList<Event> Event::readVCalendar( const QString &filename ) | 1263 | QValueList<Event> Event::readVCalendar( const QString &filename ) |