KCalendarCore::ICalFormat

KCalendarCore::ICalFormat Class Reference

#include <icalformat.h>

Inheritance diagram for KCalendarCore::ICalFormat:

Public Member Functions

 ICalFormat ()
 
 ~ICalFormat () override
 
QString createScheduleMessage (const IncidenceBase::Ptr &incidence, iTIPMethod method)
 
bool fromRawString (const Calendar::Ptr &calendar, const QByteArray &string, bool deleted=false, const QString &notebook=QString()) override
 
bool fromString (const Calendar::Ptr &calendar, const QString &string, bool deleted=false, const QString &notebook=QString()) override
 
Incidence::Ptr fromString (const QString &string)
 
bool fromString (RecurrenceRule *rule, const QString &string)
 
bool load (const Calendar::Ptr &calendar, const QString &fileName) override
 
FreeBusy::Ptr parseFreeBusy (const QString &string)
 
ScheduleMessage::Ptr parseScheduleMessage (const Calendar::Ptr &calendar, const QString &string)
 
Incidence::Ptr readIncidence (const QByteArray &string)
 
bool save (const Calendar::Ptr &calendar, const QString &fileName) override
 
void setTimeZone (const QTimeZone &timeZone)
 
QTimeZone timeZone () const
 
QByteArray timeZoneId () const
 
QString toICalString (const Incidence::Ptr &incidence)
 
QByteArray toRawString (const Incidence::Ptr &incidence)
 
QString toString (const Calendar::Ptr &calendar, const QString &notebook=QString(), bool deleted=false) override
 
QString toString (const Incidence::Ptr &incidence)
 
QString toString (RecurrenceRule *rule)
 
- Public Member Functions inherited from KCalendarCore::CalFormat
 CalFormat ()
 
virtual ~CalFormat ()
 
void clearException ()
 
Exceptionexception () const
 
QString loadedProductId ()
 
void setException (Exception *error)
 

Protected Member Functions

void virtual_hook (int id, void *data) override
 
- Protected Member Functions inherited from KCalendarCore::CalFormat
void setLoadedProductId (const QString &id)
 

Additional Inherited Members

- Static Public Member Functions inherited from KCalendarCore::CalFormat
static const QStringapplication ()
 
static QString createUniqueId ()
 
static const QStringproductId ()
 
static void setApplication (const QString &application, const QString &productID)
 

Detailed Description

iCalendar format implementation.

This class implements the iCalendar format. It provides methods for loading/saving/converting iCalendar format data into the internal representation as Calendar and Incidences.

Warning
When importing/loading to a Calendar, there is only duplicate check if those Incidences are loaded into the Calendar. If they are not loaded it will create duplicates.

Definition at line 44 of file icalformat.h.

Constructor & Destructor Documentation

ICalFormat::ICalFormat ( )

Constructor a new iCalendar Format object.

Definition at line 57 of file icalformat.cpp.

ICalFormat::~ICalFormat ( )
override

Destructor.

Definition at line 62 of file icalformat.cpp.

Member Function Documentation

QString ICalFormat::createScheduleMessage ( const IncidenceBase::Ptr incidence,
iTIPMethod  method 
)

Creates a scheduling message string for an Incidence.

Parameters
incidenceis a pointer to an IncidenceBase object to be scheduled.
methodis a Scheduler::Method
Returns
a QString containing the message if successful; 0 otherwise.

Definition at line 404 of file icalformat.cpp.

bool ICalFormat::fromRawString ( const Calendar::Ptr calendar,
const QByteArray string,
bool  deleted = false,
const QString notebook = QString() 
)
overridevirtual

CalFormat::fromRawString()

Implements KCalendarCore::CalFormat.

Definition at line 185 of file icalformat.cpp.

bool ICalFormat::fromString ( const Calendar::Ptr calendar,
const QString string,
bool  deleted = false,
const QString notebook = QString() 
)
overridevirtual

CalFormat::fromString()

Note
The notebook is ignored and the default one is used

Implements KCalendarCore::CalFormat.

Definition at line 144 of file icalformat.cpp.

Incidence::Ptr ICalFormat::fromString ( const QString string)

Parses a string, returning the first iCal component as an Incidence.

Parameters
stringis a QString containing the data to be parsed.
Returns
non-zero pointer if the parsing was successful; 0 otherwise.
See also
fromString(const Calendar::Ptr &, const QString &), fromRawString()

Definition at line 241 of file icalformat.cpp.

bool ICalFormat::fromString ( RecurrenceRule rule,
const QString string 
)

Parses a string and fills a RecurrenceRule object with the information.

Parameters
ruleis a pointer to a RecurrenceRule object.
stringis a QString containing the data to be parsed.
Returns
true if successful; false otherwise.

Definition at line 384 of file icalformat.cpp.

bool ICalFormat::load ( const Calendar::Ptr calendar,
const QString fileName 
)
overridevirtual

CalFormat::load()

Implements KCalendarCore::CalFormat.

Definition at line 68 of file icalformat.cpp.

FreeBusy::Ptr ICalFormat::parseFreeBusy ( const QString string)

Converts a QString into a FreeBusy object.

Parameters
stringis a QString containing the data to be parsed.
Returns
a pointer to a FreeBusy object if successful; 0 otherwise.
Note
Do not attempt to free the FreeBusy memory from the calling routine.

Definition at line 452 of file icalformat.cpp.

ScheduleMessage::Ptr ICalFormat::parseScheduleMessage ( const Calendar::Ptr calendar,
const QString string 
)

Parses a Calendar scheduling message string into ScheduleMessage object.

Parameters
calendaris a pointer to a Calendar object associated with the scheduling message.
stringis a QString containing the data to be parsed.
Returns
a pointer to a ScheduleMessage object if successful; 0 otherwise. The calling routine may later free the return memory.

Definition at line 485 of file icalformat.cpp.

Incidence::Ptr ICalFormat::readIncidence ( const QByteArray string)

Parses a bytearray, returning the first iCal component as an Incidence, ignoring timezone information.

This function is significantly faster than fromString by avoiding the overhead of parsing timezone information. Timezones are instead solely interpreted by using system-timezones.

Parameters
stringis a utf8 QByteArray containing the data to be parsed.
Returns
non-zero pointer if the parsing was successful; 0 otherwise.
See also
fromString(const QString &), fromRawString()

Definition at line 150 of file icalformat.cpp.

bool ICalFormat::save ( const Calendar::Ptr calendar,
const QString fileName 
)
overridevirtual

CalFormat::save()

Implements KCalendarCore::CalFormat.

Definition at line 96 of file icalformat.cpp.

void ICalFormat::setTimeZone ( const QTimeZone timeZone)

Sets the iCalendar time zone.

Parameters
timeZoneis the time zone to set.
See also
timeZone().

Definition at line 651 of file icalformat.cpp.

QTimeZone ICalFormat::timeZone ( ) const

Returns the iCalendar time zone.

See also
setTimeZone().

Definition at line 656 of file icalformat.cpp.

QByteArray ICalFormat::timeZoneId ( ) const

Returns the timezone id string used by the iCalendar; an empty string if the iCalendar does not have a timezone.

Definition at line 661 of file icalformat.cpp.

QString ICalFormat::toICalString ( const Incidence::Ptr incidence)

Converts an Incidence to iCalendar formatted text.

Parameters
incidenceis a pointer to an Incidence object to be converted into iCal formatted text.
Returns
the QString will be Null if the conversion was unsuccessful.

Definition at line 333 of file icalformat.cpp.

QByteArray ICalFormat::toRawString ( const Incidence::Ptr incidence)

Converts an Incidence to a QByteArray.

Parameters
incidenceis a pointer to an Incidence object to be converted into a QByteArray.
Returns
the QString will be Null if the conversion was unsuccessful.
Since
4.7

Definition at line 345 of file icalformat.cpp.

QString ICalFormat::toString ( const Calendar::Ptr calendar,
const QString notebook = QString(),
bool  deleted = false 
)
overridevirtual

CalFormat::toString()

Implements KCalendarCore::CalFormat.

Definition at line 250 of file icalformat.cpp.

QString ICalFormat::toString ( const Incidence::Ptr incidence)

Converts an Incidence to a QString.

Parameters
incidenceis a pointer to an Incidence object to be converted into a QString.
Returns
the QString will be Null if the conversion was unsuccessful.

Definition at line 340 of file icalformat.cpp.

QString ICalFormat::toString ( RecurrenceRule rule)

Converts a RecurrenceRule to a QString.

Parameters
ruleis a pointer to a RecurrenceRule object to be converted into a QString.
Returns
the QString will be Null if the conversion was unsuccessful.

Definition at line 376 of file icalformat.cpp.

void ICalFormat::virtual_hook ( int  id,
void *  data 
)
overrideprotectedvirtual

IncidenceBase::virtual_hook()

Reimplemented from KCalendarCore::CalFormat.

Definition at line 666 of file icalformat.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 5 2020 22:48:59 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.