• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KCalCore Library

KCalCore::ICalFormat

KCalCore::ICalFormat Class Reference

iCalendar format implementation. More...

#include <icalformat.h>

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

List of all members.

Public Member Functions

 ICalFormat ()
virtual ~ICalFormat ()
QString createScheduleMessage (const IncidenceBase::Ptr &incidence, iTIPMethod method)
bool fromRawString (const Calendar::Ptr &calendar, const QByteArray &string, bool deleted=false, const QString &notebook=QString())
bool fromString (RecurrenceRule *rule, const QString &string)
Incidence::Ptr fromString (const QString &string)
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)
FreeBusy::Ptr parseFreeBusy (const QString &string)
ScheduleMessage::Ptr parseScheduleMessage (const Calendar::Ptr &calendar, const QString &string)
bool save (const Calendar::Ptr &calendar, const QString &fileName)
void setTimeSpec (const KDateTime::Spec &timeSpec)
KDateTime::Spec timeSpec () const
QString timeZoneId () const
QString toICalString (const Incidence::Ptr &incidence)
QString toString (RecurrenceRule *rule)
QString toString (const Incidence::Ptr &incidence)
QString toString (const Calendar::Ptr &calendar, const QString &notebook=QString(), bool deleted=false)

Protected Member Functions

virtual void virtual_hook (int id, void *data)

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 58 of file icalformat.h.


Constructor & Destructor Documentation

ICalFormat::ICalFormat (  ) 

Constructor a new iCalendar Format object.

Definition at line 66 of file icalformat.cpp.

ICalFormat::~ICalFormat (  )  [virtual]

Destructor.

Definition at line 71 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:
incidence is a pointer to an IncidenceBase object to be scheduled.
method is a Scheduler::Method
Returns:
a QString containing the message if successful; 0 otherwise.

Definition at line 355 of file icalformat.cpp.

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

Parses a utf8 encoded string, returning the first iCal component encountered in that string. This is an overload used for efficient reading to avoid utf8 conversions, which are expensive when reading from disk.

Parameters:
calendar is the Calendar to be loaded.
string is the QByteArray containing the Calendar data.
deleted use deleted incidences
notebook notebook uid
Returns:
true if successful; false otherwise.
See also:
fromString(), toString().

Implements KCalCore::CalFormat.

Definition at line 145 of file icalformat.cpp.

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

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

Parameters:
rule is a pointer to a RecurrenceRule object.
string is a QString containing the data to be parsed.
Returns:
true if successful; false otherwise.

Definition at line 335 of file icalformat.cpp.

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

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

Parameters:
string is 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 201 of file icalformat.cpp.

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

Loads a calendar from a string.

Parameters:
calendar is the Calendar to be loaded.
string is the QString containing the Calendar data.
deleted use deleted incidences
notebook notebook uid
Returns:
true if successful; false otherwise.
See also:
fromRawString(), toString().

Note:
The notebook is ignored and the default one is used

Implements KCalCore::CalFormat.

Definition at line 139 of file icalformat.cpp.

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

Loads a calendar on disk into the calendar associated with this format.

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

Implements KCalCore::CalFormat.

Definition at line 76 of file icalformat.cpp.

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

Converts a QString into a FreeBusy object.

Parameters:
string is 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 384 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:
calendar is a pointer to a Calendar object associated with the scheduling message.
string is 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 418 of file icalformat.cpp.

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

Writes the calendar to disk.

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

Implements KCalCore::CalFormat.

Definition at line 101 of file icalformat.cpp.

void ICalFormat::setTimeSpec ( const KDateTime::Spec &  timeSpec  ) 

Sets the iCalendar time specification (time zone, etc.

).

Parameters:
timeSpec is the time specification to set.
See also:
timeSpec().

Definition at line 588 of file icalformat.cpp.

KDateTime::Spec ICalFormat::timeSpec (  )  const

Returns the iCalendar time specification.

See also:
setTimeSpec().

Definition at line 593 of file icalformat.cpp.

QString 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 598 of file icalformat.cpp.

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

Converts an Incidence to iCalendar formatted text.

Parameters:
incidence is 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 306 of file icalformat.cpp.

QString ICalFormat::toString ( RecurrenceRule *  rule  ) 

Converts a RecurrenceRule to a QString.

Parameters:
rule is 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 326 of file icalformat.cpp.

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

Converts an Incidence to a QString.

Parameters:
incidence is 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 313 of file icalformat.cpp.

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

Returns the calendar as a string.

Parameters:
calendar is the Calendar containing the data to be saved.
notebook uid use only incidences with given notebook
deleted use 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 225 of file icalformat.cpp.

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

Standard trick to add virtuals later.

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

Reimplemented from KCalCore::CalFormat.

Definition at line 604 of file icalformat.cpp.


The documentation for this class was generated from the following files:
  • icalformat.h
  • icalformat.cpp

KCalCore Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • 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
Generated for KDE-PIM Libraries by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal