KAlarmCal

kacalendar.h
1 /*
2  * kacalendar.h - KAlarm kcal library calendar and event categorisation
3  * This file is part of kalarmcal library, which provides access to KAlarm
4  * calendar data.
5  * SPDX-FileCopyrightText: 2005-2020 David Jarvie <[email protected]>
6  *
7  * SPDX-License-Identifier: LGPL-2.0-or-later
8  */
9 
10 #ifndef KALARM_KACALENDAR_H
11 #define KALARM_KACALENDAR_H
12 
13 #include "kalarmcal_export.h"
14 
15 #include <KCalendarCore/FileStorage>
16 #include <KCalendarCore/Calendar>
17 #include <KCalendarCore/Event>
18 
19 #include <AkonadiCore/Collection>
20 
21 #include <QByteArray>
22 #include <QStringList>
23 #include <QDebug>
24 
25 namespace KCalendarCore
26 {
27 class Alarm;
28 }
29 
30 namespace KAlarmCal
31 {
32 
33 extern const QLatin1String KALARMCAL_EXPORT MIME_BASE;
34 extern const QLatin1String KALARMCAL_EXPORT MIME_ACTIVE;
35 extern const QLatin1String KALARMCAL_EXPORT MIME_ARCHIVED;
36 extern const QLatin1String KALARMCAL_EXPORT MIME_TEMPLATE;
37 
39 typedef Akonadi::Collection::Id ResourceId;
40 
50 namespace KACalendar
51 {
54  Unknown = 0,
55  Current = 0x02,
56  Converted = Current | 0x01,
57  Convertible = 0x04,
58  Incompatible = 0x08
59 };
60 Q_DECLARE_FLAGS(Compat, Compatibility)
61 
62 
65 enum {
67  MixedFormat = -2,
69 };
70 
83 KALARMCAL_EXPORT int updateVersion(const KCalendarCore::FileStorage::Ptr &, QString &versionString);
84 
86 KALARMCAL_EXPORT void setKAlarmVersion(const KCalendarCore::Calendar::Ptr &);
87 
89 KALARMCAL_EXPORT void setProductId(const QByteArray &progName, const QByteArray &progVersion);
90 
94 KALARMCAL_EXPORT QByteArray icalProductId();
95 
96 extern const QByteArray APPNAME;
97 } // namespace KACalendar
98 
99 //
100 
110 namespace CalEvent
111 {
113 enum Type {
114  EMPTY = 0,
115  ACTIVE = 0x01,
116  ARCHIVED = 0x02,
117  TEMPLATE = 0x04,
118  DISPLAYING = 0x08
119 };
120 Q_DECLARE_FLAGS(Types, Type)
121 
122 KALARMCAL_EXPORT QString uid(const QString &id, Type);
123 KALARMCAL_EXPORT Type status(const KCalendarCore::Event::Ptr &, QString *param = nullptr);
124 KALARMCAL_EXPORT void setStatus(const KCalendarCore::Event::Ptr &, Type, const QString &param = QString());
125 
127 KALARMCAL_EXPORT Type type(const QString &mimeType);
129 KALARMCAL_EXPORT Types types(const QStringList &mimeTypes);
131 KALARMCAL_EXPORT QString mimeType(Type);
133 KALARMCAL_EXPORT QStringList mimeTypes(Types);
134 } // namespace CalEvent
135 
136 Q_DECLARE_OPERATORS_FOR_FLAGS(CalEvent::Types)
137 
138 } // namespace KAlarmCal
139 
140 KALARMCAL_EXPORT QDebug operator<<(QDebug, KAlarmCal::CalEvent::Type);
141 
142 #endif // KALARM_KACALENDAR_H
143 
144 // vim: et sw=4:
the event is an alarm template
Definition: kacalendar.h:117
void setKAlarmVersion(const Calendar::Ptr &calendar)
Set the KAlarm version custom property for a calendar.
Definition: kacalendar.cpp:71
not written by KAlarm, or a newer KAlarm version
Definition: kacalendar.h:68
not written by KAlarm, or in a newer KAlarm version
Definition: kacalendar.h:58
in an older KAlarm format
Definition: kacalendar.h:57
QByteArray icalProductId()
Return the product ID string for use in calendars.
Definition: kacalendar.cpp:63
Type
The category of an event, indicated by the middle part of its UID.
Definition: kacalendar.h:113
in current KAlarm format, but not yet saved
Definition: kacalendar.h:56
const QByteArray APPNAME("KALARM")
The application name ("KALARM") used in calendar properties.
Definition: kacalendar.h:96
the event is currently being displayed
Definition: kacalendar.h:118
the event is currently active
Definition: kacalendar.h:115
int updateVersion(const FileStorage::Ptr &fileStorage, QString &versionString)
Check the version of KAlarm which wrote a calendar file, and convert it in memory to the current KAla...
Definition: kacalendar.cpp:82
in current KAlarm format
Definition: kacalendar.h:55
the event has no alarms
Definition: kacalendar.h:114
current KAlarm format
Definition: kacalendar.h:66
the event is archived
Definition: kacalendar.h:116
void setProductId(const QByteArray &progName, const QByteArray &progVersion)
Set the program name and version for use in calendars.
Definition: kacalendar.cpp:58
calendar may contain more than one version
Definition: kacalendar.h:67
Compatibility
Compatibility of resource backend calendar format.
Definition: kacalendar.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 6 2020 23:08:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.