#include <showrecord.h>
Public Member Functions | |
ShowRecord () | |
~ShowRecord () | |
void | saveOptions (QDomDocument &doc, QDomElement &parent) |
void | readStoredMails (QDomElement &parent) |
void | applyFilters () |
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) |
Static Public Attributes | |
static const int | continueShowHeaders |
static const int | cancelShowHeaders |
The mails are objects of ShowRecordElem. Inherits QPtrList.
Definition at line 54 of file showrecord.h.
ShowRecord::ShowRecord | ( | ) |
Constructor
Definition at line 23 of file showrecord.cpp.
ShowRecord::~ShowRecord | ( | ) |
Destructor Does nothing.
Definition at line 30 of file showrecord.cpp.
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 |
Definition at line 34 of file showrecord.cpp.
Referenced by ConfigElem::saveOptions().
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) |
Definition at line 44 of file showrecord.cpp.
References ShowRecordElem::readOptions().
Referenced by ConfigElem::readStoredMails().
void ShowRecord::applyFilters | ( | ) |
Apply the filters to the mails in this list.
Definition at line 72 of file showrecord.cpp.
Referenced by ConfigElem::applyFilters().
bool ShowRecord::hasSelectedMails | ( | ) |
Returns whether there are mails in this list which are selected in the list view.
FALSE - there aren't selected mails
Definition at line 82 of file showrecord.cpp.
References ShowRecordElem::isSelected().
Referenced by ConfigElem::deleteSelectedMails(), ConfigElem::hasSelectedMails(), and ConfigElem::showSelectedMails().
MailNumberList_Type ShowRecord::getSelectedMails | ( | ) |
Returns the numbers of all selected mails.
Definition at line 103 of file showrecord.cpp.
References ShowRecordElem::isSelected(), and ShowRecordElem::number().
Referenced by ConfigElem::deleteSelectedMails(), and ConfigElem::showSelectedMails().
void ShowRecord::removeMail | ( | int | number | ) |
Removes the mail which has the given number.
number | number of the mail which will be removed |
Definition at line 123 of file showrecord.cpp.
References ShowRecordElem::number().
Referenced by ConfigElem::slotMailDeleted().
QStringList ShowRecord::getSelectedSubjects | ( | ) | const |
Returns the subjects of the selected mails.
Definition at line 140 of file showrecord.cpp.
References ShowRecordElem::isSelected(), and ShowRecordElem::subject().
Referenced by ConfigElem::getSelectedSubjects().
QString ShowRecord::getSenderOf | ( | int | number | ) | const |
Returns the sender of the mail with the given number.
number | mail number |
Definition at line 160 of file showrecord.cpp.
References ShowRecordElem::from(), and ShowRecordElem::number().
Referenced by ConfigElem::slotBodyDownloaded().
QString ShowRecord::getDateOf | ( | int | number | ) | const |
Returns the date of sent of the mail with the given number.
number | mail number |
Definition at line 183 of file showrecord.cpp.
References ShowRecordElem::date(), and ShowRecordElem::number().
Referenced by ConfigElem::slotBodyDownloaded().
QString ShowRecord::getSizeOf | ( | int | number | ) | const |
Returns the size of the mail with the given number.
number | mail number |
Definition at line 207 of file showrecord.cpp.
References ShowRecordElem::number(), and ShowRecordElem::strSizePrefix().
Referenced by ConfigElem::slotBodyDownloaded().
QString ShowRecord::getSubjectOf | ( | int | number | ) | const |
Returns the subject of the mail with the given number.
number | mail number |
Definition at line 231 of file showrecord.cpp.
References ShowRecordElem::number(), and ShowRecordElem::subject().
Referenced by ConfigElem::slotBodyDownloaded().
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 |
Definition at line 255 of file showrecord.cpp.
References ShowRecordElem::decodeMailBody(), and ShowRecordElem::number().
Referenced by ConfigElem::slotBodyDownloaded().
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
Definition at line 279 of file showrecord.cpp.
References ShowRecordElem::uidl().
Referenced by ConfigElem::slotUIDsReceived().
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
Definition at line 537 of file showrecord.cpp.
References ShowRecordElem::isNew(), and ShowRecordElem::uidl().
Referenced by ConfigElem::slotUIDsReceived().
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 |
Definition at line 299 of file showrecord.cpp.
Referenced by ConfigElem::slotUIDsReceived().
void ShowRecord::printMailList | ( | ) |
Just for debugging. Prints a list of all contained mails to stdout.
Definition at line 309 of file showrecord.cpp.
References ShowRecordElem::isNew(), ShowRecordElem::number(), ShowRecordElem::size(), ShowRecordElem::subject(), and ShowRecordElem::uidl().
void ShowRecord::setSize | ( | int | number, | |
long | size | |||
) |
Sets the size of a mail.
number | number of the mail | |
size | mail size |
Definition at line 325 of file showrecord.cpp.
References ShowRecordElem::number(), and ShowRecordElem::setSize().
Referenced by ConfigElem::slotSizesReceived().
Types::MailNumberList_Type ShowRecord::getNewMails | ( | ) |
Returns the numbers of mails which are marked as new.
Definition at line 346 of file showrecord.cpp.
References ShowRecordElem::isNew(), and ShowRecordElem::number().
Referenced by ConfigElem::getHeaders().
void ShowRecord::setHeader | ( | int | number, | |
QString | header | |||
) |
Sets the header of the given mail.
number | number of the mail | |
subject | the subject |
Definition at line 366 of file showrecord.cpp.
References ShowRecordElem::number(), and ShowRecordElem::setHeader().
Referenced by ConfigElem::copyHeaders(), and ConfigElem::slotHeaderDownloaded().
QStringList ShowRecord::getUIDsOfOldMails | ( | ) |
Returns a list of the UIDs of all old mails.
Definition at line 387 of file showrecord.cpp.
References ShowRecordElem::isNew(), and ShowRecordElem::uidl().
Referenced by ConfigElem::copyHeaders().
QString ShowRecord::getHeaderOf | ( | QString | uid | ) |
Returns the header of the mail with the given UID.
uid | UID |
Definition at line 407 of file showrecord.cpp.
References ShowRecordElem::header(), and ShowRecordElem::uidl().
Referenced by ConfigElem::copyHeaders().
void ShowRecord::setHeader | ( | QString | uid, | |
QString | header | |||
) |
Sets the header of the mail with the given UID.
uid | UID | |
header | mail header |
Definition at line 430 of file showrecord.cpp.
References ShowRecordElem::setHeader(), and ShowRecordElem::uidl().
int ShowRecord::getNumberNewMails | ( | ) |
Returns the number of new mails.
Definition at line 451 of file showrecord.cpp.
References ShowRecordElem::isNew().
Referenced by ConfigElem::getNumberNewMails().
int ShowRecord::getNumberMails | ( | ) |
Returns the number of mails.
Definition at line 470 of file showrecord.cpp.
Referenced by ConfigElem::getNumberMails().
long ShowRecord::getTotalSize | ( | ) |
Returns the total size of all mails.
Definition at line 475 of file showrecord.cpp.
References ShowRecordElem::size().
Referenced by ConfigElem::getTotalSize().
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 |
Definition at line 492 of file showrecord.cpp.
References ShowRecordElem::content(), ShowRecordElem::date(), ShowRecordElem::from(), KshowmailView::insertMail(), ShowRecordElem::number(), ShowRecordElem::setViewItem(), ShowRecordElem::size(), ShowRecordElem::state(), ShowRecordElem::strUnixTime(), ShowRecordElem::subject(), and ShowRecordElem::to().
Referenced by ConfigElem::fillMailListView().
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.
Definition at line 518 of file showrecord.cpp.
References cancelShowHeaders, continueShowHeaders, ShowRecordElem::continueShowHeaders, ShowRecordElem::isSelected(), and ShowRecordElem::showHeader().
Referenced by ConfigElem::showSelectedHeaders().
int const ShowRecord::continueShowHeaders [static] |
Returned by showSelectedHeaders() if the user has always clicked OK.
Definition at line 63 of file showrecord.h.
Referenced by showSelectedHeaders(), and ConfigElem::showSelectedHeaders().
int const ShowRecord::cancelShowHeaders [static] |
Returned by showSelectedHeaders() if the user has clicked Cancel.
Definition at line 69 of file showrecord.h.
Referenced by showSelectedHeaders().