Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

popclient.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2001 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of Qt Palmtop Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
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

Generated on Sat Nov 5 16:18:09 2005 for OPIE by  doxygen 1.4.2