libkcal

icalformat.cpp
1 /*
2  This file is part of libkcal.
3 
4  Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include <tqdatetime.h>
23 #include <tqstring.h>
24 #include <tqptrlist.h>
25 #include <tqregexp.h>
26 #include <tqclipboard.h>
27 #include <tqfile.h>
28 #include <tqtextstream.h>
29 
30 #include <kdebug.h>
31 #include <tdelocale.h>
32 
33 extern "C" {
34  #include <libical/ical.h>
35  #include <libical/icalss.h>
36  #include <libical/icalparser.h>
37  #include <libical/icalrestriction.h>
38  #include <libical/icalmemory.h>
39 }
40 
41 #include "calendar.h"
42 #include "calendarlocal.h"
43 #include "journal.h"
44 
45 #include "icalformat.h"
46 #include "icalformatimpl.h"
47 #include <ksavefile.h>
48 
49 #include <stdio.h>
50 
51 #define _ICAL_VERSION "2.0"
52 
53 using namespace KCal;
54 
55 ICalFormat::ICalFormat() : mImpl(0)
56 {
57  setImplementation( new ICalFormatImpl( this ) );
58 
59  mTimeZoneId = "UTC";
60  mUtc = true;
61 }
62 
63 ICalFormat::~ICalFormat()
64 {
65  delete mImpl;
66 }
67 
68 void ICalFormat::setImplementation( ICalFormatImpl *impl )
69 {
70  if ( mImpl ) delete mImpl;
71  mImpl = impl;
72 }
73 
74 #if defined(_AIX) && defined(open)
75 #undef open
76 #endif
77 
78 bool ICalFormat::load( Calendar *calendar, const TQString &fileName)
79 {
80  kdDebug(5800) << "ICalFormat::load() " << fileName << endl;
81 
83 
84  TQFile file( fileName );
85  if (!file.open( IO_ReadOnly ) ) {
86  kdDebug(5800) << "ICalFormat::load() load error" << endl;
88  return false;
89  }
90  TQTextStream ts( &file );
91  ts.setEncoding( TQTextStream::UnicodeUTF8 );
92  TQString text = ts.read();
93  file.close();
94 
95  if ( text.stripWhiteSpace().isEmpty() ) // empty files are valid
96  return true;
97  else
98  return fromRawString( calendar, text.utf8() );
99 }
100 
101 
102 bool ICalFormat::save( Calendar *calendar, const TQString &fileName )
103 {
104  kdDebug(5800) << "ICalFormat::save(): " << fileName << endl;
105 
106  clearException();
107 
108  TQString text = toString( calendar );
109 
110  if ( text.isNull() ) return false;
111 
112  // Write backup file
113  KSaveFile::backupFile( fileName );
114 
115  KSaveFile file( fileName );
116  if ( file.status() != 0 ) {
117  kdDebug(5800) << "ICalFormat::save() errno: " << strerror( file.status() )
118  << endl;
120  i18n( "Error saving to '%1'." ).arg( fileName ) ) );
121  return false;
122  }
123 
124  // Convert to UTF8 and save
125  TQCString textUtf8 = text.utf8();
126  file.textStream()->setEncoding( TQTextStream::UnicodeUTF8 );
127  file.file()->writeBlock(textUtf8.data(),textUtf8.size()-1);
128 
129  if ( !file.close() ) {
130  kdDebug(5800) << "KSaveFile: close: status was " << file.status() << ". See errno.h." << endl;
132  i18n("Could not save '%1'").arg(fileName)));
133  return false;
134  }
135 
136  return true;
137 }
138 
139 bool ICalFormat::fromString( Calendar *cal, const TQString &text )
140 {
141  return fromRawString( cal, text.utf8() );
142 }
143 
144 bool ICalFormat::fromRawString( Calendar *cal, const TQCString &text )
145 {
146  setTimeZone( cal->timeZoneId(), !cal->isLocalTime() );
147 
148  // Get first VCALENDAR component.
149  // TODO: Handle more than one VCALENDAR or non-VCALENDAR top components
150  icalcomponent *calendar;
151 
152  // Let's defend const correctness until the very gates of hell
153  calendar = icalcomponent_new_from_string( const_cast<char*>( (const char*)text ) );
154  // kdDebug(5800) << "Error: " << icalerror_perror() << endl;
155  if (!calendar) {
156  kdDebug(5800) << "ICalFormat::load() parse error" << endl;
158  return false;
159  }
160 
161  bool success = true;
162 
163  if (icalcomponent_isa(calendar) == ICAL_XROOT_COMPONENT) {
164  icalcomponent *comp;
165  for ( comp = icalcomponent_get_first_component(calendar, ICAL_VCALENDAR_COMPONENT);
166  comp != 0; comp = icalcomponent_get_next_component(calendar, ICAL_VCALENDAR_COMPONENT) ) {
167  // put all objects into their proper places
168  if ( !mImpl->populate( cal, comp ) ) {
169  kdDebug(5800) << "ICalFormat::load(): Could not populate calendar" << endl;
170  if ( !exception() ) {
172  }
173  success = false;
174  } else {
175  mLoadedProductId = mImpl->loadedProductId();
176  }
177  icalcomponent_free( comp );
178  }
179  } else if (icalcomponent_isa(calendar) != ICAL_VCALENDAR_COMPONENT) {
180  kdDebug(5800) << "ICalFormat::load(): No VCALENDAR component found" << endl;
182  success = false;
183  } else {
184  // put all objects into their proper places
185  if ( !mImpl->populate( cal, calendar ) ) {
186  kdDebug(5800) << "ICalFormat::load(): Could not populate calendar" << endl;
187  if ( !exception() ) {
189  }
190  success = false;
191  } else
192  mLoadedProductId = mImpl->loadedProductId();
193  }
194 
195  icalcomponent_free( calendar );
196  icalmemory_free_ring();
197 
198  return success;
199 }
200 
201 Incidence *ICalFormat::fromString( const TQString &text )
202 {
203  CalendarLocal cal( mTimeZoneId );
204  fromString(&cal, text);
205 
206  Incidence *ical = 0;
207  Event::List elist = cal.events();
208  if ( elist.count() > 0 ) {
209  ical = elist.first();
210  } else {
211  Todo::List tlist = cal.todos();
212  if ( tlist.count() > 0 ) {
213  ical = tlist.first();
214  } else {
215  Journal::List jlist = cal.journals();
216  if ( jlist.count() > 0 ) {
217  ical = jlist.first();
218  }
219  }
220  }
221 
222  return ical ? ical->clone() : 0;
223 }
224 
226 {
227  setTimeZone( cal->timeZoneId(), !cal->isLocalTime() );
228 
229  icalcomponent *calendar = mImpl->createCalendarComponent(cal);
230 
231  icalcomponent *component;
232 
233  // todos
234  Todo::List todoList = cal->rawTodos();
235  Todo::List::ConstIterator it;
236  for( it = todoList.begin(); it != todoList.end(); ++it ) {
237 // kdDebug(5800) << "ICalFormat::toString() write todo "
238 // << (*it)->uid() << endl;
239  component = mImpl->writeTodo( *it );
240  icalcomponent_add_component( calendar, component );
241  }
242 
243  // events
244  Event::List events = cal->rawEvents();
245  Event::List::ConstIterator it2;
246  for( it2 = events.begin(); it2 != events.end(); ++it2 ) {
247 // kdDebug(5800) << "ICalFormat::toString() write event "
248 // << (*it2)->uid() << endl;
249  component = mImpl->writeEvent( *it2 );
250  icalcomponent_add_component( calendar, component );
251  }
252 
253  // journals
254  Journal::List journals = cal->journals();
255  Journal::List::ConstIterator it3;
256  for( it3 = journals.begin(); it3 != journals.end(); ++it3 ) {
257  kdDebug(5800) << "ICalFormat::toString() write journal "
258  << (*it3)->uid() << endl;
259  component = mImpl->writeJournal( *it3 );
260  icalcomponent_add_component( calendar, component );
261  }
262 
263  TQString text = TQString::fromUtf8( icalcomponent_as_ical_string( calendar ) );
264 
265  icalcomponent_free( calendar );
266  icalmemory_free_ring();
267 
268  if (!text) {
270  i18n("libical error")));
271  return TQString();
272  }
273 
274  return text;
275 }
276 
277 TQString ICalFormat::toICalString( Incidence *incidence )
278 {
279  CalendarLocal cal( mTimeZoneId );
280  cal.addIncidence( incidence->clone() );
281  return toString( &cal );
282 }
283 
284 TQString ICalFormat::toString( Incidence *incidence )
285 {
286  icalcomponent *component;
287 
288  component = mImpl->writeIncidence( incidence );
289 
290  TQString text = TQString::fromUtf8( icalcomponent_as_ical_string( component ) );
291 
292  icalcomponent_free( component );
293 
294  return text;
295 }
296 
297 TQString ICalFormat::toString( Incidence *incidence, Calendar *calendar )
298 {
299  icalcomponent *component;
300  TQString text = "";
301 
302  // See if there are any parent or child events that must be added to the string
303  if ( incidence->hasRecurrenceID() ) {
304  // Get the parent
305  IncidenceList il = incidence->childIncidences();
306  IncidenceListIterator it;
307  it = il.begin();
308  Incidence *parentIncidence;
309  parentIncidence = calendar->incidence(*it);
310  il = parentIncidence->childIncidences();
311  if (il.count() > 0) {
312  for ( it = il.begin(); it != il.end(); ++it ) {
313  component = mImpl->writeIncidence( calendar->incidence(*it) );
314  text = text + TQString::fromUtf8( icalcomponent_as_ical_string( component ) );
315  icalcomponent_free( component );
316  }
317  }
318  component = mImpl->writeIncidence( parentIncidence );
319  text = text + TQString::fromUtf8( icalcomponent_as_ical_string( component ) );
320  icalcomponent_free( component );
321  }
322  else {
323  // This incidence is a potential parent
324  IncidenceList il = incidence->childIncidences();
325  if (il.count() > 0) {
326  IncidenceListIterator it;
327  for ( it = il.begin(); it != il.end(); ++it ) {
328  component = mImpl->writeIncidence( calendar->incidence(*it) );
329  text = text + TQString::fromUtf8( icalcomponent_as_ical_string( component ) );
330  icalcomponent_free( component );
331  }
332  }
333  component = mImpl->writeIncidence( incidence );
334  text = text + TQString::fromUtf8( icalcomponent_as_ical_string( component ) );
335  icalcomponent_free( component );
336  }
337 
338  return text;
339 }
340 
341 TQString ICalFormat::toString( RecurrenceRule *recurrence )
342 {
343  icalproperty *property;
344  property = icalproperty_new_rrule( mImpl->writeRecurrenceRule( recurrence ) );
345  TQString text = TQString::fromUtf8( icalproperty_as_ical_string( property ) );
346  icalproperty_free( property );
347  return text;
348 }
349 
350 bool ICalFormat::fromString( RecurrenceRule * recurrence, const TQString& rrule )
351 {
352  if ( !recurrence ) return false;
353  bool success = true;
354  icalerror_clear_errno();
355  struct icalrecurrencetype recur = icalrecurrencetype_from_string( rrule.latin1() );
356  if ( icalerrno != ICAL_NO_ERROR ) {
357  kdDebug(5800) << "Recurrence parsing error: " << icalerror_strerror( icalerrno ) << endl;
358  success = false;
359  }
360 
361  if ( success ) {
362  mImpl->readRecurrence( recur, recurrence );
363  }
364 
365  return success;
366 }
367 
368 
370  Scheduler::Method method)
371 {
372  icalcomponent *message = 0;
373 
374  // Handle scheduling ID being present
375  if ( incidence->type() == "Event" || incidence->type() == "Todo" ) {
376  Incidence* i = static_cast<Incidence*>( incidence );
377  if ( i->schedulingID() != i->uid() ) {
378  // We have a separation of scheduling ID and UID
379  i = i->clone();
380  i->setUid( i->schedulingID() );
381  i->setSchedulingID( TQString() );
382 
383  // Build the message with the cloned incidence
384  message = mImpl->createScheduleComponent( i, method );
385 
386  // And clean up
387  delete i;
388  }
389  }
390 
391  if ( message == 0 )
392  message = mImpl->createScheduleComponent(incidence,method);
393 
394  // FIXME TODO: Don't we have to free message? What about the ical_string? MEMLEAK
395  TQString messageText = TQString::fromUtf8( icalcomponent_as_ical_string(message) );
396 
397 #if 0
398  kdDebug(5800) << "ICalFormat::createScheduleMessage: message START\n"
399  << messageText
400  << "ICalFormat::createScheduleMessage: message END" << endl;
401 #endif
402 
403  return messageText;
404 }
405 
406 FreeBusy *ICalFormat::parseFreeBusy( const TQString &str )
407 {
408  clearException();
409 
410  icalcomponent *message;
411  message = icalparser_parse_string( str.utf8() );
412 
413  if ( !message ) return 0;
414 
415  FreeBusy *freeBusy = 0;
416 
417  icalcomponent *c;
418  for ( c = icalcomponent_get_first_component( message, ICAL_VFREEBUSY_COMPONENT );
419  c != 0; c = icalcomponent_get_next_component( message, ICAL_VFREEBUSY_COMPONENT ) ) {
420  FreeBusy *fb = mImpl->readFreeBusy( c );
421 
422  if ( freeBusy ) {
423  freeBusy->merge( fb );
424  delete fb;
425  } else {
426  freeBusy = fb;
427  }
428  }
429 
430  if ( !freeBusy )
431  kdDebug(5800) << "ICalFormat:parseFreeBusy: object is not a freebusy."
432  << endl;
433  return freeBusy;
434 }
435 
437  const TQString &messageText )
438 {
439  setTimeZone( cal->timeZoneId(), !cal->isLocalTime() );
440  clearException();
441 
442  if (messageText.isEmpty())
443  {
444  setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "messageText was empty, unable to parse into a ScheduleMessage" ) ) );
445  return 0;
446  }
447  // TODO FIXME: Don't we have to ical-free message??? MEMLEAK
448  icalcomponent *message;
449  message = icalparser_parse_string(messageText.utf8());
450 
451  if (!message)
452  {
453  setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "icalparser was unable to parse messageText into a ScheduleMessage" ) ) );
454  return 0;
455  }
456 
457  icalproperty *m = icalcomponent_get_first_property(message,
458  ICAL_METHOD_PROPERTY);
459  if (!m)
460  {
461  setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "message didn't contain an ICAL_METHOD_PROPERTY" ) ) );
462  return 0;
463  }
464 
465  icalcomponent *c;
466 
467  IncidenceBase *incidence = 0;
468  c = icalcomponent_get_first_component(message,ICAL_VEVENT_COMPONENT);
469  if (c) {
470  icalcomponent *ctz = icalcomponent_get_first_component(message,ICAL_VTIMEZONE_COMPONENT);
471  incidence = mImpl->readEvent(c, ctz);
472  }
473 
474  if (!incidence) {
475  c = icalcomponent_get_first_component(message,ICAL_VTODO_COMPONENT);
476  if (c) {
477  incidence = mImpl->readTodo(c);
478  }
479  }
480 
481  if (!incidence) {
482  c = icalcomponent_get_first_component(message,ICAL_VJOURNAL_COMPONENT);
483  if (c) {
484  incidence = mImpl->readJournal(c);
485  }
486  }
487 
488  if (!incidence) {
489  c = icalcomponent_get_first_component(message,ICAL_VFREEBUSY_COMPONENT);
490  if (c) {
491  incidence = mImpl->readFreeBusy(c);
492  }
493  }
494 
495 
496 
497  if (!incidence) {
498  kdDebug(5800) << "ICalFormat:parseScheduleMessage: object is not a freebusy, event, todo or journal" << endl;
499  setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, TQString::fromLatin1( "object is not a freebusy, event, todo or journal" ) ) );
500  return 0;
501  }
502 
503  kdDebug(5800) << "ICalFormat::parseScheduleMessage() getting method..." << endl;
504 
505  icalproperty_method icalmethod = icalproperty_get_method(m);
506  Scheduler::Method method;
507 
508  switch (icalmethod) {
509  case ICAL_METHOD_PUBLISH:
510  method = Scheduler::Publish;
511  break;
512  case ICAL_METHOD_REQUEST:
513  method = Scheduler::Request;
514  break;
515  case ICAL_METHOD_REFRESH:
516  method = Scheduler::Refresh;
517  break;
518  case ICAL_METHOD_CANCEL:
519  method = Scheduler::Cancel;
520  break;
521  case ICAL_METHOD_ADD:
522  method = Scheduler::Add;
523  break;
524  case ICAL_METHOD_REPLY:
525  method = Scheduler::Reply;
526  break;
527  case ICAL_METHOD_COUNTER:
528  method = Scheduler::Counter;
529  break;
530  case ICAL_METHOD_DECLINECOUNTER:
531  method = Scheduler::Declinecounter;
532  break;
533  default:
534  method = Scheduler::NoMethod;
535  kdDebug(5800) << "ICalFormat::parseScheduleMessage(): Unknow method" << endl;
536  break;
537  }
538 
539  kdDebug(5800) << "ICalFormat::parseScheduleMessage() restriction..." << endl;
540 
541  if (!icalrestriction_check(message)) {
542  kdWarning(5800) << k_funcinfo << endl << "libkcal reported a problem while parsing:" << endl;
543  kdWarning(5800) << Scheduler::translatedMethodName(method) + ": " + mImpl->extractErrorProperty(c)<< endl;
544  /*
545  setException(new ErrorFormat(ErrorFormat::Restriction,
546  Scheduler::translatedMethodName(method) + ": " +
547  mImpl->extractErrorProperty(c)));
548  delete incidence;
549  return 0;
550  */
551  }
552  icalcomponent *calendarComponent = mImpl->createCalendarComponent(cal);
553 
554  Incidence *existingIncidence =
555  cal->incidenceFromSchedulingID(incidence->uid());
556  if (existingIncidence) {
557  // TODO: check, if cast is required, or if it can be done by virtual funcs.
558  // TODO: Use a visitor for this!
559  if (existingIncidence->type() == "Todo") {
560  Todo *todo = static_cast<Todo *>(existingIncidence);
561  icalcomponent_add_component(calendarComponent,
562  mImpl->writeTodo(todo));
563  }
564  if (existingIncidence->type() == "Event") {
565  Event *event = static_cast<Event *>(existingIncidence);
566  icalcomponent_add_component(calendarComponent,
567  mImpl->writeEvent(event));
568  }
569  } else {
570  calendarComponent = 0;
571  }
572 
573  kdDebug(5800) << "ICalFormat::parseScheduleMessage() classify..." << endl;
574 
575  icalproperty_xlicclass result = icalclassify( message, calendarComponent,
576  (char *)"" );
577 
578  kdDebug(5800) << "ICalFormat::parseScheduleMessage() returning..." << endl;
579  kdDebug(5800) << "ICalFormat::parseScheduleMessage(), result = " << result << endl;
580 
582 
583  switch (result) {
584  case ICAL_XLICCLASS_PUBLISHNEW:
585  status = ScheduleMessage::PublishNew;
586  break;
587  case ICAL_XLICCLASS_PUBLISHUPDATE:
588  status = ScheduleMessage::PublishUpdate;
589  break;
590  case ICAL_XLICCLASS_OBSOLETE:
591  status = ScheduleMessage::Obsolete;
592  break;
593  case ICAL_XLICCLASS_REQUESTNEW:
594  status = ScheduleMessage::RequestNew;
595  break;
596  case ICAL_XLICCLASS_REQUESTUPDATE:
597  status = ScheduleMessage::RequestUpdate;
598  break;
599  case ICAL_XLICCLASS_UNKNOWN:
600  default:
601  status = ScheduleMessage::Unknown;
602  break;
603  }
604 
605  kdDebug(5800) << "ICalFormat::parseScheduleMessage(), status = " << status << endl;
606 // TODO FIXME: Don't we have to free calendarComponent??? MEMLEAK
607 
608  return new ScheduleMessage(incidence,method,status);
609 }
610 
611 void ICalFormat::setTimeZone( const TQString &id, bool utc )
612 {
613  mTimeZoneId = id;
614  mUtc = utc;
615 }
616 
617 TQString ICalFormat::timeZoneId() const
618 {
619  return mTimeZoneId;
620 }
621 
622 bool ICalFormat::utc() const
623 {
624  return mUtc;
625 }
Provides the main "calendar" object class.
void setException(ErrorFormat *error)
Set exception for this object.
Definition: calformat.cpp:50
void clearException()
Clear exception status of this format object.
Definition: calformat.cpp:44
ErrorFormat * exception()
Return exception, if there is any, containing information about the last error that occurred.
Definition: calformat.cpp:56
This class provides a calendar stored as a local file.
Definition: calendarlocal.h:37
This is the main "calendar" object class.
Definition: calendar.h:171
virtual bool addIncidence(Incidence *incidence)
Insert an Incidence into the Calendar.
Definition: calendar.cpp:466
bool isLocalTime() const
Determine if Calendar Incidences are to be written without a time zone.
Definition: calendar.cpp:125
Incidence * incidenceFromSchedulingID(const TQString &sid)
Returns the Incidence associated with the given scheduling identifier.
Definition: calendar.cpp:599
virtual Event::List rawEvents(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
Return a sorted, unfiltered list of all Events for this Calendar.
TQString timeZoneId() const
Get the Time Zone ID for the Calendar.
Definition: calendar.cpp:112
virtual Event::List events(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
Return a sorted, filtered list of all Events for this Calendar.
Definition: calendar.cpp:458
virtual Journal::List journals(JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
Return a sorted, filtered list of all Journals for this Calendar.
Definition: calendar.cpp:823
virtual Todo::List rawTodos(TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
Return a sorted, unfiltered list of all Todos for this Calendar.
Incidence * incidence(const TQString &uid)
Returns the Incidence associated with the given unique identifier.
Definition: calendar.cpp:576
virtual Todo::List todos(TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)
Return a sorted, filtered list of all Todos for this Calendar.
Definition: calendar.cpp:755
Calendar format related error class.
Definition: exceptions.h:65
@ NoCalendar
No calendar component found.
Definition: exceptions.h:75
@ LoadError
Load error.
Definition: exceptions.h:71
@ ParseErrorIcal
Parse error in libical.
Definition: exceptions.h:73
@ ParseErrorKcal
Parse error in libkcal.
Definition: exceptions.h:74
@ SaveError
Save error.
Definition: exceptions.h:72
This class provides an Event in the sense of RFC2445.
Definition: event.h:33
This class provides information about free/busy time of a calendar user.
Definition: freebusy.h:41
void setTimeZone(const TQString &id, bool utc)
Set id of used time zone and whether this time zone is UTC or not.
Definition: icalformat.cpp:611
bool load(Calendar *calendar, const TQString &fileName)
Loads a calendar on disk in iCalendar format into calendar.
Definition: icalformat.cpp:78
ScheduleMessage * parseScheduleMessage(Calendar *, const TQString &s)
Parse scheduling message provided as string s.
Definition: icalformat.cpp:436
bool utc() const
Return true if timezone used is UTC, otherwise return false.
Definition: icalformat.cpp:622
bool fromString(Calendar *calendar, const TQString &)
Parse string and populate calendar with that information.
Definition: icalformat.cpp:139
TQString timeZoneId() const
Return id string of timezone used.
Definition: icalformat.cpp:617
TQString createScheduleMessage(IncidenceBase *e, Scheduler::Method m)
Create a scheduling message for event e using method m.
Definition: icalformat.cpp:369
TQString toICalString(Incidence *)
Return incidence as full iCalendar formatted text.
Definition: icalformat.cpp:277
bool save(Calendar *calendar, const TQString &fileName)
Writes out the calendar to disk in iCalendar format.
Definition: icalformat.cpp:102
bool fromRawString(Calendar *calendar, const TQCString &)
Parse string and return first ical component of a raw byte array of a utf8 encoded string.
Definition: icalformat.cpp:144
FreeBusy * parseFreeBusy(const TQString &)
Parse FREEBUSY object.
Definition: icalformat.cpp:406
TQString toString(Calendar *)
Return calendar information as string.
Definition: icalformat.cpp:225
This class provides the base class common to all calendar components.
Definition: incidencebase.h:46
TQString uid() const
Return the unique id for the event.
void setUid(const TQString &)
Set the unique id for the event.
This class provides the base class common to all calendar components.
Definition: incidence.h:48
virtual Incidence * clone()=0
Return copy of this object.
void setSchedulingID(const TQString &sid)
Set the event's/todo's scheduling ID.
Definition: incidence.cpp:880
IncidenceList childIncidences() const
Returns an EventList of all child incidences.
Definition: incidence.cpp:934
TQString schedulingID() const
Return the event's/todo's scheduling ID.
Definition: incidence.cpp:885
bool hasRecurrenceID() const
Returns true if the incidence has recurrenceID, otherwise return false.
Definition: incidence.cpp:893
This class represents a recurrence rule for a calendar incidence.
This class provides an encapsulation of a scheduling message.
Definition: scheduler.h:45
Status
Message status.
Definition: scheduler.h:50
static TQString translatedMethodName(Method)
Return a translated human-readable name for a iTIP method.
Definition: scheduler.cpp:156
Method
iTIP methods.
Definition: scheduler.h:103
This class provides a Todo in the sense of RFC2445.
Definition: todo.h:32
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38