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>
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.
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.
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
22
#ifndef __IMAP_ACCOUNT_H__
23
#define __IMAP_ACCOUNT_H__
27
#include <akonadi/resourcebase.h>
28
#include <boost/shared_ptr.hpp>
29
#include <QtCore/QStringList>
32
#include <kimap/loginjob.h>
47
class ImapAccount : public QObject, public KPIM::KAccount
50
Q_ENUMS( ConnectError )
56
CapabilitiesTestError,
57
IncompatibleServerError
60
ImapAccount( Settings *settings, QObject *parent = 0 );
61
ImapAccount( QObject *parent = 0 );
64
bool connect( const QString &password = QString() );
67
void setServer( const QString &server );
68
QString server() const;
70
void setUserName( const QString &userName );
71
QString userName() const;
73
void setEncryptionMode( KIMAP::LoginJob::EncryptionMode mode );
74
KIMAP::LoginJob::EncryptionMode encryptionMode() const;
76
void setAuthenticationMode( KIMAP::LoginJob::AuthenticationMode mode );
77
KIMAP::LoginJob::AuthenticationMode authenticationMode() const;
79
void setSubscriptionEnabled( bool enabled );
80
bool isSubscriptionEnabled() const;
82
KIMAP::Session *session() const;
83
QStringList capabilities() const;
87
void error( int code, const QString &message );
90
void onLoginDone( KJob *job );
91
void onCapabilitiesTestDone( KJob *job );
94
void doConnect( const QString &password );
96
KIMAP::Session *m_session;
97
QStringList m_capabilities;
100
KIMAP::LoginJob::EncryptionMode m_encryption;
101
KIMAP::LoginJob::AuthenticationMode m_authentication;
102
bool m_subscriptionEnabled;