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

« back to all changes in this revision

Viewing changes to akonadi/resources/imap/imapresource.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi, Alessandro Ghersi, Harald Sitter
  • Date: 2009-06-27 04:40:05 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627044005-4y2vm9xz7rvmzi4p
Tags: 4:4.2.95svn20090701-0ubuntu1
[ Alessandro Ghersi ]
* New upstream release
  - Bump build-deps
* Remove akonadi-kde and libmaildir4 packages
  - remove akonadi-kde.install and libmaildir4.install
  - remove libmaildir4 from debian/rules
  - remove akonadi-kde and libmaildir4 from depends
  - remove akonadi-kde and libmaildir4 from installgen
* Update kdepim-dev.install
* Update kpilot.install
* Add akonadi-kde and libmaildir4 transitional packages

[ Harald Sitter ]
* KAddressbook replaces Kontact << 4.2.85 (LP: #378373)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2007 Till Adam <adam@kde.org>
 
3
    Copyright (C) 2008 Omat Holding B.V. <info@omat.nl>
 
4
    Copyright (C) 2009 Kevin Ottens <ervin@kde.org>
 
5
 
 
6
    This library is free software; you can redistribute it and/or modify it
 
7
    under the terms of the GNU Library General Public License as published by
 
8
    the Free Software Foundation; either version 2 of the License, or (at your
 
9
    option) any later version.
 
10
 
 
11
    This library is distributed in the hope that it will be useful, but WITHOUT
 
12
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
 
14
    License for more details.
 
15
 
 
16
    You should have received a copy of the GNU Library General Public License
 
17
    along with this library; see the file COPYING.LIB.  If not, write to the
 
18
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
19
    02110-1301, USA.
 
20
*/
 
21
 
 
22
#ifndef __IMAP_RESOURCE_H__
 
23
#define __IMAP_RESOURCE_H__
 
24
 
 
25
class Imaplib;
 
26
class KJob;
 
27
 
 
28
#include <akonadi/resourcebase.h>
 
29
#include <boost/shared_ptr.hpp>
 
30
#include <QtCore/QStringList>
 
31
 
 
32
#include <kimap/fetchjob.h>
 
33
#include <kimap/listjob.h>
 
34
 
 
35
namespace KMime
 
36
{
 
37
  class Message;
 
38
}
 
39
 
 
40
namespace KIMAP
 
41
{
 
42
  class Session;
 
43
}
 
44
 
 
45
class ImapAccount;
 
46
 
 
47
class ImapResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
 
48
{
 
49
  Q_OBJECT
 
50
  Q_CLASSINFO( "D-Bus Interface", "org.kde.Akonadi.Imap.Resource" )
 
51
 
 
52
public:
 
53
  ImapResource( const QString &id );
 
54
  ~ImapResource();
 
55
 
 
56
public Q_SLOTS:
 
57
  virtual void configure( WId windowId );
 
58
 
 
59
protected Q_SLOTS:
 
60
  void retrieveCollections();
 
61
  void retrieveItems( const Akonadi::Collection &col );
 
62
  bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
 
63
 
 
64
protected:
 
65
  virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
 
66
  virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &parts );
 
67
  virtual void itemRemoved( const Akonadi::Item &item );
 
68
 
 
69
  virtual void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
 
70
  virtual void collectionChanged( const Akonadi::Collection &collection );
 
71
  virtual void collectionRemoved( const Akonadi::Collection &collection );
 
72
 
 
73
private Q_SLOTS:
 
74
  void onConnectSuccess();
 
75
  void onConnectError( int code, const QString &message );
 
76
  void onMailBoxesReceived( const QList<KIMAP::MailBoxDescriptor> &descriptors,
 
77
                            const QList< QList<QByteArray> > &flags );
 
78
  void onMailBoxesReceiveDone( KJob *job );
 
79
  void onGetAclDone( KJob *job );
 
80
  void onRightsReceived( KJob *job );
 
81
  void onQuotasReceived( KJob *job );
 
82
  void onGetMetaDataDone( KJob *job );
 
83
  void onSelectDone( KJob *job );
 
84
  void onHeadersReceived( const QString &mailBox, const QMap<qint64, qint64> &uids,
 
85
                          const QMap<qint64, qint64> &sizes, const QMap<qint64, KIMAP::MessageFlags> &flags,
 
86
                          const QMap<qint64, KIMAP::MessagePtr> &messages );
 
87
  void onHeadersFetchDone( KJob *job );
 
88
  void onMessagesReceived( const QString &mailBox, const QMap<qint64, qint64> &uids,
 
89
                           const QMap<qint64, KIMAP::MessagePtr> &messages );
 
90
  void onContentFetchDone( KJob *job );
 
91
  void onCreateMailBoxDone( KJob *job );
 
92
  void onRenameMailBoxDone( KJob *job );
 
93
  void onDeleteMailBoxDone( KJob *job );
 
94
  void onAppendMessageDone( KJob *job );
 
95
  void onStoreFlagsDone( KJob *job );
 
96
 
 
97
  void startConnect( bool forceManualAuth = false );
 
98
 
 
99
private:
 
100
  QString rootRemoteId() const;
 
101
  QString remoteIdForMailBox( const QString &path ) const;
 
102
  QString mailBoxForRemoteId( const QString &remoteId ) const;
 
103
 
 
104
  Akonadi::Collection collectionFromRemoteId( const QString &remoteId );
 
105
  Akonadi::Item itemFromRemoteId( const Akonadi::Collection &collection, const QString &remoteId );
 
106
  void itemsClear( const Akonadi::Collection &collection );
 
107
 
 
108
  bool manualAuth( const QString& username, QString &password );
 
109
 
 
110
  ImapAccount *m_account;
 
111
};
 
112
 
 
113
#endif