#include <maillist.h>
Public Member Functions | |
MailList (QPointer< Account > account, QObject *parent) | |
~MailList () | |
Mail * | addMail (long number, const QString &unid, bool isNew) |
void | print () const |
bool | hasMail (QString uid) |
bool | isNew (QString uid) const |
void | setSize (long number, long size) |
Types::MailNumberList_Type | getNewMails () |
void | setHeader (int number, QStringList header) |
void | setHeader (QString unid, QStringList header) |
QStringList | getUIDsOfOldMails () |
QStringList | getHeaderOf (QString unid) throw ( CorruptDataException ) |
int | getNumberMails () const |
QPointer< Account > | getAccount () const |
void | applyHeaderFilter (HeaderFilter *filter, QString account, MailNumberList_Type &deleteList, MailToDownloadMap_Type &downloadList, int &nmbIgnoredMails, FilterLog *log=NULL) |
void | removeMail (int number) |
void | saveMails (QDomDocument &doc, QDomElement &parent) |
QString | getSenderOf (int number) const |
QString | getDateOf (int number) const |
QString | getSizeOf (int number) const |
QString | getSubjectOf (int number) const |
QString | getCharsetFromHeaderOf (int number) const |
QStringList | decodeMailBody (const QStringList &body, int number, bool preferHTML) const |
void | writeToMoveLog (FilterLog *log, int number, QString account, QString mailbox) |
void | writeToDeleteLog (FilterLog *log, int number, QString account) |
void | setMarkAtNextViewRefresh (int number) |
int | getNumberNewMails () |
long | getTotalSize () |
void | readStoredMails (QDomElement &parent) |
QList< Mail > | getAllMails () const |
Used in class Account.
Definition at line 47 of file maillist.h.
MailList::MailList | ( | QPointer< Account > | account, | |
QObject * | parent | |||
) |
Constructor
account | pointer to the parent account | |
parent | parent object |
Definition at line 20 of file maillist.cpp.
MailList::~MailList | ( | ) |
Destructor
Definition at line 25 of file maillist.cpp.
Mail * MailList::addMail | ( | long | number, | |
const QString & | unid, | |||
bool | isNew | |||
) |
Creates a mail object and adds it to the list
number | number of the mail on the server | |
unid | Unique ID of the mail | |
isNew | TRUE - mail is new; FALSE - mail is not new |
Definition at line 37 of file maillist.cpp.
void MailList::print | ( | ) | const |
Prints all data of this mail list to stdout
Definition at line 48 of file maillist.cpp.
bool MailList::hasMail | ( | QString | uid | ) |
Returns whether there is mail with the given uid in the list.
uid | UID of the mail |
FALSE - mail is not in the list
Definition at line 59 of file maillist.cpp.
bool MailList::isNew | ( | QString | uid | ) | const |
Returns whether the given mail is new.
uid | UID of the mail |
FALSE - mail is not new or mail doesn't exist
Definition at line 78 of file maillist.cpp.
void MailList::setSize | ( | long | number, | |
long | size | |||
) |
Sets the size of a mail.
number | number of the mail | |
size | mail size |
Definition at line 100 of file maillist.cpp.
Types::MailNumberList_Type MailList::getNewMails | ( | ) |
Returns the numbers of mails which are marked as new.
Definition at line 119 of file maillist.cpp.
void MailList::setHeader | ( | int | number, | |
QStringList | header | |||
) |
Sets the header of the given mail.
number | number of the mail | |
header | the header |
Definition at line 138 of file maillist.cpp.
void MailList::setHeader | ( | QString | unid, | |
QStringList | header | |||
) |
Sets the header of the mail with the given UID.
unid | UID | |
header | mail header |
Definition at line 198 of file maillist.cpp.
QStringList MailList::getUIDsOfOldMails | ( | ) |
Returns a list of the UIDs of all old mails.
Definition at line 158 of file maillist.cpp.
QStringList MailList::getHeaderOf | ( | QString | unid | ) | throw ( CorruptDataException ) |
Returns the header of the mail with the given UID.
unid | UID |
CorruptDataException |
Definition at line 177 of file maillist.cpp.
int MailList::getNumberMails | ( | ) | const |
QPointer< Account > MailList::getAccount | ( | ) | const |
Returns a pointer to the account which this list holds.
Definition at line 221 of file maillist.cpp.
void MailList::applyHeaderFilter | ( | HeaderFilter * | filter, | |
QString | account, | |||
MailNumberList_Type & | deleteList, | |||
MailToDownloadMap_Type & | downloadList, | |||
int & | nmbIgnoredMails, | |||
FilterLog * | log = NULL | |||
) |
Apply the filters to the mails in this list.
filter | pointer to the header filter | |
account | name of this account | |
deleteList | reference to a list in which this methode writes the numbers of mails to delete | |
downloadList | reference to a list in which this methode writes the number of mails to download | |
nmbIgnoredMails | reference to an integer in which it writes the number of ignored mails | |
log | pointer to the filter log |
Definition at line 226 of file maillist.cpp.
void MailList::removeMail | ( | int | number | ) |
Removes the mail which has the given number.
number | number of the mail which will be removed |
Definition at line 267 of file maillist.cpp.
void MailList::saveMails | ( | QDomDocument & | doc, | |
QDomElement & | parent | |||
) |
Saves all stored mails into the given DOM document inside the given account element.
doc | DOM document in that all options are stored | |
parent | account element |
Definition at line 282 of file maillist.cpp.
QString MailList::getSenderOf | ( | int | number | ) | const |
Returns the sender of the mail with the given number.
number | mail number |
Definition at line 294 of file maillist.cpp.
QString MailList::getDateOf | ( | int | number | ) | const |
Returns the date of sent of the mail with the given number.
number | mail number |
Definition at line 315 of file maillist.cpp.
QString MailList::getSizeOf | ( | int | number | ) | const |
Returns the size of the mail with the given number.
number | mail number |
Definition at line 337 of file maillist.cpp.
QString MailList::getSubjectOf | ( | int | number | ) | const |
Returns the subject of the mail with the given number.
number | mail number |
Definition at line 359 of file maillist.cpp.
QString MailList::getCharsetFromHeaderOf | ( | int | number | ) | const |
Returns the charset of the mail with the given number.
number | mail number |
Definition at line 381 of file maillist.cpp.
QStringList MailList::decodeMailBody | ( | const QStringList & | body, | |
int | number, | |||
bool | preferHTML | |||
) | const |
Decodes the given mail body by the appropriate mail object. The mail object has to do this job, because it has stored the mail header and therefore it knows the content type and encoding of the mail. It decodes just the text or html part of the body. The rest of it will be rejected.
body | the whole mail (including header) | |
number | number of the downloaded mail | |
preferHTML | decode HTML part if present |
Definition at line 403 of file maillist.cpp.
void MailList::writeToMoveLog | ( | FilterLog * | log, | |
int | number, | |||
QString | account, | |||
QString | mailbox | |||
) |
Writes the mail into the Move Log.
log | pointer to the log | |
number | number of the mail | |
account | name of the account | |
mailbox | name of the mailbox |
Definition at line 425 of file maillist.cpp.
void MailList::writeToDeleteLog | ( | FilterLog * | log, | |
int | number, | |||
QString | account | |||
) |
Writes the mail into the Delete Log.
log | pointer to the log | |
number | number of the mail | |
account | name of the account |
Definition at line 463 of file maillist.cpp.
void MailList::setMarkAtNextViewRefresh | ( | int | number | ) |
The given mail will be marked at the next view refresh.
number | number of the mail |
Definition at line 444 of file maillist.cpp.
int MailList::getNumberNewMails | ( | ) |
Returns the number of new mails.
Definition at line 482 of file maillist.cpp.
long MailList::getTotalSize | ( | ) |
Returns the total size (bytes) of all mails.
Definition at line 499 of file maillist.cpp.
void MailList::readStoredMails | ( | QDomElement & | parent | ) |
Reads out all mails stored inside the given account element, creates objects from class Mail and stores them in this list. All old items will be removed.
parent | account element (DOM element) |
Definition at line 515 of file maillist.cpp.
QList< Mail > MailList::getAllMails | ( | ) | const |
Returns a list which contains the pointers to all mails.
Definition at line 548 of file maillist.cpp.