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
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 open()
65 {
66 return true;
67 }
68 bool load()
69 {
70 return true;
71 }
72 bool save()
73 {
74 return true;
75 }
77 {
78 return true;
79 }
80 bool close()
81 {
82 return true;
83 }
84 bool load(const QString &)
85 {
86 return true;
87 }
88 bool load(const QDate &, const QDate &)
89 {
90 return true;
91 }
92 bool loadNotebookIncidences(const QString &)
93 {
94 return true;
95 }
96 bool purgeDeletedIncidences(const KCalendarCore::Incidence::List &, const QString &)
97 {
98 return true;
99 }
100 bool insertedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
101 {
102 return true;
103 }
104 bool modifiedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
105 {
106 return true;
107 }
108 bool deletedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
109 {
110 return true;
111 }
112 bool allIncidences(KCalendarCore::Incidence::List *, const QString &)
113 {
114 return true;
115 }
116 bool search(const QString &, QStringList *, int)
117 {
118 return true;
119 }
121 {
122 return true;
123 }
125 {
126 return true;
127 }
129 {
130 return true;
131 }
133 {
134 return true;
135 }
136 QDateTime incidenceDeletedDate(const KCalendarCore::Incidence::Ptr &)
137 {
138 return QDateTime();
139 }
140 void virtual_hook(int, void *)
141 {
142 return;
143 }
144};
145
146#endif /* DUMMYSTORAGE_H */
This module provides a simple storage abstraction which contains exactly nothing.
Definition dummystorage.h:36
bool close()
Definition dummystorage.h:80
bool modifyNotebook(const mKCal::Notebook::Ptr &)
Definition dummystorage.h:128
bool insertedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
Get inserted incidences from storage.
Definition dummystorage.h:100
bool load()
Definition dummystorage.h:68
bool deletedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
Get deleted incidences from storage.
Definition dummystorage.h:108
bool save(DeleteAction)
This is an overload of save() method.
Definition dummystorage.h:76
void calendarIncidenceDeleted(const KCalendarCore::Incidence::Ptr &, const KCalendarCore::Calendar *)
Definition dummystorage.h:58
bool modifiedIncidences(KCalendarCore::Incidence::List *, const QDateTime &, const QString &)
Get modified incidences from storage.
Definition dummystorage.h:104
void calendarIncidenceAdditionCanceled(const KCalendarCore::Incidence::Ptr &)
Definition dummystorage.h:61
bool open()
Definition dummystorage.h:64
void calendarModified(bool, KCalendarCore::Calendar *)
Definition dummystorage.h:49
bool loadNotebooks()
Definition dummystorage.h:120
bool allIncidences(KCalendarCore::Incidence::List *, const QString &)
Get all incidences from storage.
Definition dummystorage.h:112
bool load(const QString &)
Load all incidences sharing the same uid into the memory.
Definition dummystorage.h:84
void calendarIncidenceChanged(const KCalendarCore::Incidence::Ptr &)
Definition dummystorage.h:55
QDateTime incidenceDeletedDate(const KCalendarCore::Incidence::Ptr &)
Get deletion time of incidence.
Definition dummystorage.h:136
bool purgeDeletedIncidences(const KCalendarCore::Incidence::List &, const QString &)
Remove from storage all incidences that have been previously marked as deleted and that matches the U...
Definition dummystorage.h:96
void virtual_hook(int, void *)
Standard trick to add virtuals later.
Definition dummystorage.h:140
bool insertNotebook(const mKCal::Notebook::Ptr &)
Definition dummystorage.h:124
bool loadNotebookIncidences(const QString &)
Load incidences of one notebook into the memory.
Definition dummystorage.h:92
bool search(const QString &, QStringList *, int)
Get all incidences from storage that match key.
Definition dummystorage.h:116
void calendarIncidenceAdded(const KCalendarCore::Incidence::Ptr &)
Definition dummystorage.h:52
bool eraseNotebook(const mKCal::Notebook::Ptr &)
Definition dummystorage.h:132
bool load(const QDate &, const QDate &)
Load incidences between given dates into the memory.
Definition dummystorage.h:88
DummyStorage(const mKCal::ExtendedCalendar::Ptr &cal)
Definition dummystorage.h:38
bool save()
Definition dummystorage.h:72
This class provides a calendar storage interface.
Definition extendedstorage.h:63
bool setDefaultNotebook(const Notebook::Ptr &nb)
setDefaultNotebook to the storage.
Definition extendedstorage.cpp:469
bool addNotebook(const Notebook::Ptr &nb)
Add new notebook to the storage.
Definition extendedstorage.cpp:370
DeleteAction
Action to be performed on save for deleted incidences.
Definition extendedstorage.h:71
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:29
Definition extendedstorage.h:49
This file is part of the API for handling calendar data and defines the Notebook class.

Generated on Thu Nov 28 2024 09:02:24 for libextendedkcal by doxygen 1.12.0