ConfigList Class Reference

#include <configlist.h>

List of all members.

Signals

void sigConfigChanged ()
void sigDeleteReady ()
void sigShowBodiesReady ()
void sigMessageWindowOpened ()
void sigAllMessageWindowsClosed ()
void sigRefreshReady ()

Public Member Functions

 ConfigList ()
virtual ~ConfigList ()
void refreshSetup (KListView *view)
int getRefreshTimeInterval () const
void setRefreshTimeInterval (unsigned int interval)
bool AutoRefreshOn () const
void setConfirmDeletion (bool confirm)
bool confirmDeletion ()
bool confirmClose () const
bool startMinimized () const
bool closeToTray () const
bool minimizesToTray () const
bool showConnectionErrors () const
void setAllowHTML (bool allowHTML)
bool allowHTML () const
bool hasActiveAccounts ()
uint getTimeoutTime () const
void setTimeoutTime (uint time)
ConfigElemgetSelectedAccount ()
void deleteSelectedMails ()
void connectAccounts ()
QStringList getSelectedSubjects () const
bool hasSelectedMails ()
void showSelectedMails ()
void refreshMailLists (FilterLog *log=NULL)
int getNumberNewMails ()
int getNumberMails ()
long getTotalSize ()
void fillMailListView (KshowmailView *view)
bool showMainWindowForNewMails ()
bool showAlertMessageForNewMails ()
bool quitNoNewMails ()
bool minimizeMainWindowNoNewMails ()
int getInitTime ()
void setInitTime (int time)
bool hasInitTime ()
void refreshAccountList ()
void killPOP3Jobs ()
void showSelectedHeaders ()
void executeNewMailCommand ()
bool keepNew ()
void printSetup ()
void saveOptions ()
void readStoredMails ()
FilterAction_Type getSpamAction ()
QString getSpamMailbox ()
bool setItem (const char *item)
void setList (QListView *list)
void beep ()
void playSound ()
void playSound (const char *file)

Protected Slots

void slotAccountConfigChanged ()
void slotCheckDeletionState (QString account)
void slotCheckShowBodiesState (QString account)
void slotMessageWindowOpened ()
void slotMessageWindowClosed ()
void slotCheckRefreshState (QString account)

Protected Member Functions

virtual QCollection::Item newItem (QCollection::Item item)
virtual int compareItems (QCollection::Item item1, QCollection::Item item2)
bool hasAccount (const QString &name) const
ConfigElemgetAccount (const QString &name) const

Private Attributes

KConfig * config
int m_nIntervalTimer
uint m_nPop3Timer
AccountTaskMap_Type AccountDeletionMap
AccountTaskMap_Type AccountShowBodiesMap
AccountTaskMap_Type AccountRefreshMap
bool m_bConfirmDelete
bool m_bAllowHTML
int ctrOpenMessageWindows
int m_nInitTimer
bool m_bShowMessage
bool m_bShowMainWindow
bool m_bBeep
bool m_bSound
QString m_strSoundFile
bool m_bCommand
QString m_strCommandPath
bool m_bTerminate
bool m_bMinimize
bool m_bShowConnectionErrors
bool m_bConfirmClose
bool m_bStartMinimized
bool m_bCloseMinimizes
bool m_bMinimizeToTray
bool m_bKeepNew
QString spamMailbox
FilterAction_Type spamAction


Detailed Description

Contains the application and account settings. The account settings are stored in ConfigElem objects.
Author:
Eggert Ehmke

Ulrich Weigelt


Constructor & Destructor Documentation

ConfigList::ConfigList (  ) 

Constructor.

virtual ConfigList::~ConfigList (  )  [inline, virtual]

Destructor


Member Function Documentation

void ConfigList::refreshSetup ( KListView *  view  ) 

Reads the setup from the configuration file (kshowmailrc) and sets the properties.

Parameters:
view pointer to the account list view

int ConfigList::getRefreshTimeInterval (  )  const

Returns the auto refresh time interval.

Returns:
refresh time interval [minutes]

void ConfigList::setRefreshTimeInterval ( unsigned int  interval  ) 

Sets the auto refresh time interval.

Parameters:
interval the new time interval [minutes]

bool ConfigList::AutoRefreshOn (  )  const

Returns whether auto refresh is on.

Returns:
TRUE - auto refresh is on; FALSE - auto refresh is off

void ConfigList::setConfirmDeletion ( bool  confirm  ) 

Sets whether the user has to confirm a deletion.

Parameters:
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.

Returns:
TRUE - the user has to confirm

FALSE - the user does not have to confirm

bool ConfigList::confirmClose (  )  const

Returns whether the user has to confirm window close.

Returns:
TRUE - user has to confirm

FALSE - user does not have to confirm

bool ConfigList::startMinimized (  )  const

Returns whether the app shall start minimized.

Returns:
TRUE - start minimized

FALSE - don't start minimized

bool ConfigList::closeToTray (  )  const

Returns whether the close button leaves the application running in tray.

Returns:
TRUE - leaves running

FALSE - app will be closed

bool ConfigList::minimizesToTray (  )  const

Returns whether minimizes to the tray rather than to the taskbar.

Returns:
TRUE - minimizes to the tray

FALSE - minimizes to the taskbar

bool ConfigList::showConnectionErrors (  )  const

Returns whether connection errors will be shown during refresh.

Returns:
TRUE - show errors

FALSE - don't show errors

void ConfigList::setAllowHTML ( bool  allowHTML  ) 

Sets whether the mail show dialog has to use HTML.

Parameters:
allowHTML TRUE - the dialog has to use HTML; FALSE - the dialog must not use HTML
See also:
m_bAllowHTML

bool ConfigList::allowHTML (  )  const

Returns whether the mail show dialog has to use HTML.

Returns:
TRUE - the dialog has to use HTML

FALSE - the dialog must not use HTML

See also:
m_bAllowHTML

bool ConfigList::hasActiveAccounts (  ) 

Returns whether there are active accounts. Doesn't set the current account.

Returns:
TRUE - Yes, there are active accounts (at least one :o) ); FALSE - no active accounts

uint ConfigList::getTimeoutTime (  )  const

Returns the number of seconds the application will be wait for a pop3 job.

Returns:
seconds to timeout

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.

Parameters:
time seconds to timeout
See also:
constants.h

ConfigElem * ConfigList::getSelectedAccount (  ) 

Returns the first account, for which an appropriate item is selected in the account list view.

Returns:
pointer to the selected account object

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.

Returns:
subjects of selected mails

bool ConfigList::hasSelectedMails (  ) 

Returns whether there are mails in this list which are selected in the list view.

Returns:
TRUE - there are selected mails

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.

Parameters:
log Pointer to the filter log.

int ConfigList::getNumberNewMails (  ) 

Returns the number of new mails.

Returns:
number of new mails

int ConfigList::getNumberMails (  ) 

Returns the number of mails.

Returns:
number of mails

long ConfigList::getTotalSize (  ) 

Returns the total size of all mails.

Returns:
total size

void ConfigList::fillMailListView ( KshowmailView view  ) 

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

Parameters:
view pointer to the application view

bool ConfigList::showMainWindowForNewMails (  ) 

Returns whether the main window will be shown, if new mails was received.

Returns:
TRUE - main window will be shown

FALSE - main window will not be shown

bool ConfigList::showAlertMessageForNewMails (  ) 

Returns whether an alert message will be shown if new mails were received.

Returns:
TRUE - will be shown

FALSE - will not be shown

bool ConfigList::quitNoNewMails (  ) 

Returns whether the app will be terminated if no new mails were received.

Returns:
TRUE - will be terminated

FALSE - will not be terminated

bool ConfigList::minimizeMainWindowNoNewMails (  ) 

Returns whether the main window will be minimized, if no new mails were received.

Returns:
TRUE - main window will be minimized

FALSE - main window will not be minimized

int ConfigList::getInitTime (  ) 

Returns the configured time to the first refresh.

Returns:
time to the first refresh (seconds)

void ConfigList::setInitTime ( int  time  ) 

Sets the time to the first refresh.

Parameters:
time time (seconds) to the first refresh

bool ConfigList::hasInitTime (  ) 

Returns whether a time to first refresh is configured.

Returns:
TRUE - init time 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.

Returns:
TRUE - mails keep new status at next refresh

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

Returns:
action to used on spam mails

QString ConfigList::getSpamMailbox (  ) 

Returns the mailbox for spam mails

Returns:
mailbox for spam

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.

Parameters:
item account object
Returns:
pointer to the new account object

int ConfigList::compareItems ( QCollection::Item  item1,
QCollection::Item  item2 
) [protected, virtual]

Compares two ConfigElem objects. Reimplementation of QPtrList::compareItems(). Used by inSort().

Parameters:
item1 account 1
item2 account 2
Returns:
0 if account name 1 == account name 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

Parameters:
name name of the searched account
Returns:
TRUE - account is existent

FALSE - account is not existent

ConfigElem * ConfigList::getAccount ( const QString &  name  )  const [protected]

Returns the pointer to the account named like the given name.

Parameters:
name of the searched account
Returns:
account or NULL, if the account was not found

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.

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

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.

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

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.

See also:
ctrOpenMessageWindows

sigMessageWindowOpened

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.

See also:
ctrOpenMessageWindows

sigAllMessageWindowsClosed

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.

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

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.

See also:
slotMessageWindowOpened

void ConfigList::sigAllMessageWindowsClosed (  )  [signal]

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

See also:
slotMessageWindowClosed

void ConfigList::sigRefreshReady (  )  [signal]

Will be emitted, when all accounts have refreshed their mail list.


Member Data Documentation

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.

See also:
deleteSelectedMails()

slotCheckDeletionState()

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.

See also:
showSelectedMails()

slotCheckShowBodiesState()

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.

See also:
refreshMailLists()

slotCheckRefreshState()

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

See also:
setAllowHTML()

allowHTML()

int ConfigList::ctrOpenMessageWindows [private]

Number of windows, which have been opened by the accounts to show mails. Used by slotMessageWindowOpened() and slotMessageWindowClosed().

See also:
slotMessageWindowOpened

slotMessageWindowClosed

int ConfigList::m_nInitTimer [private]

Contains the time (seconds) to first refresh.

See also:
setInitTime()

getInitTime()

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


The documentation for this class was generated from the following files:
Generated on Tue Apr 1 21:59:49 2008 for kshowmail.kdevelop by  doxygen 1.5.0