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

KCalCore Library

  • KCalCore
  • VCalFormat
Public Member Functions | Protected Member Functions
KCalCore::VCalFormat Class Reference

#include <vcalformat.h>

Inheritance diagram for KCalCore::VCalFormat:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 VCalFormat ()
virtual ~VCalFormat ()
bool fromRawString (const Calendar::Ptr &calendar, const QByteArray &string, bool deleted=false, const QString &notebook=QString())
bool fromString (const Calendar::Ptr &calendar, const QString &string, bool deleted=false, const QString &notebook=QString())
bool load (const Calendar::Ptr &calendar, const QString &fileName)
bool save (const Calendar::Ptr &calendar, const QString &fileName)
QString toString (const Calendar::Ptr &calendar, const QString &notebook=QString(), bool deleted=false)

Protected Member Functions

const char * dayFromNum (int day)
VObject * eventToVEvent (const Event::Ptr &event)
VObject * eventToVTodo (const Todo::Ptr &todo)
KDateTime ISOToKDateTime (const QString &dtStr)
QDate ISOToQDate (const QString &dtStr)
QString kDateTimeToISO (const KDateTime &date, bool zulu=true)
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, bool deleted=false, const QString &notebook=QString())
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)
virtual void virtual_hook (int id, void *data)
Todo::Ptr VTodoToEvent (VObject *vtodo)
void writeCustomProperties (VObject *o, const Incidence::Ptr &i)
QByteArray writeStatus (Attendee::PartStat status) const

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 69 of file vcalformat.h.


Constructor & Destructor Documentation

VCalFormat::VCalFormat ( )

Constructor a new vCalendar Format object.

Private class that helps to provide binary compatibility between releases.

Definition at line 77 of file vcalformat.cpp.

VCalFormat::~VCalFormat ( ) [virtual]

Destructor.

Definition at line 87 of file vcalformat.cpp.


Member Function Documentation

const char * VCalFormat::dayFromNum ( int  day) [protected]

Takes a number 0 - 6 and returns the two letter string of that day, i.e.

MO, TU, WE, etc.

 @param day number of the day to get a two letter name for. Range @c 0 - @c 6
 @see numFromDay().

Definition at line 2541 of file vcalformat.cpp.

VObject * VCalFormat::eventToVEvent ( const Event::Ptr &  event) [protected]

Translates an Event into a VEvent-type VObject and returns a pointer to it.

Parameters:
eventis a pointer to a valid Event object.

Definition at line 645 of file vcalformat.cpp.

VObject * VCalFormat::eventToVTodo ( const Todo::Ptr &  todo) [protected]

Translates a Todo into a VTodo-type VObject and return pointer.

Parameters:
todois a pointer to a valid Todo object.

Definition at line 303 of file vcalformat.cpp.

bool VCalFormat::fromRawString ( const Calendar::Ptr &  calendar,
const QByteArray &  string,
bool  deleted = false,
const QString &  notebook = QString() 
) [virtual]

This is an overload used for efficient reading to avoid utf8 conversions, which are expensive when reading from disk.

Parameters:
calendaris the Calendar to be loaded.
stringis the QByteArray containing the Calendar data.
deleteduse deleted incidences
notebooknotebook uid
Returns:
true if successful; false otherwise.
See also:
fromString(), toString().

Implements KCalCore::CalFormat.

Definition at line 195 of file vcalformat.cpp.

bool VCalFormat::fromString ( const Calendar::Ptr &  calendar,
const QString &  string,
bool  deleted = false,
const QString &  notebook = QString() 
) [virtual]

Parameters:
calendaris the Calendar to be loaded.
stringis the QString containing the Calendar data.
deleteduse deleted incidences
notebooknotebook uid
Returns:
true if successful; false otherwise.
See also:
fromRawString(), toString().

Implements KCalCore::CalFormat.

Definition at line 189 of file vcalformat.cpp.

KDateTime VCalFormat::ISOToKDateTime ( const QString &  dtStr) [protected]

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

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

Definition at line 2154 of file vcalformat.cpp.

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 KDateTime() is returned.

Definition at line 2183 of file vcalformat.cpp.

QString VCalFormat::kDateTimeToISO ( const KDateTime &  date,
bool  zulu = true 
) [protected]

Takes a KDateTime and returns a string in format YYYYMMDDTHHMMSS.

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

Definition at line 2126 of file vcalformat.cpp.

bool VCalFormat::load ( const Calendar::Ptr &  calendar,
const QString &  fileName 
) [virtual]

Parameters:
calendaris the Calendar to be loaded.
fileNameis the name of the disk file containing the Calendar data.
Returns:
true if successful; false otherwise.

Implements KCalCore::CalFormat.

Definition at line 92 of file vcalformat.cpp.

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.
See also:
dayFromNum().

Definition at line 2548 of file vcalformat.cpp.

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

Parse DAYLIGHT tag from vtimezone.

Definition at line 2092 of file vcalformat.cpp.

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

Parse TZ tag from vtimezone.

Definition at line 2085 of file vcalformat.cpp.

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 2194 of file vcalformat.cpp.

void VCalFormat::populate ( VObject *  vcal,
bool  deleted = false,
const QString &  notebook = QString() 
) [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 2256 of file vcalformat.cpp.

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 2113 of file vcalformat.cpp.

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 2575 of file vcalformat.cpp.

bool VCalFormat::save ( const Calendar::Ptr &  calendar,
const QString &  fileName 
) [virtual]

Parameters:
calendaris the Calendar containing the data to be saved.
fileNameis the name of the file to write the calendar data.
Returns:
true if successful; false otherwise.

Implements KCalCore::CalFormat.

Definition at line 123 of file vcalformat.cpp.

QString VCalFormat::toString ( const Calendar::Ptr &  calendar,
const QString &  notebook = QString(),
bool  deleted = false 
) [virtual]

Parameters:
calendaris the Calendar containing the data to be saved.
notebookuid use only incidences with given notebook
deleteduse deleted incidences
Returns:
a QString containing the Calendar data if successful; an empty string otherwise.
See also:
fromString(), fromRawString().

Implements KCalCore::CalFormat.

Definition at line 224 of file vcalformat.cpp.

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 1509 of file vcalformat.cpp.

void VCalFormat::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Parameters:
idis any integer unique to this class which we will use to identify the method to be called.
datais a pointer to some glob of data, typically a struct.

Reimplemented from KCalCore::CalFormat.

Definition at line 2671 of file vcalformat.cpp.

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 1018 of file vcalformat.cpp.

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 2607 of file vcalformat.cpp.


The documentation for this class was generated from the following files:
  • vcalformat.h
  • vcalformat.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 22:16:58 by doxygen 1.8.0 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.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • 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