• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KCal Library

KCal::CalFormat

KCal::CalFormat Class Reference

An abstract base class that provides an interface to various calendar formats. More...

#include <calformat.h>

Inheritance diagram for KCal::CalFormat:

Inheritance graph
[legend]

List of all members.


Public Member Functions

 CalFormat ()
void clearException ()
ErrorFormat * exception ()
virtual bool fromRawString (Calendar *calendar, const QByteArray &string)=0
virtual bool fromString (Calendar *calendar, const QString &string)=0
virtual bool load (Calendar *calendar, const QString &fileName)=0
const QString & loadedProductId ()
virtual bool save (Calendar *calendar, const QString &fileName)=0
void setException (ErrorFormat *error)
virtual QString toString (Calendar *calendar)=0
virtual ~CalFormat ()

Static Public Member Functions

static const QString & application ()
static QString createUniqueId ()
static const QString & productId ()
static void setApplication (const QString &application, const QString &productID)

Protected Member Functions

void setLoadedProductId (const QString &id)

Detailed Description

An abstract base class that provides an interface to various calendar formats.

This is the base class for calendar formats. It provides an interface for the generation/interpretation of a textual representation of a calendar.

Definition at line 51 of file calformat.h.


Constructor & Destructor Documentation

CalFormat::CalFormat (  ) 

Constructs a new Calendar Format object.

Private class that helps to provide binary compatibility between releases.

For internal use only.

Definition at line 62 of file calformat.cpp.

CalFormat::~CalFormat (  )  [virtual]

Destructor.

Definition at line 67 of file calformat.cpp.


Member Function Documentation

const QString & CalFormat::application (  )  [static]

Returns the application name used in unique IDs and error messages.

Definition at line 96 of file calformat.cpp.

void CalFormat::clearException (  ) 

Clears the exception status.

Definition at line 72 of file calformat.cpp.

QString CalFormat::createUniqueId (  )  [static]

Creates a unique id string.

Definition at line 116 of file calformat.cpp.

ErrorFormat * CalFormat::exception (  ) 

Returns an exception, if there is any, containing information about the last error that occurred.

Definition at line 84 of file calformat.cpp.

virtual bool KCal::CalFormat::fromRawString ( Calendar *  calendar,
const QByteArray &  string 
) [pure 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.
Returns:
true if successful; false otherwise.
See also:
fromString(), toString().

Implemented in KCal::ICalFormat, and KCal::QtopiaFormat.

virtual bool KCal::CalFormat::fromString ( Calendar *  calendar,
const QString &  string 
) [pure virtual]

Loads a calendar from a string.

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

Implemented in KCal::ICalFormat, and KCal::QtopiaFormat.

virtual bool KCal::CalFormat::load ( Calendar *  calendar,
const QString &  fileName 
) [pure 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.

Implemented in KCal::ICalFormat, and KCal::QtopiaFormat.

const QString & CalFormat::loadedProductId (  ) 

Returns the PRODID string loaded from calendar file.

Definition at line 106 of file calformat.cpp.

const QString & CalFormat::productId (  )  [static]

Returns the PRODID string to write into calendar files.

Definition at line 101 of file calformat.cpp.

virtual bool KCal::CalFormat::save ( Calendar *  calendar,
const QString &  fileName 
) [pure 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.

Implemented in KCal::ICalFormat, and KCal::QtopiaFormat.

void CalFormat::setApplication ( const QString &  application,
const QString &  productID 
) [static]

Sets the application name for use in unique IDs and error messages, and product ID for incidence PRODID property.

Parameters:
application is a string containing the application name.
productID is a string containing the product identifier.

Definition at line 89 of file calformat.cpp.

void CalFormat::setException ( ErrorFormat *  error  ) 

Sets an exception that is to be used by the functions of this class to report errors.

Parameters:
error is a pointer to an ErrorFormat which contains the exception.

Definition at line 78 of file calformat.cpp.

void CalFormat::setLoadedProductId ( const QString &  id  )  [protected]

PRODID string loaded from calendar file.

Definition at line 111 of file calformat.cpp.

virtual QString KCal::CalFormat::toString ( Calendar *  calendar  )  [pure virtual]

Returns the calendar as a string.

Parameters:
calendar is the Calendar containing the data to be saved.
Returns:
a QString containing the Calendar data if successful; an empty string otherwise.
See also:
fromString(), fromRawString().

Implemented in KCal::ICalFormat, and KCal::QtopiaFormat.


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

KCal Library

Skip menu "KCal 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
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7
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