kmail

kmservertest.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-
00002     kmservertest.h
00003 
00004     This file is part of KMail, the KDE mail client.
00005     Copyright (c) 2001-2002 Michael Haeckel <haeckel@kde.org>
00006     Copyright (c) 2003 Marc Mutz <mutz@kde.org>
00007 
00008     KMail is free software; you can redistribute it and/or modify it
00009     under the terms of the GNU General Public License, version 2, as
00010     published by the Free Software Foundation.
00011 
00012     KMail is distributed in the hope that it will be useful, but
00013     WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 
00033 #ifndef kmservertest_h
00034 #define kmservertest_h
00035 
00036 #include <qobject.h>
00037 #include <qstring.h>
00038 #include <qstringlist.h>
00039 
00040 namespace KIO {
00041   class Job;
00042   class Slave;
00043   class SimpleJob;
00044   class MetaData;
00045 }
00046 
00047 class KMServerTest : public QObject
00048 {
00049   Q_OBJECT
00050 
00051 public:
00052   KMServerTest( const QString & protocol, const QString & host, int port );
00053   virtual ~KMServerTest();
00054 
00055 signals:
00056   void capabilities( const QStringList & capaNormal,
00057                      const QStringList & capaSSL );
00058   void capabilities( const QStringList & capaNormal,
00059                      const QStringList & capaSSL,
00060                      const QString & authNone, const QString & authSSL,
00061                      const QString & authTLS );
00062 
00063 protected slots:
00064   void slotData(KIO::Job *job, const QString &data);
00065   void slotResult(KIO::Job *job);
00066   void slotMetaData( const KIO::MetaData & );
00067   void slotSlaveResult(KIO::Slave *aSlave, int error,
00068     const QString &errorText = QString::null);
00069 
00070 protected:
00071   KIO::MetaData slaveConfig() const;
00072   void startOffSlave( int port=0 );
00073 
00074 protected:
00075   const QString  mProtocol;
00076   const QString  mHost;
00077   bool           mSSL;
00078   QStringList    mListNormal;
00079   QStringList    mListSSL;
00080   QString        mAuthNone;
00081   QString        mAuthSSL;
00082   QString        mAuthTLS;
00083   KIO::SimpleJob *mJob;
00084   KIO::Slave     *mSlave;
00085   int            mConnectionErrorCount;
00086 };
00087 
00088 #endif