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

KCalCore Library

  • kcalcore
vcalformat.h
Go to the documentation of this file.
1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
37
38#ifndef KCALCORE_VCALFORMAT_H
39#define KCALCORE_VCALFORMAT_H
40
41#include "kcalcore_export.h"
42#include "attendee.h"
43#include "calformat.h"
44#include "event.h"
45#include "todo.h"
46#include "journal.h"
47
48struct VObject;
49
50class KDateTime;
51
52class QDate;
53
54#define _VCAL_VERSION "1.0"
55
56namespace KCalCore {
57
58class Event;
59class Todo;
60
69class KCALCORE_EXPORT VCalFormat : public CalFormat
70{
71public:
75 VCalFormat();
76
80 virtual ~VCalFormat();
81
86 bool load(const Calendar::Ptr &calendar, const QString &fileName);
87
92 bool save(const Calendar::Ptr &calendar, const QString &fileName);
93
98 bool fromString(const Calendar::Ptr &calendar, const QString &string,
99 bool deleted = false, const QString &notebook = QString());
100
105 QString toString(const Calendar::Ptr &calendar, const QString &notebook = QString(),
106 bool deleted = false);
107
112 bool fromRawString(const Calendar::Ptr &calendar, const QByteArray &string,
113 bool deleted = false, const QString &notebook = QString());
114
115protected:
120 Todo::Ptr VTodoToEvent(VObject *vtodo);
121
126 Event::Ptr VEventToEvent(VObject *vevent);
127
132 VObject *eventToVEvent(const Event::Ptr &event);
133
137 QString parseTZ(const QByteArray &timezone) const;
138
142 QString parseDst(QByteArray &timezone) const;
143
148 VObject *eventToVTodo(const Todo::Ptr &todo);
149
154 QString qDateToISO(const QDate &date);
155
161 QString kDateTimeToISO(const KDateTime &date, bool zulu = true);
162
168 KDateTime ISOToKDateTime(const QString &dtStr);
169
175 QDate ISOToQDate(const QString &dtStr);
176
187 bool parseTZOffsetISO8601(const QString &s, int &result);
188
193 void populate(VObject *vcal, bool deleted = false, const QString &notebook = QString());
194
202 const char *dayFromNum(int day);
203
210 int numFromDay(const QString &day);
211
219 Attendee::PartStat readStatus(const char *s) const;
220
227 QByteArray writeStatus(Attendee::PartStat status) const;
228
229 void readCustomProperties(VObject *o, const Incidence::Ptr &i);
230 void writeCustomProperties(VObject *o, const Incidence::Ptr &i);
231
232protected:
237 virtual void virtual_hook(int id, void *data);
238
239private:
243 enum PilotState {
244 SYNCNONE = 0,
245 SYNCMOD = 1,
246 SYNCDEL = 3
247 };
248
249 //@cond PRIVATE
250 Q_DISABLE_COPY(VCalFormat)
251 class Private;
252 Private *const d;
253 //@endcond
254};
255
256}
257
258#endif
attendee.h
This file is part of the API for handling calendar data and defines the Attendee class.
calformat.h
This file is part of the API for handling calendar data and defines the CalFormat abstract base class...
KCalCore::Attendee::PartStat
PartStat
The different types of participant status.
Definition attendee.h:70
KCalCore::CalFormat::CalFormat
CalFormat()
Constructs a new Calendar Format object.
Definition calformat.cpp:68
KCalCore::Calendar::Ptr
QSharedPointer< Calendar > Ptr
A shared pointer to a Calendar.
Definition calendar.h:138
KCalCore::Event
This class provides an Event in the sense of RFC2445.
Definition event.h:42
KCalCore::Event::Ptr
QSharedPointer< Event > Ptr
A shared pointer to an Event object.
Definition event.h:55
KCalCore::Incidence::Ptr
QSharedPointer< Incidence > Ptr
A shared pointer to an Incidence.
Definition incidence.h:112
KCalCore::Todo
Provides a To-do in the sense of RFC2445.
Definition todo.h:45
KCalCore::Todo::Ptr
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
Definition todo.h:50
KCalCore::VCalFormat::populate
void populate(VObject *vcal, bool deleted=false, const QString &notebook=QString())
Takes a vCalendar tree of VObjects, and puts all of them that have the "event" property into the dict...
Definition vcalformat.cpp:2265
KCalCore::VCalFormat::load
bool load(const Calendar::Ptr &calendar, const QString &fileName)
Definition vcalformat.cpp:103
KCalCore::VCalFormat::eventToVTodo
VObject * eventToVTodo(const Todo::Ptr &todo)
Translates a Todo into a VTodo-type VObject and return pointer.
Definition vcalformat.cpp:314
KCalCore::VCalFormat::writeStatus
QByteArray writeStatus(Attendee::PartStat status) const
Converts an Attendee::PartStat into a QByteArray string.
Definition vcalformat.cpp:2615
KCalCore::VCalFormat::qDateToISO
QString qDateToISO(const QDate &date)
Takes a QDate and returns a string in the format YYYYMMDDTHHMMSS.
Definition vcalformat.cpp:2122
KCalCore::VCalFormat::kDateTimeToISO
QString kDateTimeToISO(const KDateTime &date, bool zulu=true)
Takes a KDateTime and returns a string in format YYYYMMDDTHHMMSS.
Definition vcalformat.cpp:2135
KCalCore::VCalFormat::VTodoToEvent
Todo::Ptr VTodoToEvent(VObject *vtodo)
Translates a VObject of the TODO type into an Event.
Definition vcalformat.cpp:1029
KCalCore::VCalFormat::fromString
bool fromString(const Calendar::Ptr &calendar, const QString &string, bool deleted=false, const QString &notebook=QString())
Definition vcalformat.cpp:200
KCalCore::VCalFormat::VCalFormat
VCalFormat()
Constructor a new vCalendar Format object.
Definition vcalformat.cpp:88
KCalCore::VCalFormat::parseDst
QString parseDst(QByteArray &timezone) const
Parse DAYLIGHT tag from vtimezone.
Definition vcalformat.cpp:2101
KCalCore::VCalFormat::readStatus
Attendee::PartStat readStatus(const char *s) const
Converts a status string into an Attendee::PartStat.
Definition vcalformat.cpp:2583
KCalCore::VCalFormat::fromRawString
bool fromRawString(const Calendar::Ptr &calendar, const QByteArray &string, bool deleted=false, const QString &notebook=QString())
Definition vcalformat.cpp:206
KCalCore::VCalFormat::parseTZOffsetISO8601
bool parseTZOffsetISO8601(const QString &s, int &result)
Parse one of the myriad of ISO8601 timezone offset formats, e.g.
Definition vcalformat.cpp:2203
KCalCore::VCalFormat::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition vcalformat.cpp:2680
KCalCore::VCalFormat::parseTZ
QString parseTZ(const QByteArray &timezone) const
Parse TZ tag from vtimezone.
Definition vcalformat.cpp:2094
KCalCore::VCalFormat::ISOToQDate
QDate ISOToQDate(const QString &dtStr)
Takes a string in the YYYYMMDD format and returns a valid QDate.
Definition vcalformat.cpp:2192
KCalCore::VCalFormat::eventToVEvent
VObject * eventToVEvent(const Event::Ptr &event)
Translates an Event into a VEvent-type VObject and returns a pointer to it.
Definition vcalformat.cpp:656
KCalCore::VCalFormat::VEventToEvent
Event::Ptr VEventToEvent(VObject *vevent)
Translates a VObject into a Event and returns a pointer to it.
Definition vcalformat.cpp:1518
KCalCore::VCalFormat::ISOToKDateTime
KDateTime ISOToKDateTime(const QString &dtStr)
Takes a string in YYYYMMDDTHHMMSS format and returns a valid KDateTime.
Definition vcalformat.cpp:2163
KCalCore::VCalFormat::toString
QString toString(const Calendar::Ptr &calendar, const QString &notebook=QString(), bool deleted=false)
Definition vcalformat.cpp:235
KCalCore::VCalFormat::dayFromNum
const char * dayFromNum(int day)
Takes a number 0 - 6 and returns the two letter string of that day, i.e.
Definition vcalformat.cpp:2549
KCalCore::VCalFormat::numFromDay
int numFromDay(const QString &day)
Converts a two letter representation of the day (i.e.
Definition vcalformat.cpp:2556
KCalCore::VCalFormat::save
bool save(const Calendar::Ptr &calendar, const QString &fileName)
Definition vcalformat.cpp:134
event.h
This file is part of the API for handling calendar data and defines the Event class.
journal.h
This file is part of the API for handling calendar data and defines the Journal class.
KCalCore
TODO: KDE5:
Definition alarm.h:47
todo.h
This file is part of the API for handling calendar data and defines the Todo class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 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.14.10 API Reference

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