2
Copyright (c) 2009 Andras Mantia <amantia@kde.org>
4
This library is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or (at your
7
option) any later version.
9
This library is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12
License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#ifndef KOLABPROXYRESOURCE_H
21
#define KOLABPROXYRESOURCE_H
23
#include <akonadi/resourcebase.h>
24
#include <QStringList>
33
class KolabProxyResource : public Akonadi::ResourceBase,
34
public Akonadi::AgentBase::Observer
39
KolabProxyResource( const QString &id );
40
~KolabProxyResource();
43
virtual void configure( WId windowId );
46
void retrieveCollections();
47
void retrieveItems( const Akonadi::Collection &col );
48
bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
49
void imapItemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection);
50
void imapItemRemoved(const Akonadi::Item &item);
51
void imapCollectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent);
52
void imapCollectionRemoved(const Akonadi::Collection &collection);
53
void imapCollectionChanged(const Akonadi::Collection &collection);
54
void itemCreatedDone(KJob *job);
55
void collectionFetchDone(KJob *job);
56
void imapCollectionFetched(KJob *job);
57
void retrieveItemFetchDone(KJob *);
58
void retrieveCollectionsFetchDone(KJob* job);
59
void addImapItem(const Akonadi::Item& item, Akonadi::Entity::Id collectionId);
60
void deleteImapItem(const Akonadi::Item& item);
64
virtual void aboutToQuit();
66
virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
67
virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &parts );
68
virtual void itemRemoved( const Akonadi::Item &item );
71
Akonadi::Collection createCollection(const Akonadi::Collection& imapCollection);
73
Akonadi::Monitor *m_monitor;
74
Akonadi::Monitor *m_colectionMonitor;
75
QStringList m_managedCollections;
76
QMap<Akonadi::Item::Id, KolabHandler*> m_monitoredCollections;
77
QMap<KJob*, QString> m_ids;
78
QMap<KJob*, Akonadi::Item> m_items;
79
QList<Akonadi::Item::Id> m_excludeAppend;
80
Akonadi::Collection m_root;
88
RetrieveState m_retrieveState;