~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/resources/kolabproxy/kolabproxyresource.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2009-07-10 06:34:50 UTC
  • mfrom: (1.1.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20090710063450-neojgew2fh0n3y0u
Tags: 4:4.2.96-0ubuntu1
* New upstream release
* Bump kde build-deps to 4.2.96

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright (c) 2009 Andras Mantia <amantia@kde.org>
3
 
 
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.
8
 
 
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.
13
 
 
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
17
 
    02110-1301, USA.
18
 
*/
19
 
 
20
 
#ifndef KOLABPROXYRESOURCE_H
21
 
#define KOLABPROXYRESOURCE_H
22
 
 
23
 
#include <akonadi/resourcebase.h>
24
 
#include <QStringList>
25
 
 
26
 
 
27
 
namespace Akonadi {
28
 
  class Monitor;
29
 
}
30
 
 
31
 
class KolabHandler;
32
 
 
33
 
class KolabProxyResource : public Akonadi::ResourceBase,
34
 
                           public Akonadi::AgentBase::Observer
35
 
{
36
 
  Q_OBJECT
37
 
 
38
 
  public:
39
 
    KolabProxyResource( const QString &id );
40
 
    ~KolabProxyResource();
41
 
 
42
 
  public Q_SLOTS:
43
 
    virtual void configure( WId windowId );
44
 
 
45
 
  protected Q_SLOTS:
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);
61
 
 
62
 
 
63
 
  protected:
64
 
    virtual void aboutToQuit();
65
 
 
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 );
69
 
 
70
 
  private:
71
 
    Akonadi::Collection createCollection(const Akonadi::Collection& imapCollection);
72
 
 
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;
81
 
 
82
 
    enum RetrieveState {
83
 
      RetrieveItems,
84
 
      RetrieveItem,
85
 
      DeleteItem
86
 
    };
87
 
 
88
 
    RetrieveState m_retrieveState;
89
 
};
90
 
 
91
 
#endif