• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 API Reference
  • KDE Home
  • Contact Us
 

KCalCore Library

  • kcalcore
icalformat.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
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 */
31 #include "icalformat.h"
32 #include "icalformat_p.h"
33 #include "icaltimezones.h"
34 #include "freebusy.h"
35 #include "memorycalendar.h"
36 
37 #include <KDebug>
38 #include <KSaveFile>
39 
40 #include <QtCore/QFile>
41 
42 extern "C" {
43  #include <libical/ical.h>
44  #include <libical/icalss.h>
45  #include <libical/icalparser.h>
46  #include <libical/icalrestriction.h>
47  #include <libical/icalmemory.h>
48 }
49 
50 using namespace KCalCore;
51 
52 //@cond PRIVATE
53 class KCalCore::ICalFormat::Private
54 {
55  public:
56  Private( ICalFormat *parent )
57  : mImpl( new ICalFormatImpl( parent ) ),
58  mTimeSpec( KDateTime::UTC )
59  {}
60  ~Private() { delete mImpl; }
61  ICalFormatImpl *mImpl;
62  KDateTime::Spec mTimeSpec;
63 };
64 //@endcond
65 
66 ICalFormat::ICalFormat()
67  : d( new Private( this ) )
68 {
69 }
70 
71 ICalFormat::~ICalFormat()
72 {
73  icalmemory_free_ring();
74  delete d;
75 }
76 
77 bool ICalFormat::load( const Calendar::Ptr &calendar, const QString &fileName )
78 {
79  kDebug() << fileName;
80 
81  clearException();
82 
83  QFile file( fileName );
84  if ( !file.open( QIODevice::ReadOnly ) ) {
85  kError() << "load error";
86  setException( new Exception( Exception::LoadError ) );
87  return false;
88  }
89  QTextStream ts( &file );
90  ts.setCodec( "UTF-8" );
91  QByteArray text = ts.readAll().trimmed().toUtf8();
92  file.close();
93 
94  if ( text.isEmpty() ) {
95  // empty files are valid
96  return true;
97  } else {
98  return fromRawString( calendar, text, false, fileName );
99  }
100 }
101 
102 bool ICalFormat::save( const Calendar::Ptr &calendar, const QString &fileName )
103 {
104  kDebug() << fileName;
105 
106  clearException();
107 
108  QString text = toString( calendar );
109  if ( text.isEmpty() ) {
110  return false;
111  }
112 
113  // Write backup file
114  KSaveFile::backupFile( fileName );
115 
116  KSaveFile file( fileName );
117  if ( !file.open() ) {
118  kError() << "file open error: " << file.errorString() << ";filename=" << fileName;
119  setException( new Exception( Exception::SaveErrorOpenFile,
120  QStringList( fileName ) ) );
121 
122  return false;
123  }
124 
125  // Convert to UTF8 and save
126  QByteArray textUtf8 = text.toUtf8();
127  file.write( textUtf8.data(), textUtf8.size() );
128 
129  if ( !file.finalize() ) {
130  kDebug() << "file finalize error:" << file.errorString();
131  setException( new Exception( Exception::SaveErrorSaveFile,
132  QStringList( fileName ) ) );
133 
134  return false;
135  }
136 
137  return true;
138 }
139 
140 bool ICalFormat::fromString( const Calendar::Ptr &cal, const QString &string,
141  bool deleted, const QString &notebook )
142 {
143  return fromRawString( cal, string.toUtf8(), deleted, notebook );
144 }
145 
146 bool ICalFormat::fromRawString( const Calendar::Ptr &cal, const QByteArray &string,
147  bool deleted, const QString &notebook )
148 {
149  Q_UNUSED( notebook );
150  // Get first VCALENDAR component.
151  // TODO: Handle more than one VCALENDAR or non-VCALENDAR top components
152  icalcomponent *calendar;
153 
154  // Let's defend const correctness until the very gates of hell^Wlibical
155  calendar = icalcomponent_new_from_string( const_cast<char*>( ( const char * )string ) );
156  if ( !calendar ) {
157  kError() << "parse error ; string is empty?" << string.isEmpty();
158  setException( new Exception( Exception::ParseErrorIcal ) );
159  return false;
160  }
161 
162  bool success = true;
163 
164  if ( icalcomponent_isa( calendar ) == ICAL_XROOT_COMPONENT ) {
165  icalcomponent *comp;
166  for ( comp = icalcomponent_get_first_component( calendar, ICAL_VCALENDAR_COMPONENT );
167  comp; comp = icalcomponent_get_next_component( calendar, ICAL_VCALENDAR_COMPONENT ) ) {
168  // put all objects into their proper places
169  if ( !d->mImpl->populate( cal, comp, deleted ) ) {
170  kError() << "Could not populate calendar";
171  if ( !exception() ) {
172  setException( new Exception( Exception::ParseErrorKcal ) );
173  }
174  success = false;
175  } else {
176  setLoadedProductId( d->mImpl->loadedProductId() );
177  }
178  }
179  } else if ( icalcomponent_isa( calendar ) != ICAL_VCALENDAR_COMPONENT ) {
180  kDebug() << "No VCALENDAR component found";
181  setException( new Exception( Exception::NoCalendar ) );
182  success = false;
183  } else {
184  // put all objects into their proper places
185  if ( !d->mImpl->populate( cal, calendar, deleted ) ) {
186  kDebug() << "Could not populate calendar";
187  if ( !exception() ) {
188  setException( new Exception( Exception::ParseErrorKcal ) );
189  }
190  success = false;
191  } else {
192  setLoadedProductId( d->mImpl->loadedProductId() );
193  }
194  }
195 
196  icalcomponent_free( calendar );
197  icalmemory_free_ring();
198 
199  return success;
200 }
201 
202 Incidence::Ptr ICalFormat::fromString( const QString &string )
203 {
204  MemoryCalendar::Ptr cal( new MemoryCalendar( d->mTimeSpec ) );
205  fromString( cal, string );
206 
207  const Incidence::List list = cal->incidences();
208  return !list.isEmpty() ? list.first() : Incidence::Ptr();
209 }
210 
211 QString ICalFormat::toString( const Calendar::Ptr &cal,
212  const QString &notebook, bool deleted )
213 {
214  icalcomponent *calendar = d->mImpl->createCalendarComponent( cal );
215  icalcomponent *component;
216 
217  ICalTimeZones *tzlist = cal->timeZones(); // time zones possibly used in the calendar
218  ICalTimeZones tzUsedList; // time zones actually used in the calendar
219 
220  // todos
221  Todo::List todoList = deleted ? cal->deletedTodos() : cal->rawTodos();
222  Todo::List::ConstIterator it;
223  for ( it = todoList.constBegin(); it != todoList.constEnd(); ++it ) {
224  if ( !deleted || !cal->todo( ( *it )->uid(), ( *it )->recurrenceId() ) ) {
225  // use existing ones, or really deleted ones
226  if ( notebook.isEmpty() ||
227  ( !cal->notebook( *it ).isEmpty() && notebook.endsWith( cal->notebook( *it ) ) ) ) {
228  component = d->mImpl->writeTodo( *it, tzlist, &tzUsedList );
229  icalcomponent_add_component( calendar, component );
230  }
231  }
232  }
233  // events
234  Event::List events = deleted ? cal->deletedEvents() : cal->rawEvents();
235  Event::List::ConstIterator it2;
236  for ( it2 = events.constBegin(); it2 != events.constEnd(); ++it2 ) {
237  if ( !deleted || !cal->event( ( *it2 )->uid(), ( *it2 )->recurrenceId() ) ) {
238  // use existing ones, or really deleted ones
239  if ( notebook.isEmpty() ||
240  ( !cal->notebook( *it2 ).isEmpty() && notebook.endsWith( cal->notebook( *it2 ) ) ) ) {
241  component = d->mImpl->writeEvent( *it2, tzlist, &tzUsedList );
242  icalcomponent_add_component( calendar, component );
243  }
244  }
245  }
246 
247  // journals
248  Journal::List journals = deleted ? cal->deletedJournals() : cal->rawJournals();
249  Journal::List::ConstIterator it3;
250  for ( it3 = journals.constBegin(); it3 != journals.constEnd(); ++it3 ) {
251  if ( !deleted || !cal->journal( ( *it3 )->uid(), ( *it3 )->recurrenceId() ) ) {
252  // use existing ones, or really deleted ones
253  if ( notebook.isEmpty() ||
254  ( !cal->notebook( *it3 ).isEmpty() && notebook.endsWith( cal->notebook( *it3 ) ) ) ) {
255  component = d->mImpl->writeJournal( *it3, tzlist, &tzUsedList );
256  icalcomponent_add_component( calendar, component );
257  }
258  }
259  }
260 
261  // time zones
262  ICalTimeZones::ZoneMap zones = tzUsedList.zones();
263  if ( todoList.isEmpty() && events.isEmpty() && journals.isEmpty() ) {
264  // no incidences means no used timezones, use all timezones
265  // this will export a calendar having only timezone definitions
266  zones = tzlist->zones();
267  }
268  for ( ICalTimeZones::ZoneMap::ConstIterator it = zones.constBegin();
269  it != zones.constEnd(); ++it ) {
270  icaltimezone *tz = ( *it ).icalTimezone();
271  if ( !tz ) {
272  kError() << "bad time zone";
273  } else {
274  component = icalcomponent_new_clone( icaltimezone_get_component( tz ) );
275  icalcomponent_add_component( calendar, component );
276  icaltimezone_free( tz, 1 );
277  }
278  }
279 
280  char *const componentString = icalcomponent_as_ical_string_r( calendar );
281  const QString &text = QString::fromUtf8( componentString );
282  free( componentString );
283 
284  icalcomponent_free( calendar );
285  icalmemory_free_ring();
286 
287  if ( text.isEmpty() ) {
288  setException( new Exception( Exception::LibICalError ) );
289  }
290 
291  return text;
292 }
293 
294 QString ICalFormat::toICalString( const Incidence::Ptr &incidence )
295 {
296  MemoryCalendar::Ptr cal( new MemoryCalendar( d->mTimeSpec ) );
297  cal->addIncidence( Incidence::Ptr( incidence->clone() ) );
298  return toString( cal.staticCast<Calendar>() );
299 }
300 
301 QString ICalFormat::toString( const Incidence::Ptr &incidence )
302 {
303  return QString::fromUtf8( toRawString( incidence ) );
304 }
305 
306 QByteArray ICalFormat::toRawString( const Incidence::Ptr &incidence )
307 {
308  icalcomponent *component;
309  ICalTimeZones tzlist;
310  ICalTimeZones tzUsedList;
311 
312  component = d->mImpl->writeIncidence( incidence, iTIPRequest, &tzlist, &tzUsedList );
313 
314  QByteArray text = icalcomponent_as_ical_string( component );
315 
316  // time zones
317  ICalTimeZones::ZoneMap zones = tzUsedList.zones();
318  for ( ICalTimeZones::ZoneMap::ConstIterator it = zones.constBegin();
319  it != zones.constEnd(); ++it ) {
320  icaltimezone *tz = ( *it ).icalTimezone();
321  if ( !tz ) {
322  kError() << "bad time zone";
323  } else {
324  icalcomponent *tzcomponent = icaltimezone_get_component( tz );
325  icalcomponent_add_component( component, component );
326  text.append( icalcomponent_as_ical_string( tzcomponent ) );
327  icaltimezone_free( tz, 1 );
328  }
329  }
330 
331  icalcomponent_free( component );
332 
333  return text;
334 }
335 
336 QString ICalFormat::toString( RecurrenceRule *recurrence )
337 {
338  icalproperty *property;
339  property = icalproperty_new_rrule( d->mImpl->writeRecurrenceRule( recurrence ) );
340  QString text = QString::fromUtf8( icalproperty_as_ical_string( property ) );
341  icalproperty_free( property );
342  return text;
343 }
344 
345 bool ICalFormat::fromString( RecurrenceRule *recurrence, const QString &rrule )
346 {
347  if ( !recurrence ) {
348  return false;
349  }
350  bool success = true;
351  icalerror_clear_errno();
352  struct icalrecurrencetype recur = icalrecurrencetype_from_string( rrule.toLatin1() );
353  if ( icalerrno != ICAL_NO_ERROR ) {
354  kDebug() << "Recurrence parsing error:" << icalerror_strerror( icalerrno );
355  success = false;
356  }
357 
358  if ( success ) {
359  d->mImpl->readRecurrence( recur, recurrence );
360  }
361 
362  return success;
363 }
364 
365 QString ICalFormat::createScheduleMessage( const IncidenceBase::Ptr &incidence,
366  iTIPMethod method )
367 {
368  icalcomponent *message = 0;
369 
370  if ( incidence->type() == Incidence::TypeEvent ||
371  incidence->type() == Incidence::TypeTodo ) {
372 
373  Incidence::Ptr i = incidence.staticCast<Incidence>();
374 
375  // Recurring events need timezone information to allow proper calculations
376  // across timezones with different DST.
377  const bool useUtcTimes = !i->recurs();
378 
379  const bool hasSchedulingId = ( i->schedulingID() != i->uid() );
380 
381  const bool incidenceNeedChanges = ( useUtcTimes || hasSchedulingId );
382 
383  if ( incidenceNeedChanges ) {
384  // The incidence need changes, so clone it before we continue
385  i = Incidence::Ptr( i->clone() );
386 
387  // Handle conversion to UTC times
388  if ( useUtcTimes ) {
389  i->shiftTimes( KDateTime::Spec::UTC(), KDateTime::Spec::UTC() );
390  }
391 
392  // Handle scheduling ID being present
393  if ( hasSchedulingId ) {
394  // We have a separation of scheduling ID and UID
395  i->setSchedulingID( QString(), i->schedulingID() );
396 
397  }
398 
399  // Build the message with the cloned incidence
400  message = d->mImpl->createScheduleComponent( i, method );
401  }
402  }
403 
404  if ( message == 0 ) {
405  message = d->mImpl->createScheduleComponent( incidence, method );
406  }
407 
408  QString messageText = QString::fromUtf8( icalcomponent_as_ical_string( message ) );
409 
410  icalcomponent_free( message );
411  return messageText;
412 }
413 
414 FreeBusy::Ptr ICalFormat::parseFreeBusy( const QString &str )
415 {
416  clearException();
417 
418  icalcomponent *message;
419  message = icalparser_parse_string( str.toUtf8() );
420 
421  if ( !message ) {
422  return FreeBusy::Ptr();
423  }
424 
425  FreeBusy::Ptr freeBusy;
426 
427  icalcomponent *c;
428  for ( c = icalcomponent_get_first_component( message, ICAL_VFREEBUSY_COMPONENT );
429  c != 0; c = icalcomponent_get_next_component( message, ICAL_VFREEBUSY_COMPONENT ) ) {
430  FreeBusy::Ptr fb = d->mImpl->readFreeBusy( c );
431 
432  if ( freeBusy ) {
433  freeBusy->merge( fb );
434  } else {
435  freeBusy = fb;
436  }
437  }
438 
439  if ( !freeBusy ) {
440  kDebug() << "object is not a freebusy.";
441  }
442 
443  icalcomponent_free( message );
444 
445  return freeBusy;
446 }
447 
448 ScheduleMessage::Ptr ICalFormat::parseScheduleMessage( const Calendar::Ptr &cal,
449  const QString &messageText )
450 {
451  setTimeSpec( cal->timeSpec() );
452  clearException();
453 
454  if ( messageText.isEmpty() ) {
455  setException(
456  new Exception( Exception::ParseErrorEmptyMessage ) );
457  return ScheduleMessage::Ptr();
458  }
459 
460  icalcomponent *message;
461  message = icalparser_parse_string( messageText.toUtf8() );
462 
463  if ( !message ) {
464  setException(
465  new Exception( Exception::ParseErrorUnableToParse ) );
466 
467  return ScheduleMessage::Ptr();
468  }
469 
470  icalproperty *m =
471  icalcomponent_get_first_property( message, ICAL_METHOD_PROPERTY );
472  if ( !m ) {
473  setException(
474  new Exception( Exception::ParseErrorMethodProperty ) );
475 
476  return ScheduleMessage::Ptr();
477  }
478 
479  // Populate the message's time zone collection with all VTIMEZONE components
480  ICalTimeZones tzlist;
481  ICalTimeZoneSource tzs;
482  tzs.parse( message, tzlist );
483 
484  icalcomponent *c;
485 
486  IncidenceBase::Ptr incidence;
487  c = icalcomponent_get_first_component( message, ICAL_VEVENT_COMPONENT );
488  if ( c ) {
489  incidence = d->mImpl->readEvent( c, &tzlist ).staticCast<IncidenceBase>();
490  }
491 
492  if ( !incidence ) {
493  c = icalcomponent_get_first_component( message, ICAL_VTODO_COMPONENT );
494  if ( c ) {
495  incidence = d->mImpl->readTodo( c, &tzlist ).staticCast<IncidenceBase>();
496  }
497  }
498 
499  if ( !incidence ) {
500  c = icalcomponent_get_first_component( message, ICAL_VJOURNAL_COMPONENT );
501  if ( c ) {
502  incidence = d->mImpl->readJournal( c, &tzlist ).staticCast<IncidenceBase>();
503  }
504  }
505 
506  if ( !incidence ) {
507  c = icalcomponent_get_first_component( message, ICAL_VFREEBUSY_COMPONENT );
508  if ( c ) {
509  incidence = d->mImpl->readFreeBusy( c ).staticCast<IncidenceBase>();
510  }
511  }
512 
513  if ( !incidence ) {
514  kDebug() << "object is not a freebusy, event, todo or journal";
515  setException( new Exception( Exception::ParseErrorNotIncidence ) );
516 
517  return ScheduleMessage::Ptr();
518  }
519 
520  icalproperty_method icalmethod = icalproperty_get_method( m );
521  iTIPMethod method;
522 
523  switch ( icalmethod ) {
524  case ICAL_METHOD_PUBLISH:
525  method = iTIPPublish;
526  break;
527  case ICAL_METHOD_REQUEST:
528  method = iTIPRequest;
529  break;
530  case ICAL_METHOD_REFRESH:
531  method = iTIPRefresh;
532  break;
533  case ICAL_METHOD_CANCEL:
534  method = iTIPCancel;
535  break;
536  case ICAL_METHOD_ADD:
537  method = iTIPAdd;
538  break;
539  case ICAL_METHOD_REPLY:
540  method = iTIPReply;
541  break;
542  case ICAL_METHOD_COUNTER:
543  method = iTIPCounter;
544  break;
545  case ICAL_METHOD_DECLINECOUNTER:
546  method = iTIPDeclineCounter;
547  break;
548  default:
549  method = iTIPNoMethod;
550  kDebug() << "Unknown method";
551  break;
552  }
553 
554  if ( !icalrestriction_check( message ) ) {
555  kWarning() << endl
556  << "kcalcore library reported a problem while parsing:";
557  kWarning() << ScheduleMessage::methodName( method ) << ":" //krazy:exclude=kdebug
558  << d->mImpl->extractErrorProperty( c );
559  }
560 
561  Incidence::Ptr existingIncidence = cal->incidence( incidence->uid() );
562 
563  icalcomponent *calendarComponent = 0;
564  if ( existingIncidence ) {
565  calendarComponent = d->mImpl->createCalendarComponent( cal );
566 
567  // TODO: check, if cast is required, or if it can be done by virtual funcs.
568  // TODO: Use a visitor for this!
569  if ( existingIncidence->type() == Incidence::TypeTodo ) {
570  Todo::Ptr todo = existingIncidence.staticCast<Todo>();
571  icalcomponent_add_component( calendarComponent,
572  d->mImpl->writeTodo( todo ) );
573  }
574  if ( existingIncidence->type() == Incidence::TypeEvent ) {
575  Event::Ptr event = existingIncidence.staticCast<Event>();
576  icalcomponent_add_component( calendarComponent,
577  d->mImpl->writeEvent( event ) );
578  }
579  } else {
580  icalcomponent_free( message );
581  return ScheduleMessage::Ptr( new ScheduleMessage( incidence, method,
582  ScheduleMessage::Unknown ) );
583  }
584 
585  icalproperty_xlicclass result =
586  icalclassify( message, calendarComponent, static_cast<const char *>( "" ) );
587 
588  ScheduleMessage::Status status;
589 
590  switch ( result ) {
591  case ICAL_XLICCLASS_PUBLISHNEW:
592  status = ScheduleMessage::PublishNew;
593  break;
594  case ICAL_XLICCLASS_PUBLISHUPDATE:
595  status = ScheduleMessage::PublishUpdate;
596  break;
597  case ICAL_XLICCLASS_OBSOLETE:
598  status = ScheduleMessage::Obsolete;
599  break;
600  case ICAL_XLICCLASS_REQUESTNEW:
601  status = ScheduleMessage::RequestNew;
602  break;
603  case ICAL_XLICCLASS_REQUESTUPDATE:
604  status = ScheduleMessage::RequestUpdate;
605  break;
606  case ICAL_XLICCLASS_UNKNOWN:
607  default:
608  status = ScheduleMessage::Unknown;
609  break;
610  }
611 
612  icalcomponent_free( message );
613  icalcomponent_free( calendarComponent );
614 
615  return ScheduleMessage::Ptr( new ScheduleMessage( incidence, method, status ) );
616 }
617 
618 void ICalFormat::setTimeSpec( const KDateTime::Spec &timeSpec )
619 {
620  d->mTimeSpec = timeSpec;
621 }
622 
623 KDateTime::Spec ICalFormat::timeSpec() const
624 {
625  return d->mTimeSpec;
626 }
627 
628 QString ICalFormat::timeZoneId() const
629 {
630  KTimeZone tz = d->mTimeSpec.timeZone();
631  return tz.isValid() ? tz.name() : QString();
632 }
633 
634 void ICalFormat::virtual_hook( int id, void *data )
635 {
636  Q_UNUSED( id );
637  Q_UNUSED( data );
638  Q_ASSERT( false );
639 }
KCalCore::Exception
Exception base class, currently used as a fancy kind of error code and not as an C++ exception...
Definition: exceptions.h:50
KCalCore::ICalFormat::save
bool save(const Calendar::Ptr &calendar, const QString &fileName)
Definition: icalformat.cpp:102
KCalCore::ICalFormat::setTimeSpec
void setTimeSpec(const KDateTime::Spec &timeSpec)
Sets the iCalendar time specification (time zone, etc.).
Definition: icalformat.cpp:618
KCalCore::CalFormat::setException
void setException(Exception *error)
Sets an exception that is to be used by the functions of this class to report errors.
Definition: calformat.cpp:83
KCalCore::Journal::List
QVector< Ptr > List
List of journals.
Definition: journal.h:54
KCalCore::CalFormat::clearException
void clearException()
Clears the exception status.
Definition: calformat.cpp:77
KCalCore::IncidenceBase::TypeTodo
Type is a to-do.
Definition: incidencebase.h:121
KCalCore::ScheduleMessage::methodName
static QString methodName(iTIPMethod method)
Returns a machine-readable (not translatable) name for a iTIP method.
Definition: schedulemessage.cpp:70
memorycalendar.h
This file is part of the API for handling calendar data and defines the MemoryCalendar class...
KCalCore::Event::Ptr
QSharedPointer< Event > Ptr
A shared pointer to an Event object.
Definition: event.h:55
KCalCore::Exception::ParseErrorIcal
Parse error in libical.
Definition: exceptions.h:61
KCalCore::ICalTimeZoneSource
A class which reads and parses iCalendar VTIMEZONE components, and accesses libical time zone data...
Definition: icaltimezones.h:405
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes. ...
Definition: incidencebase.h:107
KCalCore::Exception::LoadError
Load error.
Definition: exceptions.h:59
KCalCore::ScheduleMessage
A Scheduling message class.
Definition: schedulemessage.h:54
KCalCore::Exception::NoCalendar
No calendar component found.
Definition: exceptions.h:63
KCalCore::Incidence::Ptr
QSharedPointer< Incidence > Ptr
A shared pointer to an Incidence.
Definition: incidence.h:112
KCalCore::ScheduleMessage::Ptr
QSharedPointer< ScheduleMessage > Ptr
A shared pointer to a ScheduleMessage.
Definition: schedulemessage.h:72
icalformat_p.h
This file is part of the API for handling calendar data and defines the internal ICalFormatImpl class...
KCalCore::ICalFormat::timeZoneId
QString timeZoneId() const
Returns the timezone id string used by the iCalendar; an empty string if the iCalendar does not have ...
Definition: icalformat.cpp:628
KCalCore::ICalFormat::fromRawString
bool fromRawString(const Calendar::Ptr &calendar, const QByteArray &string, bool deleted=false, const QString &notebook=QString())
Definition: icalformat.cpp:146
KCalCore::Event::List
QVector< Ptr > List
List of events.
Definition: event.h:60
KCalCore::ICalFormatImpl
This class provides the libical dependent functions for ICalFormat.
Definition: icalformat_p.h:89
KCalCore::MemoryCalendar
This class provides a calendar stored in memory.
Definition: memorycalendar.h:46
KCalCore::Exception::ParseErrorKcal
Parse error in libkcal.
Definition: exceptions.h:62
KCalCore::ICalFormat::toRawString
QByteArray toRawString(const Incidence::Ptr &incidence)
Converts an Incidence to a QByteArray.
Definition: icalformat.cpp:306
KCalCore::MemoryCalendar::Ptr
QSharedPointer< MemoryCalendar > Ptr
A shared pointer to a MemoryCalendar.
Definition: memorycalendar.h:53
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition: incidencebase.h:113
KCalCore::iTIPMethod
iTIPMethod
iTIP methods.
Definition: schedulemessage.h:35
KCalCore::ICalFormat
iCalendar format implementation.
Definition: icalformat.h:58
KCalCore::ICalTimeZoneSource::parse
ICalTimeZone parse(icalcomponent *vtimezone)
Creates an ICalTimeZone instance containing the detailed information parsed from an iCalendar VTIMEZO...
Definition: icaltimezones.cpp:910
KCalCore::iTIPCounter
Event or to-do submit counter proposal.
Definition: schedulemessage.h:42
freebusy.h
This file is part of the API for handling calendar data and defines the FreeBusy class.
KCalCore::ICalFormat::toICalString
QString toICalString(const Incidence::Ptr &incidence)
Converts an Incidence to iCalendar formatted text.
Definition: icalformat.cpp:294
KCalCore::ScheduleMessage::RequestNew
Request new message posting.
Definition: schedulemessage.h:64
KCalCore::ICalFormat::parseFreeBusy
FreeBusy::Ptr parseFreeBusy(const QString &string)
Converts a QString into a FreeBusy object.
Definition: icalformat.cpp:414
KCalCore::ICalFormat::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition: icalformat.cpp:634
KCalCore::iTIPNoMethod
No method.
Definition: schedulemessage.h:44
KCalCore::ScheduleMessage::Unknown
No status.
Definition: schedulemessage.h:66
KCalCore::iTIPDeclineCounter
Event or to-do decline a counter proposal.
Definition: schedulemessage.h:43
KCalCore::CalFormat::setLoadedProductId
void setLoadedProductId(const QString &id)
Sets the PRODID string loaded from calendar file.
Definition: calformat.cpp:116
KCalCore::CalFormat::exception
Exception * exception() const
Returns an exception, if there is any, containing information about the last error that occurred...
Definition: calformat.cpp:89
KCalCore::ICalFormat::timeSpec
KDateTime::Spec timeSpec() const
Returns the iCalendar time specification.
Definition: icalformat.cpp:623
KCalCore::iTIPReply
Event, to-do or freebusy reply to request.
Definition: schedulemessage.h:38
KCalCore::Calendar::Ptr
QSharedPointer< Calendar > Ptr
A shared pointer to a Calendar.
Definition: calendar.h:138
KCalCore::ScheduleMessage::Status
Status
Message status.
Definition: schedulemessage.h:60
KCalCore::Todo::List
QVector< Ptr > List
List of to-dos.
Definition: todo.h:55
KCalCore::ICalFormat::parseScheduleMessage
ScheduleMessage::Ptr parseScheduleMessage(const Calendar::Ptr &calendar, const QString &string)
Parses a Calendar scheduling message string into ScheduleMessage object.
Definition: icalformat.cpp:448
KCalCore::IncidenceBase::TypeEvent
Type is an event.
Definition: incidencebase.h:120
KCalCore::iTIPCancel
Event, to-do or journal cancellation notice.
Definition: schedulemessage.h:40
KCalCore::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:44
KCalCore::FreeBusy::Ptr
QSharedPointer< FreeBusy > Ptr
A shared pointer to a FreeBusy object.
Definition: freebusy.h:64
KCalCore::Incidence::List
QVector< Ptr > List
List of incidences.
Definition: incidence.h:117
KCalCore::Event
This class provides an Event in the sense of RFC2445.
Definition: event.h:41
KCalCore::ICalFormat::ICalFormat
ICalFormat()
Constructor a new iCalendar Format object.
Definition: icalformat.cpp:66
KCalCore::Incidence::recurs
bool recurs() const
Returns whether the event recurs at all.
Definition: incidence.cpp:578
KCalCore::ICalTimeZones
The ICalTimeZones class represents a time zone database which consists of a collection of individual ...
Definition: icaltimezones.h:65
KCalCore::ScheduleMessage::PublishNew
New message posting.
Definition: schedulemessage.h:61
KCalCore::ScheduleMessage::PublishUpdate
Updated message.
Definition: schedulemessage.h:62
KCalCore::Calendar
Represents the main calendar class.
Definition: calendar.h:128
KCalCore::iTIPAdd
Event, to-do or journal additional property request.
Definition: schedulemessage.h:39
KCalCore::ScheduleMessage::Obsolete
obsolete
Definition: schedulemessage.h:63
KCalCore::iTIPPublish
Event, to-do, journal or freebusy posting.
Definition: schedulemessage.h:36
KCalCore::ICalFormat::~ICalFormat
virtual ~ICalFormat()
Destructor.
Definition: icalformat.cpp:71
KCalCore::ICalFormat::fromString
bool fromString(const Calendar::Ptr &calendar, const QString &string, bool deleted=false, const QString &notebook=QString())
Definition: icalformat.cpp:140
KCalCore::iTIPRefresh
Event or to-do description update request.
Definition: schedulemessage.h:41
KCalCore::Todo::Ptr
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
Definition: todo.h:50
KCalCore::ICalTimeZones::zones
const ZoneMap zones() const
Returns all the time zones defined in this collection.
Definition: icaltimezones.cpp:130
KCalCore::ICalFormat::load
bool load(const Calendar::Ptr &calendar, const QString &fileName)
Definition: icalformat.cpp:77
KCalCore::ICalFormat::toString
QString toString(const Calendar::Ptr &calendar, const QString &notebook=QString(), bool deleted=false)
Definition: icalformat.cpp:211
KCalCore::ScheduleMessage::RequestUpdate
Request updated message.
Definition: schedulemessage.h:65
KCalCore::ICalFormat::createScheduleMessage
QString createScheduleMessage(const IncidenceBase::Ptr &incidence, iTIPMethod method)
Creates a scheduling message string for an Incidence.
Definition: icalformat.cpp:365
KCalCore::iTIPRequest
Event, to-do or freebusy scheduling request.
Definition: schedulemessage.h:37
icalformat.h
This file is part of the API for handling calendar data and defines the ICalFormat class...
KCalCore::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:68
KCalCore::RecurrenceRule
This class represents a recurrence rule for a calendar incidence.
Definition: recurrencerule.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:02:04 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal