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

KCalCore Library

  • kcalcore
memorycalendar.h
Go to the documentation of this file.
1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5 Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public 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
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
32#ifndef KCALCORE_MEMORYCALENDAR_H
33#define KCALCORE_MEMORYCALENDAR_H
34
35#include "kcalcore_export.h"
36#include "calendar.h"
37
38namespace KCalCore {
39
40class CalFormat;
41
46class KCALCORE_EXPORT MemoryCalendar : public Calendar
47{
48public:
49
53 typedef QSharedPointer<MemoryCalendar> Ptr;
54
58 explicit MemoryCalendar(const KDateTime::Spec &timeSpec);
59
63 explicit MemoryCalendar(const QString &timeZoneId);
64
68 ~MemoryCalendar();
69
73 void close();
74
78 bool deleteIncidence(const Incidence::Ptr &incidence);
79
83 bool deleteIncidenceInstances(const Incidence::Ptr &incidence);
84
88 bool addIncidence(const Incidence::Ptr &incidence);
89
90 // Event Specific Methods //
91
95 bool addEvent(const Event::Ptr &event);
96
100 bool deleteEvent(const Event::Ptr &event);
101
105 bool deleteEventInstances(const Event::Ptr &event);
106
110 void deleteAllEvents();
111
115 Event::List rawEvents(
116 EventSortField sortField = EventSortUnsorted,
117 SortDirection sortDirection = SortDirectionAscending) const;
118
122 Event::List rawEvents(const QDate &start, const QDate &end,
123 const KDateTime::Spec &timeSpec = KDateTime::Spec(),
124 bool inclusive = false) const;
125
137 Event::List rawEventsForDate(
138 const QDate &date, const KDateTime::Spec &timeSpec = KDateTime::Spec(),
139 EventSortField sortField = EventSortUnsorted,
140 SortDirection sortDirection = SortDirectionAscending) const;
141
145 Event::List rawEventsForDate(const KDateTime &dt) const;
146
152 Incidence::Ptr instance(const QString &identifier) const;
153
157 Event::Ptr event(
158 const QString &uid,
159 const KDateTime &recurrenceId = KDateTime()) const;
160
164 Event::Ptr deletedEvent(
165 const QString &uid, const KDateTime &recurrenceId = KDateTime()) const;
166
170 Event::List deletedEvents(
171 EventSortField sortField = EventSortUnsorted,
172 SortDirection sortDirection = SortDirectionAscending) const;
173
177 Event::List eventInstances(
178 const Incidence::Ptr &event,
179 EventSortField sortField = EventSortUnsorted,
180 SortDirection sortDirection = SortDirectionAscending) const;
181
182 // To-do Specific Methods //
183
187 bool addTodo(const Todo::Ptr &todo);
188
192 bool deleteTodo(const Todo::Ptr &todo);
193
197 bool deleteTodoInstances(const Todo::Ptr &todo);
198
202 void deleteAllTodos();
203
207 Todo::List rawTodos(
208 TodoSortField sortField = TodoSortUnsorted,
209 SortDirection sortDirection = SortDirectionAscending) const;
210
214 Todo::List rawTodos(
215 const QDate &start, const QDate &end,
216 const KDateTime::Spec &timespec = KDateTime::Spec(),
217 bool inclusive = false) const;
218
222 Todo::List rawTodosForDate(const QDate &date) const;
223
227 Todo::Ptr todo(const QString &uid,
228 const KDateTime &recurrenceId = KDateTime()) const;
229
233 Todo::Ptr deletedTodo(const QString &uid, const KDateTime &recurrenceId = KDateTime()) const;
234
238 Todo::List deletedTodos(
239 TodoSortField sortField = TodoSortUnsorted,
240 SortDirection sortDirection = SortDirectionAscending) const;
241
245 Todo::List todoInstances(const Incidence::Ptr &todo,
246 TodoSortField sortField = TodoSortUnsorted,
247 SortDirection sortDirection = SortDirectionAscending) const;
248
249 // Journal Specific Methods //
250
254 bool addJournal(const Journal::Ptr &journal);
255
259 bool deleteJournal(const Journal::Ptr &journal);
260
264 bool deleteJournalInstances(const Journal::Ptr &journal);
265
269 void deleteAllJournals();
270
274 Journal::List rawJournals(
275 JournalSortField sortField = JournalSortUnsorted,
276 SortDirection sortDirection = SortDirectionAscending) const;
277
281 Journal::List rawJournalsForDate(const QDate &date) const;
282
286 Journal::Ptr journal(const QString &uid,
287 const KDateTime &recurrenceId = KDateTime()) const;
288
292 Journal::Ptr deletedJournal(const QString &uid,
293 const KDateTime &recurrenceId = KDateTime()) const;
294
298 Journal::List deletedJournals(
299 JournalSortField sortField = JournalSortUnsorted,
300 SortDirection sortDirection = SortDirectionAscending) const;
301
306 Journal::List journalInstances(const Incidence::Ptr &journal,
307 JournalSortField sortField = JournalSortUnsorted,
308 SortDirection sortDirection = SortDirectionAscending) const;
309
310 // Alarm Specific Methods //
311
315 Alarm::List alarms(const KDateTime &from, const KDateTime &to) const;
316
323 Alarm::List alarmsTo(const KDateTime &to) const;
324
328 void incidenceUpdate(const QString &uid, const KDateTime &recurrenceId);
329
333 void incidenceUpdated(const QString &uid, const KDateTime &recurrenceId);
334
335 using QObject::event; // prevent warning about hidden virtual method
336
337protected:
341 virtual void virtual_hook(int id, void *data);
342
343private:
344 //@cond PRIVATE
345 class Private;
346 Private *const d;
347 //@endcond
348
349 Q_DISABLE_COPY(MemoryCalendar)
350};
351
352}
353
354#endif
calendar.h
This file is part of the API for handling calendar data and defines the Calendar class.
KCalCore::Alarm::List
QVector< Ptr > List
List of alarms.
Definition: alarm.h:83
KCalCore::Calendar
Represents the main calendar class.
Definition: calendar.h:130
KCalCore::Event::Ptr
QSharedPointer< Event > Ptr
A shared pointer to an Event object.
Definition: event.h:55
KCalCore::Event::List
QVector< Ptr > List
List of events.
Definition: event.h:60
KCalCore::Incidence::Ptr
QSharedPointer< Incidence > Ptr
A shared pointer to an Incidence.
Definition: incidence.h:112
KCalCore::Journal::Ptr
QSharedPointer< Journal > Ptr
A shared pointer to a Journal object.
Definition: journal.h:49
KCalCore::Journal::List
QVector< Ptr > List
List of journals.
Definition: journal.h:54
KCalCore::MemoryCalendar
This class provides a calendar stored in memory.
Definition: memorycalendar.h:47
KCalCore::MemoryCalendar::deletedEvents
Event::List deletedEvents(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all deleted Events for this Calendar.
KCalCore::MemoryCalendar::Ptr
QSharedPointer< MemoryCalendar > Ptr
A shared pointer to a MemoryCalendar.
Definition: memorycalendar.h:53
KCalCore::MemoryCalendar::deleteJournalInstances
bool deleteJournalInstances(const Journal::Ptr &journal)
Delete all journals that are instances of recurring journal journal.
KCalCore::MemoryCalendar::deleteAllTodos
void deleteAllTodos()
Removes all To-dos from the calendar.
KCalCore::MemoryCalendar::deleteIncidenceInstances
bool deleteIncidenceInstances(const Incidence::Ptr &incidence)
Delete all incidences that are instances of recurring incidence incidence.
KCalCore::MemoryCalendar::rawTodos
Todo::List rawTodos(TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all Todos for this Calendar.
KCalCore::MemoryCalendar::deleteIncidence
bool deleteIncidence(const Incidence::Ptr &incidence)
Removes an Incidence from the calendar.
KCalCore::MemoryCalendar::todoInstances
Todo::List todoInstances(const Incidence::Ptr &todo, TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all possible instances for this recurring Todo.
KCalCore::MemoryCalendar::incidenceUpdate
void incidenceUpdate(const QString &uid, const KDateTime &recurrenceId)
The IncidenceObserver interface.
KCalCore::MemoryCalendar::deletedTodos
Todo::List deletedTodos(TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all deleted Todos for this Calendar.
KCalCore::MemoryCalendar::rawEventsForDate
Event::List rawEventsForDate(const QDate &date, const KDateTime::Spec &timeSpec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns an unfiltered list of all Events which occur on the given date.
KCalCore::MemoryCalendar::event
Event::Ptr event(const QString &uid, const KDateTime &recurrenceId=KDateTime()) const
Returns the Event associated with the given unique identifier.
KCalCore::MemoryCalendar::virtual_hook
virtual void virtual_hook(int id, void *data)
KCalCore::MemoryCalendar::addEvent
bool addEvent(const Event::Ptr &event)
Inserts an Event into the calendar.
KCalCore::MemoryCalendar::journal
Journal::Ptr journal(const QString &uid, const KDateTime &recurrenceId=KDateTime()) const
Returns the Journal associated with the given unique identifier.
KCalCore::MemoryCalendar::alarms
Alarm::List alarms(const KDateTime &from, const KDateTime &to) const
Returns a list of Alarms within a time range for this Calendar.
KCalCore::MemoryCalendar::addJournal
bool addJournal(const Journal::Ptr &journal)
Inserts a Journal into the calendar.
KCalCore::MemoryCalendar::MemoryCalendar
MemoryCalendar(const QString &timeZoneId)
Construct Calendar object using a time zone ID.
KCalCore::MemoryCalendar::deleteAllEvents
void deleteAllEvents()
Removes all Events from the calendar.
KCalCore::MemoryCalendar::deleteAllJournals
void deleteAllJournals()
Removes all Journals from the calendar.
KCalCore::MemoryCalendar::deletedJournals
Journal::List deletedJournals(JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all deleted Journals for this Calendar.
KCalCore::MemoryCalendar::rawTodosForDate
Todo::List rawTodosForDate(const QDate &date) const
Returns an unfiltered list of all Todos which due on the specified date.
KCalCore::MemoryCalendar::~MemoryCalendar
~MemoryCalendar()
Destroys the calendar.
KCalCore::MemoryCalendar::instance
Incidence::Ptr instance(const QString &identifier) const
Returns an incidence by identifier.
KCalCore::MemoryCalendar::eventInstances
Event::List eventInstances(const Incidence::Ptr &event, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all possible instances for this recurring Event.
KCalCore::MemoryCalendar::journalInstances
Journal::List journalInstances(const Incidence::Ptr &journal, JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all instances for this recurring Journal.
KCalCore::MemoryCalendar::rawEventsForDate
Event::List rawEventsForDate(const KDateTime &dt) const
Returns an unfiltered list of all Events which occur on the given timestamp.
KCalCore::MemoryCalendar::deleteEventInstances
bool deleteEventInstances(const Event::Ptr &event)
Delete all events that are instances of recurring event event.
KCalCore::MemoryCalendar::rawEvents
Event::List rawEvents(const QDate &start, const QDate &end, const KDateTime::Spec &timeSpec=KDateTime::Spec(), bool inclusive=false) const
Returns an unfiltered list of all Events occurring within a date range.
KCalCore::MemoryCalendar::todo
Todo::Ptr todo(const QString &uid, const KDateTime &recurrenceId=KDateTime()) const
Returns the Todo associated with the given unique identifier.
KCalCore::MemoryCalendar::deleteJournal
bool deleteJournal(const Journal::Ptr &journal)
Removes a Journal from the calendar.
KCalCore::MemoryCalendar::deletedTodo
Todo::Ptr deletedTodo(const QString &uid, const KDateTime &recurrenceId=KDateTime()) const
Returns the deleted Todo associated with the given unique identifier.
KCalCore::MemoryCalendar::deletedJournal
Journal::Ptr deletedJournal(const QString &uid, const KDateTime &recurrenceId=KDateTime()) const
Returns the deleted Journal associated with the given unique identifier.
KCalCore::MemoryCalendar::deleteTodo
bool deleteTodo(const Todo::Ptr &todo)
Removes a Todo from the calendar.
KCalCore::MemoryCalendar::deleteTodoInstances
bool deleteTodoInstances(const Todo::Ptr &todo)
Delete all to-dos that are instances of recurring to-do todo.
KCalCore::MemoryCalendar::close
void close()
Clears out the current calendar, freeing all used memory etc.
KCalCore::MemoryCalendar::rawTodos
Todo::List rawTodos(const QDate &start, const QDate &end, const KDateTime::Spec &timespec=KDateTime::Spec(), bool inclusive=false) const
Returns an unfiltered list of all Todos occurring within a date range.
KCalCore::MemoryCalendar::deletedEvent
Event::Ptr deletedEvent(const QString &uid, const KDateTime &recurrenceId=KDateTime()) const
Returns the deleted Event associated with the given unique identifier.
KCalCore::MemoryCalendar::rawJournals
Journal::List rawJournals(JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all Journals for this Calendar.
KCalCore::MemoryCalendar::addIncidence
bool addIncidence(const Incidence::Ptr &incidence)
Inserts an Incidence into the calendar.
KCalCore::MemoryCalendar::rawEvents
Event::List rawEvents(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Returns a sorted, unfiltered list of all Events for this Calendar.
KCalCore::MemoryCalendar::addTodo
bool addTodo(const Todo::Ptr &todo)
Inserts a Todo into the calendar.
KCalCore::MemoryCalendar::rawJournalsForDate
Journal::List rawJournalsForDate(const QDate &date) const
Returns an unfiltered list of all Journals for on the specified date.
KCalCore::MemoryCalendar::MemoryCalendar
MemoryCalendar(const KDateTime::Spec &timeSpec)
Constructs a calendar with a specified time zone timeZoneid.
KCalCore::MemoryCalendar::deleteEvent
bool deleteEvent(const Event::Ptr &event)
Removes an Event from the calendar.
KCalCore::MemoryCalendar::incidenceUpdated
void incidenceUpdated(const QString &uid, const KDateTime &recurrenceId)
The Observer interface.
KCalCore::MemoryCalendar::alarmsTo
Alarm::List alarmsTo(const KDateTime &to) const
Return a list of Alarms that occur before the specified timestamp.
KCalCore::Todo::List
QVector< Ptr > List
List of to-dos.
Definition: todo.h:55
KCalCore::Todo::Ptr
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
Definition: todo.h:50
KCalCore
TODO: KDE5:
Definition: alarm.h:47
KCalCore::JournalSortField
JournalSortField
Calendar Journal sort keys.
Definition: calendar.h:100
KCalCore::TodoSortField
TodoSortField
Calendar Todo sort keys.
Definition: calendar.h:87
KCalCore::EventSortField
EventSortField
Calendar Event sort keys.
Definition: calendar.h:77
KCalCore::SortDirection
SortDirection
Calendar Incidence sort directions.
Definition: calendar.h:69
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

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