#include <accountlist.h>
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. | |
Account * | addAccount (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. | |
Account * | getAccount (int index) const |
Returns a pointer to the account object at the given index position. | |
Account * | getAccount (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< AccountViewItem > | getAllAccountViewItems () 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< Mail > | getAllMails () 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 |
Definition at line 50 of file accountlist.h.
AccountList::AccountList | ( | QObject * | parent | ) |
Account * AccountList::addAccount | ( | const QString & | name | ) |
Creates an account and append it to the list.
name | account name |
Definition at line 28 of file accountlist.cpp.
int AccountList::numberAccounts | ( | ) | const |
Returns the 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.
index | the index |
Definition at line 63 of file accountlist.cpp.
Account * AccountList::getAccount | ( | QString | name | ) | const |
Returns the account with the given name.
name | account name |
Definition at line 606 of file accountlist.cpp.
QList< QPointer< Account > > AccountList::getAllAccounts | ( | ) | const |
Returns a list which contains the pointers to 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.
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.
accountName | name of the wanted account |
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.
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.
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.
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.
Definition at line 316 of file accountlist.cpp.
int AccountList::numberDeletedMailsStart | ( | ) |
Returns the 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.
Definition at line 350 of file accountlist.cpp.
int AccountList::numberMovedMailsStart | ( | ) |
Returns the 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.
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.
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.
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.
account | name of the account which has emitted the signal |
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.
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.
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.
account | name of the account which has emitted the signal |
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.
account | name of the account which has emitted the signal |
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.
void AccountList::sigAllMessageWindowsClosed | ( | ) | [signal] |
Will be emitted by slotMessageWindowClosed when all accounts have closed their windows to show mails.