summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/oevent.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/oevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/oevent.cpp534
1 files changed, 405 insertions, 129 deletions
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp
index de5e30b..d9cee2b 100644
--- a/libopie2/opiepim/oevent.cpp
+++ b/libopie2/opiepim/oevent.cpp
@@ -1,9 +1,9 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) 3 Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
@@ -23,67 +23,85 @@
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#include <qshared.h>
30#include <qarray.h>
31 29
32#include <qpe/palmtopuidgen.h> 30#include "oevent.h"
33#include <qpe/categories.h>
34#include <qpe/stringutil.h>
35 31
32/* OPIE */
36#include <opie2/orecur.h> 33#include <opie2/orecur.h>
37#include <opie2/opimresolver.h> 34#include <opie2/opimresolver.h>
38#include <opie2/opimnotifymanager.h> 35#include <opie2/opimnotifymanager.h>
36#include <qpe/categories.h>
37#include <qpe/palmtopuidgen.h>
38#include <qpe/stringutil.h>
39 39
40#include <opie2/oevent.h> 40/* QT */
41#include <qshared.h>
42#include <qarray.h>
41 43
42namespace Opie { 44namespace Opie
45{
43 46
44int OCalendarHelper::week( const QDate& date) { 47int OCalendarHelper::week( const QDate& date )
48{
45 // Calculates the week this date is in within that 49 // Calculates the week this date is in within that
46 // month. Equals the "row" is is in in the month view 50 // month. Equals the "row" is is in in the month view
47 int week = 1; 51 int week = 1;
48 QDate tmp( date.year(), date.month(), 1 ); 52 QDate tmp( date.year(), date.month(), 1 );
49 if ( date.dayOfWeek() < tmp.dayOfWeek() ) 53 if ( date.dayOfWeek() < tmp.dayOfWeek() )
50 ++week; 54 ++week;
51 55
52 week += ( date.day() - 1 ) / 7; 56 week += ( date.day() - 1 ) / 7;
53 57
54 return week; 58 return week;
55} 59}
56int OCalendarHelper::ocurrence( const QDate& date) { 60
61
62int OCalendarHelper::ocurrence( const QDate& date )
63{
57 // calculates the number of occurrances of this day of the 64 // calculates the number of occurrances of this day of the
58 // week till the given date (e.g 3rd Wednesday of the month) 65 // week till the given date (e.g 3rd Wednesday of the month)
59 return ( date.day() - 1 ) / 7 + 1; 66 return ( date.day() - 1 ) / 7 + 1;
60} 67}
61int OCalendarHelper::dayOfWeek( char day ) { 68
69
70int OCalendarHelper::dayOfWeek( char day )
71{
62 int dayOfWeek = 1; 72 int dayOfWeek = 1;
63 char i = ORecur::MON; 73 char i = ORecur::MON;
64 while ( !( i & day ) && i <= ORecur::SUN ) { 74 while ( !( i & day ) && i <= ORecur::SUN )
75 {
65 i <<= 1; 76 i <<= 1;
66 ++dayOfWeek; 77 ++dayOfWeek;
67 } 78 }
68 return dayOfWeek; 79 return dayOfWeek;
69} 80}
70int OCalendarHelper::monthDiff( const QDate& first, const QDate& second ) { 81
82
83int OCalendarHelper::monthDiff( const QDate& first, const QDate& second )
84{
71 return ( second.year() - first.year() ) * 12 + 85 return ( second.year() - first.year() ) * 12 +
72 second.month() - first.month(); 86 second.month() - first.month();
73} 87}
74 88
75struct OEvent::Data : public QShared { 89
76 Data() : QShared() { 90struct OEvent::Data : public QShared
91{
92 Data() : QShared()
93 {
77 child = 0; 94 child = 0;
78 recur = 0; 95 recur = 0;
79 manager = 0; 96 manager = 0;
80 isAllDay = false; 97 isAllDay = false;
81 parent = 0; 98 parent = 0;
82 } 99 }
83 ~Data() { 100 ~Data()
101 {
84 delete manager; 102 delete manager;
85 delete recur; 103 delete recur;
86 } 104 }
87 QString description; 105 QString description;
88 QString location; 106 QString location;
89 OPimNotifyManager* manager; 107 OPimNotifyManager* manager;
@@ -95,246 +113,352 @@ struct OEvent::Data : public QShared {
95 bool isAllDay : 1; 113 bool isAllDay : 1;
96 QString timezone; 114 QString timezone;
97 QArray<int>* child; 115 QArray<int>* child;
98 int parent; 116 int parent;
99}; 117};
100 118
119
101OEvent::OEvent( int uid ) 120OEvent::OEvent( int uid )
102 : OPimRecord( uid ) { 121 : OPimRecord( uid )
122{
103 data = new Data; 123 data = new Data;
104} 124}
125
126
105OEvent::OEvent( const OEvent& ev) 127OEvent::OEvent( const OEvent& ev)
106 : OPimRecord( ev ), data( ev.data ) 128 : OPimRecord( ev ), data( ev.data )
107{ 129{
108 data->ref(); 130 data->ref();
109} 131}
110 132
133
111OEvent::OEvent( const QMap<int, QString> map ) 134OEvent::OEvent( const QMap<int, QString> map )
112 : OPimRecord( 0 ) 135 : OPimRecord( 0 )
113{ 136{
114 data = new Data; 137 data = new Data;
115 138
116 fromMap( map ); 139 fromMap( map );
117} 140}
118 141
119OEvent::~OEvent() { 142
120 if ( data->deref() ) { 143OEvent::~OEvent()
144{
145 if ( data->deref() )
146 {
121 delete data; 147 delete data;
122 data = 0; 148 data = 0;
123 } 149 }
124} 150}
125OEvent& OEvent::operator=( const OEvent& ev) { 151
152
153OEvent& OEvent::operator=( const OEvent& ev )
154{
126 if ( this == &ev ) return *this; 155 if ( this == &ev ) return *this;
127 156
128 OPimRecord::operator=( ev ); 157 OPimRecord::operator=( ev );
129 ev.data->ref(); 158 ev.data->ref();
130 deref(); 159 deref();
131 data = ev.data; 160 data = ev.data;
132 161
133 162
134 return *this; 163 return *this;
135} 164}
136QString OEvent::description()const { 165
166
167QString OEvent::description() const
168{
137 return data->description; 169 return data->description;
138} 170}
139void OEvent::setDescription( const QString& description ) { 171
172
173void OEvent::setDescription( const QString& description )
174{
140 changeOrModify(); 175 changeOrModify();
141 data->description = description; 176 data->description = description;
142} 177}
143void OEvent::setLocation( const QString& loc ) { 178
179
180void OEvent::setLocation( const QString& loc )
181{
144 changeOrModify(); 182 changeOrModify();
145 data->location = loc; 183 data->location = loc;
146} 184}
147QString OEvent::location()const { 185
186
187QString OEvent::location() const
188{
148 return data->location; 189 return data->location;
149} 190}
150OPimNotifyManager &OEvent::notifiers()const { 191
192
193OPimNotifyManager &OEvent::notifiers() const
194{
151 // I hope we can skip the changeOrModify here 195 // I hope we can skip the changeOrModify here
152 // the notifier should take care of it 196 // the notifier should take care of it
153 // and OPimNotify is shared too 197 // and OPimNotify is shared too
154 if (!data->manager ) 198 if (!data->manager )
155 data->manager = new OPimNotifyManager; 199 data->manager = new OPimNotifyManager;
156 200
157 return *data->manager; 201 return *data->manager;
158} 202}
159bool OEvent::hasNotifiers()const { 203
204
205bool OEvent::hasNotifiers() const
206{
160 if (!data->manager ) 207 if (!data->manager )
161 return false; 208 return false;
162 if (data->manager->reminders().isEmpty() && 209 if (data->manager->reminders().isEmpty() &&
163 data->manager->alarms().isEmpty() ) 210 data->manager->alarms().isEmpty() )
164 return false; 211 return false;
165 212
166 return true; 213 return true;
167} 214}
168ORecur OEvent::recurrence()const { 215
216
217ORecur OEvent::recurrence() const
218{
169 if (!data->recur) 219 if (!data->recur)
170 data->recur = new ORecur; 220 data->recur = new ORecur;
171 221
172 return *data->recur; 222 return *data->recur;
173} 223}
174void OEvent::setRecurrence( const ORecur& rec) { 224
225
226void OEvent::setRecurrence( const ORecur& rec )
227{
175 changeOrModify(); 228 changeOrModify();
176 if (data->recur ) 229 if (data->recur )
177 (*data->recur) = rec; 230 (*data->recur) = rec;
178 else 231 else
179 data->recur = new ORecur( rec ); 232 data->recur = new ORecur( rec );
180} 233}
181bool OEvent::hasRecurrence()const { 234
235
236bool OEvent::hasRecurrence() const
237{
182 if (!data->recur ) return false; 238 if (!data->recur ) return false;
183 return data->recur->doesRecur(); 239 return data->recur->doesRecur();
184} 240}
185QString OEvent::note()const { 241
242
243QString OEvent::note() const
244{
186 return data->note; 245 return data->note;
187} 246}
188void OEvent::setNote( const QString& note ) { 247
248
249void OEvent::setNote( const QString& note )
250{
189 changeOrModify(); 251 changeOrModify();
190 data->note = note; 252 data->note = note;
191} 253}
192QDateTime OEvent::createdDateTime()const { 254
255
256QDateTime OEvent::createdDateTime() const
257{
193 return data->created; 258 return data->created;
194} 259}
195void OEvent::setCreatedDateTime( const QDateTime& time ) { 260
261
262void OEvent::setCreatedDateTime( const QDateTime& time )
263{
196 changeOrModify(); 264 changeOrModify();
197 data->created = time; 265 data->created = time;
198} 266}
199QDateTime OEvent::startDateTime()const { 267
268
269QDateTime OEvent::startDateTime() const
270{
200 if ( data->isAllDay ) 271 if ( data->isAllDay )
201 return QDateTime( data->start.date(), QTime(0, 0, 0 ) ); 272 return QDateTime( data->start.date(), QTime(0, 0, 0 ) );
202 return data->start; 273 return data->start;
203} 274}
204QDateTime OEvent::startDateTimeInZone()const { 275
276
277QDateTime OEvent::startDateTimeInZone() const
278{
205 /* if no timezone, or all day event or if the current and this timeZone match... */ 279 /* if no timezone, or all day event or if the current and this timeZone match... */
206 if (data->timezone.isEmpty() || data->isAllDay || data->timezone == OTimeZone::current().timeZone() ) return startDateTime(); 280 if (data->timezone.isEmpty() || data->isAllDay || data->timezone == OTimeZone::current().timeZone() ) return startDateTime();
207 281
208 OTimeZone zone(data->timezone ); 282 OTimeZone zone(data->timezone );
209 return zone.toDateTime( data->start, OTimeZone::current() ); 283 return zone.toDateTime( data->start, OTimeZone::current() );
210} 284}
211void OEvent::setStartDateTime( const QDateTime& dt ) { 285
286
287void OEvent::setStartDateTime( const QDateTime& dt )
288{
212 changeOrModify(); 289 changeOrModify();
213 data->start = dt; 290 data->start = dt;
214} 291}
215QDateTime OEvent::endDateTime()const { 292
293
294QDateTime OEvent::endDateTime() const
295{
216 /* 296 /*
217 * if all Day event the end time needs 297 * if all Day event the end time needs
218 * to be on the same day as the start 298 * to be on the same day as the start
219 */ 299 */
220 if ( data->isAllDay ) 300 if ( data->isAllDay )
221 return QDateTime( data->start.date(), QTime(23, 59, 59 ) ); 301 return QDateTime( data->start.date(), QTime(23, 59, 59 ) );
222 return data->end; 302 return data->end;
223} 303}
224QDateTime OEvent::endDateTimeInZone()const { 304
305
306QDateTime OEvent::endDateTimeInZone() const
307{
225 /* if no timezone, or all day event or if the current and this timeZone match... */ 308 /* if no timezone, or all day event or if the current and this timeZone match... */
226 if (data->timezone.isEmpty() || data->isAllDay || data->timezone == OTimeZone::current().timeZone() ) return endDateTime(); 309 if (data->timezone.isEmpty() || data->isAllDay || data->timezone == OTimeZone::current().timeZone() ) return endDateTime();
227 310
228 OTimeZone zone(data->timezone ); 311 OTimeZone zone(data->timezone );
229 return zone.toDateTime( data->end, OTimeZone::current() ); 312 return zone.toDateTime( data->end, OTimeZone::current() );
230} 313}
231void OEvent::setEndDateTime( const QDateTime& dt ) { 314
315
316void OEvent::setEndDateTime( const QDateTime& dt )
317{
232 changeOrModify(); 318 changeOrModify();
233 data->end = dt; 319 data->end = dt;
234} 320}
235bool OEvent::isMultipleDay()const { 321
322
323bool OEvent::isMultipleDay() const
324{
236 return data->end.date().day() - data->start.date().day(); 325 return data->end.date().day() - data->start.date().day();
237} 326}
238bool OEvent::isAllDay()const { 327
328
329bool OEvent::isAllDay() const
330{
239 return data->isAllDay; 331 return data->isAllDay;
240} 332}
241void OEvent::setAllDay( bool allDay ) { 333
334
335void OEvent::setAllDay( bool allDay )
336{
242 changeOrModify(); 337 changeOrModify();
243 data->isAllDay = allDay; 338 data->isAllDay = allDay;
244 if (allDay ) data->timezone = "UTC"; 339 if (allDay ) data->timezone = "UTC";
245} 340}
246void OEvent::setTimeZone( const QString& tz ) { 341
342
343void OEvent::setTimeZone( const QString& tz )
344{
247 changeOrModify(); 345 changeOrModify();
248 data->timezone = tz; 346 data->timezone = tz;
249} 347}
250QString OEvent::timeZone()const { 348
349
350QString OEvent::timeZone() const
351{
251 if (data->isAllDay ) return QString::fromLatin1("UTC"); 352 if (data->isAllDay ) return QString::fromLatin1("UTC");
252 return data->timezone; 353 return data->timezone;
253} 354}
254bool OEvent::match( const QRegExp& re )const { 355
255 if ( re.match( data->description ) != -1 ){ 356
357bool OEvent::match( const QRegExp& re ) const
358{
359 if ( re.match( data->description ) != -1 )
360 {
256 setLastHitField( Qtopia::DatebookDescription ); 361 setLastHitField( Qtopia::DatebookDescription );
257 return true; 362 return true;
258 } 363 }
259 if ( re.match( data->note ) != -1 ){ 364 if ( re.match( data->note ) != -1 )
365 {
260 setLastHitField( Qtopia::Note ); 366 setLastHitField( Qtopia::Note );
261 return true; 367 return true;
262 } 368 }
263 if ( re.match( data->location ) != -1 ){ 369 if ( re.match( data->location ) != -1 )
370 {
264 setLastHitField( Qtopia::Location ); 371 setLastHitField( Qtopia::Location );
265 return true; 372 return true;
266 } 373 }
267 if ( re.match( data->start.toString() ) != -1 ){ 374 if ( re.match( data->start.toString() ) != -1 )
375 {
268 setLastHitField( Qtopia::StartDateTime ); 376 setLastHitField( Qtopia::StartDateTime );
269 return true; 377 return true;
270 } 378 }
271 if ( re.match( data->end.toString() ) != -1 ){ 379 if ( re.match( data->end.toString() ) != -1 )
380 {
272 setLastHitField( Qtopia::EndDateTime ); 381 setLastHitField( Qtopia::EndDateTime );
273 return true; 382 return true;
274 } 383 }
275 return false; 384 return false;
276} 385}
277QString OEvent::toRichText()const { 386
387
388QString OEvent::toRichText() const
389{
278 QString text, value; 390 QString text, value;
279 391
280 // description 392 // description
281 text += "<b><h3><img src=\"datebook/DateBook\">"; 393 text += "<b><h3><img src=\"datebook/DateBook\">";
282 if ( !description().isEmpty() ) { 394 if ( !description().isEmpty() )
395 {
283 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "" ); 396 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "" );
284 } 397 }
285 text += "</h3></b><br><hr><br>"; 398 text += "</h3></b><br><hr><br>";
286 399
287 // location 400 // location
288 if ( !(value = location()).isEmpty() ) { 401 if ( !( value = location() ).isEmpty() )
402 {
289 text += "<b>" + QObject::tr( "Location:" ) + "</b> "; 403 text += "<b>" + QObject::tr( "Location:" ) + "</b> ";
290 text += Qtopia::escapeString(value) + "<br>"; 404 text += Qtopia::escapeString(value) + "<br>";
291 } 405 }
292 406
293 // all day event 407 // all day event
294 if ( isAllDay() ) { 408 if ( isAllDay() )
409 {
295 text += "<b><i>" + QObject::tr( "This is an all day event" ) + "</i></b><br>"; 410 text += "<b><i>" + QObject::tr( "This is an all day event" ) + "</i></b><br>";
296 } 411 }
297 // multiple day event 412 // multiple day event
298 else if ( isMultipleDay () ) { 413 else if ( isMultipleDay () )
414 {
299 text += "<b><i>" + QObject::tr( "This is a multiple day event" ) + "</i></b><br>"; 415 text += "<b><i>" + QObject::tr( "This is a multiple day event" ) + "</i></b><br>";
300 } 416 }
301 // start & end times 417 // start & end times
302 else { 418 else
419 {
303 // start time 420 // start time
304 if ( startDateTime().isValid() ) { 421 if ( startDateTime().isValid() )
422 {
305 text += "<b>" + QObject::tr( "Start:") + "</b> "; 423 text += "<b>" + QObject::tr( "Start:") + "</b> ";
306 text += Qtopia::escapeString(startDateTime().toString() ). 424 text += Qtopia::escapeString(startDateTime().toString() ).
307 replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; 425 replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
308 } 426 }
309 427
310 // end time 428 // end time
311 if ( endDateTime().isValid() ) { 429 if ( endDateTime().isValid() )
430 {
312 text += "<b>" + QObject::tr( "End:") + "</b> "; 431 text += "<b>" + QObject::tr( "End:") + "</b> ";
313 text += Qtopia::escapeString(endDateTime().toString() ). 432 text += Qtopia::escapeString(endDateTime().toString() ).
314 replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; 433 replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
315 } 434 }
316 } 435 }
317 436
318 // categories 437 // categories
319 if ( categoryNames("Calendar").count() ){ 438 if ( categoryNames( "Calendar" ).count() )
439 {
320 text += "<b>" + QObject::tr( "Category:") + "</b> "; 440 text += "<b>" + QObject::tr( "Category:") + "</b> ";
321 text += categoryNames("Calendar").join(", "); 441 text += categoryNames("Calendar").join(", ");
322 text += "<br>"; 442 text += "<br>";
323 } 443 }
324 444
325 //notes 445 //notes
326 if ( !note().isEmpty() ) { 446 if ( !note().isEmpty() )
447 {
327 text += "<b>" + QObject::tr( "Note:") + "</b><br>"; 448 text += "<b>" + QObject::tr( "Note:") + "</b><br>";
328 text += note(); 449 text += note();
329// text += Qtopia::escapeString(note() ). 450// text += Qtopia::escapeString(note() ).
330// replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; 451// replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
331 } 452 }
332 return text; 453 return text;
333} 454}
334QString OEvent::toShortText()const { 455
456
457QString OEvent::toShortText() const
458{
335 QString text; 459 QString text;
336 text += QString::number( startDateTime().date().day() ); 460 text += QString::number( startDateTime().date().day() );
337 text += "."; 461 text += ".";
338 text += QString::number( startDateTime().date().month() ); 462 text += QString::number( startDateTime().date().month() );
339 text += "."; 463 text += ".";
340 text += QString::number( startDateTime().date().year() ); 464 text += QString::number( startDateTime().date().year() );
@@ -343,29 +467,48 @@ QString OEvent::toShortText()const {
343 text += ":"; 467 text += ":";
344 text += QString::number( startDateTime().time().minute() ); 468 text += QString::number( startDateTime().time().minute() );
345 text += " - "; 469 text += " - ";
346 text += description(); 470 text += description();
347 return text; 471 return text;
348} 472}
349QString OEvent::type()const { 473
474
475QString OEvent::type() const
476{
350 return QString::fromLatin1("OEvent"); 477 return QString::fromLatin1("OEvent");
351} 478}
352QString OEvent::recordField( int /*id */ )const { 479
480
481QString OEvent::recordField( int /*id */ ) const
482{
353 return QString::null; 483 return QString::null;
354} 484}
355int OEvent::rtti() { 485
486
487int OEvent::rtti()
488{
356 return OPimResolver::DateBook; 489 return OPimResolver::DateBook;
357} 490}
358bool OEvent::loadFromStream( QDataStream& ) { 491
492
493bool OEvent::loadFromStream( QDataStream& )
494{
359 return true; 495 return true;
360} 496}
361bool OEvent::saveToStream( QDataStream& )const { 497
498
499bool OEvent::saveToStream( QDataStream& ) const
500{
362 return true; 501 return true;
363} 502}
364void OEvent::changeOrModify() { 503
365 if ( data->count != 1 ) { 504
505void OEvent::changeOrModify()
506{
507 if ( data->count != 1 )
508 {
366 data->deref(); 509 data->deref();
367 Data* d2 = new Data; 510 Data* d2 = new Data;
368 d2->description = data->description; 511 d2->description = data->description;
369 d2->location = data->location; 512 d2->location = data->location;
370 513
371 if (data->manager ) 514 if (data->manager )
@@ -379,32 +522,38 @@ void OEvent::changeOrModify() {
379 d2->start = data->start; 522 d2->start = data->start;
380 d2->end = data->end; 523 d2->end = data->end;
381 d2->isAllDay = data->isAllDay; 524 d2->isAllDay = data->isAllDay;
382 d2->timezone = data->timezone; 525 d2->timezone = data->timezone;
383 d2->parent = data->parent; 526 d2->parent = data->parent;
384 527
385 if ( data->child ) { 528 if ( data->child )
529 {
386 d2->child = new QArray<int>( *data->child ); 530 d2->child = new QArray<int>( *data->child );
387 d2->child->detach(); 531 d2->child->detach();
388 } 532 }
389 533
390 data = d2; 534 data = d2;
391 } 535 }
392} 536}
393void OEvent::deref() { 537
394 if ( data->deref() ) { 538
539void OEvent::deref()
540{
541 if ( data->deref() )
542 {
395 delete data; 543 delete data;
396 data = 0; 544 data = 0;
397 } 545 }
398} 546}
399// Exporting Event data to map. Using the same 547// Exporting Event data to map. Using the same
400// encoding as ODateBookAccessBackend_xml does.. 548// encoding as ODateBookAccessBackend_xml does..
401// Thus, we could remove the stuff there and use this 549// Thus, we could remove the stuff there and use this
402// for it and for all other places.. 550// for it and for all other places..
403// Encoding should happen at one place, only ! (eilers) 551// Encoding should happen at one place, only ! (eilers)
404QMap<int, QString> OEvent::toMap()const { 552QMap<int, QString> OEvent::toMap() const
553{
405 QMap<int, QString> retMap; 554 QMap<int, QString> retMap;
406 555
407 retMap.insert( OEvent::FUid, QString::number( uid() ) ); 556 retMap.insert( OEvent::FUid, QString::number( uid() ) );
408 retMap.insert( OEvent::FCategories, Qtopia::escapeString( Qtopia::Record::idsToString( categories() ) )); 557 retMap.insert( OEvent::FCategories, Qtopia::escapeString( Qtopia::Record::idsToString( categories() ) ));
409 retMap.insert( OEvent::FDescription, Qtopia::escapeString( description() ) ); 558 retMap.insert( OEvent::FDescription, Qtopia::escapeString( description() ) );
410 retMap.insert( OEvent::FLocation, Qtopia::escapeString( location() ) ); 559 retMap.insert( OEvent::FLocation, Qtopia::escapeString( location() ) );
@@ -417,43 +566,49 @@ QMap<int, QString> OEvent::toMap()const {
417 retMap.insert( OEvent::FStart, QString::number( zone.fromUTCDateTime( zone.toDateTime( startDateTime(), OTimeZone::utc() ) ) ) ); 566 retMap.insert( OEvent::FStart, QString::number( zone.fromUTCDateTime( zone.toDateTime( startDateTime(), OTimeZone::utc() ) ) ) );
418 retMap.insert( OEvent::FEnd, QString::number( zone.fromUTCDateTime( zone.toDateTime( endDateTime(), OTimeZone::utc() ) ) ) ); 567 retMap.insert( OEvent::FEnd, QString::number( zone.fromUTCDateTime( zone.toDateTime( endDateTime(), OTimeZone::utc() ) ) ) );
419 retMap.insert( OEvent::FNote, Qtopia::escapeString( note() ) ); 568 retMap.insert( OEvent::FNote, Qtopia::escapeString( note() ) );
420 retMap.insert( OEvent::FTimeZone, timeZone().isEmpty() ? QString( "None" ) : timeZone() ); 569 retMap.insert( OEvent::FTimeZone, timeZone().isEmpty() ? QString( "None" ) : timeZone() );
421 if( parent() ) 570 if( parent() )
422 retMap.insert( OEvent::FRecParent, QString::number( parent() ) ); 571 retMap.insert( OEvent::FRecParent, QString::number( parent() ) );
423 if( children().count() ){ 572 if ( children().count() )
573 {
424 QArray<int> childr = children(); 574 QArray<int> childr = children();
425 QString buf; 575 QString buf;
426 for ( uint i = 0; i < childr.count(); i++ ) { 576 for ( uint i = 0; i < childr.count(); i++ )
577 {
427 if ( i != 0 ) buf += " "; 578 if ( i != 0 ) buf += " ";
428 buf += QString::number( childr[i] ); 579 buf += QString::number( childr[i] );
429 } 580 }
430 retMap.insert( OEvent::FRecChildren, buf ); 581 retMap.insert( OEvent::FRecChildren, buf );
431 } 582 }
432 583
433 // Add recurrence stuff 584 // Add recurrence stuff
434 if( hasRecurrence() ){ 585 if ( hasRecurrence() )
586 {
435 ORecur recur = recurrence(); 587 ORecur recur = recurrence();
436 QMap<int, QString> recFields = recur.toMap(); 588 QMap<int, QString> recFields = recur.toMap();
437 retMap.insert( OEvent::FRType, recFields[ORecur::RType] ); 589 retMap.insert( OEvent::FRType, recFields[ORecur::RType] );
438 retMap.insert( OEvent::FRWeekdays, recFields[ORecur::RWeekdays] ); 590 retMap.insert( OEvent::FRWeekdays, recFields[ORecur::RWeekdays] );
439 retMap.insert( OEvent::FRPosition, recFields[ORecur::RPosition] ); 591 retMap.insert( OEvent::FRPosition, recFields[ORecur::RPosition] );
440 retMap.insert( OEvent::FRFreq, recFields[ORecur::RFreq] ); 592 retMap.insert( OEvent::FRFreq, recFields[ORecur::RFreq] );
441 retMap.insert( OEvent::FRHasEndDate, recFields[ORecur::RHasEndDate] ); 593 retMap.insert( OEvent::FRHasEndDate, recFields[ORecur::RHasEndDate] );
442 retMap.insert( OEvent::FREndDate, recFields[ORecur::EndDate] ); 594 retMap.insert( OEvent::FREndDate, recFields[ORecur::EndDate] );
443 retMap.insert( OEvent::FRCreated, recFields[ORecur::Created] ); 595 retMap.insert( OEvent::FRCreated, recFields[ORecur::Created] );
444 retMap.insert( OEvent::FRExceptions, recFields[ORecur::Exceptions] ); 596 retMap.insert( OEvent::FRExceptions, recFields[ORecur::Exceptions] );
445 } else { 597 }
598 else
599 {
446 ORecur recur = recurrence(); 600 ORecur recur = recurrence();
447 QMap<int, QString> recFields = recur.toMap(); 601 QMap<int, QString> recFields = recur.toMap();
448 retMap.insert( OEvent::FRType, recFields[ORecur::RType] ); 602 retMap.insert( OEvent::FRType, recFields[ORecur::RType] );
449 } 603 }
450 604
451 return retMap; 605 return retMap;
452} 606}
453 607
608
454void OEvent::fromMap( const QMap<int, QString>& map ) 609void OEvent::fromMap( const QMap<int, QString>& map )
455{ 610{
456 611
457 // We just want to set the UID if it is really stored. 612 // We just want to set the UID if it is really stored.
458 if ( !map[OEvent::FUid].isEmpty() ) 613 if ( !map[OEvent::FUid].isEmpty() )
459 setUid( map[OEvent::FUid].toInt() ); 614 setUid( map[OEvent::FUid].toInt() );
@@ -469,31 +624,36 @@ void OEvent::fromMap( const QMap<int, QString>& map )
469 624
470 int alarmTime = -1; 625 int alarmTime = -1;
471 if( !map[OEvent::FAlarm].isEmpty() ) 626 if( !map[OEvent::FAlarm].isEmpty() )
472 alarmTime = map[OEvent::FAlarm].toInt(); 627 alarmTime = map[OEvent::FAlarm].toInt();
473 628
474 int sound = ( ( map[OEvent::FSound] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent ); 629 int sound = ( ( map[OEvent::FSound] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent );
475 if ( ( alarmTime != -1 ) ){ 630 if ( ( alarmTime != -1 ) )
631 {
476 QDateTime dt = startDateTime().addSecs( -1*alarmTime*60 ); 632 QDateTime dt = startDateTime().addSecs( -1*alarmTime*60 );
477 OPimAlarm al( sound , dt ); 633 OPimAlarm al( sound , dt );
478 notifiers().add( al ); 634 notifiers().add( al );
479 } 635 }
480 if ( !map[OEvent::FTimeZone].isEmpty() && ( map[OEvent::FTimeZone] != "None" ) ){ 636 if ( !map[ OEvent::FTimeZone ].isEmpty() && ( map[ OEvent::FTimeZone ] != "None" ) )
637 {
481 setTimeZone( map[OEvent::FTimeZone] ); 638 setTimeZone( map[OEvent::FTimeZone] );
482 } 639 }
483 640
484 time_t start = (time_t) map[OEvent::FStart].toLong(); 641 time_t start = (time_t) map[OEvent::FStart].toLong();
485 time_t end = (time_t) map[OEvent::FEnd].toLong(); 642 time_t end = (time_t) map[OEvent::FEnd].toLong();
486 643
487 /* AllDay is always in UTC */ 644 /* AllDay is always in UTC */
488 if ( isAllDay() ) { 645 if ( isAllDay() )
646 {
489 OTimeZone utc = OTimeZone::utc(); 647 OTimeZone utc = OTimeZone::utc();
490 setStartDateTime( utc.fromUTCDateTime( start ) ); 648 setStartDateTime( utc.fromUTCDateTime( start ) );
491 setEndDateTime ( utc.fromUTCDateTime( end ) ); 649 setEndDateTime ( utc.fromUTCDateTime( end ) );
492 setTimeZone( "UTC"); // make sure it is really utc 650 setTimeZone( "UTC"); // make sure it is really utc
493 }else { 651 }
652 else
653 {
494 /* to current date time */ 654 /* to current date time */
495 // qWarning(" Start is %d", start ); 655 // qWarning(" Start is %d", start );
496 OTimeZone zone( timeZone().isEmpty() ? OTimeZone::current() : timeZone() ); 656 OTimeZone zone( timeZone().isEmpty() ? OTimeZone::current() : timeZone() );
497 QDateTime date = zone.toDateTime( start ); 657 QDateTime date = zone.toDateTime( start );
498 qWarning(" Start is %s", date.toString().latin1() ); 658 qWarning(" Start is %s", date.toString().latin1() );
499 setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) ); 659 setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) );
@@ -502,21 +662,24 @@ void OEvent::fromMap( const QMap<int, QString>& map )
502 setEndDateTime ( zone.toDateTime( date, OTimeZone::current() ) ); 662 setEndDateTime ( zone.toDateTime( date, OTimeZone::current() ) );
503 } 663 }
504 664
505 if ( !map[OEvent::FRecParent].isEmpty() ) 665 if ( !map[OEvent::FRecParent].isEmpty() )
506 setParent( map[OEvent::FRecParent].toInt() ); 666 setParent( map[OEvent::FRecParent].toInt() );
507 667
508 if ( !map[OEvent::FRecChildren].isEmpty() ){ 668 if ( !map[ OEvent::FRecChildren ].isEmpty() )
669 {
509 QStringList list = QStringList::split(' ', map[OEvent::FRecChildren] ); 670 QStringList list = QStringList::split(' ', map[OEvent::FRecChildren] );
510 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 671 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
672 {
511 addChild( (*it).toInt() ); 673 addChild( (*it).toInt() );
512 } 674 }
513 } 675 }
514 676
515 // Fill recurrence stuff and put it directly into the ORecur-Object using fromMap.. 677 // Fill recurrence stuff and put it directly into the ORecur-Object using fromMap..
516 if( !map[OEvent::FRType].isEmpty() ){ 678 if ( !map[ OEvent::FRType ].isEmpty() )
679 {
517 QMap<int, QString> recFields; 680 QMap<int, QString> recFields;
518 recFields.insert( ORecur::RType, map[OEvent::FRType] ); 681 recFields.insert( ORecur::RType, map[OEvent::FRType] );
519 recFields.insert( ORecur::RWeekdays, map[OEvent::FRWeekdays] ); 682 recFields.insert( ORecur::RWeekdays, map[OEvent::FRWeekdays] );
520 recFields.insert( ORecur::RPosition, map[OEvent::FRPosition] ); 683 recFields.insert( ORecur::RPosition, map[OEvent::FRPosition] );
521 recFields.insert( ORecur::RFreq, map[OEvent::FRFreq] ); 684 recFields.insert( ORecur::RFreq, map[OEvent::FRFreq] );
522 recFields.insert( ORecur::RHasEndDate, map[OEvent::FRHasEndDate] ); 685 recFields.insert( ORecur::RHasEndDate, map[OEvent::FRHasEndDate] );
@@ -527,74 +690,103 @@ void OEvent::fromMap( const QMap<int, QString>& map )
527 setRecurrence( recur ); 690 setRecurrence( recur );
528 } 691 }
529 692
530} 693}
531 694
532 695
533int OEvent::parent()const { 696int OEvent::parent() const
697{
534 return data->parent; 698 return data->parent;
535} 699}
536void OEvent::setParent( int uid ) { 700
701
702void OEvent::setParent( int uid )
703{
537 changeOrModify(); 704 changeOrModify();
538 data->parent = uid; 705 data->parent = uid;
539} 706}
540QArray<int> OEvent::children() const{ 707
708
709QArray<int> OEvent::children() const
710{
541 if (!data->child) return QArray<int>(); 711 if (!data->child) return QArray<int>();
542 else 712 else
543 return data->child->copy(); 713 return data->child->copy();
544} 714}
545void OEvent::setChildren( const QArray<int>& arr ) { 715
716
717void OEvent::setChildren( const QArray<int>& arr )
718{
546 changeOrModify(); 719 changeOrModify();
547 if (data->child) delete data->child; 720 if (data->child) delete data->child;
548 721
549 data->child = new QArray<int>( arr ); 722 data->child = new QArray<int>( arr );
550 data->child->detach(); 723 data->child->detach();
551} 724}
552void OEvent::addChild( int uid ) { 725
726
727void OEvent::addChild( int uid )
728{
553 changeOrModify(); 729 changeOrModify();
554 if (!data->child ) { 730 if ( !data->child )
731 {
555 data->child = new QArray<int>(1); 732 data->child = new QArray<int>(1);
556 (*data->child)[0] = uid; 733 (*data->child)[0] = uid;
557 }else{ 734 }
735 else
736 {
558 int count = data->child->count(); 737 int count = data->child->count();
559 data->child->resize( count + 1 ); 738 data->child->resize( count + 1 );
560 (*data->child)[count] = uid; 739 (*data->child)[count] = uid;
561 } 740 }
562} 741}
563void OEvent::removeChild( int uid ) { 742
743
744void OEvent::removeChild( int uid )
745{
564 if (!data->child || !data->child->contains( uid ) ) return; 746 if (!data->child || !data->child->contains( uid ) ) return;
565 changeOrModify(); 747 changeOrModify();
566 QArray<int> newAr( data->child->count() - 1 ); 748 QArray<int> newAr( data->child->count() - 1 );
567 int j = 0; 749 int j = 0;
568 uint count = data->child->count(); 750 uint count = data->child->count();
569 for ( uint i = 0; i < count; i++ ) { 751 for ( uint i = 0; i < count; i++ )
570 if ( (*data->child)[i] != uid ) { 752 {
753 if ( ( *data->child ) [ i ] != uid )
754 {
571 newAr[j] = (*data->child)[i]; 755 newAr[j] = (*data->child)[i];
572 j++; 756 j++;
573 } 757 }
574 } 758 }
575 (*data->child) = newAr; 759 (*data->child) = newAr;
576} 760}
577struct OEffectiveEvent::Data : public QShared { 761
578 Data() : QShared() { 762
579 } 763struct OEffectiveEvent::Data : public QShared
764{
765 Data() : QShared()
766 {}
580 OEvent event; 767 OEvent event;
581 QDate date; 768 QDate date;
582 QTime start, end; 769 QTime start, end;
583 QDate startDate, endDate; 770 QDate startDate, endDate;
584 bool dates : 1; 771 bool dates : 1;
585}; 772};
586 773
587OEffectiveEvent::OEffectiveEvent() { 774
775OEffectiveEvent::OEffectiveEvent()
776{
588 data = new Data; 777 data = new Data;
589 data->date = QDate::currentDate(); 778 data->date = QDate::currentDate();
590 data->start = data->end = QTime::currentTime(); 779 data->start = data->end = QTime::currentTime();
591 data->dates = false; 780 data->dates = false;
592} 781}
782
783
593OEffectiveEvent::OEffectiveEvent( const OEvent& ev, const QDate& startDate, 784OEffectiveEvent::OEffectiveEvent( const OEvent& ev, const QDate& startDate,
594 Position pos ) { 785 Position pos )
786{
595 data = new Data; 787 data = new Data;
596 data->event = ev; 788 data->event = ev;
597 data->date = startDate; 789 data->date = startDate;
598 if ( pos & Start ) 790 if ( pos & Start )
599 data->start = ev.startDateTime().time(); 791 data->start = ev.startDateTime().time();
600 else 792 else
@@ -604,146 +796,230 @@ OEffectiveEvent::OEffectiveEvent( const OEvent& ev, const QDate& startDate,
604 data->end = ev.endDateTime().time(); 796 data->end = ev.endDateTime().time();
605 else 797 else
606 data->end = QTime( 23, 59, 59 ); 798 data->end = QTime( 23, 59, 59 );
607 799
608 data->dates = false; 800 data->dates = false;
609} 801}
610OEffectiveEvent::OEffectiveEvent( const OEffectiveEvent& ev) { 802
803
804OEffectiveEvent::OEffectiveEvent( const OEffectiveEvent& ev )
805{
611 data = ev.data; 806 data = ev.data;
612 data->ref(); 807 data->ref();
613} 808}
614OEffectiveEvent::~OEffectiveEvent() { 809
615 if ( data->deref() ) { 810
811OEffectiveEvent::~OEffectiveEvent()
812{
813 if ( data->deref() )
814 {
616 delete data; 815 delete data;
617 data = 0; 816 data = 0;
618 } 817 }
619} 818}
620OEffectiveEvent& OEffectiveEvent::operator=( const OEffectiveEvent& ev ) { 819
820
821OEffectiveEvent& OEffectiveEvent::operator=( const OEffectiveEvent& ev )
822{
621 if ( *this == ev ) return *this; 823 if ( *this == ev ) return *this;
622 824
623 ev.data->ref(); 825 ev.data->ref();
624 deref(); 826 deref();
625 data = ev.data; 827 data = ev.data;
626 828
627 return *this; 829 return *this;
628} 830}
629 831
630void OEffectiveEvent::setStartTime( const QTime& ti) { 832
833void OEffectiveEvent::setStartTime( const QTime& ti )
834{
631 changeOrModify(); 835 changeOrModify();
632 data->start = ti; 836 data->start = ti;
633} 837}
634void OEffectiveEvent::setEndTime( const QTime& en) { 838
839
840void OEffectiveEvent::setEndTime( const QTime& en )
841{
635 changeOrModify(); 842 changeOrModify();
636 data->end = en; 843 data->end = en;
637} 844}
638void OEffectiveEvent::setEvent( const OEvent& ev) { 845
846
847void OEffectiveEvent::setEvent( const OEvent& ev )
848{
639 changeOrModify(); 849 changeOrModify();
640 data->event = ev; 850 data->event = ev;
641} 851}
642void OEffectiveEvent::setDate( const QDate& da) { 852
853
854void OEffectiveEvent::setDate( const QDate& da )
855{
643 changeOrModify(); 856 changeOrModify();
644 data->date = da; 857 data->date = da;
645} 858}
859
860
646void OEffectiveEvent::setEffectiveDates( const QDate& from, 861void OEffectiveEvent::setEffectiveDates( const QDate& from,
647 const QDate& to ) { 862 const QDate& to )
648 if (!from.isValid() ) { 863{
864 if ( !from.isValid() )
865 {
649 data->dates = false; 866 data->dates = false;
650 return; 867 return;
651 } 868 }
652 869
653 data->startDate = from; 870 data->startDate = from;
654 data->endDate = to; 871 data->endDate = to;
655} 872}
656QString OEffectiveEvent::description()const { 873
874
875QString OEffectiveEvent::description() const
876{
657 return data->event.description(); 877 return data->event.description();
658} 878}
659QString OEffectiveEvent::location()const { 879
880
881QString OEffectiveEvent::location() const
882{
660 return data->event.location(); 883 return data->event.location();
661} 884}
662QString OEffectiveEvent::note()const { 885
886
887QString OEffectiveEvent::note() const
888{
663 return data->event.note(); 889 return data->event.note();
664} 890}
665OEvent OEffectiveEvent::event()const { 891
892
893OEvent OEffectiveEvent::event() const
894{
666 return data->event; 895 return data->event;
667} 896}
668QTime OEffectiveEvent::startTime()const { 897
898
899QTime OEffectiveEvent::startTime() const
900{
669 return data->start; 901 return data->start;
670} 902}
671QTime OEffectiveEvent::endTime()const { 903
904
905QTime OEffectiveEvent::endTime() const
906{
672 return data->end; 907 return data->end;
673} 908}
674QDate OEffectiveEvent::date()const { 909
910
911QDate OEffectiveEvent::date() const
912{
675 return data->date; 913 return data->date;
676} 914}
677int OEffectiveEvent::length()const { 915
916
917int OEffectiveEvent::length() const
918{
678 return (data->end.hour() * 60 - data->start.hour() * 60) 919 return (data->end.hour() * 60 - data->start.hour() * 60)
679 + QABS(data->start.minute() - data->end.minute() ); 920 + QABS(data->start.minute() - data->end.minute() );
680} 921}
681int OEffectiveEvent::size()const { 922
923
924int OEffectiveEvent::size() const
925{
682 return ( data->end.hour() - data->start.hour() ) * 3600 926 return ( data->end.hour() - data->start.hour() ) * 3600
683 + (data->end.minute() - data->start.minute() * 60 927 + (data->end.minute() - data->start.minute() * 60
684 + data->end.second() - data->start.second() ); 928 + data->end.second() - data->start.second() );
685} 929}
686QDate OEffectiveEvent::startDate()const { 930
931
932QDate OEffectiveEvent::startDate() const
933{
687 if ( data->dates ) 934 if ( data->dates )
688 return data->startDate; 935 return data->startDate;
689 else if ( data->event.hasRecurrence() ) // single day, since multi-day should have a d pointer 936 else if ( data->event.hasRecurrence() ) // single day, since multi-day should have a d pointer
690 return data->date; 937 return data->date;
691 else 938 else
692 return data->event.startDateTime().date(); 939 return data->event.startDateTime().date();
693} 940}
694QDate OEffectiveEvent::endDate()const { 941
942
943QDate OEffectiveEvent::endDate() const
944{
695 if ( data->dates ) 945 if ( data->dates )
696 return data->endDate; 946 return data->endDate;
697 else if ( data->event.hasRecurrence() ) 947 else if ( data->event.hasRecurrence() )
698 return data->date; 948 return data->date;
699 else 949 else
700 return data->event.endDateTime().date(); 950 return data->event.endDateTime().date();
701} 951}
702void OEffectiveEvent::deref() { 952
703 if ( data->deref() ) { 953
954void OEffectiveEvent::deref()
955{
956 if ( data->deref() )
957 {
704 delete data; 958 delete data;
705 data = 0; 959 data = 0;
706 } 960 }
707} 961}
708void OEffectiveEvent::changeOrModify() { 962
709 if ( data->count != 1 ) { 963
964void OEffectiveEvent::changeOrModify()
965{
966 if ( data->count != 1 )
967 {
710 data->deref(); 968 data->deref();
711 Data* d2 = new Data; 969 Data* d2 = new Data;
712 d2->event = data->event; 970 d2->event = data->event;
713 d2->date = data->date; 971 d2->date = data->date;
714 d2->start = data->start; 972 d2->start = data->start;
715 d2->end = data->end; 973 d2->end = data->end;
716 d2->startDate = data->startDate; 974 d2->startDate = data->startDate;
717 d2->endDate = data->endDate; 975 d2->endDate = data->endDate;
718 d2->dates = data->dates; 976 d2->dates = data->dates;
719 data = d2; 977 data = d2;
720 } 978 }
721} 979}
722bool OEffectiveEvent::operator<( const OEffectiveEvent &e ) const{ 980
981
982bool OEffectiveEvent::operator<( const OEffectiveEvent &e ) const
983{
723 if ( data->date < e.date() ) 984 if ( data->date < e.date() )
724 return TRUE; 985 return TRUE;
725 if ( data->date == e.date() ) 986 if ( data->date == e.date() )
726 return ( startTime() < e.startTime() ); 987 return ( startTime() < e.startTime() );
727 else 988 else
728 return FALSE; 989 return FALSE;
729} 990}
730bool OEffectiveEvent::operator<=( const OEffectiveEvent &e ) const{ 991
992
993bool OEffectiveEvent::operator<=( const OEffectiveEvent &e ) const
994{
731 return (data->date <= e.date() ); 995 return (data->date <= e.date() );
732} 996}
733bool OEffectiveEvent::operator==( const OEffectiveEvent &e ) const { 997
998
999bool OEffectiveEvent::operator==( const OEffectiveEvent &e ) const
1000{
734 return ( date() == e.date() 1001 return ( date() == e.date()
735 && startTime() == e.startTime() 1002 && startTime() == e.startTime()
736 && endTime()== e.endTime() 1003 && endTime()== e.endTime()
737 && event() == e.event() ); 1004 && event() == e.event() );
738} 1005}
739bool OEffectiveEvent::operator!=( const OEffectiveEvent &e ) const { 1006
1007
1008bool OEffectiveEvent::operator!=( const OEffectiveEvent &e ) const
1009{
740 return !(*this == e ); 1010 return !(*this == e );
741} 1011}
742bool OEffectiveEvent::operator>( const OEffectiveEvent &e ) const { 1012
1013
1014bool OEffectiveEvent::operator>( const OEffectiveEvent &e ) const
1015{
743 return !(*this <= e ); 1016 return !(*this <= e );
744} 1017}
745bool OEffectiveEvent::operator>= ( const OEffectiveEvent &e ) const { 1018
1019
1020bool OEffectiveEvent::operator>= ( const OEffectiveEvent &e ) const
1021{
746 return !(*this < e); 1022 return !(*this < e);
747} 1023}
748 1024
749} 1025}