# ConfigElem Class Reference

Represents a mail account. More...

`#include <configelem.h>`

List of all members.

## Signals

void | sigDeleteReady (TQString account)
void | sigShowBodiesReady (TQString account)
void | sigConfigChanged ()
void | sigMessageWindowOpened ()
void | sigMessageWindowClosed ()
void | sigRefreshReady (TQString account)

## Public Member Functions

| ConfigElem ()
| ConfigElem (ConfigList *config)
| ConfigElem (ConfigElem *pElem)
| ConfigElem (ConfigList *config, const TQString &account)
| ~ConfigElem ()
bool | isActive () const
void | setActive (bool active)
TQString | getAccountName () const
void | setAccountName (TQString name)
TQString | getPassword () const
void | setPassword (const TQString &password)
bool | hasPassword () const
KURL | getURL () const
void | setListViewItem (TQListViewItem *item)
TQListViewItem * | getListViewItem ()
bool | isSelected () const
void | clearMailList ()
void | setHost (const TQString &host)
TQString | getHost () const
void | setProtocol (const TQString &protocol)
TQString | getProtocol (bool upperCase=false) const
void | setTLS (bool tls)
bool | getTLS () const
void | setPort (unsigned short int port)
unsigned short int | getPort () const
void | setUser (const TQString &user)
TQString | getUser () const
void | setPasswordStorage (int storage)
int | getPasswordStorage () const
void | saveOptions (TQDomDocument &doc, TQDomElement &parent)
void | readStoredMails (TQDomElement &parent)
int | count ()
void | deleteSelectedMails ()
void | showSelectedMails ()
bool | assertPassword (bool force=false)
Types::AccountState_Type | getState ()
TQStringList | getSelectedSubjects () const
bool | hasSelectedMails ()
void | refreshMailList (FilterLog *log=NULL)
int | getNumberNewMails ()
int | getNumberMails ()
long | getTotalSize ()
void | fillMailListView (KshowmailView *view)
void | refreshAccountListItem ()
void | killPOP3Job ()
int | showSelectedHeaders ()
void | printSetup () const
void | reloadFilterSettings ()

## Static Public Attributes

static const int | continueShowHeaders
static const int | cancelShowHeaders

## Protected Member Functions

bool | isSpam (TQByteArray mail) const
bool | isSpamAssassinRunning () const

## Private Slots

void | slotMailDeleted (TDEIO::Job *job)
void | slotFinalizeDeletion (TDEIO::Job *)
void | slotBodyDownloaded (TDEIO::Job *job)
void | slotMailDownloadedForAction (TDEIO::Job *job)
void | slotDataMailBody (TDEIO::Job *, const TQByteArray &datas)
void | slotFinalizeShowMail (TDEIO::Job *)
void | slotTimeout ()
void | slotReceiveUID (TDEIO::Job *, const TQByteArray &data)
void | slotUIDsReceived (TDEIO::Job *job)
void | slotReceiveSize (TDEIO::Job *, const TQByteArray &data)
void | slotSizesReceived (TDEIO::Job *job)
void | slotFinalizeRefresh (TDEIO::Job *)
void | slotHeaderDownloaded (TDEIO::Job *job)
void | slotReceiveHeader (TDEIO::Job *, const TQByteArray &data)

## Private Member Functions

void | init ()
void | deleteNextMail ()
void | commitDeletion ()
void | showNextMail ()
void | commitDownloading ()
void | startKIOJob (const TQString &path)
unsigned int | getTimeoutTime ()
void | getUIDs ()
void | getSizes ()
void | getHeaders ()
void | getNextHeader ()
void | copyHeaders ()
void | applyFilters ()
void | applyFiltersDeleted ()
void | cancelRefresh ()
void | commitRefresh ()
void | swapMailLists ()
void | doDownloadActions ()
void | getNextMailForDownloadActions ()
bool | isMailDir (const TQDir &path)
bool | writeToMailBox (const TQString &mail, const TQString &box)

## Private Attributes

ConfigList * | appConfig
FilterLog * | FLog
Types::AccountState_Type | state
int | PasswordStorage
bool | m_bActive
TQString | m_strAccount
TQListViewItem * | m_pViewItem
ShowRecord * | m_pshowrecord
KURL | m_url
int | secureLoginType
bool | useTLS
TQByteArray | mailbody
MailNumberList_Type | MailsToDelete
MailToDownloadMap_Type | MailsToDownload
MailNumberList_Type | MailsToShow
MailNumberList_Type | newMails
TDEIO::TransferJob * | pop3Job
TQTimer * | pop3Timer
ShowRecord * | tempMailList
TQStringList | receivedUIDs
TQStringList | receivedSizes
TQByteArray | receivedHeader
HeaderFilter | headerFilter
bool | filterApplied
bool | deletionPerformedByFilters
bool | refreshPerformedByFilters
bool | downloadActionsInvoked
int | moveCounter

## Detailed Description

Represents a mail account.

Contains all datas of the account like server, user password and so on. It also contains the mails read from the server. Used in class ConfigList and ConfigAccounts.

See also:
  ShowRecord

  ConfigList

  ConfigAccounts::Accounts

Author:
  Eggert Ehmke <eggert.ehmke@berlin.de>

  Ulrich Weigelt <ulrich.weigelt@gmx.de>

## Constructor & Destructor Documentation

ConfigElem::ConfigElem | ( |  | ) |

General Constructor Warning: The pointer to the application configuration (ConfigList) will not be set.

ConfigElem::ConfigElem | ( | ConfigList * | config | ) |

Default Constructor

Parameters:

  | config | pointer to the general app configuration

ConfigElem::ConfigElem | ( | ConfigElem * | pElem | ) |

Copy Constructor. It doesn't copy the mail list but creates a new empty one. The pointer to the appropriate account list view item is set to NULL.The new account is active by default.

Parameters:

  | pElem | the account which will be copied

ConfigElem::ConfigElem | ( | ConfigList * | config,
|  | const TQString & | account |
| ) |  |  |

Constructs a account which is called like the given name. Creates a empty mail list. Sets the pointer to the appropriate account list view item to NULL. The account is deactivated by default. The url doesn't contain any server informations.

Parameters:

  | config | pointer to the general app configuration
  | account | name of the new account

ConfigElem::~ConfigElem | ( |  | ) |

Destructor Does nothing.

## Member Function Documentation

bool ConfigElem::isActive | ( |  | ) | const

Returns whether the account is active.

Returns:
  TRUE - account is active; FALSE - account is not active

void ConfigElem::setActive | ( | bool | active | ) |

Sets the account active.

Parameters:

  | active | TRUE - active account; FALSE - deactivate account

TQString ConfigElem::getAccountName | ( |  | ) | const

Gets the account name.

Returns:
  account name

void ConfigElem::setAccountName | ( | TQString | name | ) |

Sets the account name.

Parameters:

  | name | the account name

TQString ConfigElem::getPassword | ( |  | ) | const

Gets the account password.

Returns:
  password

void ConfigElem::setPassword | ( | const TQString & | password | ) |

Sets the account password. To save it in the configuration file call saveOptions().

Parameters:

  | password | new password

bool ConfigElem::hasPassword | ( |  | ) | const

Returns whether a password is stored.

Returns:
  TRUE - there is password stored; FALSE - no password stored

KURL ConfigElem::getURL | ( |  | ) | const

Returns the url of this account.

Returns:
  url

void ConfigElem::setListViewItem | ( | TQListViewItem * | item | ) |

Sets the pointer to the item in the account list view item.

See also:
  m_pViewItem

Parameters:

  | item | account list view item

TQListViewItem * ConfigElem::getListViewItem | ( |  | ) |

Returns the pointer to the account list view item.

See also:
  m_pViewItem

Returns:
  pointer to the appropriate list view item

bool ConfigElem::isSelected | ( |  | ) | const

Returns TRUE, if the appropriate list view item is selected.

Returns:
  TRUE - list view item is selected

  FALSE - list view item is not selected

void ConfigElem::clearMailList | ( |  | ) |

Clears the mail list or creates a new one.

void ConfigElem::setHost | ( | const TQString & | host | ) |

Sets the host name.

Parameters:

  | host | host name

TQString ConfigElem::getHost | ( |  | ) | const

Returns the hostname.

Returns:
  the name of the host or TQString::null if no host is set

void ConfigElem::setProtocol | ( | const TQString & | protocol | ) |

Sets the protocol.

Parameters:

  | protocol | the protocol

TQString ConfigElem::getProtocol | ( | bool | upperCase = `false` | ) | const

Returns the protocol.

Parameters:

  | upperCase | TRUE - transforms the protocol string to upper case

Returns:
  protocol

void ConfigElem::setTLS | ( | bool | tls | ) |

Enable or disable TLS.

Parameters:

  | tls | TRUE: use TLS; FALSE: don't use TLS

bool ConfigElem::getTLS | ( |  | ) | const

Returns whether TLS is enabled.

Returns:
  TRUE: TLS is enabled

  FALSE: TLS is disabled

void ConfigElem::setPort | ( | unsigned short int | port | ) |

Sets the port.

Parameters:

  | port | the port

unsigned short int ConfigElem::getPort | ( |  | ) | const

Returns the port number.

Returns:
  port number

void ConfigElem::setUser | ( | const TQString & | user | ) |

Sets the user.

Parameters:

  | user | username

TQString ConfigElem::getUser | ( |  | ) | const

Returns the user name.

Returns:
  the user name or TQString::null if there is no user name

void ConfigElem::setPasswordStorage | ( | int | storage | ) |

Sets the password storage type. The Constants are defined in constants.h

Parameters:

  | storage | type of password storage; valid values are: CONFIG_VALUE_ACCOUNT_PASSWORD_DONT_SAVE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_FILE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_TDEWALLET

int ConfigElem::getPasswordStorage | ( |  | ) | const

Returns the password storage type. The Constants are defined in constants.h.

Returns:
  type of password storage; valid values are: CONFIG_VALUE_ACCOUNT_PASSWORD_DONT_SAVE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_FILE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_TDEWALLET

void ConfigElem::saveOptions | ( | TQDomDocument & | doc,
|  | TQDomElement & | parent |
| ) |  |  |

Saves the stored mails into the given DOM document. It doesn't create a new DOM element but used the given one. Saves the setup into the application config.

Parameters:

  | doc | DOM document which contains all application settings, mails and account settings
  | parent | DOM element in which all settings and mails of this account will be saved

void ConfigElem::readStoredMails | ( | TQDomElement & | parent | ) |

Gets the stored mails.

Parameters:

  | parent | DOM element which contains the mails of this account

int ConfigElem::count | ( |  | ) |

Returns the number of stored mails.

Returns:
  number of mails

void ConfigElem::deleteSelectedMails | ( |  | ) |

Deletes all selected mails. This just starts the deletion and returns after then. When the deletion is ready the signal sigDeleteReady will be emitted.

void ConfigElem::showSelectedMails | ( |  | ) |

Downloads and shows the bodies of all selected mails. This just starts the download and returns after then. When the download is ready and the body is shown the sigShowBodiesReady will be emitted.

bool ConfigElem::assertPassword | ( | bool | force = `false` | ) |

Opens a dialog to ask for a password, stores it temporarily in the account settings and emits the signal sigConfigChanged. Does not open a dialog if a password is already stored in the account settings.

Parameters:

  | force | ask for a new password even if a password is stored

Returns:
  TRUE - a password is available

  FALSE - no password is available

Types::AccountState_Type ConfigElem::getState | ( |  | ) |

Returns the state of the account.

Returns:
  account state

TQStringList ConfigElem::getSelectedSubjects | ( |  | ) | const

Returns the subjects of the selected mails.

Returns:
  subjects of selected mails

bool ConfigElem::hasSelectedMails | ( |  | ) |

Returns whether there are mails in the list that are selected in the list view.

Returns:
  TRUE - there are selected mails

  FALSE - there aren't selected mails

void ConfigElem::refreshMailList | ( | FilterLog * | log = `NULL` | ) |

Refreshes the mail list. This just starts the refresh and returns after then. When the refresh is ready, the signal sigRefreshReady will be emitted.

Parameters:

  | log | Pointer to the filter log

See also:
  sigRefreshReady

int ConfigElem::getNumberNewMails | ( |  | ) |

Returns the number of new mails.

Returns:
  number of new mails

int ConfigElem::getNumberMails | ( |  | ) |

Returns the number of mails.

Returns:
  number of mails

long ConfigElem::getTotalSize | ( |  | ) |

Returns the total size of all mails.

Returns:
  total size

void ConfigElem::fillMailListView | ( | KshowmailView * | view | ) |

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

Parameters:

  | view | pointer to the application view

void ConfigElem::refreshAccountListItem | ( |  | ) |

Refreshes the appropriate entry of the account list (number of mails and total size) Uses the pointer to the list view item stored in m_pViewItem.

void ConfigElem::killPOP3Job | ( |  | ) |

Kills a running pop3 job.

int ConfigElem::showSelectedHeaders | ( |  | ) |

Shows the headers of all selected mails.

Returns:
  continueShowHeaders - the user has 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.

  continueShowHeaders - no mails of this account are selected

void ConfigElem::printSetup | ( |  | ) | const

Prints the setup to stdout.

void ConfigElem::reloadFilterSettings | ( |  | ) |

Reloads the settings of the filters. It just calls the load() methode of the header filter.

void ConfigElem::init | ( |  | ) | `[private]`

Initializes the account.

void ConfigElem::deleteNextMail | ( |  | ) | `[private]`

Deletes the first mail of MailsToDelete. After a succesful deletion this mail will be removed from the list by slotMailDeleted() and this method will be invoked again. If the list is empty, it will call commitDelete.

See also:
  slotMailDeleted()

  MailsToDelete

void ConfigElem::commitDeletion | ( |  | ) | `[private]`

Commits the deletion. Starts a pop3 job that will do the commit. Its signal result is connected with slotFinalizeDeletion().

See also:
  slotFinalizeDeletion()

void ConfigElem::showNextMail | ( |  | ) | `[private]`

Shows the body of the first mail in MailsToShow. After a succesful download and opening of the window this mail will be removed from the list by slotBodyDownloaded() and this method will be invoked again. If the list is empty, it will call commitDownloading().

See also:
  commitDownloading()

  slotBodyDownloaded()

void ConfigElem::commitDownloading | ( |  | ) | `[private]`

Commits the downloading of mail bodies. Starts a pop3 job that will do the commit. Its signal result is connected with slotFinalizeShowMail().

See also:
  slotFinalizeShowMail()

void ConfigElem::startKIOJob | ( | const TQString & | path | ) | `[private]`

Creates a POP3 transfer job (TDEIO Job), which will be stored in pop3Job.

Parameters:

  | path | command and parameters of the job as URL path

unsigned int ConfigElem::getTimeoutTime | ( |  | ) | `[private]`

Returns the timeout time in seconds which is stored in the general configuration of the application. Returns POP3_DEFAULT_TIMEOUT_TIME (defined in constants.h), if no time is available. Returns POP3_MINIMUM_TIMEOUT_TIME (defined in constants.h), if the get time is less than POP3_MINIMUM_TIMEOUT_TIME.

Returns:
  seconds to timeout

void ConfigElem::getUIDs | ( |  | ) | `[private]`

First step of the refresh cycle. Gets the UIDs of the available mails from the server. It starts a TDEIO job to get the UIDs. The UIDs will be stored in receivedUIDs by slotReceiveUID(). When the job is ready, it will invoke slotUIDsReceived().

void ConfigElem::getSizes | ( |  | ) | `[private]`

Second step of the refresh cycle. Gets the sizes of the available mails from the server. It starts a TDEIO job to get these. The Sizes will be temporarily stored in receivedSizes by slotReceiveSize(). When the job is ready, it will invoke slotSizesReceived().

void ConfigElem::getHeaders | ( |  | ) | `[private]`

Third step of the refresh cycle. Gets the header of the new mails from the server.

void ConfigElem::getNextHeader | ( |  | ) | `[private]`

Get the header of the first mail in newMails. After a succesful download this mail will be removed from the list by slotHeaderDownloaded() and this method will be invoked again. If the list is empty, it will call copyHeaders() to get the known headers from the old mail list (m_pshowrecord).

See also:
  copyHeaders()

  slotHeaderDownloaded()

void ConfigElem::copyHeaders | ( |  | ) | `[private]`

Fourth step of the refresh cycle. Copies the known headers of the old mails from the old mail list to the new one. At the end it invokes swapMailLists().

void ConfigElem::applyFilters | ( |  | ) | `[private]`

Sixth step of the refresh cycle. Applies the filters to the mails in the mail list. Invoked by swapMailLists(). This methode maybe starts a new refresh cycle because after a deletion or moving we need a actual list of mails on the server. To avoid a never-ending loop you must not call this methode during the second refresh cycle. Therefore it sets filterApplied to TRUE.

See also:
  filterApplied

  applyFiltersDeleted()

void ConfigElem::applyFiltersDeleted | ( |  | ) | `[private]`

If there are mails to delete by filters applyFilters will call the regular deletion cycle of this class with set byFilter-flag. Therefore the deletion will not branch to commitDeletion() but to this methode. This performs a second refresh cycle to get an effective mail list from the server. This new cycle will not apply the filters again, because the flag filterApplied is set to TRUE.

See also:
  applyFilters()

  filterApplied

void ConfigElem::cancelRefresh | ( |  | ) | `[private]`

Cancels the refresh. Will be invoked, when a pop3 job has reported an error.

void ConfigElem::commitRefresh | ( |  | ) | `[private]`

Commits the refresh. Starts a pop3 job that will do the commit. Its signal result is connected with slotFinalizeRefresh(). Invoked by copyHeaders() if the filters was applied or applyFilters() if not second refresh was necessary.

See also:
  slotFinalizeRefresh()

  applyFilters()

void ConfigElem::swapMailLists | ( |  | ) | `[private]`

Fifth step of the refresh cycle. Copies the pointer to the temporary list to m_pshowrecord. Invoked by copyHeaders() and slotUIDsReceived(). The temporary list will be the current mail list. At the end it invokes commitRefresh() if the filters were applied (filterApplied == TRUE) or deactive or it invokes applyFilters() if the filters were not applied (filterApplied == FALSE).

See also:
  m_pshowrecord

  copyHeaders()

  slotUIDsReceived()

  commitRefresh()

  filterApplied

void ConfigElem::doDownloadActions | ( |  | ) | `[private]`

Does all filter actions for which we have to download the mails These are: Moving, spam check It doesn't removes they from the server.

void ConfigElem::getNextMailForDownloadActions | ( |  | ) | `[private]`

Gets the body of the first mail in MailsToDownload. After a succesful download and writing into the mailbox this mail will be removed from the list by slotMailDownloadedforDownloadActions() and this method will be invoked again. If the list is empty, it will call applyFilters() to continue the filtering.

See also:
  applyFilters()

  slotMailDownloadedforDownloadActions()

bool ConfigElem::isMailDir | ( | const TQDir & | path | ) | `[private]`

Returns whether the given directory is a maildir directory

Parameters:

  | path | the directory for test

Returns:
  TRUE - directory is a maildir directory

bool ConfigElem::writeToMailBox | ( | const TQString & | mail,
|  | const TQString & | box |
| ) |  |  | `[private]`

Writes the given mail into the mailbox.

Parameters:

  | mail | the Mail
  | box | path to the mailbox

Returns:
  TRUE - Writing was succesful

void ConfigElem::slotMailDeleted | ( | TDEIO::Job * | job | ) | `[private, slot]`

Connected with signal result of the launched pop3 job. Removes the deleted mail from the internal mail list (m_pshowrecord). Removes the first mail from MailsToDelete and invokes deleteNextMail() again to delete the next mail. If the list is empty after it has removed the first item, it will call commitDelete(). If an error is occured, it will call slotFinalizeDeletion().

Parameters:

  | job | job which has emit the result signal

See also:
  deleteNextMail()

  MailsToDelete

  pop3Job

  slotFinalizeDeletion()

void ConfigElem::slotFinalizeDeletion | ( | TDEIO::Job * |  | ) | `[private, slot]`

Connected with the signal result of the job which commits the deletion. Finalizes the deletion of mails. Emits signal sigDeleteReady.

See also:
  deleteNextMail()

  slotMailDeleted()

  sigDeleteReady

void ConfigElem::slotBodyDownloaded | ( | TDEIO::Job * | job | ) | `[private, slot]`

Connected with signal result of the launched pop3 job to download a mail body. Opens a window (class ShowMailDialog) with the downloaded mail body. Removes the first mail from MailsToShow and invokes showNextMail() again to show the next mail. If the list is empty after it has removed the first item, it will call commitDownloading(). If an error is occured, it will call slotFinalizeShowMail().

Parameters:

  | job | job which has emit the result signal

See also:
  showNextMail()

  commitDownloading()

  MailsToShow

  pop3Job

  slotFinalizeShowMail()

  ShowMailDialog

void ConfigElem::slotMailDownloadedForAction | ( | TDEIO::Job * | job | ) | `[private, slot]`

Connected with signal result of the launched pop3 job to download a mail to write it into a mailbox or do a spam check. Maybe it puts the number of the downloaded mail into the list of mails to delete (MailsToDelete). Removes the first mail from MailsToMove and invokes getNextMailForMove() again to get and write the next mail. If the list is empty after it has removed the first item, it will call applyFilters() to continue the filtering. If an error is occured the current mail will not put into MailsToDelete. And it returns to applyFilters() immediately.

Parameters:

  | job | job which has emit the result signal

See also:
  MailsToDownload

  getNextMailForDownloadActions()

  applyFilters()

void ConfigElem::slotDataMailBody | ( | TDEIO::Job * | ,
|  | const TQByteArray & | datas |
| ) |  |  | `[private, slot]`

Connected with signal data of the launched pop3 job to download a mail body. Receives the downloaded data from the job. This lot will be called several times during the donwload. At the last one the array is empty. It extracts the body from the downloaded data and stores it in DownloadedMailBody.

Parameters:

  | datas | the downloaded mail

void ConfigElem::slotFinalizeShowMail | ( | TDEIO::Job * |  | ) | `[private, slot]`

Connected with the signal result of the job which commits the download of the mail bodies. Finalizes the downloading and showing of the selected mails. Emits signal sigShowBodiesReady and sets account state to idle.

See also:
  showNextMail()

  slotBodyDownloaded()

  sigShowBodiesReady

void ConfigElem::slotTimeout | ( |  | ) | `[private, slot]`

Connected with signal timeout() of the timeout timer pop3Timer. Will be called when the timer is run down, if the pop3 job has not ended on time. It kills a running pop3 job and invokes the appropriate finalize slot of the running operation.

void ConfigElem::slotReceiveUID | ( | TDEIO::Job * | ,
|  | const TQByteArray & | data |
| ) |  |  | `[private, slot]`

Connected with the signal "data" of the pop3 transfer job which gets mail UIDs (Unique ID). Therefore it will be called when the job has received an UIDL from the server. Every received UID causes a call of this slot. When the job ends, it causes a last call but with an empty data array. The UIDs will be stored in receivedUIDs.

Parameters:

  | data | received data, which contain an uid

void ConfigElem::slotUIDsReceived | ( | TDEIO::Job * | job | ) | `[private, slot]`

Connected with signal result of the launched pop3 job to get the UIDs. Will be invoked, when all UIDs are received and stored in receivedUIDs. Analyzes the received UID datas and creates new ShowRecordElem instances in the new mail list accordingly.

Parameters:

  | job | job which has emitted the result signal

void ConfigElem::slotReceiveSize | ( | TDEIO::Job * | ,
|  | const TQByteArray & | data |
| ) |  |  | `[private, slot]`

Connected with the signal "data" of the pop3 transfer job which gets mail Sizes. Therefore it will be called when the job has received a size from the server. Every received size causes a call of this slot. When the job ends, it causes a last call but with an empty data array. The UIDs will be stored in receivedSizes.

Parameters:

  | data | received data, which contain a size

void ConfigElem::slotSizesReceived | ( | TDEIO::Job * | job | ) | `[private, slot]`

Connected with signal result of the launched pop3 job to get the Sizes. Will be invoked, when all Sizes are received and stored in receivedSizes. Analyzes the received datas and writes these in the appropriate mail instances.

Parameters:

  | job | job which has emitted the result signal

void ConfigElem::slotFinalizeRefresh | ( | TDEIO::Job * |  | ) | `[private, slot]`

Connected with signal result of the job which commits the refresh. Finalizes a succesful refresh. Emits sigRefreshReady and sets account state to idle

void ConfigElem::slotHeaderDownloaded | ( | TDEIO::Job * | job | ) | `[private, slot]`

Connected with signal result of the launched pop3 job. Stores the received headers into the appropriate instance of the mail list. Removes the first mail from newMails and invokes getNextHeader() again to get the next header. If the list is empty after it has removed the first item, it will call copyHeaders(). If an error has occured, it will call cancelRefresh().

Parameters:

  | job | job which has emit the result signal

See also:
  getNextHeader()

  newMails

  pop3Job

  cancelRefresh()

  copyHeaders()

void ConfigElem::slotReceiveHeader | ( | TDEIO::Job * | ,
|  | const TQByteArray & | data |
| ) |  |  | `[private, slot]`

Connected with the signal "data" of the pop3 transfer job which gets a mail header. Therefore it will be called when the job has received a part of the header from the server. When the job ends, it causes a last call but with an empty data array. The complete header will be stored in receivedHeader.

Parameters:

  | data | received data, which contains a header part

void ConfigElem::sigDeleteReady | ( | TQString | account | ) | `[signal]`

Will be emitted when all selected mails are deleted.

Parameters:

  | account | name of the account, which has emitted this signal

void ConfigElem::sigShowBodiesReady | ( | TQString | account | ) | `[signal]`

Will be emitted when the bodies of all selected mails are downloaded and shown.

Parameters:

  | account | name of the account, which has emitted this signal

void ConfigElem::sigConfigChanged | ( |  | ) | `[signal]`

Will be emitted when the settings have been changed.

void ConfigElem::sigMessageWindowOpened | ( |  | ) | `[signal]`

Will be emitted, when a window to show a message was opened.

void ConfigElem::sigMessageWindowClosed | ( |  | ) | `[signal]`

Will be emitted, when a window to show a message was closed.

void ConfigElem::sigRefreshReady | ( | TQString | account | ) | `[signal]`

Will be emitted, when the mail list was refreshed.

Parameters:

  | account | name of the account, which has emitted this signal

bool ConfigElem::isSpam | ( | TQByteArray | mail | ) | const`[protected]`

Forwards the given mail to SpamAssassin and returns the test result

Parameters:

  | mail | the mail to test

Returns:
  TRUE - mail is spam

bool ConfigElem::isSpamAssassinRunning | ( |  | ) | const`[protected]`

Looks for a running spamd daemon of SpamAssassin.

Returns:
  TRUE - SpamAssassin is running

## Member Data Documentation

int const ConfigElem::continueShowHeaders `[static]`

Returned by showSelectedHeaders(), if the user has clicked OK.

int const ConfigElem::cancelShowHeaders `[static]`

Returned by showSelectedHeaders(), if the user has clicked Cancel.

ConfigList* ConfigElem::appConfig `[private]`

Pointer to the configuration of the application. Set by the constructors.

FilterLog* ConfigElem::FLog `[private]`

Pointer to the filter log. Will be set by refreshMailList() at every refresh.

Types::AccountState_Type ConfigElem::state `[private]`

State of the account.

int ConfigElem::PasswordStorage `[private]`

Type of password storage. valid values are: CONFIG_VALUE_ACCOUNT_PASSWORD_DONT_SAVE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_FILE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_TDEWALLET The Constants are defined in constants.h

See also:
  saveOptions()

  setPasswordStorage()

bool ConfigElem::m_bActive `[private]`

TRUE - account is active; FALSE - account is not active

TQString ConfigElem::m_strAccount `[private]`

Account Name

TQListViewItem* ConfigElem::m_pViewItem `[private]`

Pointer to the appropriate item in the account list view.

ShowRecord* ConfigElem::m_pshowrecord `[private]`

List which contains all read mails from the server.

KURL ConfigElem::m_url `[private]`

Uniform Resource Locator of the account on the pop3 server.

int ConfigElem::secureLoginType `[private]`

Type of secure login. See constants.h for valid values (CONFIG_VALUE_ACCOUNT_SECLOGIN_...)

bool ConfigElem::useTLS `[private]`

False: TLS is enabled

TQByteArray ConfigElem::mailbody `[private]`

Contains a downloaded mail body. Will be set by slotDataMailBody() and read by slotBodyDownloaded().

MailNumberList_Type ConfigElem::MailsToDelete `[private]`

Contains the numbers of mails which will be deleted. Set by deleteSelectedMails() and applyFilters() and used by deleteNextMail() to get the number of the next mail to delete.

See also:
  deleteSelectedMails()

  deleteNextMail()

  applyFilters()

MailToDownloadMap_Type ConfigElem::MailsToDownload `[private]`

Contains the numbers of the mails shall be moved for actions like moving to mailbox or spam check. Contains also some parameters (like mailbox) about the action which have to be performed. Set and used by applyFilters().

See also:
  applyFilters()

MailNumberList_Type ConfigElem::MailsToShow `[private]`

Contains the numbers of mails for which the bodies will be shown. Set by showSelectedMails() and used by showNextMail() to get the number of the next mail to show.

See also:
  showSelectedMails()

  showNextMail()

MailNumberList_Type ConfigElem::newMails `[private]`

Contains the numbers of new mails. Set by getHeaders() and used by getNextHeader() to download the headers of the new mails.

See also:
  getHeaders()

  getNextHeader()

TDEIO::TransferJob* ConfigElem::pop3Job `[private]`

Pointer to a launched pop3 job.

TQTimer* ConfigElem::pop3Timer `[private]`

timeout timer. Will be started together with every pop3 job. If it runs down, slotTimeout() will be invoked.

ShowRecord* ConfigElem::tempMailList `[private]`

While refreshing, this ShowRecord instance will be used to build a new mail list. After that this pointer will be assigned to m_pshowrecord.

TQStringList ConfigElem::receivedUIDs `[private]`

List of received mail UIDs (unique ID). Used by slotReceiveUID() and slotUIDsReceived().

TQStringList ConfigElem::receivedSizes `[private]`

List of received mail sizes. Used by slotReceiveSize() and slotSizesReceived().

TQByteArray ConfigElem::receivedHeader `[private]`

A received mail header. Set by slotReceiveHeader() and used by slotHeaderDownloaded().

HeaderFilter ConfigElem::headerFilter `[private]`

Every account has is own header filter instance.

bool ConfigElem::filterApplied `[private]`

This is a flag whether the filters was applied during a refresh cycle. If the some mails was deleted (recommend by the filter), we need a actual list of mails from the server. Therefore a second refresh cycle will be started. To avoid a never-ending loop this flag will be set to TRUE by applyFilters(). If the second refresh is running this one will not invoke the filters.

bool ConfigElem::deletionPerformedByFilters `[private]`

This flag is set by applyFilters() to indicate the deletion cycle is performed by filters and not by user. The deletion methodes need it to decide on branch targets

bool ConfigElem::refreshPerformedByFilters `[private]`

This flag is set by applyFiltersDeleted() to indicate the refresh cycle is the second one after a deletion which was performed by filters. The refresh cycle need it to hold the remaining mails as new.

bool ConfigElem::downloadActionsInvoked `[private]`

This flag is set to TRUE by applyFilters() to indicate the mailbodies are downloading and writing to the mailboxes or spam checking. When this is ended, applyFilters() will be called again and it reset this flag

int ConfigElem::moveCounter `[private]`

Counter for moving to create an unique file name

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

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