00001 #ifndef VIEWMAIL_H
00002 #define VIEWMAIL_H
00003
00004 #include "viewmailbase.h"
00005 #include <libmailwrapper/mailtypes.h>
00006
00007 #include <opie2/odialog.h>
00008
00009 #include <qlistview.h>
00010 #include <qmap.h>
00011 #include <qstringlist.h>
00012 #include <qvaluelist.h>
00013
00014 class MailImageDlg;
00015
00016 namespace Opie { namespace MM { class OImageScrollView; } }
00017
00018 class AttachItem : public QListViewItem
00019 {
00020 public:
00021 AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
00022 const QString&fsize,int num,const QValueList<int>&path);
00023 AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
00024 const QString&fsize,int num,const QValueList<int>&path);
00025 int Partnumber() { return _partNum; }
00026 bool isParentof(const QValueList<int>&path);
00027
00028 private:
00029 int _partNum;
00030
00031 QValueList<int> _path;
00032 };
00033
00034 class ViewMail : public ViewMailBase
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
00040 ~ViewMail();
00041
00042 void hide();
00043 void exec();
00044 void setMail(const RecMailP&mail );
00045 void setBody(const RecBodyP&body);
00046 bool deleted;
00047
00048 protected:
00049 QString deHtml(const QString &string);
00050 AttachItem* searchParent(const QValueList<int>&path);
00051 AttachItem* lastChild(AttachItem*parent);
00052
00053 Opie::MM::OImageScrollView*m_lastdlg;
00054
00055 protected slots:
00056 void slotReply();
00057 void slotForward();
00058 void setMainText();
00059 void slotItemClicked( QListViewItem * item , const QPoint & point, int c );
00060 void slotDeleteMail( );
00061 void slotShowHtml( bool );
00062 void slotImageInline(bool);
00063
00064 private:
00065 void readConfig();
00066
00067 bool _inLoop;
00068 QString m_mailHtml;
00069 bool m_gotBody;
00070 RecBodyP m_body;
00071 RecMailP m_recMail;
00072 bool m_showHtml:1;
00073 bool m_PicsInline:1;
00074 unsigned int _icounter;
00075 int m_lastimagepart;
00076 int m_lasttextpart;
00077
00078
00079 QMap <int,QString> m_mail;
00080
00081 QMap <int,QStringList> m_mail2;
00082 };
00083
00084 class MailImageDlg:public Opie::Ui::ODialog
00085 {
00086 Q_OBJECT
00087 public:
00088 MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0);
00089 ~MailImageDlg();
00090 void setName(const QString&);
00091 protected:
00092 Opie::MM::OImageScrollView*m_imageview;
00093 };
00094
00095 #endif