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

KCalCore Library

  • KCalCore
  • CalFormat
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KCalCore::CalFormat Class Referenceabstract

#include <calformat.h>

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

Public Member Functions

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

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)
 
virtual void virtual_hook (int id, void *data)
 

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 48 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.

Definition at line 68 of file calformat.cpp.

CalFormat::~CalFormat ( )
virtual

Destructor.

Definition at line 73 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 103 of file calformat.cpp.

void CalFormat::clearException ( )

Clears the exception status.

Definition at line 79 of file calformat.cpp.

QString CalFormat::createUniqueId ( )
static

Creates a unique id string.

Definition at line 123 of file calformat.cpp.

Exception * CalFormat::exception ( ) const

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

Definition at line 91 of file calformat.cpp.

virtual bool KCalCore::CalFormat::fromRawString ( const Calendar::Ptr &  calendar,
const QByteArray &  string,
bool  deleted = false,
const QString &  notebook = QString() 
)
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
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().

Implemented in KCalCore::ICalFormat, and KCalCore::VCalFormat.

virtual bool KCalCore::CalFormat::fromString ( const Calendar::Ptr &  calendar,
const QString &  string,
bool  deleted = false,
const QString &  notebook = QString() 
)
pure virtual

Loads a calendar from a string.

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().

Implemented in KCalCore::VCalFormat, and KCalCore::ICalFormat.

virtual bool KCalCore::CalFormat::load ( const Calendar::Ptr &  calendar,
const QString &  fileName 
)
pure virtual

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

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

Implemented in KCalCore::VCalFormat, and KCalCore::ICalFormat.

QString CalFormat::loadedProductId ( )

Returns the PRODID string loaded from calendar file.

See also
setLoadedProductId()

Definition at line 113 of file calformat.cpp.

const QString & CalFormat::productId ( )
static

Returns the our library's PRODID string to write into calendar files.

Definition at line 108 of file calformat.cpp.

virtual bool KCalCore::CalFormat::save ( const Calendar::Ptr &  calendar,
const QString &  fileName 
)
pure virtual

Writes the calendar to disk.

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.

Implemented in KCalCore::VCalFormat, and KCalCore::ICalFormat.

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
applicationis a string containing the application name.
productIDis a string containing the product identifier.

Definition at line 96 of file calformat.cpp.

void CalFormat::setException ( Exception *  error)

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

Parameters
erroris a pointer to an Exception which contains the exception.

Definition at line 85 of file calformat.cpp.

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

Sets the PRODID string loaded from calendar file.

Parameters
idis a pruduct Id string to set for the calendar file.
See also
loadedProductId()

Definition at line 118 of file calformat.cpp.

virtual QString KCalCore::CalFormat::toString ( const Calendar::Ptr &  calendar,
const QString &  notebook = QString(),
bool  deleted = false 
)
pure virtual

Returns the calendar as a string.

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().

Implemented in KCalCore::ICalFormat, and KCalCore::VCalFormat.

void CalFormat::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

IncidenceBase::virtual_hook()

Reimplemented in KCalCore::VCalFormat, and KCalCore::ICalFormat.

Definition at line 144 of file calformat.cpp.


The documentation for this class was generated from the following files:
  • calformat.h
  • calformat.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:58 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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