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

KAlarm Library

  • 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 * Copyright © 2005-2012 by David Jarvie <djarvie@kde.org>
6 *
7 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Library General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15 * 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 the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 * MA 02110-1301, USA.
21 */
22
23#ifndef KALARM_KACALENDAR_H
24#define KALARM_KACALENDAR_H
25
26#include "kalarmcal_export.h"
27#ifndef KALARMCAL_USE_KRESOURCES
28#include <kcalcore/filestorage.h>
29#include <kcalcore/calendar.h>
30#include <kcalcore/event.h>
31#include <akonadi/collection.h>
32#endif
33#include <QtCore/QByteArray>
34#include <QtCore/QStringList>
35
36#ifndef KALARMCAL_USE_KRESOURCES
37namespace KCalCore {
38 class Alarm;
39}
40#else
41namespace KCal {
42 class Event;
43 class Alarm;
44 class CalendarLocal;
45}
46#endif
47
48namespace KAlarmCal
49{
50
51#ifndef KALARMCAL_USE_KRESOURCES
52extern const QLatin1String KALARMCAL_EXPORT MIME_BASE;
53extern const QLatin1String KALARMCAL_EXPORT MIME_ACTIVE;
54extern const QLatin1String KALARMCAL_EXPORT MIME_ARCHIVED;
55extern const QLatin1String KALARMCAL_EXPORT MIME_TEMPLATE;
56#endif
57
67namespace KACalendar
68{
69#ifndef KALARMCAL_USE_KRESOURCES
71 enum Compatibility
72 {
73 Unknown = 0,
74 Current = 0x02,
75 Converted = Current | 0x01,
76 Convertible = 0x04,
77 Incompatible = 0x08
78 };
79 Q_DECLARE_FLAGS(Compat, Compatibility)
80#else
82 enum Compat
83 {
84 Current,
85 Converted,
86 Convertible,
87 Incompatible,
88 ByEvent
89 };
90#endif
91
95 enum
96 {
97 CurrentFormat = 0,
98#ifndef KALARMCAL_USE_KRESOURCES
99 MixedFormat = -2,
100#endif
101 IncompatibleFormat = -1
102 };
103
117#ifndef KALARMCAL_USE_KRESOURCES
118 KALARMCAL_EXPORT int updateVersion(const KCalCore::FileStorage::Ptr&, QString& versionString);
119#else
120 KALARMCAL_EXPORT int updateVersion(KCal::CalendarLocal& calendar, const QString& localFile, QString& versionString);
121#endif
122
123#ifndef KALARMCAL_USE_KRESOURCES
125 KALARMCAL_EXPORT void setKAlarmVersion(const KCalCore::Calendar::Ptr&);
126#else
127 KALARMCAL_EXPORT void setKAlarmVersion(KCal::CalendarLocal&);
128#endif
129
131 KALARMCAL_EXPORT void setProductId(const QByteArray& progName, const QByteArray& progVersion);
132
136 KALARMCAL_EXPORT QByteArray icalProductId();
137
138 extern const QByteArray APPNAME;
139} // namespace KACalendar
140
141//
142
152namespace CalEvent
153{
155 enum Type
156 {
157 EMPTY = 0,
158 ACTIVE = 0x01,
159 ARCHIVED = 0x02,
160 TEMPLATE = 0x04,
161 DISPLAYING = 0x08
162 };
163 Q_DECLARE_FLAGS(Types, Type)
164
165 KALARMCAL_EXPORT QString uid(const QString& id, Type);
166#ifndef KALARMCAL_USE_KRESOURCES
167 KALARMCAL_EXPORT Type status(const KCalCore::Event::Ptr&, QString* param = 0);
168 KALARMCAL_EXPORT void setStatus(const KCalCore::Event::Ptr&, Type, const QString& param = QString());
169
171 KALARMCAL_EXPORT Type type(const QString& mimeType);
173 KALARMCAL_EXPORT Types types(const QStringList& mimeTypes);
175 KALARMCAL_EXPORT QString mimeType(Type);
177 KALARMCAL_EXPORT QStringList mimeTypes(Types);
178#else
179 KALARMCAL_EXPORT Type status(const KCal::Event*, QString* param = 0);
180 KALARMCAL_EXPORT void setStatus(KCal::Event*, Type, const QString& param = QString());
181#endif
182} // namespace CalEvent
183
184Q_DECLARE_OPERATORS_FOR_FLAGS(CalEvent::Types)
185
186} // namespace KAlarmCal
187
188#endif // KALARM_KACALENDAR_H
189
190// vim: et sw=4:
calendar.h
KCalCore::Calendar::Ptr
QSharedPointer< Calendar > Ptr
KCalCore::Event::Ptr
QSharedPointer< Event > Ptr
KCalCore::FileStorage::Ptr
QSharedPointer< FileStorage > Ptr
event.h
filestorage.h
KAlarmCal::CalEvent::type
Type type(const QString &mimeType)
Return the alarm Type for a mime type string.
Definition kacalendar.cpp:469
KAlarmCal::CalEvent::mimeType
QString mimeType(Type type)
Return the mime type string corresponding to an alarm Type.
Definition kacalendar.cpp:495
KAlarmCal::CalEvent::mimeTypes
QStringList mimeTypes(Types types)
Return the mime type strings corresponding to alarm Types.
Definition kacalendar.cpp:506
KAlarmCal::CalEvent::Type
Type
The category of an event, indicated by the middle part of its UID.
Definition kacalendar.h:156
KAlarmCal::CalEvent::DISPLAYING
@ DISPLAYING
the event is currently being displayed
Definition kacalendar.h:161
KAlarmCal::CalEvent::TEMPLATE
@ TEMPLATE
the event is an alarm template
Definition kacalendar.h:160
KAlarmCal::CalEvent::ACTIVE
@ ACTIVE
the event is currently active
Definition kacalendar.h:158
KAlarmCal::CalEvent::ARCHIVED
@ ARCHIVED
the event is archived
Definition kacalendar.h:159
KAlarmCal::CalEvent::EMPTY
@ EMPTY
the event has no alarms
Definition kacalendar.h:157
KAlarmCal::CalEvent::types
Types types(const QStringList &mimeTypes)
Return the alarm Types for a list of mime type strings.
Definition kacalendar.cpp:480
KAlarmCal::KACalendar::updateVersion
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:127
KAlarmCal::KACalendar::CurrentFormat
@ CurrentFormat
current KAlarm format
Definition kacalendar.h:97
KAlarmCal::KACalendar::IncompatibleFormat
@ IncompatibleFormat
not written by KAlarm, or a newer KAlarm version
Definition kacalendar.h:101
KAlarmCal::KACalendar::MixedFormat
@ MixedFormat
calendar may contain more than one version
Definition kacalendar.h:99
KAlarmCal::KACalendar::setProductId
void setProductId(const QByteArray &progName, const QByteArray &progVersion)
Set the program name and version for use in calendars.
Definition kacalendar.cpp:95
KAlarmCal::KACalendar::Compatibility
Compatibility
Compatibility of resource backend calendar format.
Definition kacalendar.h:72
KAlarmCal::KACalendar::Incompatible
@ Incompatible
not written by KAlarm, or in a newer KAlarm version
Definition kacalendar.h:77
KAlarmCal::KACalendar::Convertible
@ Convertible
in an older KAlarm format
Definition kacalendar.h:76
KAlarmCal::KACalendar::Unknown
@ Unknown
format not determined
Definition kacalendar.h:73
KAlarmCal::KACalendar::Converted
@ Converted
in current KAlarm format, but not yet saved
Definition kacalendar.h:75
KAlarmCal::KACalendar::Current
@ Current
in current KAlarm format
Definition kacalendar.h:74
KAlarmCal::KACalendar::icalProductId
QByteArray icalProductId()
Return the product ID string for use in calendars.
Definition kacalendar.cpp:100
KAlarmCal::KACalendar::APPNAME
const QByteArray APPNAME
The application name ("KALARM") used in calendar properties.
KAlarmCal::KACalendar::setKAlarmVersion
void setKAlarmVersion(const Calendar::Ptr &calendar)
Set the KAlarm version custom property for a calendar.
Definition kacalendar.cpp:109
KCalCore
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KAlarm Library

Skip menu "KAlarm Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • 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