KCalendarCore::VCalFormat

Search for usage in LXR

KCalendarCore::VCalFormat Class Reference

#include <vcalformat.h>

Inheritance diagram for KCalendarCore::VCalFormat:

Public Member Functions

 VCalFormat ()
 
 ~VCalFormat () override
 
bool fromRawString (const Calendar::Ptr &calendar, const QByteArray &string) override
 
bool load (const Calendar::Ptr &calendar, const QString &fileName) override
 
bool save (const Calendar::Ptr &calendar, const QString &fileName) override
 
QString toString (const Calendar::Ptr &calendar) override
 
- Public Member Functions inherited from KCalendarCore::CalFormat
virtual ~CalFormat ()
 
void clearException ()
 
Exceptionexception () const
 
bool fromString (const Calendar::Ptr &calendar, const QString &string)
 
QString loadedProductId ()
 
void setException (Exception *error)
 

Protected Member Functions

QDate ISOToQDate (const QString &dtStr)
 
QDateTime ISOToQDateTime (const QString &dtStr)
 
int numFromDay (const QString &day)
 
QString parseDst (QByteArray &timezone) const
 
QString parseTZ (const QByteArray &timezone) const
 
bool parseTZOffsetISO8601 (const QString &s, int &result)
 
void populate (VObject *vcal)
 
QString qDateTimeToISO (const QDateTime &date, bool zulu=true)
 
QString qDateToISO (const QDate &date)
 
void readCustomProperties (VObject *o, const Incidence::Ptr &i)
 
Attendee::PartStat readStatus (const char *s) const
 
Event::Ptr VEventToEvent (VObject *vevent)
 
Todo::Ptr VTodoToEvent (VObject *vtodo)
 
void writeCustomProperties (VObject *o, const Incidence::Ptr &i)
 
QByteArray writeStatus (Attendee::PartStat status) const
 
- 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

vCalendar format implementation.

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

Definition at line 60 of file vcalformat.h.

Constructor & Destructor Documentation

◆ VCalFormat()

VCalFormat::VCalFormat ( )

Constructor a new vCalendar Format object.

Private class that helps to provide binary compatibility between releases.

Definition at line 75 of file vcalformat.cpp.

◆ ~VCalFormat()

VCalFormat::~VCalFormat ( )
override

Destructor.

Definition at line 80 of file vcalformat.cpp.

Member Function Documentation

◆ fromRawString()

bool VCalFormat::fromRawString ( const Calendar::Ptr & calendar,
const QByteArray & string )
overridevirtual

CalFormat::fromRawString()

Implements KCalendarCore::CalFormat.

Definition at line 129 of file vcalformat.cpp.

◆ ISOToQDate()

QDate VCalFormat::ISOToQDate ( const QString & dtStr)
protected

Takes a string in the YYYYMMDD format and returns a valid QDate.

Parameters
dtStris a QString containing the date to convert. If this value is invalid, then QDateTime() is returned.

Definition at line 1247 of file vcalformat.cpp.

◆ ISOToQDateTime()

QDateTime VCalFormat::ISOToQDateTime ( const QString & dtStr)
protected

Takes a string in YYYYMMDDTHHMMSS format and returns a valid QDateTime.

Parameters
dtStris a QString containing the date to convert. If this value is invalid, then QDateTime() is returned.

Definition at line 1218 of file vcalformat.cpp.

◆ load()

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

CalFormat::load()

Implements KCalendarCore::CalFormat.

Definition at line 89 of file vcalformat.cpp.

◆ numFromDay()

int VCalFormat::numFromDay ( const QString & day)
protected

Converts a two letter representation of the day (i.e.

MO, TU, WE, etc) and returns a number 0-6 corresponding to that ordinal day of the week.

Parameters
dayis the QString containing the two letter day representation.

Definition at line 1549 of file vcalformat.cpp.

◆ parseDst()

QString VCalFormat::parseDst ( QByteArray & timezone) const
protected

Parse DAYLIGHT tag from vtimezone.

Definition at line 1162 of file vcalformat.cpp.

◆ parseTZ()

QString VCalFormat::parseTZ ( const QByteArray & timezone) const
protected

Parse TZ tag from vtimezone.

Definition at line 1155 of file vcalformat.cpp.

◆ parseTZOffsetISO8601()

bool VCalFormat::parseTZOffsetISO8601 ( const QString & s,
int & result )
protected

Parse one of the myriad of ISO8601 timezone offset formats, e.g.

+- hh : mm +- hh mm +- hh

Parameters
sstring to be parsed.
resulttimezone offset in seconds, if parse succeeded.
Returns
Whether the parse succeeded or not.

Definition at line 1258 of file vcalformat.cpp.

◆ populate()

void VCalFormat::populate ( VObject * vcal)
protected

Takes a vCalendar tree of VObjects, and puts all of them that have the "event" property into the dictionary, todos in the todo-list, etc.

Definition at line 1320 of file vcalformat.cpp.

◆ qDateTimeToISO()

QString VCalFormat::qDateTimeToISO ( const QDateTime & date,
bool zulu = true )
protected

Takes a QDateTime and returns a string in format YYYYMMDDTHHMMSS.

Parameters
dateis the date to format.
zuluif true, then shift the date to UTC.

Definition at line 1192 of file vcalformat.cpp.

◆ qDateToISO()

QString VCalFormat::qDateToISO ( const QDate & date)
protected

Takes a QDate and returns a string in the format YYYYMMDDTHHMMSS.

Parameters
dateis the date to format.

Definition at line 1183 of file vcalformat.cpp.

◆ readCustomProperties()

void VCalFormat::readCustomProperties ( VObject * o,
const Incidence::Ptr & i )
protected

Definition at line 1629 of file vcalformat.cpp.

◆ readStatus()

Attendee::PartStat VCalFormat::readStatus ( const char * s) const
protected

Converts a status string into an Attendee::PartStat.

Parameters
sis a null-terminated character string containing the status to convert.
Returns
a valid Attendee::PartStat. If the string provided is empty, null, or the contents are unrecognized, then Attendee::NeedsAction is returned.

Definition at line 1576 of file vcalformat.cpp.

◆ save()

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

CalFormat::save()

Implements KCalendarCore::CalFormat.

Definition at line 121 of file vcalformat.cpp.

◆ toString()

QString VCalFormat::toString ( const Calendar::Ptr & calendar)
overridevirtual

CalFormat::toString()

Implements KCalendarCore::CalFormat.

Definition at line 158 of file vcalformat.cpp.

◆ VEventToEvent()

Event::Ptr VCalFormat::VEventToEvent ( VObject * vevent)
protected

Translates a VObject into a Event and returns a pointer to it.

Parameters
veventis a pointer to a valid VObject object.

Definition at line 625 of file vcalformat.cpp.

◆ VTodoToEvent()

Todo::Ptr VCalFormat::VTodoToEvent ( VObject * vtodo)
protected

Translates a VObject of the TODO type into an Event.

Parameters
vtodois a pointer to a valid VObject object.

Definition at line 166 of file vcalformat.cpp.

◆ writeCustomProperties()

void VCalFormat::writeCustomProperties ( VObject * o,
const Incidence::Ptr & i )
protected

Definition at line 1648 of file vcalformat.cpp.

◆ writeStatus()

QByteArray VCalFormat::writeStatus ( Attendee::PartStat status) const
protected

Converts an Attendee::PartStat into a QByteArray string.

Parameters
statusis the Attendee::PartStat to convert.
Returns
a QByteArray containing the status string.

Definition at line 1608 of file vcalformat.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:47 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.