00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PopClient_H
00021 #define PopClient_H
00022
00023 #include <stdio.h>
00024 #include <qsocket.h>
00025 #include <qstring.h>
00026 #include <qobject.h>
00027 #include <qtextstream.h>
00028 #include <qlist.h>
00029 #include "maillist.h"
00030
00031 class PopClient: public QObject
00032 {
00033 Q_OBJECT
00034
00035 public:
00036 PopClient();
00037 ~PopClient();
00038 void newConnection(const QString &target, int port);
00039 void setAccount(const QString &popUser, const QString &popPasswd);
00040 void setSynchronize(int lastCount);
00041 void removeSynchronize();
00042 void headersOnly(bool headers, int limit);
00043 void setSelectedMails(MailList *list);
00044
00045 signals:
00046 void newMessage(const QString &, int, uint, bool);
00047 void errorOccurred(int status, const QString & Msg );
00048 void updateStatus(const QString &);
00049 void mailTransfered(int);
00050 void mailboxSize(int);
00051 void currentMailSize(int);
00052 void downloadedSize(int);
00053
00054 public slots:
00055 void errorHandling(int);
00056 void errorHandlingWithMsg(int, const QString & );
00057
00058 protected slots:
00059 void connectionEstablished();
00060 void incomingData();
00061
00062 private:
00063 QSocket *socket;
00064 QTextStream *stream;
00065 enum transferStatus
00066 {
00067 Init, Pass, Stat, Mcnt, Read, List, Size, Retr, Acks,
00068 Quit, Done, Ignore
00069 };
00070 int status, lastSync;
00071 int messageCount, newMessages, mailSize, headerLimit;
00072 bool receiving, synchronize, preview, selected;
00073 QString popUserName, popPassword, message;
00074 MailList *mailList;
00075 };
00076
00077 #endif