ConfigElem Class Reference

Represents a mail account. More...

#include <configelem.h>

List of all members.

Signals

void sigDeleteReady (QString account)
void sigShowBodiesReady (QString account)
void sigConfigChanged ()
void sigMessageWindowOpened ()
void sigMessageWindowClosed ()
void sigRefreshReady (QString account)

Public Member Functions

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

Static Public Attributes

static const int continueShowHeaders
static const int cancelShowHeaders

Private Slots

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

Private Member Functions

void init ()
void deleteNextMail ()
void commitDeletion ()
void showNextMail ()
void commitDownloading ()
void startKIOJob (const QString &path)
unsigned int getTimeoutTime ()
void getUIDs ()
void getSizes ()
void getHeaders ()
void getNextHeader ()
void copyHeaders ()
void cancelRefresh ()
void commitRefresh ()

Private Attributes

ConfigListappConfig
Types::AccountState_Type state
int PasswordStorage
bool m_bActive
QString m_strAccount
QListViewItem * m_pViewItem
ShowRecordm_pshowrecord
KURL m_url
QByteArray mailbody
MailNumberList_Type MailsToDelete
MailNumberList_Type MailsToShow
MailNumberList_Type newMails
KIO::TransferJob * pop3Job
QTimer * pop3Timer
ShowRecordtempMailList
QStringList receivedUIDs
QStringList receivedSizes
QByteArray receivedHeader


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>

Definition at line 75 of file configelem.h.


Constructor & Destructor Documentation

ConfigElem::ConfigElem (  ) 

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

Definition at line 24 of file configelem.cpp.

References appConfig, init(), m_bActive, m_strAccount, and m_url.

ConfigElem::ConfigElem ( ConfigList config  ) 

Default Constructor

Parameters:
config pointer to the general app configuration

Definition at line 37 of file configelem.cpp.

References appConfig, init(), m_bActive, and m_url.

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

Definition at line 51 of file configelem.cpp.

References appConfig, getAccountName(), getURL(), init(), isActive(), m_bActive, m_strAccount, and m_url.

ConfigElem::ConfigElem ( ConfigList config,
const QString &  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

Definition at line 67 of file configelem.cpp.

References appConfig, init(), m_bActive, and m_strAccount.

ConfigElem::~ConfigElem (  ) 

Destructor Does nothing.

Definition at line 102 of file configelem.cpp.


Member Function Documentation

bool ConfigElem::isActive (  )  const

Returns whether the account is active.

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

Definition at line 139 of file configelem.cpp.

References m_bActive.

Referenced by ConfigElem(), deleteSelectedMails(), ServerDialog::fillDialog(), ConfigList::fillMailListView(), ConfigList::hasActiveAccounts(), refreshAccountListItem(), refreshMailList(), showSelectedMails(), and KshowmailView::slotAccountClicked().

void ConfigElem::setActive ( bool  active  ) 

Sets the account active.

Parameters:
active TRUE - active account; FALSE - deactivate account

Definition at line 144 of file configelem.cpp.

References m_bActive.

Referenced by ConfigList::refreshSetup(), and KshowmailView::slotAccountClicked().

QString ConfigElem::getAccountName (  )  const

Gets the account name.

Returns:
account name

Definition at line 149 of file configelem.cpp.

References m_strAccount.

Referenced by assertPassword(), ConfigList::compareItems(), ConfigElem(), ConfigList::deleteSelectedMails(), ServerDialog::fillDialog(), ConfigList::getAccount(), ConfigList::hasAccount(), ConfigList::refreshMailLists(), ConfigList::refreshSetup(), saveOptions(), and ConfigList::showSelectedMails().

void ConfigElem::setAccountName ( QString  name  ) 

Sets the account name.

Parameters:
name the account name

Definition at line 154 of file configelem.cpp.

References m_strAccount.

QString ConfigElem::getPassword (  )  const

Gets the account password.

Returns:
password

Definition at line 160 of file configelem.cpp.

References m_url.

Referenced by ServerDialog::fillDialog().

void ConfigElem::setPassword ( const QString &  password  ) 

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

Parameters:
password new password

Definition at line 165 of file configelem.cpp.

References m_url.

Referenced by assertPassword(), and ConfigList::refreshSetup().

bool ConfigElem::hasPassword (  )  const

Returns whether a password is stored.

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

Definition at line 175 of file configelem.cpp.

References m_url.

Referenced by assertPassword().

KURL ConfigElem::getURL (  )  const

Returns the url of this account.

Returns:
url

Definition at line 170 of file configelem.cpp.

References m_url.

Referenced by ConfigElem().

void ConfigElem::setListViewItem ( QListViewItem *  item  ) 

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

See also:
m_pViewItem
Parameters:
item account list view item

Definition at line 180 of file configelem.cpp.

References m_pViewItem.

QListViewItem * ConfigElem::getListViewItem (  ) 

Returns the pointer to the account list view item.

See also:
m_pViewItem
Returns:
pointer to the appropriate list view item

Definition at line 185 of file configelem.cpp.

References m_pViewItem.

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

Definition at line 190 of file configelem.cpp.

References m_pViewItem.

Referenced by ConfigList::getSelectedAccount().

void ConfigElem::clearMailList (  ) 

Clears the mail list or creates a new one.

Definition at line 201 of file configelem.cpp.

References m_pshowrecord.

void ConfigElem::setHost ( const QString &  host  ) 

Sets the host name.

Parameters:
host host name

Definition at line 211 of file configelem.cpp.

References m_url.

Referenced by ConfigList::refreshSetup().

QString ConfigElem::getHost (  )  const

Returns the hostname.

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

Definition at line 236 of file configelem.cpp.

References m_url.

Referenced by ServerDialog::fillDialog().

void ConfigElem::setProtocol ( const QString &  protocol  ) 

Sets the protocol.

Parameters:
protocol the protocol

Definition at line 216 of file configelem.cpp.

References m_url.

Referenced by ConfigList::refreshSetup().

QString ConfigElem::getProtocol ( bool  upperCase = false  )  const

Returns the protocol.

Parameters:
upperCase TRUE - transforms the protocol string to upper case
Returns:
protocol

Definition at line 1189 of file configelem.cpp.

References m_url.

Referenced by ServerDialog::fillDialog().

void ConfigElem::setPort ( unsigned short int  port  ) 

Sets the port.

Parameters:
port the port

Definition at line 221 of file configelem.cpp.

References m_url.

Referenced by ConfigList::refreshSetup().

unsigned short int ConfigElem::getPort (  )  const

Returns the port number.

Returns:
port number

Definition at line 1197 of file configelem.cpp.

References m_url.

Referenced by ServerDialog::fillDialog().

void ConfigElem::setUser ( const QString &  user  ) 

Sets the user.

Parameters:
user username

Definition at line 226 of file configelem.cpp.

References m_url.

Referenced by ConfigList::refreshSetup().

QString ConfigElem::getUser (  )  const

Returns the user name.

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

Definition at line 231 of file configelem.cpp.

References m_url.

Referenced by ServerDialog::fillDialog().

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_KWALLET

Definition at line 1171 of file configelem.cpp.

References PasswordStorage.

Referenced by ConfigList::refreshSetup().

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_KWALLET

Definition at line 1184 of file configelem.cpp.

References PasswordStorage.

Referenced by ServerDialog::fillDialog().

void ConfigElem::saveOptions ( QDomDocument &  doc,
QDomElement &  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

Definition at line 107 of file configelem.cpp.

References getAccountName(), m_bActive, m_pshowrecord, m_strAccount, and ShowRecord::saveOptions().

Referenced by ConfigList::saveOptions().

void ConfigElem::readStoredMails ( QDomElement &  parent  ) 

Gets the stored mails.

Parameters:
parent DOM element which contains the mails of this account

Definition at line 122 of file configelem.cpp.

References m_pshowrecord, and ShowRecord::readStoredMails().

Referenced by ConfigList::readStoredMails().

void ConfigElem::applyFilters (  ) 

Apply the filters to the stored mails.

See also:
ShowRecordElem::applyFilters

Definition at line 134 of file configelem.cpp.

References ShowRecord::applyFilters(), and m_pshowrecord.

int ConfigElem::count (  ) 

Returns the number of stored mails.

Returns:
number of mails

Definition at line 129 of file configelem.cpp.

References m_pshowrecord.

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.

Definition at line 241 of file configelem.cpp.

References Types::AccountDeleting, Types::AccountIdle, assertPassword(), deleteNextMail(), ShowRecord::getSelectedMails(), ShowRecord::hasSelectedMails(), isActive(), m_pshowrecord, m_strAccount, MailsToDelete, sigDeleteReady(), and state.

Referenced by ConfigList::deleteSelectedMails().

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.

Definition at line 494 of file configelem.cpp.

References Types::AccountDownloading, Types::AccountIdle, assertPassword(), ShowRecord::getSelectedMails(), ShowRecord::hasSelectedMails(), isActive(), m_pshowrecord, m_strAccount, MailsToShow, showNextMail(), sigShowBodiesReady(), and state.

Referenced by ConfigList::showSelectedMails().

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

Definition at line 276 of file configelem.cpp.

References Encryption::crypt(), getAccountName(), hasPassword(), m_url, PasswordStorage, KWalletAccess::savePassword(), setPassword(), and sigConfigChanged().

Referenced by deleteSelectedMails(), refreshMailList(), showSelectedMails(), slotBodyDownloaded(), slotMailDeleted(), and slotUIDsReceived().

Types::AccountState_Type ConfigElem::getState (  ) 

Returns the state of the account.

Returns:
account state

Definition at line 432 of file configelem.cpp.

References state.

QStringList ConfigElem::getSelectedSubjects (  )  const

Returns the subjects of the selected mails.

Returns:
subjects of selected mails

Definition at line 484 of file configelem.cpp.

References ShowRecord::getSelectedSubjects(), and m_pshowrecord.

Referenced by ConfigList::getSelectedSubjects().

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

Definition at line 489 of file configelem.cpp.

References ShowRecord::hasSelectedMails(), and m_pshowrecord.

Referenced by ConfigList::hasSelectedMails(), ConfigList::showSelectedHeaders(), and showSelectedHeaders().

void ConfigElem::refreshMailList (  ) 

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

See also:
sigRefreshReady

Definition at line 653 of file configelem.cpp.

References Types::AccountRefreshing, assertPassword(), getUIDs(), isActive(), m_strAccount, sigRefreshReady(), state, and tempMailList.

Referenced by ConfigList::refreshMailLists(), and slotUIDsReceived().

int ConfigElem::getNumberNewMails (  ) 

Returns the number of new mails.

Returns:
number of new mails

Definition at line 1075 of file configelem.cpp.

References ShowRecord::getNumberNewMails(), and m_pshowrecord.

Referenced by ConfigList::getNumberNewMails().

int ConfigElem::getNumberMails (  ) 

Returns the number of mails.

Returns:
number of mails

Definition at line 1080 of file configelem.cpp.

References ShowRecord::getNumberMails(), and m_pshowrecord.

Referenced by ConfigList::getNumberMails(), and refreshAccountListItem().

long ConfigElem::getTotalSize (  ) 

Returns the total size of all mails.

Returns:
total size

Definition at line 1085 of file configelem.cpp.

References ShowRecord::getTotalSize(), and m_pshowrecord.

Referenced by ConfigList::getTotalSize(), and refreshAccountListItem().

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

Definition at line 1090 of file configelem.cpp.

References ShowRecord::fillMailListView(), m_pshowrecord, and m_strAccount.

Referenced by ConfigList::fillMailListView().

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.

Definition at line 1095 of file configelem.cpp.

References getNumberMails(), getTotalSize(), isActive(), and m_pViewItem.

Referenced by ConfigList::refreshAccountList().

void ConfigElem::killPOP3Job (  ) 

Kills a running pop3 job.

Definition at line 1112 of file configelem.cpp.

References Types::AccountDeleting, Types::AccountDownloading, Types::AccountIdle, Types::AccountRefreshing, cancelRefresh(), pop3Job, pop3Timer, slotFinalizeDeletion(), slotFinalizeShowMail(), and state.

Referenced by ConfigList::killPOP3Jobs().

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

Definition at line 1136 of file configelem.cpp.

References cancelShowHeaders, ShowRecord::continueShowHeaders, continueShowHeaders, hasSelectedMails(), m_pshowrecord, m_strAccount, and ShowRecord::showSelectedHeaders().

Referenced by ConfigList::showSelectedHeaders().

void ConfigElem::printSetup (  )  const

Prints the setup to stdout.

Definition at line 1148 of file configelem.cpp.

References m_bActive, m_strAccount, m_url, and PasswordStorage.

Referenced by ConfigList::printSetup().

void ConfigElem::init (  )  [private]

Initializes the account.

Definition at line 82 of file configelem.cpp.

References Types::AccountIdle, m_pshowrecord, m_pViewItem, PasswordStorage, pop3Timer, slotTimeout(), and state.

Referenced by ConfigElem().

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

Definition at line 329 of file configelem.cpp.

References commitDeletion(), MailsToDelete, pop3Job, slotMailDeleted(), and startKIOJob().

Referenced by deleteSelectedMails(), and slotMailDeleted().

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()

Definition at line 437 of file configelem.cpp.

References pop3Job, slotFinalizeDeletion(), and startKIOJob().

Referenced by deleteNextMail(), and slotMailDeleted().

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()

Definition at line 530 of file configelem.cpp.

References mailbody, MailsToShow, pop3Job, slotBodyDownloaded(), slotDataMailBody(), slotFinalizeShowMail(), and startKIOJob().

Referenced by showSelectedMails(), and 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()

Definition at line 646 of file configelem.cpp.

References pop3Job, slotFinalizeShowMail(), and startKIOJob().

Referenced by slotBodyDownloaded().

void ConfigElem::startKIOJob ( const QString &  path  )  [private]

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

Parameters:
path command and parameters of the job as URL path

Definition at line 406 of file configelem.cpp.

References getTimeoutTime(), m_url, pop3Job, and pop3Timer.

Referenced by commitDeletion(), commitDownloading(), commitRefresh(), deleteNextMail(), getNextHeader(), getSizes(), getUIDs(), and showNextMail().

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

Definition at line 444 of file configelem.cpp.

References appConfig, and ConfigList::getTimeoutTime().

Referenced by startKIOJob().

void ConfigElem::getUIDs (  )  [private]

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

Definition at line 683 of file configelem.cpp.

References pop3Job, receivedUIDs, slotReceiveUID(), slotUIDsReceived(), and startKIOJob().

Referenced by refreshMailList().

void ConfigElem::getSizes (  )  [private]

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

Definition at line 870 of file configelem.cpp.

References pop3Job, receivedSizes, slotReceiveSize(), slotSizesReceived(), and startKIOJob().

Referenced by slotUIDsReceived().

void ConfigElem::getHeaders (  )  [private]

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

Definition at line 976 of file configelem.cpp.

References copyHeaders(), ShowRecord::getNewMails(), getNextHeader(), newMails, and tempMailList.

Referenced by slotSizesReceived().

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()

Definition at line 991 of file configelem.cpp.

References copyHeaders(), newMails, pop3Job, receivedHeader, slotHeaderDownloaded(), slotReceiveHeader(), and startKIOJob().

Referenced by getHeaders(), and slotHeaderDownloaded().

void ConfigElem::copyHeaders (  )  [private]

Fourth and last step of the refresh cycle. Copies the known headers of the old mails from the old mail list to the new one.

Definition at line 1044 of file configelem.cpp.

References commitRefresh(), ShowRecord::getHeaderOf(), ShowRecord::getUIDsOfOldMails(), m_pshowrecord, ShowRecord::setHeader(), and tempMailList.

Referenced by getHeaders(), getNextHeader(), and slotHeaderDownloaded().

void ConfigElem::cancelRefresh (  )  [private]

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

Definition at line 821 of file configelem.cpp.

References Types::AccountIdle, m_pshowrecord, m_strAccount, sigRefreshReady(), state, and tempMailList.

Referenced by killPOP3Job(), slotHeaderDownloaded(), slotSizesReceived(), slotTimeout(), and slotUIDsReceived().

void ConfigElem::commitRefresh (  )  [private]

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

See also:
slotFinalizeRefresh()

Definition at line 863 of file configelem.cpp.

References pop3Job, slotFinalizeRefresh(), and startKIOJob().

Referenced by copyHeaders(), and slotUIDsReceived().

void ConfigElem::slotMailDeleted ( KIO::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()

Definition at line 343 of file configelem.cpp.

References assertPassword(), commitDeletion(), deleteNextMail(), m_pshowrecord, MailsToDelete, pop3Timer, ShowRecord::removeMail(), and slotFinalizeDeletion().

Referenced by deleteNextMail().

void ConfigElem::slotFinalizeDeletion ( KIO::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

Definition at line 394 of file configelem.cpp.

References Types::AccountIdle, m_strAccount, pop3Timer, sigDeleteReady(), and state.

Referenced by commitDeletion(), killPOP3Job(), slotMailDeleted(), and slotTimeout().

void ConfigElem::slotBodyDownloaded ( KIO::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

Definition at line 549 of file configelem.cpp.

References ConfigList::allowHTML(), appConfig, assertPassword(), commitDownloading(), ShowRecord::decodeMailBody(), ShowRecord::getDateOf(), ShowRecord::getSenderOf(), ShowRecord::getSizeOf(), ShowRecord::getSubjectOf(), m_pshowrecord, m_strAccount, mailbody, MailsToShow, pop3Timer, showNextMail(), sigMessageWindowClosed(), sigMessageWindowOpened(), and slotFinalizeShowMail().

Referenced by showNextMail().

void ConfigElem::slotDataMailBody ( KIO::Job *  ,
const QByteArray &  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:
job job which has emit the data signal
datas the downloaded mail

Definition at line 633 of file configelem.cpp.

References mailbody.

Referenced by showNextMail().

void ConfigElem::slotFinalizeShowMail ( KIO::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

Definition at line 621 of file configelem.cpp.

References Types::AccountIdle, m_strAccount, pop3Timer, sigShowBodiesReady(), and state.

Referenced by commitDownloading(), killPOP3Job(), showNextMail(), slotBodyDownloaded(), and slotTimeout().

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.

Definition at line 460 of file configelem.cpp.

References Types::AccountDeleting, Types::AccountDownloading, Types::AccountIdle, Types::AccountRefreshing, appConfig, cancelRefresh(), m_strAccount, pop3Job, ConfigList::showConnectionErrors(), slotFinalizeDeletion(), slotFinalizeShowMail(), and state.

Referenced by init().

void ConfigElem::slotReceiveUID ( KIO::Job *  ,
const QByteArray &  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

Definition at line 695 of file configelem.cpp.

References receivedUIDs.

Referenced by getUIDs().

void ConfigElem::slotUIDsReceived ( KIO::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

Definition at line 707 of file configelem.cpp.

References appConfig, ShowRecord::appendNewMail(), assertPassword(), cancelRefresh(), commitRefresh(), getSizes(), ShowRecord::hasMail(), ShowRecord::isNew(), ConfigList::keepNew(), m_pshowrecord, pop3Timer, receivedUIDs, refreshMailList(), ConfigList::showConnectionErrors(), and tempMailList.

Referenced by getUIDs().

void ConfigElem::slotReceiveSize ( KIO::Job *  ,
const QByteArray &  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

Definition at line 963 of file configelem.cpp.

References receivedSizes.

Referenced by getSizes().

void ConfigElem::slotSizesReceived ( KIO::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

Definition at line 882 of file configelem.cpp.

References appConfig, cancelRefresh(), getHeaders(), pop3Timer, receivedSizes, ShowRecord::setSize(), ConfigList::showConnectionErrors(), and tempMailList.

Referenced by getSizes().

void ConfigElem::slotFinalizeRefresh ( KIO::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

Definition at line 842 of file configelem.cpp.

References Types::AccountIdle, m_pshowrecord, m_strAccount, pop3Timer, sigRefreshReady(), state, and tempMailList.

Referenced by commitRefresh().

void ConfigElem::slotHeaderDownloaded ( KIO::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()

Definition at line 1010 of file configelem.cpp.

References appConfig, cancelRefresh(), copyHeaders(), getNextHeader(), newMails, pop3Timer, receivedHeader, ShowRecord::setHeader(), ConfigList::showConnectionErrors(), and tempMailList.

Referenced by getNextHeader().

void ConfigElem::slotReceiveHeader ( KIO::Job *  ,
const QByteArray &  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

Definition at line 1062 of file configelem.cpp.

References receivedHeader.

Referenced by getNextHeader().

void ConfigElem::sigDeleteReady ( QString  account  )  [signal]

Will be emitted when all selected mails are deleted.

Parameters:
account name of the account, which has emitted this signal

Definition at line 167 of file configelem.moc.cpp.

Referenced by deleteSelectedMails(), and slotFinalizeDeletion().

void ConfigElem::sigShowBodiesReady ( QString  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

Definition at line 173 of file configelem.moc.cpp.

Referenced by showSelectedMails(), and slotFinalizeShowMail().

void ConfigElem::sigConfigChanged (  )  [signal]

Will be emitted when the settings have been changed.

Definition at line 179 of file configelem.moc.cpp.

Referenced by assertPassword().

void ConfigElem::sigMessageWindowOpened (  )  [signal]

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

Definition at line 185 of file configelem.moc.cpp.

Referenced by slotBodyDownloaded().

void ConfigElem::sigMessageWindowClosed (  )  [signal]

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

Definition at line 191 of file configelem.moc.cpp.

Referenced by slotBodyDownloaded().

void ConfigElem::sigRefreshReady ( QString  account  )  [signal]

Will be emitted, when the mail list was refreshed.

Parameters:
account name of the account, which has emitted this signal

Definition at line 197 of file configelem.moc.cpp.

Referenced by cancelRefresh(), refreshMailList(), and slotFinalizeRefresh().


Member Data Documentation

int const ConfigElem::continueShowHeaders [static]

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

Definition at line 85 of file configelem.h.

Referenced by ConfigList::showSelectedHeaders(), and showSelectedHeaders().

int const ConfigElem::cancelShowHeaders [static]

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

Definition at line 91 of file configelem.h.

Referenced by showSelectedHeaders().

ConfigList* ConfigElem::appConfig [private]

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

Definition at line 408 of file configelem.h.

Referenced by ConfigElem(), getTimeoutTime(), slotBodyDownloaded(), slotHeaderDownloaded(), slotSizesReceived(), slotTimeout(), and slotUIDsReceived().

Types::AccountState_Type ConfigElem::state [private]

State of the account.

Definition at line 413 of file configelem.h.

Referenced by cancelRefresh(), deleteSelectedMails(), getState(), init(), killPOP3Job(), refreshMailList(), showSelectedMails(), slotFinalizeDeletion(), slotFinalizeRefresh(), slotFinalizeShowMail(), and slotTimeout().

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_KWALLET The Constants are defined in constants.h

See also:
saveOptions()

setPasswordStorage()

Definition at line 422 of file configelem.h.

Referenced by assertPassword(), getPasswordStorage(), init(), printSetup(), and setPasswordStorage().

bool ConfigElem::m_bActive [private]

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

Definition at line 427 of file configelem.h.

Referenced by ConfigElem(), isActive(), printSetup(), saveOptions(), and setActive().

QString ConfigElem::m_strAccount [private]

Account Name

Definition at line 432 of file configelem.h.

Referenced by cancelRefresh(), ConfigElem(), deleteSelectedMails(), fillMailListView(), getAccountName(), printSetup(), refreshMailList(), saveOptions(), setAccountName(), showSelectedHeaders(), showSelectedMails(), slotBodyDownloaded(), slotFinalizeDeletion(), slotFinalizeRefresh(), slotFinalizeShowMail(), and slotTimeout().

QListViewItem* ConfigElem::m_pViewItem [private]

Pointer to the appropriate item in the account list view.

Definition at line 437 of file configelem.h.

Referenced by getListViewItem(), init(), isSelected(), refreshAccountListItem(), and setListViewItem().

ShowRecord* ConfigElem::m_pshowrecord [private]

List which contains all read mails from the server.

Definition at line 442 of file configelem.h.

Referenced by applyFilters(), cancelRefresh(), clearMailList(), copyHeaders(), count(), deleteSelectedMails(), fillMailListView(), getNumberMails(), getNumberNewMails(), getSelectedSubjects(), getTotalSize(), hasSelectedMails(), init(), readStoredMails(), saveOptions(), showSelectedHeaders(), showSelectedMails(), slotBodyDownloaded(), slotFinalizeRefresh(), slotMailDeleted(), and slotUIDsReceived().

KURL ConfigElem::m_url [private]

Uniform Resource Locator of the account on the pop3 server.

Definition at line 448 of file configelem.h.

Referenced by assertPassword(), ConfigElem(), getHost(), getPassword(), getPort(), getProtocol(), getURL(), getUser(), hasPassword(), printSetup(), setHost(), setPassword(), setPort(), setProtocol(), setUser(), and startKIOJob().

QByteArray ConfigElem::mailbody [private]

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

Definition at line 454 of file configelem.h.

Referenced by showNextMail(), slotBodyDownloaded(), and slotDataMailBody().

MailNumberList_Type ConfigElem::MailsToDelete [private]

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

See also:
deleteSelectedMails

deleteNextMail

Definition at line 463 of file configelem.h.

Referenced by deleteNextMail(), deleteSelectedMails(), and slotMailDeleted().

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()

Definition at line 472 of file configelem.h.

Referenced by showNextMail(), showSelectedMails(), and slotBodyDownloaded().

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()

Definition at line 481 of file configelem.h.

Referenced by getHeaders(), getNextHeader(), and slotHeaderDownloaded().

KIO::TransferJob* ConfigElem::pop3Job [private]

Pointer to a launched pop3 job.

Definition at line 486 of file configelem.h.

Referenced by commitDeletion(), commitDownloading(), commitRefresh(), deleteNextMail(), getNextHeader(), getSizes(), getUIDs(), killPOP3Job(), showNextMail(), slotTimeout(), and startKIOJob().

QTimer* ConfigElem::pop3Timer [private]

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

Definition at line 492 of file configelem.h.

Referenced by init(), killPOP3Job(), slotBodyDownloaded(), slotFinalizeDeletion(), slotFinalizeRefresh(), slotFinalizeShowMail(), slotHeaderDownloaded(), slotMailDeleted(), slotSizesReceived(), slotUIDsReceived(), and startKIOJob().

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.

Definition at line 499 of file configelem.h.

Referenced by cancelRefresh(), copyHeaders(), getHeaders(), refreshMailList(), slotFinalizeRefresh(), slotHeaderDownloaded(), slotSizesReceived(), and slotUIDsReceived().

QStringList ConfigElem::receivedUIDs [private]

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

Definition at line 505 of file configelem.h.

Referenced by getUIDs(), slotReceiveUID(), and slotUIDsReceived().

QStringList ConfigElem::receivedSizes [private]

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

Definition at line 511 of file configelem.h.

Referenced by getSizes(), slotReceiveSize(), and slotSizesReceived().

QByteArray ConfigElem::receivedHeader [private]

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

Definition at line 517 of file configelem.h.

Referenced by getNextHeader(), slotHeaderDownloaded(), and slotReceiveHeader().


The documentation for this class was generated from the following files:
Generated on Thu Jul 5 19:36:07 2007 for kshowmail by  doxygen 1.5.0