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
250 void close();
251
262 KCalendarCore::Incidence::Ptr dissociateSingleOccurrence(const KCalendarCore::Incidence::Ptr &incidence,
263 const QDateTime &dateTime);
264
269 bool addIncidence(const KCalendarCore::Incidence::Ptr &incidence);
270
280 bool addIncidence(const KCalendarCore::Incidence::Ptr &incidence, const QString &notebookUid);
281
282 // Event Specific Methods //
283
288 bool addEvent(const KCalendarCore::Event::Ptr &event);
289
299 bool addEvent(const KCalendarCore::Event::Ptr &event, const QString &notebookUid);
300
301 // To-do Specific Methods //
302
307 bool addTodo(const KCalendarCore::Todo::Ptr &todo);
308
318 bool addTodo(const KCalendarCore::Todo::Ptr &todo, const QString &notebookUid);
319
320 // Journal Specific Methods //
321
326 bool addJournal(const KCalendarCore::Journal::Ptr &journal);
327
337 bool addJournal(const KCalendarCore::Journal::Ptr &journal, const QString &notebookUid);
338
339 using KCalendarCore::Calendar::journals;
340
348 KCalendarCore::Journal::List journals(const QDate &start, const QDate &end);
349
350 using KCalendarCore::Calendar::incidences;
351
361 KCalendarCore::Incidence::List incidences(const QDate &start, const QDate &end);
362
372 static QSharedPointer<ExtendedStorage> defaultStorage(const ExtendedCalendar::Ptr
373 &calendar); //No typedef to avoid cyclic includes
374
375 // Adopt the deprecated notebook API from KF6.
380 void clearNotebookAssociations();
381
390 bool setNotebook(const KCalendarCore::Incidence::Ptr &incidence, const QString &notebook);
391
399 QString notebook(const KCalendarCore::Incidence::Ptr &incidence) const;
400
408 QString notebook(const QString &uid) const;
409
415 QStringList notebooks() const;
416
424 Q_REQUIRED_RESULT bool hasValidNotebook(const QString &notebook) const;
425
435 Q_REQUIRED_RESULT bool addNotebook(const QString &notebook, bool isVisible);
436
446 Q_REQUIRED_RESULT bool updateNotebook(const QString &notebook, bool isVisible);
447
456 Q_REQUIRED_RESULT bool deleteNotebook(const QString &notebook);
457
464 Q_REQUIRED_RESULT bool setDefaultNotebook(const QString &notebook);
465
471 Q_REQUIRED_RESULT QString defaultNotebook() const;
472
478 Q_REQUIRED_RESULT bool isVisible(const KCalendarCore::Incidence::Ptr &incidence) const;
479
485 Q_REQUIRED_RESULT bool isVisible(const QString &notebook) const;
486
493 KCalendarCore::Incidence::List incidences(const QString &notebook) const;
494
501 KCalendarCore::Incidence::List duplicates(const KCalendarCore::Incidence::Ptr &incidence);
502
503private:
504 //@cond PRIVATE
505 Q_DISABLE_COPY(ExtendedCalendar)
506 class Private;
507 Private *const d;
508 //@endcond
509};
510
511}
512
513#endif
This class provides a calendar storage interface.
Definition extendedstorage.h:63
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