KCalendarCore::CalFormat
#include <calformat.h>

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 ¬ebook=QString())=0 |
virtual bool | fromString (const Calendar::Ptr &calendar, const QString &string, bool deleted, const QString ¬ebook={})=0 |
bool | fromString (const Calendar::Ptr &calendar, const QString &string, const QString ¬ebook={}) |
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 ¬ebook=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 38 of file calformat.h.
Constructor & Destructor Documentation
◆ CalFormat()
CalFormat::CalFormat | ( | ) |
Constructs a new Calendar Format object.
- Deprecated:
- since 5.96, unused with the move to hierarchical dptrs.
Definition at line 33 of file calformat.cpp.
◆ ~CalFormat()
|
virtual |
Destructor.
Definition at line 44 of file calformat.cpp.
Member Function Documentation
◆ application()
|
static |
Returns the application name used in unique IDs and error messages.
Definition at line 75 of file calformat.cpp.
◆ clearException()
void CalFormat::clearException | ( | ) |
Clears the exception status.
Definition at line 54 of file calformat.cpp.
◆ createUniqueId()
|
static |
Creates a unique id string.
Definition at line 95 of file calformat.cpp.
◆ exception()
Exception * CalFormat::exception | ( | ) | const |
Returns an exception, if there is any, containing information about the last error that occurred.
Definition at line 64 of file calformat.cpp.
◆ fromRawString()
|
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. deleted use deleted incidences notebook notebook uid
- Returns
- true if successful; false otherwise.
- See also
- fromString(), toString().
Implemented in KCalendarCore::ICalFormat, and KCalendarCore::VCalFormat.
◆ fromString() [1/2]
|
pure virtual |
Loads a calendar from a string.
When a notebook is given, incidences are added to this notebook, otherwise no notebook is associated to loaded incidences. The notebook should already be added to the calendar, see Calendar::addNotebook().
- 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().
- Deprecated:
- since 5.97, use fromString(const Calendar::Ptr &calendar, const QString &string, const QString ¬ebook) instead.
Implemented in KCalendarCore::VCalFormat, and KCalendarCore::ICalFormat.
◆ fromString() [2/2]
bool CalFormat::fromString | ( | const Calendar::Ptr & | calendar, |
const QString & | string, | ||
const QString & | notebook = {} |
||
) |
Loads a calendar from a string.
When a notebook is given, incidences are added to this notebook, otherwise no notebook is associated to loaded incidences. The notebook should already be added to the calendar, see Calendar::addNotebook().
- Parameters
-
calendar is the Calendar to be loaded. string is the QString containing the Calendar data. notebook notebook uid
- Returns
- true if successful; false otherwise.
- See also
- fromRawString(), toString().
- Since
- 5.97
Definition at line 49 of file calformat.cpp.
◆ load()
|
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 KCalendarCore::VCalFormat, and KCalendarCore::ICalFormat.
◆ loadedProductId()
QString CalFormat::loadedProductId | ( | ) |
Returns the PRODID string loaded from calendar file.
- See also
- setLoadedProductId()
Definition at line 85 of file calformat.cpp.
◆ productId()
|
static |
Returns the our library's PRODID string to write into calendar files.
Definition at line 80 of file calformat.cpp.
◆ save()
|
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 KCalendarCore::VCalFormat, and KCalendarCore::ICalFormat.
◆ setApplication()
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 69 of file calformat.cpp.
◆ setException()
void CalFormat::setException | ( | Exception * | 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 Exception which contains the exception.
Definition at line 59 of file calformat.cpp.
◆ setLoadedProductId()
|
protected |
Sets the PRODID string loaded from calendar file.
- Parameters
-
id is a pruduct Id string to set for the calendar file.
- See also
- loadedProductId()
Definition at line 90 of file calformat.cpp.
◆ toString()
|
pure 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
- See also
- fromString(), fromRawString().
Implemented in KCalendarCore::ICalFormat, and KCalendarCore::VCalFormat.
◆ virtual_hook()
|
protectedvirtual |
- Deprecated:
- since 5.96 unused, hierarchical dptrs provide the same ABI compatible extension vector as this class is not intended to be inherited externally.
Reimplemented in KCalendarCore::ICalFormat, and KCalendarCore::VCalFormat.
Definition at line 101 of file calformat.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 03:58:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.