2
This file is part of libkcal.
3
Copyright (c) 2009 Kevin Krammer <kevin.krammer@gmx.at>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
21
#ifndef KCAL_RESOURCEAKONADI_P_H
22
#define KCAL_RESOURCEAKONADI_P_H
24
#include "subresource.h"
25
#include "resourceakonadi.h"
26
#include "sharedresourceprivate.h"
28
#include "kcal/kcalmimetypevisitor.h"
30
#include <kcal/assignmentvisitor.h>
31
#include <kcal/calendarlocal.h>
34
class AgentFilterProxyModel;
35
class AgentInstanceModel;
44
class KCal::ResourceAkonadi::Private : public SharedResourcePrivate<SubResource>,
45
public KCal::Calendar::CalendarObserver
50
explicit Private( ResourceAkonadi *parent );
52
Private( const KConfigGroup &config, ResourceAkonadi *parent );
56
bool doSaveIncidence( Incidence *incidence );
58
QString subResourceIdentifier( const QString &incidenceUid ) const;
61
ResourceAkonadi *mParent;
63
CalendarLocal mCalendar;
65
KABC::LockNull *mLock;
67
bool mInternalCalendarModification;
69
AssignmentVisitor mIncidenceAssigner;
71
Akonadi::KCalMimeTypeVisitor mMimeVisitor;
73
Akonadi::AgentInstanceModel *mAgentModel;
74
Akonadi::AgentFilterProxyModel *mAgentFilterModel;
83
void subResourceAdded( SubResourceBase *subResource );
85
void subResourceRemoved( SubResourceBase *subResource );
87
void loadingResult( bool ok, const QString &errorString );
89
void savingResult( bool ok, const QString &errorString );
91
const SubResourceBase *storeSubResourceFromUser( const QString &uid, const QString &mimeType );
93
Akonadi::Item createItem( const QString &kresId );
95
Akonadi::Item updateItem( const Akonadi::Item &item, const QString &kresId, const QString &originalId );
97
CollectionsByMimeType storeCollectionsFromOldDefault() const;
99
// from the CalendarObserver interface
100
void calendarIncidenceAdded( KCal::Incidence *incidence );
102
void calendarIncidenceChanged( KCal::Incidence *incidence );
104
void calendarIncidenceDeleted( KCal::Incidence *incidence );
107
void incidenceAdded( const IncidencePtr &incidencePtr, const QString &subResourceIdentifier );
109
void incidenceChanged( const IncidencePtr &incidencePtr, const QString &subResourceIdentifier );
111
void incidenceRemoved( const QString &uid, const QString &subResourceIdentifier );
116
// kate: space-indent on; indent-width 2; replace-tabs on;