#include <showrecord.h>
Public Member Functions | |
ShowRecord () | |
~ShowRecord () | |
void | saveOptions (QDomDocument &doc, QDomElement &parent) |
void | readStoredMails (QDomElement &parent) |
void | applyHeaderFilter (HeaderFilter *filter, QString account, MailNumberList_Type &deleteList, MailToDownloadMap_Type &downloadList, FilterLog *log=NULL) |
bool | hasSelectedMails () |
Types::MailNumberList_Type | getSelectedMails () |
void | removeMail (int number) |
QStringList | getSelectedSubjects () const |
QString | getSenderOf (int number) const |
QString | getDateOf (int number) const |
QString | getSizeOf (int number) const |
QString | getSubjectOf (int number) const |
QString | decodeMailBody (QByteArray body, int number, bool preferHTML) const |
bool | hasMail (QString uid) |
bool | isNew (QString uid) const |
void | appendNewMail (int number, QString uid, bool isNew) |
void | printMailList () |
void | setSize (int number, long size) |
Types::MailNumberList_Type | getNewMails () |
void | setHeader (int number, QString header) |
QStringList | getUIDsOfOldMails () |
QString | getHeaderOf (QString uid) |
void | setHeader (QString uid, QString header) |
int | getNumberNewMails () |
int | getNumberMails () |
long | getTotalSize () |
void | fillMailListView (KshowmailView *view, QString &account) |
int | showSelectedHeaders (QString &account) |
void | writeToMoveLog (FilterLog *log, int number, QString account, QString mailbox) |
void | writeToDeleteLog (FilterLog *log, int number, QString account) |
void | setMarkAtNextViewRefresh (int number) |
Static Public Attributes | |
static const int | continueShowHeaders |
static const int | cancelShowHeaders |
The mails are objects of ShowRecordElem. Inherits QPtrList.
ShowRecord::ShowRecord | ( | ) |
Constructor
ShowRecord::~ShowRecord | ( | ) |
Destructor Does nothing.
void ShowRecord::saveOptions | ( | 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 |
void ShowRecord::readStoredMails | ( | QDomElement & | parent | ) |
Reads out all mails stored inside the given account element, creates objects from class ShowRecordElem and stores them in this list. All old items will be removed.
parent | account element (DOM element) |
void ShowRecord::applyHeaderFilter | ( | HeaderFilter * | filter, | |
QString | account, | |||
MailNumberList_Type & | deleteList, | |||
MailToDownloadMap_Type & | downloadList, | |||
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 | |
log | pointer to the filter log |
bool ShowRecord::hasSelectedMails | ( | ) |
Returns whether there are mails in this list which are selected in the list view.
FALSE - there aren't selected mails
MailNumberList_Type ShowRecord::getSelectedMails | ( | ) |
Returns the numbers of all selected mails.
void ShowRecord::removeMail | ( | int | number | ) |
Removes the mail which has the given number.
number | number of the mail which will be removed |
QStringList ShowRecord::getSelectedSubjects | ( | ) | const |
Returns the subjects of the selected mails.
QString ShowRecord::getSenderOf | ( | int | number | ) | const |
Returns the sender of the mail with the given number.
number | mail number |
QString ShowRecord::getDateOf | ( | int | number | ) | const |
Returns the date of sent of the mail with the given number.
number | mail number |
QString ShowRecord::getSizeOf | ( | int | number | ) | const |
Returns the size of the mail with the given number.
number | mail number |
QString ShowRecord::getSubjectOf | ( | int | number | ) | const |
Returns the subject of the mail with the given number.
number | mail number |
QString ShowRecord::decodeMailBody | ( | QByteArray | body, | |
int | number, | |||
bool | preferHTML | |||
) | const |
Decodes the given mail body by the appropriate mail object. The mail object (ShowRecordElem) 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 encoded mail (including header) | |
number | number of the downloaded mail | |
preferHTML | decode HTML part if present |
bool ShowRecord::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
bool ShowRecord::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
void ShowRecord::appendNewMail | ( | int | number, | |
QString | uid, | |||
bool | isNew | |||
) |
Appends a new mail to the list.
number | number of the mail on the server | |
uid | Unique ID of the mail | |
isNew | TRUE - mail is new; FALSE - mail is not new |
void ShowRecord::printMailList | ( | ) |
Just for debugging. Prints a list of all contained mails to stdout.
void ShowRecord::setSize | ( | int | number, | |
long | size | |||
) |
Sets the size of a mail.
number | number of the mail | |
size | mail size |
Types::MailNumberList_Type ShowRecord::getNewMails | ( | ) |
Returns the numbers of mails which are marked as new.
void ShowRecord::setHeader | ( | int | number, | |
QString | header | |||
) |
Sets the header of the given mail.
number | number of the mail | |
header | the header |
QStringList ShowRecord::getUIDsOfOldMails | ( | ) |
Returns a list of the UIDs of all old mails.
QString ShowRecord::getHeaderOf | ( | QString | uid | ) |
Returns the header of the mail with the given UID.
uid | UID |
void ShowRecord::setHeader | ( | QString | uid, | |
QString | header | |||
) |
Sets the header of the mail with the given UID.
uid | UID | |
header | mail header |
int ShowRecord::getNumberNewMails | ( | ) |
Returns the number of new mails.
int ShowRecord::getNumberMails | ( | ) |
Returns the number of mails.
long ShowRecord::getTotalSize | ( | ) |
Returns the total size of all mails.
void ShowRecord::fillMailListView | ( | KshowmailView * | view, | |
QString & | account | |||
) |
Creates for every mail a list view item and insert it into the mail list view.
view | pointer to the application view | |
account | account name |
int ShowRecord::showSelectedHeaders | ( | QString & | account | ) |
Shows the headers of all selected mails.
account | account name |
cancelShowHeaders - the user has clicked Cancel. The invoking function will not show the next header.
void ShowRecord::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 |
void ShowRecord::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 |
void ShowRecord::setMarkAtNextViewRefresh | ( | int | number | ) |
The given mail will be marked at the next view refresh.
number | number of the mail |
int const ShowRecord::continueShowHeaders [static] |
Returned by showSelectedHeaders() if the user has always clicked OK.
int const ShowRecord::cancelShowHeaders [static] |
Returned by showSelectedHeaders() if the user has clicked Cancel.