showrecordelem.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           showrecord.h  -  description
00003                              -------------------
00004     begin                : Thu Dec 28 2000
00005     copyright            : (C) 2000-2001 by Eggert Ehmke
00006     email                : eggert.ehmke@berlin.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef SHOWRECORDELEM_H
00019 #define SHOWRECORDELEM_H
00020 
00021 //Qt headers
00022 #include <qdom.h>
00023 #include <qstring.h>
00024 #include <qlistview.h>
00025 #include <qdatetime.h>
00026 
00027 //KDE headers
00028 #include <klocale.h>
00029 #include <kglobal.h>
00030 #include <kdebug.h>
00031 #include <mimelib/datetime.h>
00032 #include <kmdcodec.h>
00033 
00034 //KShowmail headers
00035 #include "showlistviewitem.h"
00036 #include "decodeRFC2047.h"
00037 #include "constants.h"
00038 #include "kshowmailview.h"
00039 #include "showheaderdialog.h"
00040 #include "headerfilter.h"
00041 #include "filterlog.h"
00042 
00043 using namespace Constants;
00044 
00045 //forward class declarations
00046 class KshowmailView;
00047 class FilterElem;
00048 
00061 class ShowRecordElem
00062 {
00063 
00064   public:
00065 
00070     static const int continueShowHeaders;
00071 
00076     static const int cancelShowHeaders;
00077 
00081         ShowRecordElem ();
00082 
00089     ShowRecordElem( int number, QString& uid, bool isNew );
00090 
00096     void setHeader( const QString& header );
00097 
00102     QString header() const;
00103 
00108     QString from() const;
00109 
00114     QString to() const;
00115 
00120     QString subject() const;
00121 
00126     QString content() const;
00127 
00128 
00134     QString date() const;
00135 
00142     QString strUnixTime () const;
00143 
00148     QDateTime sentDateTime() const;
00149 
00154     void setUIDL( const QString& uid );
00155 
00160     QString uidl() const;
00161 
00166     void setSize( int size );
00167 
00172     int size() const;
00173 
00178     QString strSize () const;
00179 
00183     QString strSizePrefix() const;
00184 
00189     void setNew( bool isnew );
00190 
00196     bool isNew() const;
00197 
00203     QString state() const;
00204 
00209     void setNumber( int n );
00210 
00215     int number() const;
00216 
00223     void setViewItem( ShowListViewItem* item );
00224 
00231     ShowListViewItem* viewItem() const;
00232 
00246     FilterAction_Type applyHeaderFilter( HeaderFilter* filter, QString account, QString& mailbox, FilterLog* log = NULL );
00247 
00255     void readOptions( QDomElement& elem );
00256 
00263     void saveOptions( QDomDocument& doc, QDomElement& parent );
00264 
00270     bool isSelected() const;
00271 
00283     QString decodeMailBody( QByteArray body, bool preferHTML ) const;
00284 
00291     int showHeader( QString& account );
00292 
00299     void writeToMoveLog( FilterLog* log, QString account, QString mailbox );
00300 
00306     void writeToDeleteLog( FilterLog* log, QString account );
00307 
00311     void setMarkAtNextViewRefresh();
00312 
00313   private:
00314 
00318     QCString m_header;
00319 
00323     QCString m_from;
00324 
00328     QCString m_to;
00329 
00333     QCString m_subject;
00334 
00338     QDateTime m_unixDate;
00339 
00343     QCString m_content;
00344 
00348     QString m_uid;
00349 
00353     int m_size;
00354 
00358     bool m_new;
00359 
00363     int m_nNumber;
00364 
00371     bool markAtViewRefresh;
00372 
00378     ShowListViewItem* m_pItem;
00379 
00386     FilterElem* m_pFilter;
00387 
00399     QCString scanHeader( const QString& item ) const;
00400 
00405     void setFrom( const QCString& from );
00406 
00411     void setTo( const QCString& to );
00412 
00417     void setSubject( const QCString& subject );
00418 
00423     void setDate( const QCString& date );
00424 
00429     void setContent( const QCString& content );
00430 
00436     void setFilter( FilterElem* filter );
00437 
00443     QString getBoundary() const;
00444 
00450     QString getCharset() const;
00451 
00458     QString getTransferEncoding() const;
00459 
00460 };
00461 
00462 #endif

Generated on Tue Apr 1 21:59:49 2008 for kshowmail.kdevelop by  doxygen 1.5.0