Commit a9c9bdc2 authored by David Jarvie's avatar David Jarvie
Browse files

Make installed headers enforce the KResources/Akonadi build option

The installed kalarmcal_export.h now contains #define or #undef of
KALARMCAL_USE_KRESOURCES so that applications built with this
library have to use the option which the library was built with.
This will prevent incompatible options being used in building.
parent a680228c
......@@ -39,6 +39,14 @@ if(NOT USE_KRESOURCES)
)
endif()
if(USE_KRESOURCES)
set(KALARMCAL_USE_KRESOURCES "// This library was built to use KResources.\n// It must be rebuilt in order to use Akonadi.\n#define KALARMCAL_USE_KRESOURCES")
else()
set(KALARMCAL_USE_KRESOURCES "// This library was built to use Akonadi.\n// It must be rebuilt in order to use KResources.\n#ifdef KALARMCAL_USE_KRESOURCES\n#undef KALARMCAL_USE_KRESOURCES\n#endif")
endif()
configure_file(kalarmcal_export.h.in kalarmcal_export.h)
kde4_add_library(kalarmcal ${LIBRARY_TYPE} ${kalarmcal_LIB_SRCS})
if(USE_KRESOURCES)
......@@ -72,7 +80,7 @@ install(FILES
identities.h
kacalendar.h
kaevent.h
kalarmcal_export.h
${CMAKE_CURRENT_BINARY_DIR}/kalarmcal_export.h
karecurrence.h
repetition.h
version.h
......
......@@ -2,7 +2,7 @@
* alarmtext.cpp - text/email alarm text conversion
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2004,2005,2007-2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2004,2005,2007-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -24,7 +24,7 @@
#include "kaevent.h"
#ifdef USE_KRESOURCES
#ifdef KALARMCAL_USE_KRESOURCES
#include <kcal/todo.h>
#endif
#include <klocale.h>
......@@ -146,7 +146,7 @@ void AlarmText::setEmail(const QString& to, const QString& from, const QString&
d->mKMailSerialNum = kmailSerialNumber;
}
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
void AlarmText::setTodo(const KCalCore::Todo::Ptr& todo)
#else
void AlarmText::setTodo(const KCal::Todo* todo)
......
......@@ -2,7 +2,7 @@
* alarmtext.h - text/email alarm text conversion
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2004,2005,2008-2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2004,2005,2008-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -25,7 +25,7 @@
#include "kalarmcal_export.h"
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
#include <kcalcore/todo.h>
#else
namespace KCal { class Todo; }
......@@ -87,7 +87,7 @@ class KALARMCAL_EXPORT AlarmText
void setEmail(const QString& to, const QString& from, const QString& cc, const QString& time,
const QString& subject, const QString& body, unsigned long kmailSerialNumber = 0);
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Set the instance contents to be a todo.
* @param todo Todo instance to set as the text
*/
......
......@@ -2,7 +2,7 @@
* kacalendar.cpp - KAlarm kcal library calendar and event functions
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2001-2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2001-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -25,7 +25,7 @@
#include "kaevent.h"
#include "version.h"
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
#include "collectionattribute.h"
#include <kcalcore/event.h>
......@@ -48,7 +48,7 @@
#include <QFileInfo>
#include <QTextStream>
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
using namespace KCalCore;
using Akonadi::Collection;
#else
......@@ -61,7 +61,7 @@ static const KCatalogLoader loader("libkalarmcal");
namespace KAlarmCal
{
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
const QLatin1String MIME_BASE("application/x-vnd.kde.alarm");
const QLatin1String MIME_ACTIVE("application/x-vnd.kde.alarm.active");
const QLatin1String MIME_ARCHIVED("application/x-vnd.kde.alarm.archived");
......@@ -76,7 +76,7 @@ static bool isUTC(const QString& localFile);
class Private
{
public:
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
static int readKAlarmVersion(const FileStorage::Ptr&, QString& subVersion, QString& versionString);
#else
static int readKAlarmVersion(CalendarLocal&, const QString& localFile, QString& subVersion, QString& versionString);
......@@ -106,7 +106,7 @@ QByteArray icalProductId()
/******************************************************************************
* Set the X-KDE-KALARM-VERSION property in a calendar.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
void setKAlarmVersion(const Calendar::Ptr& calendar)
{
calendar->setCustomProperty(APPNAME, VERSION_PROPERTY, QString::fromLatin1(KAEvent::currentCalendarVersionString()));
......@@ -124,14 +124,14 @@ void setKAlarmVersion(CalendarLocal& calendar)
* updated. The compatibility of the calendar format is indicated by the return
* value.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
int updateVersion(const FileStorage::Ptr& fileStorage, QString& versionString)
#else
int updateVersion(CalendarLocal& calendar, const QString& localFile, QString& versionString)
#endif
{
QString subVersion;
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
int version = Private::readKAlarmVersion(fileStorage, subVersion, versionString);
#else
int version = Private::readKAlarmVersion(calendar, localFile, subVersion, versionString);
......@@ -143,7 +143,7 @@ int updateVersion(CalendarLocal& calendar, const QString& localFile, QString& ve
// Calendar was created by an earlier version of KAlarm.
// Convert it to the current format.
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
const QString localFile = fileStorage->fileName();
#endif
int ver = version;
......@@ -159,7 +159,7 @@ int updateVersion(CalendarLocal& calendar, const QString& localFile, QString& ve
kDebug() << "KAlarm version" << version;
// Convert events to current KAlarm format for when/if the calendar is saved
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KAEvent::convertKCalEvents(fileStorage->calendar(), ver);
#else
KAEvent::convertKCalEvents(calendar, ver);
......@@ -176,14 +176,14 @@ int updateVersion(CalendarLocal& calendar, const QString& localFile, QString& ve
* = IncompatibleFormat if it was created by KAlarm pre-0.3.5, or another program
* = version number if created by another KAlarm version.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
int Private::readKAlarmVersion(const FileStorage::Ptr& fileStorage, QString& subVersion, QString& versionString)
#else
int Private::readKAlarmVersion(CalendarLocal& calendar, const QString& localFile, QString& subVersion, QString& versionString)
#endif
{
subVersion.clear();
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
Calendar::Ptr calendar = fileStorage->calendar();
versionString = calendar->customProperty(KACalendar::APPNAME, VERSION_PROPERTY);
kDebug() << "File=" << fileStorage->fileName() << ", version=" << versionString;
......@@ -196,7 +196,7 @@ int Private::readKAlarmVersion(CalendarLocal& calendar, const QString& localFile
{
// Pre-KAlarm 1.4 defined the KAlarm version number in the PRODID field.
// If another application has written to the file, this may not be present.
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
const QString prodid = calendar->productId();
#else
const QString prodid = calendar.productId();
......@@ -205,7 +205,7 @@ int Private::readKAlarmVersion(CalendarLocal& calendar, const QString& localFile
{
// Check whether the calendar file is empty, in which case
// it can be written to freely.
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
QFileInfo fi(fileStorage->fileName());
#else
QFileInfo fi(localFile);
......@@ -380,7 +380,7 @@ QString uid(const QString& id, Type status)
* triggered. They will be archived once KAlarm tries to handle them.
* Do not call this function for the displaying alarm calendar.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
Type status(const Event::Ptr& event, QString* param)
#else
Type status(const Event* event, QString* param)
......@@ -441,7 +441,7 @@ Type status(const Event* event, QString* param)
* If a parameter is supplied, it will be appended as a second parameter to the
* custom property.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
void setStatus(const Event::Ptr& event, Type status, const QString& param)
#else
void setStatus(Event* event, Type status, const QString& param)
......@@ -465,7 +465,7 @@ void setStatus(Event* event, Type status, const QString& param)
event->setCustomProperty(KACalendar::APPNAME, staticStrings->STATUS_PROPERTY, text);
}
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
Type type(const QString& mimeType)
{
if (mimeType == MIME_ACTIVE)
......
......@@ -2,7 +2,7 @@
* kacalendar.h - KAlarm kcal library calendar and event categorisation
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2005-2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2005-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -24,7 +24,7 @@
#define KALARM_KACALENDAR_H
#include "kalarmcal_export.h"
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
#include <kcalcore/filestorage.h>
#include <kcalcore/calendar.h>
#include <kcalcore/event.h>
......@@ -33,7 +33,7 @@
#include <QtCore/QByteArray>
#include <QtCore/QStringList>
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
namespace KCalCore {
class Alarm;
}
......@@ -48,7 +48,7 @@ namespace KCal {
namespace KAlarmCal
{
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
extern const QLatin1String KALARMCAL_EXPORT MIME_BASE; //!< The base mime type for KAlarm alarms
extern const QLatin1String KALARMCAL_EXPORT MIME_ACTIVE; //!< The mime type for KAlarm active alarms
extern const QLatin1String KALARMCAL_EXPORT MIME_ARCHIVED; //!< The mime type for KAlarm archived alarms
......@@ -66,7 +66,7 @@ extern const QLatin1String KALARMCAL_EXPORT MIME_TEMPLATE; //!< The mime type f
*/
namespace KACalendar
{
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Compatibility of resource backend calendar format. */
enum Compatibility
{
......@@ -95,7 +95,7 @@ namespace KACalendar
enum
{
CurrentFormat = 0, //!< current KAlarm format
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
MixedFormat = -2, //!< calendar may contain more than one version
#endif
IncompatibleFormat = -1 //!< not written by KAlarm, or a newer KAlarm version
......@@ -114,13 +114,13 @@ namespace KACalendar
unknown KAlarm format;
* >0 the older KAlarm version which wrote the calendar
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KALARMCAL_EXPORT int updateVersion(const KCalCore::FileStorage::Ptr&, QString& versionString);
#else
KALARMCAL_EXPORT int updateVersion(KCal::CalendarLocal& calendar, const QString& localFile, QString& versionString);
#endif
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Set the KAlarm version custom property for a calendar. */
KALARMCAL_EXPORT void setKAlarmVersion(const KCalCore::Calendar::Ptr&);
#else
......@@ -162,7 +162,7 @@ namespace CalEvent
Q_DECLARE_FLAGS(Types, Type)
KALARMCAL_EXPORT QString uid(const QString& id, Type);
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KALARMCAL_EXPORT Type status(const KCalCore::Event::Ptr&, QString* param = 0);
KALARMCAL_EXPORT void setStatus(const KCalCore::Event::Ptr&, Type, const QString& param = QString());
......
This diff is collapsed.
......@@ -30,7 +30,7 @@
#include "kacalendar.h"
#include "repetition.h"
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
#include <akonadi/collection.h>
#include <akonadi/item.h>
#include <kcalcore/person.h>
......@@ -43,14 +43,14 @@
#include <QtGui/QColor>
#include <QtGui/QFont>
#include <QtCore/QVector>
#ifdef USE_KRESOURCES
#ifdef KALARMCAL_USE_KRESOURCES
#include <QtCore/QList>
#endif
#include <QtCore/QSharedDataPointer>
#include <QtCore/QMetaType>
namespace KHolidays { class HolidayRegion; }
#ifdef USE_KRESOURCES
#ifdef KALARMCAL_USE_KRESOURCES
namespace KCal {
class CalendarLocal;
class Event;
......@@ -123,7 +123,7 @@ class KALARMCAL_EXPORT KAAlarm
/** Return the action type for the alarm. */
Action action() const;
/** Return whether the alarm is valid. */
/** Return whether the alarm is valid, i.e. whether it contains any alarm data. */
bool isValid() const;
/** Return the alarm's type (main, reminder, etc.). */
......@@ -356,7 +356,7 @@ class KALARMCAL_EXPORT KAEvent
*/
KAEvent(const KDateTime&, const QString& text, const QColor& bg, const QColor& fg,
const QFont& f, SubAction, int lateCancel, Flags flags, bool changesPending = false);
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Construct an event and initialise it from a KCalCore::Event. */
explicit KAEvent(const KCalCore::Event::Ptr&);
......@@ -396,7 +396,7 @@ class KALARMCAL_EXPORT KAEvent
const QColor& fg, const QFont& font, SubAction action, int lateCancel,
Flags flags, bool changesPending = false);
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Update an existing KCalCore::Event with the KAEvent data.
* @param event Event to update.
* @param u how to deal with the Event's UID.
......@@ -423,7 +423,7 @@ class KALARMCAL_EXPORT KAEvent
/** Return the enabled status of the alarm. */
bool enabled() const;
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Set the read-only status of the alarm. */
void setReadOnly(bool ro);
/** Return the read-only status of the alarm. */
......@@ -469,7 +469,7 @@ class KALARMCAL_EXPORT KAEvent
/** Return the revision number of the event (SEQUENCE property in iCalendar). */
int revision() const;
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Set the ID of the Akonadi Collection which contains the event. */
void setCollectionId(Akonadi::Collection::Id id);
/** Return the ID of the Akonadi Collection which contains the event. */
......@@ -594,7 +594,7 @@ class KALARMCAL_EXPORT KAEvent
bool commandXterm() const;
/** Return whether the command output is to be displayed in an alarm message window. */
bool commandDisplay() const;
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Set or clear the command execution error for the last time the alarm triggered. */
void setCommandError(CmdErrType error) const;
#else
......@@ -627,7 +627,7 @@ class KALARMCAL_EXPORT KAEvent
bool copyToKOrganizer() const;
/** Set the email related data for the event. */
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
void setEmail(uint from, const KCalCore::Person::List&, const QString& subject,
const QStringList& attachments);
#else
......@@ -646,7 +646,7 @@ class KALARMCAL_EXPORT KAEvent
uint emailFromId() const;
/** Return the list of email addressees, including names, for an email alarm. */
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::Person::List emailAddressees() const;
#else
QList<KCal::Person> emailAddressees() const;
......@@ -663,7 +663,7 @@ class KALARMCAL_EXPORT KAEvent
/** Concatenate a list of email addresses into a string.
* @param sep separator string to insert between addresses.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
static QString joinEmailAddresses(const KCalCore::Person::List& addresses, const QString& sep);
#else
static QString joinEmailAddresses(const QList<KCal::Person>& addresses, const QString& sep);
......@@ -1141,7 +1141,7 @@ class KALARMCAL_EXPORT KAEvent
/** Return the longest interval which can occur between consecutive recurrences.
* @see recurInterval()
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::Duration longestRecurrenceInterval() const;
#else
KCal::Duration longestRecurrenceInterval() const;
......@@ -1229,13 +1229,13 @@ class KALARMCAL_EXPORT KAEvent
* @param showDefer whether the Defer button was displayed
* @return @c true if successful, @c false if alarm was not copied.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
bool setDisplaying(const KAEvent& event, KAAlarm::Type type, Akonadi::Collection::Id colId, const KDateTime& dt, bool showEdit, bool showDefer);
#else
bool setDisplaying(const KAEvent& event, KAAlarm::Type type, const QString& resourceID, const KDateTime& dt, bool showEdit, bool showDefer);
#endif
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Reinstate the original event from the 'displaying' event.
* This instance is initialised from the supplied displaying @p event,
* and appropriate adjustments are made to convert it back to the
......@@ -1336,13 +1336,13 @@ class KALARMCAL_EXPORT KAEvent
* which does not require the adjustment.
* @return @c true if any conversions were done.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
static bool convertKCalEvents(const KCalCore::Calendar::Ptr&, int calendarVersion);
#else
static bool convertKCalEvents(KCal::CalendarLocal&, int calendarVersion);
#endif
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
/** Return a list of pointers to a list of KAEvent objects. */
static List ptrList(QVector<KAEvent>& events);
#endif
......
/*
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2011-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -22,6 +22,8 @@
#ifndef KALARMCAL_EXPORT_H
#define KALARMCAL_EXPORT_H
@KALARMCAL_USE_KRESOURCES@
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
......
......@@ -2,7 +2,7 @@
* karecurrence.cpp - recurrence with special yearly February 29th handling
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2005-2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2005-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -22,7 +22,7 @@
#include "karecurrence.h"
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
#include <kcalcore/recurrence.h>
#include <kcalcore/icalformat.h>
#else
......@@ -36,7 +36,7 @@
#include <QBitArray>
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
using namespace KCalCore;
#else
using namespace KCal;
......
......@@ -2,7 +2,7 @@
* karecurrence.h - recurrence with special yearly February 29th handling
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2005-2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2005-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -25,7 +25,7 @@
#include "kalarmcal_export.h"
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
#include <kcalcore/recurrencerule.h>
#include <kcalcore/duration.h>
namespace KCalCore { class Recurrence; }
......@@ -82,7 +82,7 @@ class KALARMCAL_EXPORT KARecurrence
};
KARecurrence();
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KARecurrence(const KCalCore::Recurrence& r);
#else
KARecurrence(const KCal::Recurrence& r);
......@@ -138,7 +138,7 @@ class KALARMCAL_EXPORT KARecurrence
* weekly, monthly, yearly or none.
* @return true if successful.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
bool init(KCalCore::RecurrenceRule::PeriodType t, int freq, int count, const KDateTime& start, const KDateTime& end);
#else
bool init(KCal::RecurrenceRule::PeriodType t, int freq, int count, const KDateTime& start, const KDateTime& end);
......@@ -150,7 +150,7 @@ class KALARMCAL_EXPORT KARecurrence
* weekly, monthly, yearly or none.
* @return true if successful.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
bool init(KCalCore::RecurrenceRule::PeriodType t, int freq, int count, const KDateTime& start, const KDateTime& end, Feb29Type f29);
#else
bool init(KCal::RecurrenceRule::PeriodType t, int freq, int count, const KDateTime& start, const KDateTime& end, Feb29Type f29);
......@@ -162,7 +162,7 @@ class KALARMCAL_EXPORT KARecurrence
/** Initialise a KCalCore::Recurrence to be the same as this instance.
* Additional recurrence rules are created as necessary if it recurs on Feb 29th.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
void writeRecurrence(KCalCore::Recurrence&) const;
#else
void writeRecurrence(KCal::Recurrence&) const;
......@@ -230,7 +230,7 @@ class KALARMCAL_EXPORT KARecurrence
QBitArray days() const; // Emulate the old behavior
/** Returns list of day positions in months. */
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
QList<KCalCore::RecurrenceRule::WDayPos> monthPositions() const;
#else
QList<KCal::RecurrenceRule::WDayPos> monthPositions() const;
......@@ -274,7 +274,7 @@ class KALARMCAL_EXPORT KARecurrence
* Friday in the given months, otherwise as third Friday of the
* year.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
QList<KCalCore::RecurrenceRule::WDayPos> yearPositions() const;
#else
QList<KCal::RecurrenceRule::WDayPos> yearPositions() const;
......@@ -368,7 +368,7 @@ class KALARMCAL_EXPORT KARecurrence
* @param date the date for which to find the recurrence times
* @param timeSpec time specification for @p date
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::TimeList recurTimesOn(const QDate& date, const KDateTime::Spec& timeSpec) const;
#else
KCal::TimeList recurTimesOn(const QDate& date, const KDateTime::Spec& timeSpec) const;
......@@ -386,7 +386,7 @@ class KALARMCAL_EXPORT KARecurrence
* @param end inclusive end of interval
* @return list of date/time values
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::DateTimeList timesInInterval(const KDateTime& start, const KDateTime& end) const;
#else
KCal::DateTimeList timesInInterval(const KDateTime& start, const KDateTime& end) const;
......@@ -422,7 +422,7 @@ class KALARMCAL_EXPORT KARecurrence
/** Return the longest interval between recurrences.
* @return 0 if it never recurs.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::Duration longestInterval() const;
#else
KCal::Duration longestInterval() const;
......@@ -432,12 +432,12 @@ class KALARMCAL_EXPORT KARecurrence
* successive occurrences does not vary.
* @return 0 if recurrence does not occur at fixed intervals.
*/
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::Duration regularInterval() const;
#else
KCal::Duration regularInterval() const;
#endif
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::DateTimeList exDateTimes() const;
KCalCore::DateList exDates() const;
void setExDateTimes(const KCalCore::DateTimeList& exdates);
......@@ -467,7 +467,7 @@ class KALARMCAL_EXPORT KARecurrence
*/
void shiftTimes(const KDateTime::Spec& oldSpec, const KDateTime::Spec& newSpec);
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
KCalCore::RecurrenceRule* defaultRRuleConst() const;
#else
KCal::RecurrenceRule* defaultRRuleConst() const;
......@@ -476,14 +476,14 @@ class KALARMCAL_EXPORT KARecurrence
Type type() const;
/** Return the type of a recurrence rule. */
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
static Type type(const KCalCore::RecurrenceRule*);
#else
static Type type(const KCal::RecurrenceRule*);
#endif
/** Check if the recurrence rule is a daily rule with or without BYDAYS specified. */
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
static bool dailyType(const KCalCore::RecurrenceRule*);
#else
static bool dailyType(const KCal::RecurrenceRule*);
......
......@@ -2,7 +2,7 @@
* repetition.cpp - represents a sub-repetition: interval and count
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2009,2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2009-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -23,7 +23,7 @@
#include "repetition.h"
#include <kdatetime.h>
#ifndef USE_KRESOURCES
#ifndef KALARMCAL_USE_KRESOURCES
using namespace KCalCore;
#else
using namespace KCal;
......
......@@ -2,7 +2,7 @@
* repetition.h - represents a sub-repetition: interval and count
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2009,2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2009-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
......@@ -24,7 +24,7 @@
#define KALARM_REPETITION_H
#include "kalarmcal_export.h"
#ifndef USE_KRESOURCES