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

KAlarm Library

  • sources
  • kde-4.12
  • kdepimlibs
  • 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
37 namespace KCalCore {
38  class Alarm;
39 }
40 #else
41 namespace KCal {
42  class Event;
43  class Alarm;
44  class CalendarLocal;
45 }
46 #endif
47 
48 namespace KAlarmCal
49 {
50 
51 #ifndef KALARMCAL_USE_KRESOURCES
52 extern const QLatin1String KALARMCAL_EXPORT MIME_BASE;
53 extern const QLatin1String KALARMCAL_EXPORT MIME_ACTIVE;
54 extern const QLatin1String KALARMCAL_EXPORT MIME_ARCHIVED;
55 extern const QLatin1String KALARMCAL_EXPORT MIME_TEMPLATE;
56 #endif
57 
67 namespace KACalendar
68 {
69 #ifndef KALARMCAL_USE_KRESOURCES
70 
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
81 
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
124 
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 
152 namespace 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 
184 Q_DECLARE_OPERATORS_FOR_FLAGS(CalEvent::Types)
185 
186 } // namespace KAlarmCal
187 
188 #endif // KALARM_KACALENDAR_H
189 
190 // vim: et sw=4:
KAlarmCal::CalEvent::type
Type type(const QString &mimeType)
Return the alarm Type for a mime type string.
Definition: kacalendar.cpp:469
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::CalEvent::TEMPLATE
the event is an alarm template
Definition: kacalendar.h:160
KCalCore::Event::Ptr
QSharedPointer< Event > Ptr
KAlarmCal::KACalendar::IncompatibleFormat
not written by KAlarm, or a newer KAlarm version
Definition: kacalendar.h:101
KAlarmCal::KACalendar::Incompatible
not written by KAlarm, or in a newer KAlarm version
Definition: kacalendar.h:77
KAlarmCal::KACalendar::Convertible
in an older KAlarm format
Definition: kacalendar.h:76
KAlarmCal::KACalendar::icalProductId
QByteArray icalProductId()
Return the product ID string for use in calendars.
Definition: kacalendar.cpp:100
KAlarmCal::CalEvent::Type
Type
The category of an event, indicated by the middle part of its UID.
Definition: kacalendar.h:155
KAlarmCal::KACalendar::Converted
in current KAlarm format, but not yet saved
Definition: kacalendar.h:75
KAlarmCal::KACalendar::APPNAME
const QByteArray APPNAME
The application name ("KALARM") used in calendar properties.
KAlarmCal::KACalendar::Unknown
format not determined
Definition: kacalendar.h:73
KAlarmCal::CalEvent::DISPLAYING
the event is currently being displayed
Definition: kacalendar.h:161
KAlarmCal::CalEvent::ACTIVE
the event is currently active
Definition: kacalendar.h:158
KAlarmCal::KACalendar::setKAlarmVersion
void setKAlarmVersion(const Calendar::Ptr &calendar)
Set the KAlarm version custom property for a calendar.
Definition: kacalendar.cpp:109
calendar.h
filestorage.h
KCalCore::FileStorage::Ptr
QSharedPointer< FileStorage > Ptr
KAlarmCal::CalEvent::mimeTypes
QStringList mimeTypes(Types types)
Return the mime type strings corresponding to alarm Types.
Definition: kacalendar.cpp:506
KCalCore::Calendar::Ptr
QSharedPointer< Calendar > Ptr
KAlarmCal::KACalendar::Current
in current KAlarm format
Definition: kacalendar.h:74
KAlarmCal::CalEvent::EMPTY
the event has no alarms
Definition: kacalendar.h:157
event.h
KAlarmCal::KACalendar::CurrentFormat
current KAlarm format
Definition: kacalendar.h:97
KAlarmCal::CalEvent::mimeType
QString mimeType(Type type)
Return the mime type string corresponding to an alarm Type.
Definition: kacalendar.cpp:495
KAlarmCal::CalEvent::ARCHIVED
the event is archived
Definition: kacalendar.h:159
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::CalEvent::types
Types types(const QStringList &mimeTypes)
Return the alarm Types for a list of mime type strings.
Definition: kacalendar.cpp:480
KAlarmCal::KACalendar::MixedFormat
calendar may contain more than one version
Definition: kacalendar.h:99
KAlarmCal::KACalendar::Compatibility
Compatibility
Compatibility of resource backend calendar format.
Definition: kacalendar.h:71
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:01:14 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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