-
Notifications
You must be signed in to change notification settings - Fork 4
/
extendedstorageobserver.h
110 lines (88 loc) · 3.83 KB
/
extendedstorageobserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
This file is part of the mkcal library.
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
Contact: Alvaro Manera <alvaro.manera@nokia.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/**
@file
This file is part of the API for handling calendar data and
defines the ExtendedStorageObserver to be used with ExtendedStorage.
@author Tero Aho \<ext-tero.1.aho@nokia.com\>
@author Alvaro Manera \<alvaro.manera@nokia.com \>
*/
#ifndef MKCAL_STORAGEOBSERVER_H
#define MKCAL_STORAGEOBSERVER_H
#include <QString>
#include <KCalendarCore/Incidence>
namespace mKCal {
class ExtendedStorage;
/**
@class ExtendedStorageObserver
The ExtendedStorageObserver class.
*/
class MKCAL_EXPORT ExtendedStorageObserver //krazy:exclude=dpointer
{
public:
/**
Destructor.
*/
virtual ~ExtendedStorageObserver() {};
/**
Notify the Observer that a Storage has been modified by an external
process. There is no information about what has been changed.
See also storageUpdated() for a notification of modifications done
in-process.
@param storage is a pointer to the ExtendedStorage object that
is being observed.
@param info uids inserted/updated/deleted, modified file etc.
*/
virtual void storageModified(ExtendedStorage *storage, const QString &info);
/**
Notify the Observer that a Storage is executing an action.
This callback is called typically for example every time
an incidence has been loaded.
@param storage is a pointer to the ExtendedStorage object that
is being observed.
@param info textual information
*/
virtual void storageProgress(ExtendedStorage *storage, const QString &info);
/**
Notify the Observer that a Storage has finished an action.
@param storage is a pointer to the ExtendedStorage object that
is being observed.
@param error true if action was unsuccessful; false otherwise
@param info textual information
*/
virtual void storageFinished(ExtendedStorage *storage, bool error, const QString &info);
/**
Notify the Observer that a Storage has been updated to reflect the
content of the associated calendar. This notification is delivered
because of local changes done in-process by a call to
ExtendedStorage::save() for instance.
See also storageModified() for a notification for modifications
done to the database by an external process.
@param storage is a pointer to the ExtendedStorage object that
is being observed.
@param added is a list of newly added incidences in the storage
@param modified is a list of updated incidences in the storage
@param deleted is a list of deleted incidences from the storage
*/
virtual void storageUpdated(ExtendedStorage *storage,
const KCalendarCore::Incidence::List &added,
const KCalendarCore::Incidence::List &modified,
const KCalendarCore::Incidence::List &deleted);
};
};
#endif /* !MKCAL_STORAGEOBSERVER_H */