KCalendarCore
vcalformat.cpp
Go to the documentation of this file.
57 qCritical() << "There number of relatedTos for this incidence is " << cnt << " (there must be 1 relatedTo only)";
98 registerMimeErrorHandler(&mimeErrorHandler); // Note: vCalendar error handler provided by libical.
130 bool VCalFormat::fromString(const Calendar::Ptr &calendar, const QString &string, bool deleted, const QString ¬ebook)
136 bool VCalFormat::fromRawString(const Calendar::Ptr &calendar, const QByteArray &string, bool deleted, const QString ¬ebook)
165 QString VCalFormat::toString(const Calendar::Ptr &calendar, const QString ¬ebook, bool deleted)
186 anEvent->setCreated(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
201 anEvent->setLastModified(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
233 a = Attendee(tmpStr.left(emailPos1 - 1), tmpStr.mid(emailPos1 + 1, emailPos2 - (emailPos1 + 1)));
294 anEvent->setCompleted(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
311 anEvent->setDtDue(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
313 if (anEvent->dtDue().time().hour() == 0 && anEvent->dtDue().time().minute() == 0 && anEvent->dtDue().time().second() == 0) {
322 anEvent->setDtStart(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
324 if (anEvent->dtStart().time().hour() == 0 && anEvent->dtStart().time().minute() == 0 && anEvent->dtStart().time().second() == 0) {
449 if ((tmpStr.mid((index2 - 1), 1) == QLatin1String("-")) || (tmpStr.mid((index2 - 1), 1) == QLatin1String("+"))) {
653 anEvent->setCreated(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
679 anEvent->setLastModified(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
712 a = Attendee(tmpStr.left(emailPos1 - 1), tmpStr.mid(emailPos1 + 1, emailPos2 - (emailPos1 + 1)));
748 anEvent->setDtStart(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
751 if (anEvent->dtStart().time().hour() == 0 && anEvent->dtStart().time().minute() == 0 && anEvent->dtStart().time().second() == 0) {
758 anEvent->setDtEnd(ISOToQDateTime(QString::fromUtf8(s = fakeCString(vObjectUStringZValue(vo)))));
761 if (anEvent->dtEnd().time().hour() == 0 && anEvent->dtEnd().time().minute() == 0 && anEvent->dtEnd().time().second() == 0) {
894 if ((tmpStr.mid((index2 - 1), 1) == QLatin1String("-")) || (tmpStr.mid((index2 - 1), 1) == QLatin1String("+"))) {
999 anEvent->setDescription(anEvent->description() + QLatin1Char('\n') + QString::fromUtf8(s), isRich);
1205 return QStringLiteral("TRUE;") + sOffset + QLatin1Char(';') + sStart + QLatin1Char(';') + sEnd + QLatin1String(";;");
1376 // qCDebug(KCALCORE_LOG) << "This calendar is an iTIP transaction of type '" << methodType << "'";
1395 qCDebug(KCALCORE_LOG) << "This vCalendar file has version" << s << "We only support" << _VCAL_VERSION;
1464 tz = QStringLiteral("%1;%2;false;%3").arg(strRealEndDate, QString::number(utcOffset), realEndDate.toString());
1467 tz = QStringLiteral("%1;%2;true;%3").arg(strRealStartDate, QString::number(utcOffsetDst), realStartDate.toString());
1521 !anEvent->hasRecurrenceId() ? d->mCalendar->event(anEvent->uid()) : d->mCalendar->event(anEvent->uid(), anEvent->recurrenceId());
1561 Todo::Ptr old = !aTodo->hasRecurrenceId() ? d->mCalendar->todo(aTodo->uid()) : d->mCalendar->todo(aTodo->uid(), aTodo->recurrenceId());
1581 } else if ((strcmp(vObjectName(curVO), VCVersionProp) == 0) || (strcmp(vObjectName(curVO), VCProdIdProp) == 0)
1703 i->setNonKDECustomProperty(curname, QString::fromUtf8(s = fakeCString(vObjectUStringZValue(cur))));
QTimeZone utc()
void append(const T &value)
bool fill(bool value, int size)
int month() const const
short toShort(bool *ok, int base) const const
int toInt(bool *ok, int base) const const
Exception base class.
QString toUpper() const const
Represents information related to an attendee of an Calendar Incidence, typically a meeting or task (...
Definition: attendee.h:44
QString number(int n, int base)
QTimeZone timeZone() const const
QString fromUtf8(const char *str, int size)
int size() const const
UTC
int indexOf(char ch, int from) const const
QStringRef midRef(int position, int n) const const
QStringList split(const QString &sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
QByteArray encodeName(const QString &fileName)
QTime time() const const
int year() const const
QString trimmed() const const
void clear()
QStringView mid(qsizetype start) const const
void chop(int n)
void populate(VObject *vcal, bool deleted=false, const QString ¬ebook=QString())
Takes a vCalendar tree of VObjects, and puts all of them that have the "event" property into the dict...
Definition: vcalformat.cpp:1361
QDateTime ISOToQDateTime(const QString &dtStr)
Takes a string in YYYYMMDDTHHMMSS format and returns a valid QDateTime.
Definition: vcalformat.cpp:1243
int numFromDay(const QString &day)
Converts a two letter representation of the day (i.e.
Definition: vcalformat.cpp:1610
QDateTime currentDateTimeUtc()
QString toString(const Calendar::Ptr &calendar, const QString ¬ebook=QString(), bool deleted=false) override
Definition: vcalformat.cpp:165
bool isValid() const const
Exception base class, currently used as a fancy kind of error code and not as an C++ exception.
Definition: exceptions.h:41
bool mightBeRichText(const QString &text)
void setException(Exception *error)
Sets an exception that is to be used by the functions of this class to report errors.
Definition: calformat.cpp:59
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
Event::Ptr VEventToEvent(VObject *vevent)
Translates a VObject into a Event and returns a pointer to it.
Definition: vcalformat.cpp:642
QStringView left(qsizetype length) const const
QMap::const_iterator cbegin() const const
QString simplified() const const
QDateTime toTimeZone(const QTimeZone &timeZone) const const
bool load(const Calendar::Ptr &calendar, const QString &fileName) override
Definition: vcalformat.cpp:89
int size() const const
QString qDateTimeToISO(const QDateTime &date, bool zulu=true)
Takes a QDateTime and returns a string in format YYYYMMDDTHHMMSS.
Definition: vcalformat.cpp:1217
void setLoadedProductId(const QString &id)
Sets the PRODID string loaded from calendar file.
Definition: calformat.cpp:90
QMap::const_iterator cend() const const
bool isTimeZoneIdAvailable(const QByteArray &ianaId)
QByteArray mid(int pos, int len) const const
int length() const const
Todo::Ptr VTodoToEvent(VObject *vtodo)
Translates a VObject of the TODO type into an Event.
Definition: vcalformat.cpp:175
Q_SCRIPTABLE CaptureState status()
bool setHMS(int h, int m, int s, int ms)
bool isValid() const const
QString parseDst(QByteArray &timezone) const
Parse DAYLIGHT tag from vtimezone.
Definition: vcalformat.cpp:1187
void setBit(int i)
bool parseTZOffsetISO8601(const QString &s, int &result)
Parse one of the myriad of ISO8601 timezone offset formats, e.g.
Definition: vcalformat.cpp:1291
Represents information related to an attachment for a Calendar Incidence.
Definition: attachment.h:46
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
QDate ISOToQDate(const QString &dtStr)
Takes a string in the YYYYMMDD format and returns a valid QDate.
Definition: vcalformat.cpp:1276
bool contains(char ch) const const
bool fromString(const Calendar::Ptr &calendar, const QString &string, bool deleted, const QString ¬ebook=QString()) override
Definition: vcalformat.cpp:130
int hour() const const
vCalendar format implementation.
bool save(const Calendar::Ptr &calendar, const QString &fileName) override
Definition: vcalformat.cpp:121
QString & replace(int position, int n, QChar after)
void virtual_hook(int id, void *data) override
Definition: vcalformat.cpp:1724
QDateTime toUTC() const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
int second() const const
QString & insert(int position, QChar ch)
bool fromRawString(const Calendar::Ptr &calendar, const QByteArray &string, bool deleted=false, const QString ¬ebook=QString()) override
Definition: vcalformat.cpp:136
An abstract base class that provides an interface to various calendar formats.
Definition: calformat.h:38
QString left(int n) const const
Attendee::PartStat readStatus(const char *s) const
Converts a status string into an Attendee::PartStat.
Definition: vcalformat.cpp:1637
QString qDateToISO(const QDate &date)
Takes a QDate and returns a string in the format YYYYMMDDTHHMMSS.
Definition: vcalformat.cpp:1208
QDate date() const const
void setStatus(PartStat status)
Sets the PartStat of the attendee to status.
Definition: attendee.cpp:205
bool isValid() const const
const QChar at(int position) const const
QString parseTZ(const QByteArray &timezone) const
Parse TZ tag from vtimezone.
Definition: vcalformat.cpp:1180
bool setDate(int year, int month, int day)
QString asprintf(const char *cformat,...)
QString toString(Qt::DateFormat format) const const
QString mid(int position, int n) const const
void setTimeZone(const QTimeZone &toZone)
int minute() const const
static const QString & productId()
Returns the our library's PRODID string to write into calendar files.
Definition: calformat.cpp:80
QByteArray writeStatus(Attendee::PartStat status) const
Converts an Attendee::PartStat into a QByteArray string.
Definition: vcalformat.cpp:1669
QString decodeName(const QByteArray &localFileName)
int day() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:00:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:00:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.