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 //TQt headers
00022 #include <tqdom.h>
00023 #include <tqstring.h>
00024 #include <tqlistview.h>
00025 #include <tqdatetime.h>
00026 
00027 //KDE headers
00028 #include <tdelocale.h>
00029 #include <tdeglobal.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, TQString& uid, bool isNew );
00090 
00096     void setHeader( const TQString& header );
00097 
00102     TQString header() const;
00103 
00108     TQString from() const;
00109 
00114     TQString to() const;
00115 
00120     TQString subject() const;
00121 
00126     TQString content() const;
00127 
00128 
00134     TQString date() const;
00135 
00142     TQString strUnixTime () const;
00143 
00148     TQDateTime sentDateTime() const;
00149 
00154     void setUIDL( const TQString& uid );
00155 
00160     TQString uidl() const;
00161 
00166     void setSize( int size );
00167 
00172     int size() const;
00173 
00178     TQString strSize () const;
00179 
00183     TQString strSizePrefix() const;
00184 
00189     void setNew( bool isnew );
00190 
00196     bool isNew() const;
00197 
00203     TQString 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, TQString account, TQString& mailbox, FilterLog* log = NULL );
00247 
00255     void readOptions( TQDomElement& elem );
00256 
00263     void saveOptions( TQDomDocument& doc, TQDomElement& parent );
00264 
00270     bool isSelected() const;
00271 
00283     TQString decodeMailBody( TQByteArray body, bool preferHTML ) const;
00284 
00291     int showHeader( TQString& account );
00292 
00299     void writeToMoveLog( FilterLog* log, TQString account, TQString mailbox );
00300 
00306     void writeToDeleteLog( FilterLog* log, TQString account );
00307 
00311     void setMarkAtNextViewRefresh();
00312 
00313   private:
00314 
00318     TQCString m_header;
00319 
00323     TQCString m_from;
00324 
00328     TQCString m_to;
00329 
00333     TQCString m_subject;
00334 
00338     TQDateTime m_unixDate;
00339 
00343     TQCString m_content;
00344 
00348     TQString 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     TQCString scanHeader( const TQString& item ) const;
00400 
00405     void setFrom( const TQCString& from );
00406 
00411     void setTo( const TQCString& to );
00412 
00417     void setSubject( const TQCString& subject );
00418 
00423     void setDate( const TQCString& date );
00424 
00429     void setContent( const TQCString& content );
00430 
00436     void setFilter( FilterElem* filter );
00437 
00443     TQString getBoundary() const;
00444 
00450     TQString getCharset() const;
00451 
00458     TQString getTransferEncoding() const;
00459 
00460 };
00461 
00462 #endif

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