00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SHOWRECORD_H
00019 #define SHOWRECORD_H
00020
00021
00022 #include <iostream>
00023
00024
00025 #include <qdom.h>
00026 #include <qptrlist.h>
00027
00028
00029 #include <kstandarddirs.h>
00030 #include <kdebug.h>
00031
00032
00033 #include "kshowmailview.h"
00034 #include "showrecordelem.h"
00035 #include "types.h"
00036 #include "headerfilter.h"
00037 #include "filterlog.h"
00038
00039 using namespace Types;
00040 using namespace std;
00041
00042
00043 class ShowRecordElem;
00044 class KshowmailView;
00045
00056 class ShowRecord: public QPtrList<ShowRecordElem>
00057 {
00058
00059 public:
00060
00065 static const int continueShowHeaders;
00066
00071 static const int cancelShowHeaders;
00072
00076 ShowRecord();
00077
00082 ~ShowRecord();
00083
00090 void saveOptions( QDomDocument& doc, QDomElement& parent );
00091
00098 void readStoredMails( QDomElement& parent );
00099
00108 void applyHeaderFilter( HeaderFilter* filter, QString account, MailNumberList_Type& deleteList, MailToDownloadMap_Type& downloadList, FilterLog* log = NULL );
00109
00110
00117 bool hasSelectedMails();
00118
00123 Types::MailNumberList_Type getSelectedMails();
00124
00129 void removeMail( int number );
00130
00135 QStringList getSelectedSubjects() const;
00136
00142 QString getSenderOf( int number ) const;
00143
00149 QString getDateOf( int number ) const;
00150
00156 QString getSizeOf( int number ) const;
00157
00163 QString getSubjectOf( int number ) const;
00164
00177 QString decodeMailBody( QByteArray body, int number, bool preferHTML ) const;
00178
00185 bool hasMail( QString uid );
00186
00193 bool isNew( QString uid ) const;
00194
00201 void appendNewMail( int number, QString uid, bool isNew );
00202
00207 void printMailList();
00208
00214 void setSize( int number, long size );
00215
00220 Types::MailNumberList_Type getNewMails();
00221
00227 void setHeader( int number, QString header );
00228
00233 QStringList getUIDsOfOldMails();
00234
00240 QString getHeaderOf( QString uid );
00241
00247 void setHeader( QString uid, QString header );
00248
00253 int getNumberNewMails();
00254
00259 int getNumberMails();
00260
00265 long getTotalSize();
00266
00273 void fillMailListView( KshowmailView* view, QString& account );
00274
00281 int showSelectedHeaders( QString& account );
00282
00290 void writeToMoveLog( FilterLog* log, int number, QString account, QString mailbox );
00291
00298 void writeToDeleteLog( FilterLog* log, int number, QString account );
00299
00304 void setMarkAtNextViewRefresh( int number );
00305
00306
00307 };
00308
00309 #endif