extendedcalendar.h
Go to the documentation of this file.
1/*
2 This file is part of the mkcal library.
3
4 Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5 Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
6 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
7 Contact: Alvaro Manera <alvaro.manera@nokia.com>
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with this library; see the file COPYING.LIB. If not, write to
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA.
23*/
33
192#ifndef MKCAL_EXTENDEDCALENDAR_H
193#define MKCAL_EXTENDEDCALENDAR_H
194
195#include "mkcal_export.h"
196
197#include <KCalendarCore/MemoryCalendar>
198
199namespace mKCal {
200
201class ExtendedStorage;
202class Notebook;
203
208class MKCAL_EXPORT ExtendedCalendar : public KCalendarCore::MemoryCalendar
209{
210public:
214 typedef QSharedPointer<ExtendedCalendar> Ptr;
215
220 explicit ExtendedCalendar(const QTimeZone &timeZone);
221
226 explicit ExtendedCalendar(const QByteArray &timeZoneId);
227
232 ~ExtendedCalendar();
233
238 bool reload();
239
244 bool save();
245
246#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
251 void close();
252#endif
253
264 KCalendarCore::Incidence::Ptr dissociateSingleOccurrence(const KCalendarCore::Incidence::Ptr &incidence,
265 const QDateTime &dateTime);
266
271 bool addIncidence(const KCalendarCore::Incidence::Ptr &incidence);
272
282 bool addIncidence(const KCalendarCore::Incidence::Ptr &incidence, const QString &notebookUid);
283
284 // Event Specific Methods //
285
290 bool addEvent(const KCalendarCore::Event::Ptr &event);
291
301 bool addEvent(const KCalendarCore::Event::Ptr &event, const QString &notebookUid);
302
303 // To-do Specific Methods //
304
309 bool addTodo(const KCalendarCore::Todo::Ptr &todo);
310
320 bool addTodo(const KCalendarCore::Todo::Ptr &todo, const QString &notebookUid);
321
322 // Journal Specific Methods //
323
328 bool addJournal(const KCalendarCore::Journal::Ptr &journal);
329
339 bool addJournal(const KCalendarCore::Journal::Ptr &journal, const QString &notebookUid);
340
341 using KCalendarCore::Calendar::journals;
342
350 KCalendarCore::Journal::List journals(const QDate &start, const QDate &end);
351
352 using KCalendarCore::Calendar::incidences;
353
363 KCalendarCore::Incidence::List incidences(const QDate &start, const QDate &end);
364
374 static QSharedPointer<ExtendedStorage> defaultStorage(const ExtendedCalendar::Ptr
375 &calendar); //No typedef to avoid cyclic includes
376
377#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
378 // Adopt the deprecated notebook API from KF6.
383 void clearNotebookAssociations();
384
393 bool setNotebook(const KCalendarCore::Incidence::Ptr &incidence, const QString &notebook);
394
402 QString notebook(const KCalendarCore::Incidence::Ptr &incidence) const;
403
411 QString notebook(const QString &uid) const;
412
418 QStringList notebooks() const;
419
427 Q_REQUIRED_RESULT bool hasValidNotebook(const QString &notebook) const;
428
438 Q_REQUIRED_RESULT bool addNotebook(const QString &notebook, bool isVisible);
439
449 Q_REQUIRED_RESULT bool updateNotebook(const QString &notebook, bool isVisible);
450
459 Q_REQUIRED_RESULT bool deleteNotebook(const QString &notebook);
460
467 Q_REQUIRED_RESULT bool setDefaultNotebook(const QString &notebook);
468
474 Q_REQUIRED_RESULT QString defaultNotebook() const;
475
481 Q_REQUIRED_RESULT bool isVisible(const KCalendarCore::Incidence::Ptr &incidence) const;
482
488 Q_REQUIRED_RESULT bool isVisible(const QString &notebook) const;
489
496 KCalendarCore::Incidence::List incidences(const QString &notebook) const;
497
504 KCalendarCore::Incidence::List duplicates(const KCalendarCore::Incidence::Ptr &incidence);
505#endif
506
507private:
508 //@cond PRIVATE
509 Q_DISABLE_COPY(ExtendedCalendar)
510 class Private;
511 Private *const d;
512 //@endcond
513};
514
515}
516
517#endif
This class provides a calendar storage interface.
Definition extendedstorage.h:67
Placeholder for Notebook parameters.
Definition notebook.h:46
#define MKCAL_EXPORT
Definition mkcal_export.h:29
Definition extendedstorage.h:49

Generated on for libextendedkcal by doxygen 1.16.1