00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MAILTRANSPORT_SERVERTEST_H
00022 #define MAILTRANSPORT_SERVERTEST_H
00023
00024 #include <mailtransport/mailtransport_export.h>
00025 #include <mailtransport/transport.h>
00026
00027 #include <QtGui/QWidget>
00028 #include <QtCore/QHash>
00029
00030 class QProgressBar;
00031
00032 namespace MailTransport
00033 {
00034
00035 class ServerTestPrivate;
00036
00042 class MAILTRANSPORT_EXPORT ServerTest : public QWidget
00043 {
00044 Q_OBJECT
00045 Q_PROPERTY( QString server READ server WRITE setServer )
00046 Q_PROPERTY( QString protocol READ protocol WRITE setProtocol )
00047 Q_PROPERTY( QProgressBar *progressBar READ progressBar WRITE setProgressBar )
00048
00049 public:
00050
00056 enum Capability {
00057 Pipelining,
00058 Top,
00059 UIDL
00060 };
00061
00067 ServerTest( QWidget *parent = 0 );
00068
00072 ~ServerTest();
00073
00077 void setServer( const QString &server );
00078
00082 QString server();
00083
00103 void setPort( Transport::EnumEncryption::type encryptionMode, uint port );
00104
00114 int port( Transport::EnumEncryption::type encryptionMode );
00115
00126 void setFakeHostname( const QString &fakeHostname );
00127
00131 QString fakeHostname();
00132
00138 void setProgressBar( QProgressBar *pb );
00139
00143 QProgressBar *progressBar();
00144
00149 void setProtocol( const QString &protocol );
00150
00154 QString protocol();
00155
00159 void start();
00160
00166 QList<int> normalProtocols();
00167
00172 bool isNormalPossible();
00173
00180 QList<int> tlsProtocols();
00181
00187 QList<int> secureProtocols();
00188
00193 bool isSecurePossible();
00194
00202 QList<Capability> capabilities() const;
00203
00204 Q_SIGNALS:
00209 void finished( QList<int> );
00210
00211 private:
00212 Q_DECLARE_PRIVATE( ServerTest )
00213 ServerTestPrivate *const d;
00214
00215 Q_PRIVATE_SLOT( d, void slotNormalPossible() )
00216 Q_PRIVATE_SLOT( d, void slotTlsDone() )
00217 Q_PRIVATE_SLOT( d, void slotSslPossible() )
00218 Q_PRIVATE_SLOT( d, void slotReadNormal( const QString &text ) )
00219 Q_PRIVATE_SLOT( d, void slotReadSecure( const QString &text ) )
00220 Q_PRIVATE_SLOT( d, void slotNormalNotPossible() )
00221 Q_PRIVATE_SLOT( d, void slotSslNotPossible() )
00222 Q_PRIVATE_SLOT( d, void slotUpdateProgress() )
00223 };
00224
00225 }
00226
00227 #endif // MAILTRANSPORT_SERVERTEST_H