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

smtpclient.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 SmtpClient_H
00021 #define SmtpClient_H
00022 
00023 //#include <stdio.h>
00024 #include <qsocket.h>
00025 #include <qstring.h>
00026 #include <qobject.h>
00027 #include <qtextstream.h>
00028 #include <qstringlist.h>
00029 #include <qlist.h>
00030 
00031 struct RawEmail
00032 {
00033   QString from;
00034   QString subject;
00035   QStringList to;
00036   QString body;
00037 };
00038 
00039 class SmtpClient: public QObject
00040 {
00041   Q_OBJECT
00042   
00043 public:
00044   SmtpClient();
00045   ~SmtpClient();
00046   void newConnection(const QString &target, int port);
00047   void addMail(const QString &from, const QString &subject, const QStringList &to, const QString &body);
00048 
00049 signals:
00050   void errorOccurred(int, const QString & LR );
00051   void updateStatus(const QString &);
00052   void mailSent();
00053   
00054 public slots:
00055   void errorHandling(int);
00056   void errorHandlingWithMsg(int, const QString & LastResponse );
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, From, Recv, MRcv, Data, Body, Quit, Done
00068   };
00069   int status;
00070   QList<RawEmail> mailList;
00071   RawEmail *mailPtr;
00072   bool sending;
00073   QStringList::Iterator it;
00074 };
00075 
00076 #endif

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