#include <showrecord.h>
Public Member Functions | |
ShowRecord () | |
~ShowRecord () | |
void | saveOptions (TQDomDocument &doc, TQDomElement &parent) |
void | readStoredMails (TQDomElement &parent) |
void | applyHeaderFilter (HeaderFilter *filter, TQString account, MailNumberList_Type &deleteList, MailToDownloadMap_Type &downloadList, FilterLog *log=NULL) |
bool | hasSelectedMails () |
Types::MailNumberList_Type | getSelectedMails () |
void | removeMail (int number) |
TQStringList | getSelectedSubjects () const |
TQString | getSenderOf (int number) const |
TQString | getDateOf (int number) const |
TQString | getSizeOf (int number) const |
TQString | getSubjectOf (int number) const |
TQString | decodeMailBody (TQByteArray body, int number, bool preferHTML) const |
bool | hasMail (TQString uid) |
bool | isNew (TQString uid) const |
void | appendNewMail (int number, TQString uid, bool isNew) |
void | printMailList () |
void | setSize (int number, long size) |
Types::MailNumberList_Type | getNewMails () |
void | setHeader (int number, TQString header) |
TQStringList | getUIDsOfOldMails () |
TQString | getHeaderOf (TQString uid) |
void | setHeader (TQString uid, TQString header) |
int | getNumberNewMails () |
int | getNumberMails () |
long | getTotalSize () |
void | fillMailListView (KshowmailView *view, TQString &account) |
int | showSelectedHeaders (TQString &account) |
void | writeToMoveLog (FilterLog *log, int number, TQString account, TQString mailbox) |
void | writeToDeleteLog (FilterLog *log, int number, TQString account) |
void | setMarkAtNextViewRefresh (int number) |
Static Public Attributes | |
static const int | continueShowHeaders |
static const int | cancelShowHeaders |
The mails are objects of ShowRecordElem. Inherits TQPtrList.
ShowRecord::ShowRecord | ( | ) |
Constructor
ShowRecord::~ShowRecord | ( | ) |
Destructor Does nothing.
void ShowRecord::saveOptions | ( | TQDomDocument & | doc, | |
TQDomElement & | 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 | ( | TQDomElement & | 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, | |
TQString | 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 |
TQStringList ShowRecord::getSelectedSubjects | ( | ) | const |
Returns the subjects of the selected mails.
TQString ShowRecord::getSenderOf | ( | int | number | ) | const |
Returns the sender of the mail with the given number.
number | mail number |
TQString ShowRecord::getDateOf | ( | int | number | ) | const |
Returns the date of sent of the mail with the given number.
number | mail number |
TQString ShowRecord::getSizeOf | ( | int | number | ) | const |
Returns the size of the mail with the given number.
number | mail number |
TQString ShowRecord::getSubjectOf | ( | int | number | ) | const |
Returns the subject of the mail with the given number.
number | mail number |
TQString ShowRecord::decodeMailBody | ( | TQByteArray | 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 | ( | TQString | 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 | ( | TQString | 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, | |
TQString | 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, | |
TQString | header | |||
) |
Sets the header of the given mail.
number | number of the mail | |
header | the header |
TQStringList ShowRecord::getUIDsOfOldMails | ( | ) |
Returns a list of the UIDs of all old mails.
TQString ShowRecord::getHeaderOf | ( | TQString | uid | ) |
Returns the header of the mail with the given UID.
uid | UID |
void ShowRecord::setHeader | ( | TQString | uid, | |
TQString | 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, | |
TQString & | 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 | ( | TQString & | 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, | |||
TQString | account, | |||
TQString | 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, | |||
TQString | 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.