dummystorage.h
Go to the documentation of this file.
1/*
2 This file is part of the mkcal library.
3
4 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
5 Contact: Alvaro Manera <alvaro.manera@nokia.com>
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*/
22#ifndef DUMMYSTORAGE_H
23#define DUMMYSTORAGE_H
24
25#include "extendedstorage.h"
26#include "extendedcalendar.h"
27#include "notebook.h"
28
29
34
36{
37public:
38 DummyStorage(const mKCal::ExtendedCalendar::Ptr &cal) : mKCal::ExtendedStorage(cal)
39 {
41 "dummy-desc"));
42 bool r;
43 r = addNotebook(nb);
44 Q_ASSERT(r);
45 r = setDefaultNotebook(nb);
46 Q_ASSERT(r);
47 }
48
49 void calendarModified(bool, KCalendarCore::Calendar *)
50 {
51 }
52 void calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &)
53 {
54 }
55 void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &)
56 {
57 }
58 void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &, const KCalendarCore::Calendar *)
59 {
60 }
61 void calendarIncidenceAdditionCanceled(const KCalendarCore::Incidence::Ptr &)
62 {
63 }
64 bool purgeDeletedIncidences(const KCalendarCore::Incidence::List &)
65 {
66 return true;
67 }
68
73 bool open()
74 {
75 return true;
76 }
77
82 bool load()
83 {
84 return true;
85 }
86
91 bool save()
92 {
93 return true;
94 }
96 {
97 return true;
98 }
99 bool close()
100 {
101 return true;
102 }
103 bool load(const QString &, const QDateTime &)
104 {
105 return true;
106 }
107 bool load(const QDate &)
108 {
109 return true;
110 }
111 bool load(const QDate &, const QDate &)
112 {
113 return true;
114 }
115 bool loadSeries(const QString &)
116 {
117 return true;
118 }
119 bool loadIncidenceInstance(const QString &)
120 {
121 return true;
122 }
123 bool loadNotebookIncidences(const QString &)
124 {
125 return true;
126 }
128 {
129 return true;
130 }
132 {
133 return true;
134 }
136 {
137 return true;
138 }
140 {
141 return true;
142 }
143 bool loadGeoIncidences(float, float, float, float)
144 {
145 return true;
146 }
148 {
149 return true;
150 }
152 {
153 return 0;
154 }
155 int loadCompletedTodos(bool, int, QDateTime *)
156 {
157 return 0;
158 }
159 int loadIncidences(bool, int, QDateTime *)
160 {
161 return 0;
162 }
163 int loadFutureIncidences(int, QDateTime *)
164 {
165 return 0;
166 }
167 int loadGeoIncidences(bool, int, QDateTime *)
168 {
169 return 0;
170 }
172 {
173 return 0;
174 }
175 int loadOldInvitationIncidences(int, QDateTime *)
176 {
177 return 0;
178 }
179 KCalendarCore::Person::List loadContacts()
180 {
181 KCalendarCore::Person::List l;
182 return l;
183 }
184 int loadContactIncidences(const KCalendarCore::Person &, int, QDateTime *)
185 {
186 return 0;
187 }
188 int loadJournals(int, QDateTime *)
189 {
190 return 0;
191 }
192 bool notifyOpened(const KCalendarCore::Incidence::Ptr &)
193 {
194 return true;
195 }
196 bool cancel()
197 {
198 return true;
199 }
200 void calendarModified(bool, const KCalendarCore::Calendar *) const
201 {
202 }
203 void calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &) const
204 {
205 }
206 void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &) const
207 {
208 }
209 void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &) const
210 {
211 }
212 void calendarIncidenceAdditionCanceled(const KCalendarCore::Incidence::Ptr &) const
213 {
214 }
215 bool insertedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
216 {
217 return true;
218 }
219 bool modifiedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
220 {
221 return true;
222 }
223 bool deletedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
224 {
225 return true;
226 }
227 bool allIncidences(KCalendarCore::Incidence::List *, const QString &)
228 {
229 return true;
230 }
231 bool duplicateIncidences(KCalendarCore::Incidence::List *, const KCalendarCore::Incidence::Ptr &, const QString &)
232 {
233 return true;
234 }
236 {
237 return true;
238 }
240 {
241 return true;
242 }
243 QDateTime incidenceDeletedDate(const KCalendarCore::Incidence::Ptr &)
244 {
245 return QDateTime();
246 }
248 {
249 return 0;
250 }
252 {
253 return 0;
254 }
256 {
257 return 0;
258 }
259 void virtual_hook(int, void *)
260 {
261 return;
262 }
263};
264
265#endif /* DUMMYSTORAGE_H */
bool notifyOpened(const KCalendarCore::Incidence::Ptr &)
Mark if supported by the storage that an incidence has been opened.
Definition dummystorage.h:192
void calendarIncidenceAdditionCanceled(const KCalendarCore::Incidence::Ptr &) const
Definition dummystorage.h:212
bool loadGeoIncidences(float, float, float, float)
Load incidences that have geo parameters inside given rectangle.
Definition dummystorage.h:143
int loadUncompletedTodos()
Load all uncompleted todos.
Definition dummystorage.h:151
bool close()
Definition dummystorage.h:99
bool insertedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
Get inserted incidences from storage.
Definition dummystorage.h:215
int todoCount()
Get count of todos.
Definition dummystorage.h:251
bool load()
Definition dummystorage.h:82
int journalCount()
Get count of journals.
Definition dummystorage.h:255
bool deletedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
Get deleted incidences from storage.
Definition dummystorage.h:223
bool duplicateIncidences(KCalendarCore::Incidence::List *, const KCalendarCore::Incidence::Ptr &, const QString &)
Get possible duplicates for given incidence.
Definition dummystorage.h:231
bool save(DeleteAction)
This is an overload of save() method.
Definition dummystorage.h:95
void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &) const
Definition dummystorage.h:209
void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &, const KCalendarCore::Calendar *)
Definition dummystorage.h:58
void calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &) const
Definition dummystorage.h:203
bool loadJournals()
Load journal type entries.
Definition dummystorage.h:127
bool purgeDeletedIncidences(const KCalendarCore::Incidence::List &)
Remove from storage all incidences that have been previously marked as deleted and that matches the U...
Definition dummystorage.h:64
int loadOldInvitationIncidences(int, QDateTime *)
Definition dummystorage.h:175
void calendarModified(bool, const KCalendarCore::Calendar *) const
Definition dummystorage.h:200
int eventCount()
Get count of events.
Definition dummystorage.h:247
bool load(const QDate &)
Load incidences at given date into the memory.
Definition dummystorage.h:107
bool modifiedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
Get modified incidences from storage.
Definition dummystorage.h:219
void calendarIncidenceAdditionCanceled(const KCalendarCore::Incidence::Ptr &)
Definition dummystorage.h:61
bool open()
Definition dummystorage.h:73
int loadContactIncidences(const KCalendarCore::Person &, int, QDateTime *)
Load all incidences that have the specified attendee.
Definition dummystorage.h:184
void calendarModified(bool, KCalendarCore::Calendar *)
Definition dummystorage.h:49
bool loadNotebooks()
Definition dummystorage.h:235
bool allIncidences(KCalendarCore::Incidence::List *, const QString &)
Get all incidences from storage.
Definition dummystorage.h:227
int loadFutureIncidences(int, QDateTime *)
Load future incidences based on start/due date.
Definition dummystorage.h:163
bool modifyNotebook(const mKCal::Notebook::Ptr &, mKCal::DBOperation)
Definition dummystorage.h:239
KCalendarCore::Person::List loadContacts()
Load all contacts in the database.
Definition dummystorage.h:179
void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &)
Definition dummystorage.h:55
QDateTime incidenceDeletedDate(const KCalendarCore::Incidence::Ptr &)
Get deletion time of incidence.
Definition dummystorage.h:243
int loadGeoIncidences(bool, int, QDateTime *)
Load incidences that have location information based on parameters.
Definition dummystorage.h:167
bool loadIncidenceInstance(const QString &)
Load the incidence matching the given identifier.
Definition dummystorage.h:119
bool load(const QString &, const QDateTime &)
Load incidence by uid into the memory.
Definition dummystorage.h:103
bool loadSeries(const QString &)
Load all incidences sharing the same uid into the memory.
Definition dummystorage.h:115
bool loadAttendeeIncidences()
Load incidences that have attendee.
Definition dummystorage.h:147
void virtual_hook(int, void *)
Standard trick to add virtuals later.
Definition dummystorage.h:259
bool loadPlainIncidences()
Load plain incidences (no startdate and no enddate).
Definition dummystorage.h:131
bool loadNotebookIncidences(const QString &)
Load incidences of one notebook into the memory.
Definition dummystorage.h:123
bool loadRecurringIncidences()
Load recurring incidences.
Definition dummystorage.h:135
int loadJournals(int, QDateTime *)
Load journal entries based on parameters.
Definition dummystorage.h:188
int loadUnreadInvitationIncidences()
Definition dummystorage.h:171
bool cancel()
Cancel any ongoing action (load etc.).
Definition dummystorage.h:196
int loadCompletedTodos(bool, int, QDateTime *)
Load completed todos based on parameters.
Definition dummystorage.h:155
void calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &)
Definition dummystorage.h:52
int loadIncidences(bool, int, QDateTime *)
Load incidences based on start/due date or creation date.
Definition dummystorage.h:159
void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &) const
Definition dummystorage.h:206
bool loadGeoIncidences()
Load incidences that have geo parameters.
Definition dummystorage.h:139
bool load(const QDate &, const QDate &)
Load incidences between given dates into the memory.
Definition dummystorage.h:111
DummyStorage(const mKCal::ExtendedCalendar::Ptr &cal)
Definition dummystorage.h:38
bool save()
Definition dummystorage.h:91
This class provides a calendar storage interface.
Definition extendedstorage.h:72
bool setDefaultNotebook(const Notebook::Ptr &nb)
setDefaultNotebook to the storage.
Definition extendedstorage.cpp:527
ExtendedStorage(const ExtendedCalendar::Ptr &cal, bool validateNotebooks=true)
Constructs a new ExtendedStorage object.
Definition extendedstorage.cpp:136
bool addNotebook(const Notebook::Ptr &nb)
Add new notebook to the storage.
Definition extendedstorage.cpp:420
DeleteAction
Action to be performed on save for deleted incidences.
Definition extendedstorage.h:80
Placeholder for Notebook parameters.
Definition notebook.h:46
QSharedPointer< Notebook > Ptr
A shared pointer to a Notebook object.
Definition notebook.h:51
This file is part of the API for handling calendar data and defines the ExtendedCalendar class.
This file is part of the API for handling calendar data and defines the ExtendedStorage interface.
#define MKCAL_EXPORT
Definition mkcal_export.h:27
Definition extendedstorage.h:49
DBOperation
Database operation type.
Definition extendedstorage.h:54
This file is part of the API for handling calendar data and defines the Notebook class.

Generated on Thu Nov 28 2024 16:34:53 for libextendedkcal by doxygen 1.13.2