kshowmail.kdevelop: ShowRecord Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ShowRecord Class Reference

List which contains all mails of an account. More...

`#include <showrecord.h>`

List of all members.

## 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

## Detailed Description

List which contains all mails of an account.

The mails are objects of ShowRecordElem. Inherits QPtrList.

See also:
  ShowRecordElem

Author:
  Eggert Ehmke

  Ulrich Weigelt

## Constructor & Destructor Documentation

ShowRecord::ShowRecord | ( |  | ) |

Constructor

ShowRecord::~ShowRecord | ( |  | ) |

Destructor Does nothing.

## Member Function Documentation

void ShowRecord::saveOptions | ( | QDomDocument & | doc,
|  | QDomElement & | parent |
| ) |  |  |

Saves all stored mails into the given DOM document inside the given account element.

Parameters:

  | 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.

Parameters:

  | 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.

Parameters:

  | 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.

Returns:
  TRUE - there are selected mails

  FALSE - there aren't selected mails

MailNumberList_Type ShowRecord::getSelectedMails | ( |  | ) |

Returns the numbers of all selected mails.

Returns:
  numbers of selected mails.

void ShowRecord::removeMail | ( | int | number | ) |

Removes the mail which has the given number.

Parameters:

  | number | number of the mail which will be removed

QStringList ShowRecord::getSelectedSubjects | ( |  | ) | const

Returns the subjects of the selected mails.

Returns:
  subjects of selected mails

QString ShowRecord::getSenderOf | ( | int | number | ) | const

Returns the sender of the mail with the given number.

Parameters:

  | number | mail number

Returns:
  sender

QString ShowRecord::getDateOf | ( | int | number | ) | const

Returns the date of sent of the mail with the given number.

Parameters:

  | number | mail number

Returns:
  date

QString ShowRecord::getSizeOf | ( | int | number | ) | const

Returns the size of the mail with the given number.

Parameters:

  | number | mail number

Returns:
  size

QString ShowRecord::getSubjectOf | ( | int | number | ) | const

Returns the subject of the mail with the given number.

Parameters:

  | number | mail number

Returns:
  subject

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.

Parameters:

  | body | the encoded mail (including header)
  | number | number of the downloaded mail
  | preferHTML | decode HTML part if present

Returns:
  decoded mail body

bool ShowRecord::hasMail | ( | QString | uid | ) |

Returns whether there is mail with the given uid in the list.

Parameters:

  | uid | UID of the mail

Returns:
  TRUE - mail is in the list

  FALSE - mail is not in the list

bool ShowRecord::isNew | ( | QString | uid | ) | const

Returns whether the given mail is new.

Parameters:

  | uid | UID of the mail

Returns:
  TRUE - mail is new

  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.

Parameters:

  | 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.

Parameters:

  | number | number of the mail
  | size | mail size

Types::MailNumberList_Type ShowRecord::getNewMails | ( |  | ) |

Returns the numbers of mails which are marked as new.

Returns:
  numbers of the new mails

void ShowRecord::setHeader | ( | int | number,
|  | QString | header |
| ) |  |  |

Sets the header of the given mail.

Parameters:

  | number | number of the mail
  | header | the header

QStringList ShowRecord::getUIDsOfOldMails | ( |  | ) |

Returns a list of the UIDs of all old mails.

Returns:
  UIDs of all old mails

QString ShowRecord::getHeaderOf | ( | QString | uid | ) |

Returns the header of the mail with the given UID.

Parameters:

  | uid | UID

Returns:
  mail header

void ShowRecord::setHeader | ( | QString | uid,
|  | QString | header |
| ) |  |  |

Sets the header of the mail with the given UID.

Parameters:

  | uid | UID
  | header | mail header

int ShowRecord::getNumberNewMails | ( |  | ) |

Returns the number of new mails.

Returns:
  number of new mails

int ShowRecord::getNumberMails | ( |  | ) |

Returns the number of mails.

Returns:
  number of mails

long ShowRecord::getTotalSize | ( |  | ) |

Returns the total size of all mails.

Returns:
  total size

void ShowRecord::fillMailListView | ( | KshowmailView * | view,
|  | QString & | account |
| ) |  |  |

Creates for every mail a list view item and insert it into the mail list view.

Parameters:

  | view | pointer to the application view
  | account | account name

int ShowRecord::showSelectedHeaders | ( | QString & | account | ) |

Shows the headers of all selected mails.

Parameters:

  | account | account name

Returns:
  continueShowHeaders - the user has always clicked OK. The invoking function will show the next header

  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.

Parameters:

  | 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.

Parameters:

  | 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.

Parameters:

  | number | number of the mail

## Member Data Documentation

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.

The documentation for this class was generated from the following files:

- Daten/Documents/programmieren/kshowmail/kshowmail/kshowmail/showrecord.h
- Daten/Documents/programmieren/kshowmail/kshowmail/kshowmail/showrecord.cpp