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( const QString& host, const QString& port, const QString& account,
00037                      const QString& password, const QString& mailbox = QString::null );
00041     ExchangeAccount( const QString& group );
00042     ~ExchangeAccount();
00043 
00044     void save( QString const& group );
00045     void load( QString const& group );
00046 
00047     QString host() { return mHost; }
00048     QString port() { return mPort; }
00049     QString account() { return mAccount; }
00050     QString mailbox() { return mMailbox; }
00051     QString password() { return mPassword; }
00052 
00053     void setHost( QString host ) { mHost = host; }
00054     void setPort( QString port ) { mPort = port; }
00055     void setAccount( QString account ) { mAccount = account; }
00056     void setMailbox( QString mailbox ) { mMailbox = mailbox; }
00057     void setPassword( QString password ) { mPassword = password; }
00058 
00059     KURL baseURL();
00060     KURL calendarURL();
00061 
00062     // Returns the mailbox URL of this user. QString::null if unsuccessful
00063     static QString tryFindMailbox( const QString& host, const QString& port, const QString& user, const QString& password );
00064 
00065     //  Put authentication info in KDE password store for auto-authentication
00066     //  with later webdav access. Also calculates the calendar URL.
00067     void authenticate();
00068     void authenticate( QWidget* window );
00069 
00070   private:
00071     void authenticate( int windowId );
00072     void calcFolderURLs();
00073     static QString tryMailbox( const QString& _url, const QString& user, const QString& password );
00074 
00075 
00076   private slots:
00077     void slotFolderResult( KIO::Job * );
00078 
00079   private:
00080     QString mHost;
00081     QString mPort;
00082     QString mAccount;
00083     QString mMailbox;
00084     QString mPassword;
00085 
00086     KURL* mCalendarURL;
00087 };
00088 
00089 }
00090 
00091 #endif
00092 
KDE Logo
This file is part of the documentation for libkpimexchange Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:38:09 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003