AccountList Class Reference

Contains the accounts. More...

#include <accountlist.h>

List of all members.

Signals

void sigRefreshReady ()
 Will be emitted, when all accounts have refreshed their mail list.
void sigMessageWindowOpened ()
 Will be emitted by slotMessageWindowOpened when an account has opened a window to show a mail.
void sigAllMessageWindowsClosed ()
 Will be emitted by slotMessageWindowClosed when all accounts have closed their windows to show mails.
void sigDeleteReady ()
 Will be emitted when all selected mails are deleted.
void sigShowBodiesReady ()
 Will be emitted when all selected mails are shown.

Public Member Functions

 AccountList (QObject *parent)
 Constructor.
 ~AccountList ()
 Destructor.
AccountaddAccount (const QString &name)
 Creates an account and append it to the list.
void print () const
 Prints the accounts to stdout.
int numberAccounts () const
 Returns the number of accounts.
AccountgetAccount (int index) const
 Returns a pointer to the account object at the given index position.
AccountgetAccount (QString name) const
 Returns the account with the given name.
QList< QPointer< Account > > getAllAccounts () const
 Returns a list which contains the pointers to all accounts.
QList< AccountViewItemgetAllAccountViewItems () const
 Returns a list of account view items for all accounts.
bool hasAccount (QString accountName) const
 Returns whether the list contains a account with the given name.
void loadSetup ()
 Loads the setup.
void refreshMailLists (FilterLog *log)
 Orders the accounts to refresh the mails.
bool keepNew ()
 Returns whether all new mails will keep new status until the app is closed.
int getNumberMails () const
 Returns the number of mails.
void deleteMails ()
 Deletes all mails from the servers and the mail lists.
int numberDeletedMailsLastRefresh ()
 Returns the number of deleted mails by last refresh.
int numberDeletedMailsStart ()
 Returns the number of deleted mails since start.
int numberMovedMailsLastRefresh ()
 Returns the number of moved mails by last refresh.
int numberMovedMailsStart ()
 Returns the number of moved mails since start.
int numberIgnoredMails ()
 Returns the number of ignored mails by last refresh.
void refreshFilterSetup ()
 Reloads the filter settings.
void saveOptions ()
 Saves the current mails data and the account setups.
void showMails ()
 Downloads and shows the selected mails.
int getNumberNewMails ()
 Returns the number of new mails.
void readStoredMails ()
 Reads stored mails data.
QList< MailgetAllMails () const
 Returns a list which contains the pointers to all mails.
void cancelTasks ()
 Cancels all running tasks.

Protected Slots

void slotCheckRefreshState (QString account)
 Connected with signal sigRefreshReady of all accounts.
void slotMessageWindowOpened ()
 Connected with signal sigMessageWindowOpened of all accounts.
void slotMessageWindowClosed ()
 Connected with signal sigMessageWindowClosed of all accounts.
void slotCheckDeletionState (QString account)
 Connected with signal sigDeleteReady of all accounts.
void slotCheckShowBodiesState (QString account)
 Connected with signal sigShowBodiesReady of all accounts.

Protected Member Functions

void init ()
 initializes this


Detailed Description

Contains the accounts.

Definition at line 50 of file accountlist.h.


Constructor & Destructor Documentation

AccountList::AccountList ( QObject *  parent  ) 

Constructor.

Parameters:
parent parent object

Definition at line 20 of file accountlist.cpp.


Member Function Documentation

Account * AccountList::addAccount ( const QString &  name  ) 

Creates an account and append it to the list.

Parameters:
name account name
Returns:
pointer to the added account

Definition at line 28 of file accountlist.cpp.

int AccountList::numberAccounts (  )  const

Returns the number of accounts.

Returns:
number of accounts

Definition at line 58 of file accountlist.cpp.

Account * AccountList::getAccount ( int  index  )  const

Returns a pointer to the account object at the given index position.

Parameters:
index the index
Returns:
pointer to the requested account

Definition at line 63 of file accountlist.cpp.

Account * AccountList::getAccount ( QString  name  )  const

Returns the account with the given name.

Parameters:
name account name
Returns:
requested account; NULL if no account found

Definition at line 606 of file accountlist.cpp.

QList< QPointer< Account > > AccountList::getAllAccounts (  )  const

Returns a list which contains the pointers to all accounts.

Returns:
all accounts

Definition at line 622 of file accountlist.cpp.

QList< AccountViewItem > AccountList::getAllAccountViewItems (  )  const

Returns a list of account view items for all accounts.

Returns:
list of account view items

Definition at line 658 of file accountlist.cpp.

bool AccountList::hasAccount ( QString  accountName  )  const

Returns whether the list contains a account with the given name.

Parameters:
accountName name of the wanted account
Returns:
TRUE - the account is in the list

FALSE - the account is not in the list

Definition at line 132 of file accountlist.cpp.

void AccountList::refreshMailLists ( FilterLog log  ) 

Orders the accounts to refresh the mails.

When the refresh is done, the signal refreshReady will be emitted.

Parameters:
log pointer to the filter log

Definition at line 143 of file accountlist.cpp.

bool AccountList::keepNew (  ) 

Returns whether all new mails will keep new status until the app is closed.

Returns:
TRUE - mails keep new status at next refresh

FALSE - mails don't keep new status at next refresh

Definition at line 234 of file accountlist.cpp.

int AccountList::getNumberMails (  )  const

Returns the number of mails.

Returns:
number of mails

Definition at line 239 of file accountlist.cpp.

void AccountList::deleteMails (  ) 

Deletes all mails from the servers and the mail lists.

You need to call Account::addMailToDelete() before.

This just starts the deletion and returns after then. When all accounts are ready the signal sigDeleteReady will be emitted.

Definition at line 258 of file accountlist.cpp.

int AccountList::numberDeletedMailsLastRefresh (  ) 

Returns the number of deleted mails by last refresh.

Returns:
number of deleted mails by last refresh

Definition at line 316 of file accountlist.cpp.

int AccountList::numberDeletedMailsStart (  ) 

Returns the number of deleted mails since start.

Returns:
number of deleted mails since start

Definition at line 332 of file accountlist.cpp.

int AccountList::numberMovedMailsLastRefresh (  ) 

Returns the number of moved mails by last refresh.

Returns:
number of moved mails by last refresh

Definition at line 350 of file accountlist.cpp.

int AccountList::numberMovedMailsStart (  ) 

Returns the number of moved mails since start.

Returns:
number of moved mails since start

Definition at line 366 of file accountlist.cpp.

int AccountList::numberIgnoredMails (  ) 

Returns the number of ignored mails by last refresh.

Returns:
number of ignored mails by last refresh

Definition at line 382 of file accountlist.cpp.

void AccountList::saveOptions (  ) 

Saves the current mails data and the account setups.

The mails data will be saved into an XML file (kshowmail.xml). The account setups will be saved into the application config file (kshowmailrc).

Definition at line 414 of file accountlist.cpp.

void AccountList::showMails (  ) 

Downloads and shows the selected mails.

You need to call Account::addMailToShow() before.

Definition at line 470 of file accountlist.cpp.

int AccountList::getNumberNewMails (  ) 

Returns the number of new mails.

Returns:
number of new mails

Definition at line 532 of file accountlist.cpp.

void AccountList::readStoredMails (  ) 

Reads stored mails data.

At every setup saving (e.g. at exit) the mails data will be stored into the file kshowmail.xml. At application start we read this file to identify mails which are not new at first refresh.

Definition at line 550 of file accountlist.cpp.

QList< Mail > AccountList::getAllMails (  )  const

Returns a list which contains the pointers to all mails.

Returns:
all mails

Definition at line 632 of file accountlist.cpp.

void AccountList::slotCheckRefreshState ( QString  account  )  [protected, slot]

Connected with signal sigRefreshReady of all accounts.

When an account has sent this signal its appropriate item in AccountRefreshMap will set to FALSE. When all accounts have refreshed their mail list it will emit signal sigRefreshReady.

Parameters:
account name of the account which has emitted the signal
See also:
AccountRefreshMap

Definition at line 178 of file accountlist.cpp.

void AccountList::slotMessageWindowOpened (  )  [protected, slot]

Connected with signal sigMessageWindowOpened of all accounts.

When an account has sent this signal the counter ctrOpenMessageWindows will be incremented. When the counter was incremented from zero (the first window was opened) the signal sigMessageWindowOpened will be emitted.

See also:
ctrOpenMessageWindows

sigMessageWindowOpened

Definition at line 209 of file accountlist.cpp.

void AccountList::slotMessageWindowClosed (  )  [protected, slot]

Connected with signal sigMessageWindowClosed of all accounts.

When an account has sent this signal the counter ctrOpenMessageWindows will be decremented. When the counter has reached zero the signal sigAllMessageWindowsClosed will be emitted.

See also:
ctrOpenMessageWindows

sigAllMessageWindowsClosed

Definition at line 221 of file accountlist.cpp.

void AccountList::slotCheckDeletionState ( QString  account  )  [protected, slot]

Connected with signal sigDeleteReady of all accounts.

When an account has sent this signal its appropriate item in AccountDeletionMap will set to FALSE. When all accounts have done the deletion it will emit signal sigDeleteReady.

Parameters:
account name of the account which has emitted the signal
See also:
AccountDeletionMap

Definition at line 295 of file accountlist.cpp.

void AccountList::slotCheckShowBodiesState ( QString  account  )  [protected, slot]

Connected with signal sigShowBodiesReady of all accounts.

When an account has sent this signal its appropriate item in AccountShowBodiesMap will set to FALSE. When all accounts have shown the mail it will emit signal sigShowBodiesReady.

Parameters:
account name of the account which has emitted the signal
See also:
AccountShowBodiesMap

Definition at line 507 of file accountlist.cpp.

void AccountList::sigMessageWindowOpened (  )  [signal]

Will be emitted by slotMessageWindowOpened when an account has opened a window to show a mail.

See also:
slotMessageWindowOpened

void AccountList::sigAllMessageWindowsClosed (  )  [signal]

Will be emitted by slotMessageWindowClosed when all accounts have closed their windows to show mails.

See also:
slotMessageWindowClosed


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

Generated on Tue May 18 19:43:52 2010 for KShowmail by  doxygen 1.5.6