libkpimexchange Library API Documentation

exchangeaccount.h

00001 /*
00002     This file is part of libkpimexchange.
00003     Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
00004 
00005     This library is free software; you can redistribute it and/or modify it
00006     under the terms of the GNU Library General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or (at your
00008     option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful, but WITHOUT
00011     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013     License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to the
00017     Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00018     02111-1307, USA.
00019 
00020 */
00021 
00022 #ifndef EXCHANGE_ACCOUNT_H
00023 #define EXCHANGE_ACCOUNT_H
00024 
00025 #include <qobject.h>
00026 #include <qstring.h>
00027 
00028 #include <kurl.h>
00029 #include <kio/job.h>
00030 
00031 namespace KPIM {
00032         
00033 class ExchangeAccount : public QObject {
00034   Q_OBJECT
00035   public:
00036     ExchangeAccount( QString host, QString account, QString password );
00037     ExchangeAccount( QString host, QString account, QString mailbox, QString password );
00041     ExchangeAccount( QString group );
00042     ~ExchangeAccount();
00043 
00044     void save( QString const& group );
00045     void load( QString const& group );
00046 
00047     QString const & host() { return mHost; }
00048     QString const & account() { return mAccount; }
00049     QString const & mailbox() { return mMailbox; }
00050     QString const & password() { return mPassword; }
00051 
00052     void setHost( QString host ) { mHost = host; }
00053     void setAccount( QString account ) { mAccount = account; }
00054     void setMailbox( QString mailbox ) { mMailbox = mailbox; }
00055     void setPassword( QString password ) { mPassword = password; }
00056 
00057     KURL baseURL();
00058     KURL calendarURL();
00059 
00060     // Returns the mailbox URL of this user. QString::null if unsuccessful
00061     static QString tryFindMailbox( const QString& host, const QString& user, const QString& password );
00062 
00063     //  Put authentication info in KDE password store for auto-authentication
00064     //  with later webdav access. Also calculates the calendar URL.
00065     void authenticate();
00066     void authenticate( QWidget* window );
00067 
00068   private:
00069     void authenticate( int windowId );
00070     void calcFolderURLs();
00071     static QString tryMailbox( const QString& _url, const QString& user, const QString& password );
00072 
00073 
00074   private slots:
00075     void slotFolderResult( KIO::Job * );
00076 
00077   private:
00078     QString mHost;
00079     QString mAccount;
00080     QString mMailbox;
00081     QString mPassword;
00082 
00083     KURL* mCalendarURL;
00084 };
00085 
00086 }
00087 
00088 #endif
00089 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:58 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001