home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kdepim / exchangeaccount.h next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  3.0 KB  |  100 lines

  1. /*
  2.     This file is part of libkpimexchange.
  3.  
  4.     Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
  5.     Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
  6.  
  7.     This library is free software; you can redistribute it and/or modify it
  8.     under the terms of the GNU Library General Public License as published by
  9.     the Free Software Foundation; either version 2 of the License, or (at your
  10.     option) any later version.
  11.  
  12.     This library is distributed in the hope that it will be useful, but WITHOUT
  13.     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14.     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
  15.     License for more details.
  16.  
  17.     You should have received a copy of the GNU Library General Public License
  18.     along with this library; see the file COPYING.LIB.  If not, write to the
  19.     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20.     02110-1301, USA.
  21.  
  22. */
  23. #ifndef EXCHANGE_ACCOUNT_H
  24. #define EXCHANGE_ACCOUNT_H
  25.  
  26. #include <qobject.h>
  27. #include <qstring.h>
  28.  
  29. #include <kdepimmacros.h>
  30. #include <kurl.h>
  31. #include <kio/job.h>
  32.  
  33. namespace KPIM {
  34.     
  35. class KDE_EXPORT ExchangeAccount : public QObject
  36. {
  37.     Q_OBJECT
  38.   public:
  39.     ExchangeAccount( const QString &host, const QString &port,
  40.                      const QString &account, const QString &password,
  41.                      const QString &mailbox = QString::null );
  42.     /** 
  43.      Create a new account object, read data from group app data
  44.      */
  45.     ExchangeAccount( const QString &group );
  46.     ~ExchangeAccount();
  47.  
  48.     void save( QString const &group );
  49.     void load( QString const &group );
  50.  
  51.     QString host() { return mHost; }
  52.     QString port() { return mPort; }
  53.     QString account() { return mAccount; }
  54.     QString mailbox() { return mMailbox; }
  55.     QString password() { return mPassword; }
  56.  
  57.     void setHost( QString host ) { mHost = host; }
  58.     void setPort( QString port ) { mPort = port; }
  59.     void setAccount( QString account ) { mAccount = account; }
  60.     void setMailbox( QString mailbox ) { mMailbox = mailbox; }
  61.     void setPassword( QString password ) { mPassword = password; }
  62.  
  63.     KURL baseURL();
  64.     KURL calendarURL();
  65.  
  66.     // Returns the mailbox URL of this user. QString::null if unsuccessful
  67.     static QString tryFindMailbox( const QString &host, const QString &port,
  68.                                    const QString &user,
  69.                                    const QString &password );
  70.  
  71.     //  Put authentication info in KDE password store for auto-authentication
  72.     //  with later webdav access. Also calculates the calendar URL.
  73.     bool authenticate();
  74.     bool authenticate( QWidget *window );
  75.  
  76.   private:
  77.     bool authenticate( int windowId );
  78.     void calcFolderURLs();
  79.     static QString tryMailbox( const QString &_url, const QString &user,
  80.                                const QString &password );
  81.  
  82.   private slots:
  83.     void slotFolderResult( KIO::Job * );
  84.  
  85.   private:
  86.     QString mHost;
  87.     QString mPort;
  88.     QString mAccount;
  89.     QString mMailbox;
  90.     QString mPassword;
  91.  
  92.     KURL *mCalendarURL;
  93.     bool mError;
  94. };
  95.  
  96. }
  97.  
  98. #endif
  99.  
  100.