#include <configlist.h>
ConfigList::ConfigList | ( | ) |
Constructor.
virtual ConfigList::~ConfigList | ( | ) | [inline, virtual] |
Destructor
void ConfigList::refreshSetup | ( | KListView * | view | ) |
Reads the setup from the configuration file (kshowmailrc) and sets the properties.
view | pointer to the account list view |
int ConfigList::getRefreshTimeInterval | ( | ) | const |
Returns the auto refresh time interval.
void ConfigList::setRefreshTimeInterval | ( | unsigned int | interval | ) |
Sets the auto refresh time interval.
interval | the new time interval [minutes] |
bool ConfigList::AutoRefreshOn | ( | ) | const |
Returns whether auto refresh is on.
void ConfigList::setConfirmDeletion | ( | bool | confirm | ) |
Sets whether the user has to confirm a deletion.
confirm | TRUE - user has to confirm; FALSE - the user does not have to confirm |
bool ConfigList::confirmDeletion | ( | ) |
Returns whether the user has to confirm a deletion.
FALSE - the user does not have to confirm
bool ConfigList::confirmClose | ( | ) | const |
Returns whether the user has to confirm window close.
FALSE - user does not have to confirm
bool ConfigList::startMinimized | ( | ) | const |
Returns whether the app shall start minimized.
FALSE - don't start minimized
bool ConfigList::closeToTray | ( | ) | const |
Returns whether the close button leaves the application running in tray.
FALSE - app will be closed
bool ConfigList::minimizesToTray | ( | ) | const |
Returns whether minimizes to the tray rather than to the taskbar.
FALSE - minimizes to the taskbar
bool ConfigList::showConnectionErrors | ( | ) | const |
Returns whether connection errors will be shown during refresh.
FALSE - don't show errors
void ConfigList::setAllowHTML | ( | bool | allowHTML | ) |
Sets whether the mail show dialog has to use HTML.
allowHTML | TRUE - the dialog has to use HTML; FALSE - the dialog must not use HTML |
bool ConfigList::allowHTML | ( | ) | const |
Returns whether the mail show dialog has to use HTML.
FALSE - the dialog must not use HTML
bool ConfigList::hasActiveAccounts | ( | ) |
Returns whether there are active accounts. Doesn't set the current account.
uint ConfigList::getTimeoutTime | ( | ) | const |
Returns the number of seconds the application will be wait for a pop3 job.
void ConfigList::setTimeoutTime | ( | uint | time | ) |
Sets the number of seconds the application will be wait for a pop3 job. Minimum time is POP3_MINIMUM_TIMEOUT_TIME seconds.
time | seconds to timeout |
ConfigElem * ConfigList::getSelectedAccount | ( | ) |
Returns the first account, for which an appropriate item is selected in the account list view.
NULL - no account is selected
void ConfigList::deleteSelectedMails | ( | ) |
Deletes all selected mails from the servers and the mail lists. This just starts the deletion and returns after then. When all accounts are ready the signal sigDeleteReady will be emitted.
void ConfigList::connectAccounts | ( | ) |
Connects the signals of the accounts with the slots of this class. It is necessary to do this after an account has been appended to the list and it is a good idea to call this method before you invoke an operation on an account that may emit a signal. The reason is that the pointer list seemingly often changes the adresses of the inserted accounts. After that the connections are corrupt.
QStringList ConfigList::getSelectedSubjects | ( | ) | const |
Returns the subjects of the selected mails.
bool ConfigList::hasSelectedMails | ( | ) |
Returns whether there are mails in this list which are selected in the list view.
FALSE - there aren't selected mails
void ConfigList::showSelectedMails | ( | ) |
Downloads and shows the bodies of the selected mails. This just starts the download and returns after then. When all bodies are downloaded and shown the signal sigShowBodiesReady will be emitted.
void ConfigList::refreshMailLists | ( | FilterLog * | log = NULL |
) |
Refreshes the mail list of all accounts. This just starts the refresh and returns after then. When all accounts have refreshed their mail list the signal sigRefreshReady will be emitted.
log | Pointer to the filter log. |
int ConfigList::getNumberNewMails | ( | ) |
Returns the number of new mails.
int ConfigList::getNumberMails | ( | ) |
Returns the number of mails.
long ConfigList::getTotalSize | ( | ) |
Returns the total size of all mails.
void ConfigList::fillMailListView | ( | KshowmailView * | view | ) |
Creates for every mail a list view item and inserts it into the mail list view.
view | pointer to the application view |
bool ConfigList::showMainWindowForNewMails | ( | ) |
Returns whether the main window will be shown, if new mails was received.
FALSE - main window will not be shown
bool ConfigList::showAlertMessageForNewMails | ( | ) |
Returns whether an alert message will be shown if new mails were received.
FALSE - will not be shown
bool ConfigList::quitNoNewMails | ( | ) |
Returns whether the app will be terminated if no new mails were received.
FALSE - will not be terminated
bool ConfigList::minimizeMainWindowNoNewMails | ( | ) |
Returns whether the main window will be minimized, if no new mails were received.
FALSE - main window will not be minimized
int ConfigList::getInitTime | ( | ) |
Returns the configured time to the first refresh.
void ConfigList::setInitTime | ( | int | time | ) |
Sets the time to the first refresh.
time | time (seconds) to the first refresh |
bool ConfigList::hasInitTime | ( | ) |
Returns whether a time to first refresh is configured.
FALSE - no init time configured
void ConfigList::refreshAccountList | ( | ) |
Refreshes the account list (number of mails and total size).
void ConfigList::killPOP3Jobs | ( | ) |
Kills all running pop3 jobs.
void ConfigList::showSelectedHeaders | ( | ) |
Shows the headers of all selected mails.
void ConfigList::executeNewMailCommand | ( | ) |
Executes the configure new mail command. Does nothing, if the command option is switched off (m_bCommand == false).
bool ConfigList::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
void ConfigList::printSetup | ( | ) |
Prints the setup.
void ConfigList::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).
void ConfigList::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.
FilterAction_Type ConfigList::getSpamAction | ( | ) |
Returns the action to used on spam mails
QString ConfigList::getSpamMailbox | ( | ) |
Returns the mailbox for spam mails
bool ConfigList::setItem | ( | const char * | item | ) |
void ConfigList::setList | ( | QListView * | list | ) |
void ConfigList::beep | ( | ) |
void ConfigList::playSound | ( | ) |
void ConfigList::playSound | ( | const char * | file | ) |
QCollection::Item ConfigList::newItem | ( | QCollection::Item | item | ) | [protected, virtual] |
Makes a copy from the given account object and returns the pointer to it. Reimplementation of QPtrList::newItem(). Used by QPtrList to add new items.
item | account object |
int ConfigList::compareItems | ( | QCollection::Item | item1, | |
QCollection::Item | item2 | |||
) | [protected, virtual] |
Compares two ConfigElem objects. Reimplementation of QPtrList::compareItems(). Used by inSort().
item1 | account 1 | |
item2 | account 2 |
nonzero if account name 2 != account name 2
bool ConfigList::hasAccount | ( | const QString & | name | ) | const [protected] |
Returns whether the given account is in the list
name | name of the searched account |
FALSE - account is not existent
ConfigElem * ConfigList::getAccount | ( | const QString & | name | ) | const [protected] |
Returns the pointer to the account named like the given name.
name | of the searched account |
void ConfigList::slotAccountConfigChanged | ( | ) | [protected, slot] |
Connected with signal sigConfigChanged of all accounts. Emits the signal sigConfigChanged.
void ConfigList::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 |
void ConfigList::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 |
void ConfigList::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.
void ConfigList::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.
void ConfigList::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 |
void ConfigList::sigConfigChanged | ( | ) | [signal] |
Will be emitted when the configuration of an account or of the app was changed.
void ConfigList::sigDeleteReady | ( | ) | [signal] |
Will be emitted when all selected mails are deleted.
void ConfigList::sigShowBodiesReady | ( | ) | [signal] |
Will be emitted when all selected mails are shown.
void ConfigList::sigMessageWindowOpened | ( | ) | [signal] |
Will be emitted by slotMessageWindowOpened when an account has opened a window to show a mail.
void ConfigList::sigAllMessageWindowsClosed | ( | ) | [signal] |
Will be emitted by slotMessageWindowClosed when all accounts have closed their windows to show mails.
void ConfigList::sigRefreshReady | ( | ) | [signal] |
Will be emitted, when all accounts have refreshed their mail list.
KConfig* ConfigList::config [private] |
Connector to the configuration file
int ConfigList::m_nIntervalTimer [private] |
Time in minutes to the next automatic refresh.
uint ConfigList::m_nPop3Timer [private] |
Number of seconds the application will wait for a pop3 job to complete.
AccountTaskMap_Type ConfigList::AccountDeletionMap [private] |
This map is used by the delete methods. deleteSelectedMails() clears it and after that inserts for every account an item. The Key is the account name and the data is TRUE. When slotCheckDeletionState() is invoked by a signal sent by an account, this slot will set the appropriate item data to FALSE. If the data of all items are set to FALSE, the method will know all accounts have ended the deletion and will emit sigDeleteReady.
AccountTaskMap_Type ConfigList::AccountShowBodiesMap [private] |
This map is used by the methods to show the mail body. showSelectedMails() clears it and after that inserts for every account an item. The Key is the account name and the data is TRUE. When slotCheckShowBodiesState() is invoked by a signal sent by an account, this slot will set the appropriate item data to FALSE. If the data of all items are set to FALSE, the method will know all accounts have shown the mail body and will emit sigShowBodiesReady.
AccountTaskMap_Type ConfigList::AccountRefreshMap [private] |
This map is used by the methods to refresh the account mail lists. refreshMailLists() clears it and after that inserts for every account an item. The Key ist the account name and the data is TRUE. When slotCheckRefreshState() is invoked by a signal sent by an account, this slot will set the appropriate item data to FALSE. If the data of all items are set to FALSE, the method will know all accounts have refreshed their mail list and will emit sigRefreshReady.
bool ConfigList::m_bConfirmDelete [private] |
TRUE - the user has to confirm a deletion, FALSE - the user does not have to confirm a deletion
bool ConfigList::m_bAllowHTML [private] |
TRUE - allow HTML formatting in the mail show dialog box FALSE - don't allow HTML formatting
int ConfigList::ctrOpenMessageWindows [private] |
Number of windows, which have been opened by the accounts to show mails. Used by slotMessageWindowOpened() and slotMessageWindowClosed().
int ConfigList::m_nInitTimer [private] |
Contains the time (seconds) to first refresh.
bool ConfigList::m_bShowMessage [private] |
TRUE - If a new mail is arrived an alert window will be shown.
bool ConfigList::m_bShowMainWindow [private] |
TRUE - If a new mail is arrived the main window will be shown.
bool ConfigList::m_bBeep [private] |
TRUE - If a new mail is arrived the system will beep.
bool ConfigList::m_bSound [private] |
TRUE - If a new mail is arrived a sound will be played.
QString ConfigList::m_strSoundFile [private] |
Sound file which will be played if a new mail is arrived.
bool ConfigList::m_bCommand [private] |
TRUE - If a new mail is arrived a command will be executed.
QString ConfigList::m_strCommandPath [private] |
Path to command which will be executed if a new mail is arrived.
bool ConfigList::m_bTerminate [private] |
TRUE - If no new mail is arrived the application will be ended.
bool ConfigList::m_bMinimize [private] |
TRUE - If no new mail is arrived the main window will be minimized.
bool ConfigList::m_bShowConnectionErrors [private] |
TRUE - If a connection error occures during refresh an error message will be shown.
bool ConfigList::m_bConfirmClose [private] |
TRUE - The user has to confirm window close.
bool ConfigList::m_bStartMinimized [private] |
TRUE - the app starts minimized.
bool ConfigList::m_bCloseMinimizes [private] |
TRUE - the close button leaves the application running in tray
bool ConfigList::m_bMinimizeToTray [private] |
TRUE - minimizes to the tray rather than to the taskbar
bool ConfigList::m_bKeepNew [private] |
TRUE - mails keep new until termination
QString ConfigList::spamMailbox [private] |
Mailbox for Spam, if configured
FilterAction_Type ConfigList::spamAction [private] |
Action which shall be done, if the mail is Spam