Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 FLSmtpClient.h 00003 ------------------- 00004 begin : vie dic 1 2006 00005 copyright : (C) 2006 by InfoSiAL S.L. 00006 email : mail@infosial.com 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; version 2 of the License. * 00012 ***************************************************************************/ 00013 /*************************************************************************** 00014 Este programa es software libre. Puede redistribuirlo y/o modificarlo 00015 bajo los términos de la Licencia Pública General de GNU en su 00016 versión 2, publicada por la Free Software Foundation. 00017 ***************************************************************************/ 00018 00019 #ifndef FLSMTPCLIENT_H 00020 #define FLSMTPCLIENT_H 00021 00022 #include <qobject.h> 00023 #include <qstringlist.h> 00024 #include <qmime.h> 00025 #include <qfile.h> 00026 #include <qfileinfo.h> 00027 #include <qapplication.h> 00028 #include <qmessagebox.h> 00029 #include <qpixmap.h> 00030 00039 class FL_EXPORT FLSmtpClient : public QObject { 00040 00041 Q_OBJECT 00042 00043 public: 00044 00048 FLSmtpClient( QObject * parent = 0 ); 00049 00053 ~FLSmtpClient(); 00054 00060 void setFrom( const QString & from ); 00061 00067 void setTo( const QString & to ); 00068 00074 void setSubject( const QString & subject ); 00075 00081 void setBody( const QString & body ); 00082 00089 void addAttachment( const QString & attach, const QString & cid = QString::null ); 00090 00097 void addTextPart( const QString & text, const QString & mimeType = "text/plain"); 00098 00107 void setMailServer( const QString & mS ); 00108 00114 void setMimeType( const QString & mT ); 00115 00116 public slots: 00117 00121 void startSend(); 00122 00123 signals: 00124 00128 void status( const QString & ); 00129 00133 void sendStarted(); 00134 00138 void sendEnded(); 00139 00143 void sendTotalSteps( int ); 00144 00148 void sendStepNumber( int ); 00149 00150 protected: 00151 00155 static QMimeSourceFactory * mimeSourceFactory_; 00156 00160 static QMimeSourceFactory * mimeSourceFactory(); 00161 00162 private: 00163 00167 QString from_; 00168 00172 QString to_; 00173 00177 QString subject_; 00178 00182 QString body_; 00183 00187 QStringList attachments_; 00188 00192 QMap<QString, QString> mapAttachCid_; 00193 00197 QString mailServer_; 00198 00202 QString mimeType_; 00203 00207 QStringList textParts_; 00208 }; 00209 00210 #endif