KShowMailApp Class Reference

#include <kshowmail.h>

List of all members.

Public Member Functions

 KShowMailApp ()
 ~KShowMailApp ()
void delayNextRefresh ()

Static Public Attributes

static KAboutData * m_pAbout

Protected Slots

void slotStatusHelpMsg (const QString &text)
void slotStatusMsg (const QString &text)
void slotConfChanged ()
void slotDelete ()
void slotDeletionReady ()
void slotShowMessage ()
void slotShowMessageReady ()
void slotNormalCursor ()
void slotWaitingCursor ()
void slotRefresh ()
void slotRefreshReady ()
void slotAlertDestroyed ()
void slotAlertOk ()
void slotRefreshView ()
void slotStop ()
void slotShowHeader ()
void slotEditToolbars ()
void slotSaveOptions ()
void slotFileQuit ()
void slotSetupAccount ()
void slotSetup ()
void slotSetupFilters ()
void slotAccountActivated (QListViewItem *)
void slotSendFeedbackMail ()
void slotForceClose ()

Protected Member Functions

void readOptions ()
void initStatusBar ()
void initActions ()
void initDocument ()
void initView ()
virtual bool queryClose ()
virtual bool queryExit ()
virtual void timerEvent (QTimerEvent *)
virtual bool event (QEvent *e)
void initFirstRefresh ()
void stopRefreshTimer ()
void initNextRefresh ()
void addFeatureList (KFeedbackQuestion *question)
bool askCloseConfirmation ()

Private Attributes

KshowmailDocm_pDoc
KshowmailViewm_pView
KCMultiDialog * SetupDialog
KAction * m_actionSave
KAction * m_actionRefresh
ConfigList m_ConfigList
AlertDialogm_pAlertDialog
KShowMailDockm_pDockWindow
QTimer * m_pTimer
Types::State_Type m_state
unsigned long m_nSecondsToGo
bool m_bForceClose

Friends

class KshowmailView
class KshowmailDock
class UniqueApp


Detailed Description

The base class for Kshowmail application windows. It sets up the main window and reads the config file as well as providing a menubar, toolbar and statusbar. An instance of KshowmailView creates your center view, which is connected to the window's Doc object. KShowMailApp reimplements the methods that KMainWindow provides for main window handling and supports full session management as well as keyboard accelerator configuration by using KAccel.
See also:
KMainWindow

KApplication

KConfig

KAccel

Author:
Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
Version:
KDevelop version 0.4 code generation

Definition at line 76 of file kshowmail.h.


Constructor & Destructor Documentation

KShowMailApp::KShowMailApp (  ) 

Constructor of KShowMailApp, calls all init functions to create the application.

See also:
initMenuBar initToolBar

Definition at line 26 of file kshowmail.cpp.

References Types::idle, initActions(), initDocument(), initFirstRefresh(), initStatusBar(), initView(), m_actionRefresh, m_bForceClose, m_ConfigList, m_pAlertDialog, m_pDockWindow, KshowmailView::m_pListAccounts, m_pTimer, m_pView, m_state, readOptions(), ConfigList::readStoredMails(), ConfigList::refreshSetup(), SetupDialog, slotAccountActivated(), slotDeletionReady(), slotForceClose(), slotNormalCursor(), slotRefresh(), slotRefreshReady(), slotRefreshView(), slotShowMessageReady(), and slotWaitingCursor().

KShowMailApp::~KShowMailApp (  ) 

Destructor

Definition at line 85 of file kshowmail.cpp.

References m_pDockWindow, and m_pTimer.


Member Function Documentation

void KShowMailApp::delayNextRefresh (  ) 

Delays the next refresh for one minute.

Definition at line 734 of file kshowmail.cpp.

References m_nSecondsToGo, and m_pTimer.

Referenced by KshowmailView::slotMessageClicked().

void KShowMailApp::readOptions (  )  [protected]

read general Options again and initialize all variables like the recent file list

Definition at line 202 of file kshowmail.cpp.

References m_actionSave, and Filter::readOptions().

Referenced by KShowMailApp().

void KShowMailApp::initStatusBar (  )  [protected]

sets up the statusbar for the main window by initialzing a statuslabel.

Definition at line 155 of file kshowmail.cpp.

Referenced by KShowMailApp().

void KShowMailApp::initActions (  )  [protected]

sets up the actions.

Definition at line 126 of file kshowmail.cpp.

References m_actionRefresh, m_actionSave, slotDelete(), slotEditToolbars(), slotFileQuit(), slotRefresh(), slotSaveOptions(), slotSendFeedbackMail(), slotSetup(), slotSetupAccount(), slotSetupFilters(), slotShowHeader(), slotShowMessage(), and slotStop().

Referenced by KShowMailApp().

void KShowMailApp::initDocument (  )  [protected]

initializes the document object of the main window that is connected to the view in initView().

See also:
initView();

Definition at line 169 of file kshowmail.cpp.

References m_pDoc, and KshowmailDoc::newDocument().

Referenced by KShowMailApp().

void KShowMailApp::initView (  )  [protected]

creates the centerwidget of the KMainWindow instance and sets it as the view

Definition at line 175 of file kshowmail.cpp.

References KshowmailDoc::addView(), KshowmailView, m_pDoc, and m_pView.

Referenced by KShowMailApp().

bool KShowMailApp::queryClose (  )  [protected, virtual]

queryClose is called by KMainWindow on each closeEvent of a window. Against the default implementation (only returns true), this calles saveModified() on the document object to ask if the document should be saved if Modified; on cancel the closeEvent is rejected.

See also:
KMainWindow::queryClose

KMainWindow::closeEvent

Definition at line 210 of file kshowmail.cpp.

References askCloseConfirmation(), ConfigList::closeToTray(), m_bForceClose, and m_ConfigList.

bool KShowMailApp::queryExit (  )  [protected, virtual]

queryExit is called by KMainWindow when the last window of the app is going to be closed during the closeEvent(). Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's properties.

See also:
KMainWindow::queryExit

KMainWindow::closeEvent

Definition at line 232 of file kshowmail.cpp.

References slotSaveOptions().

void KShowMailApp::timerEvent ( QTimerEvent *   )  [protected, virtual]

overwrite method of QObject; will be invoked by the internal QObject-Timer the timer is set to 1 second in the construtor; this method sets the time to the next refresh in the statusbar and animates the "?" in the traybar, when the refresh is working

Definition at line 96 of file kshowmail.cpp.

References KShowMailDock::clear(), Types::deleting, KShowMailDock::drawText(), m_nSecondsToGo, m_pDockWindow, m_state, and Types::refreshing.

bool KShowMailApp::event ( QEvent *  e  )  [protected, virtual]

overwrite method of QWidget; to hide the taskbar button

Definition at line 508 of file kshowmail.cpp.

References m_ConfigList, and ConfigList::minimizesToTray().

void KShowMailApp::initFirstRefresh (  )  [protected]

Starts the first refresh or starts the refresh timer with the configured init time.

Definition at line 680 of file kshowmail.cpp.

References ConfigList::AutoRefreshOn(), ConfigList::getInitTime(), ConfigList::hasInitTime(), m_ConfigList, m_nSecondsToGo, m_pTimer, and slotRefresh().

Referenced by KShowMailApp().

void KShowMailApp::stopRefreshTimer (  )  [protected]

Stops the refresh timer.

Definition at line 710 of file kshowmail.cpp.

References m_nSecondsToGo, and m_pTimer.

Referenced by slotRefresh(), slotSetup(), and slotSetupAccount().

void KShowMailApp::initNextRefresh (  )  [protected]

Starts the refresh timer for the next refresh.

Definition at line 716 of file kshowmail.cpp.

References ConfigList::AutoRefreshOn(), ConfigList::getRefreshTimeInterval(), m_ConfigList, m_nSecondsToGo, and m_pTimer.

Referenced by slotRefresh(), slotRefreshReady(), slotSetup(), and slotSetupAccount().

void KShowMailApp::slotStatusHelpMsg ( const QString &  text  )  [protected, slot]

Changes the status message of the whole statusbar for two seconds, then restores the last status. This is used to display statusbar messages that give information about actions for toolbar icons and menu entries.

Parameters:
text the text that is displayed in the statusbar

Definition at line 500 of file kshowmail.cpp.

void KShowMailApp::slotStatusMsg ( const QString &  text  )  [protected, slot]

Changes the contents in the left status bar item permanently, used to indicate current actions. And sets the current time in the right item.

Parameters:
text the text that is displayed in the statusbar

Definition at line 484 of file kshowmail.cpp.

Referenced by slotDelete(), slotDeletionReady(), slotRefresh(), slotRefreshReady(), slotRefreshView(), slotShowMessage(), slotShowMessageReady(), and slotStop().

void KShowMailApp::slotConfChanged (  )  [protected, slot]

Connected with the setup dialog. Reloads the configuration, if it was changed from the dialog.

Definition at line 801 of file kshowmail.cpp.

References m_ConfigList, KshowmailView::m_pListAccounts, m_pView, KshowmailView::refreshSetup(), and ConfigList::refreshSetup().

Referenced by slotSetup(), and slotSetupAccount().

void KShowMailApp::slotDelete (  )  [protected, slot]

Connected with action m_actionDelete. Deletes all selected mails.

Definition at line 404 of file kshowmail.cpp.

References ConfigList::confirmDeletion(), ConfigList::deleteSelectedMails(), Types::deleting, ConfigList::getSelectedSubjects(), ConfigList::hasSelectedMails(), Types::idle, m_ConfigList, m_state, and slotStatusMsg().

Referenced by initActions(), and slotRefreshReady().

void KShowMailApp::slotDeletionReady (  )  [protected, slot]

Connected with signal sigDeleteReady of m_ConfigList. This signal will be emitted when one or many accounts have ended a deletion. This slot refreshes the view, sets the state to idle and sets a normal cursor.

Definition at line 553 of file kshowmail.cpp.

References Types::idle, m_state, slotRefresh(), and slotStatusMsg().

Referenced by KShowMailApp().

void KShowMailApp::slotShowMessage (  )  [protected, slot]

Connected with action m_actionShowMessage. Shows all selected mails.

Definition at line 458 of file kshowmail.cpp.

References ConfigList::hasSelectedMails(), Types::idle, m_ConfigList, m_state, Types::showing, ConfigList::showSelectedMails(), and slotStatusMsg().

Referenced by initActions().

void KShowMailApp::slotShowMessageReady (  )  [protected, slot]

Connected with signal sigShowBodiesReady of m_ConfigList. This signal will be emitted when all accounts have downloaded and shown the selected messages. This slot sets the state to idle and sets a normal cursor.

Definition at line 569 of file kshowmail.cpp.

References Types::idle, m_state, and slotStatusMsg().

Referenced by KShowMailApp().

void KShowMailApp::slotNormalCursor (  )  [protected, slot]

Connected with signal sigMessageWindowOpened of m_ConfigList. This signal will be emitted when a window to show a mail body was opened. Switches the cursor to normal view.

Definition at line 584 of file kshowmail.cpp.

Referenced by KShowMailApp().

void KShowMailApp::slotWaitingCursor (  )  [protected, slot]

Connected with signal sigAllMessageWindowsClosed of m_ConfigList. This signal will be emitted when all windows to show a mail body have been closed. Switches the cursor to waiting view.

Definition at line 592 of file kshowmail.cpp.

Referenced by KShowMailApp().

void KShowMailApp::slotRefresh (  )  [protected, slot]

Connected with m_actionRefresh. Refreshes the mail list.

Definition at line 318 of file kshowmail.cpp.

References Types::idle, initNextRefresh(), m_ConfigList, m_state, Types::refreshing, ConfigList::refreshMailLists(), slotStatusMsg(), and stopRefreshTimer().

Referenced by initActions(), initFirstRefresh(), KShowMailApp(), UniqueApp::newInstance(), and slotDeletionReady().

void KShowMailApp::slotRefreshReady (  )  [protected, slot]

Connected with signal sigRefreshReady of m_ConfigList. This signal will be emitted when all accounts have refreshed their mail list. This slot refreshes the mail view.

Definition at line 598 of file kshowmail.cpp.

References Filter::_status, ConfigList::applyFilters(), ConfigList::beep(), ConfigList::executeNewMailCommand(), ConfigList::getNumberNewMails(), Types::idle, initNextRefresh(), m_ConfigList, m_pAlertDialog, m_state, ConfigList::minimizeMainWindowNoNewMails(), ConfigList::playSound(), ConfigList::quitNoNewMails(), ConfigList::showAlertMessageForNewMails(), ConfigList::showMainWindowForNewMails(), slotAlertDestroyed(), slotAlertOk(), slotDelete(), slotFileQuit(), slotRefreshView(), and slotStatusMsg().

Referenced by KShowMailApp().

void KShowMailApp::slotAlertDestroyed (  )  [protected, slot]

Connected with signal destroyed of the alert message dialog. Sets m_pAlertDialog to NULL, if the dialog was destroyed. If m_pAlertDialog == NULL, slotRefreshReady will create a new instance of it.

See also:
m_pAlertDialog

slotRefreshReady()

Definition at line 306 of file kshowmail.cpp.

References m_pAlertDialog.

Referenced by slotRefreshReady().

void KShowMailApp::slotAlertOk (  )  [protected, slot]

Connected with signal signalOk of the alert message dialog. Switches the main window to normal view.

See also:
m_pAlertDialog;

Definition at line 311 of file kshowmail.cpp.

Referenced by slotRefreshReady().

void KShowMailApp::slotRefreshView (  )  [protected, slot]

Refreshes the account and messages list view.

Definition at line 375 of file kshowmail.cpp.

References KshowmailView::clearMailListView(), KShowMailDock::drawNumber(), ConfigList::fillMailListView(), ConfigList::getNumberMails(), ConfigList::getNumberNewMails(), ConfigList::getTotalSize(), m_ConfigList, m_pDockWindow, m_pView, ConfigList::refreshAccountList(), and slotStatusMsg().

Referenced by KShowMailApp(), slotRefreshReady(), and slotStop().

void KShowMailApp::slotStop (  )  [protected, slot]

If the application state is not "idle" it will stop all current running POP3 jobs. Connected with m_actionStop().

Definition at line 346 of file kshowmail.cpp.

References Types::idle, ConfigList::killPOP3Jobs(), m_ConfigList, m_state, slotRefreshView(), and slotStatusMsg().

Referenced by initActions().

void KShowMailApp::slotShowHeader (  )  [protected, slot]

Shows the headers of all selected mails. Connected with action m_actionShowHeader.

Definition at line 444 of file kshowmail.cpp.

References Types::idle, m_ConfigList, m_state, and ConfigList::showSelectedHeaders().

Referenced by initActions(), and KshowmailView::slotMessageDoubleClicked().

void KShowMailApp::slotEditToolbars (  )  [protected, slot]

Connected with standard action configureToolbars. Opens a dialog to configure the icons of the toolbar.

Definition at line 749 of file kshowmail.cpp.

Referenced by initActions().

void KShowMailApp::slotSaveOptions (  )  [protected, slot]

Saves GUI options, account and filter settings to the configuration file.

Definition at line 186 of file kshowmail.cpp.

References m_actionSave, m_ConfigList, m_pView, ConfigList::saveOptions(), Filter::saveOptions(), and KshowmailView::saveOptions().

Referenced by initActions(), and queryExit().

void KShowMailApp::slotFileQuit (  )  [protected, slot]

Calls the close() method of KShowMailApp to exit the application. Uses askCloseConfirmation() to ask the user (if configured). Sets m_bForceClose to TRUE, therefore queryClose() will be passed without anything to do. After that in queryExit() slotSaveOptions() will be invoked.

Definition at line 244 of file kshowmail.cpp.

References askCloseConfirmation(), and m_bForceClose.

Referenced by initActions(), and slotRefreshReady().

void KShowMailApp::slotSetupAccount (  )  [protected, slot]

Opens the setup dialog for the highlighted account. Connected with m_actionSetupAccount.

Definition at line 256 of file kshowmail.cpp.

References Types::configure, ConfigList::getSelectedAccount(), Types::idle, initNextRefresh(), m_ConfigList, m_state, slotConfChanged(), and stopRefreshTimer().

Referenced by initActions().

void KShowMailApp::slotSetup (  )  [protected, slot]

Connected with the standard setup action. If the application state is "idle" (m_state == idle) it will open the configuration dialog.

Definition at line 764 of file kshowmail.cpp.

References Types::configure, Types::idle, initNextRefresh(), m_state, SetupDialog, slotConfChanged(), and stopRefreshTimer().

Referenced by initActions(), and UniqueApp::newInstance().

void KShowMailApp::slotSetupFilters (  )  [protected, slot]

If the application state is "idle" (m_state == idle) it will open the filter configuration dialog. This dialog does all neccessary work to edit the mail filters. Connected with m_actionSetupFilters.

Definition at line 518 of file kshowmail.cpp.

References Types::configure, Types::idle, m_actionSave, and m_state.

Referenced by initActions().


Member Data Documentation

KshowmailDoc* KShowMailApp::m_pDoc [private]

The central document of our application. Just contains the view (m_pView).

Definition at line 90 of file kshowmail.h.

Referenced by initDocument(), and initView().

KshowmailView* KShowMailApp::m_pView [private]

Contains the account and messages list views.

Definition at line 95 of file kshowmail.h.

Referenced by initView(), KShowMailApp(), slotConfChanged(), slotRefreshView(), and slotSaveOptions().

KCMultiDialog* KShowMailApp::SetupDialog [private]

The setup dialog. Created and used by slotSetup().

Definition at line 100 of file kshowmail.h.

Referenced by KShowMailApp(), and slotSetup().

KAction* KShowMailApp::m_actionSave [private]

save action; connected with slotSaveOptions()

Definition at line 105 of file kshowmail.h.

Referenced by initActions(), readOptions(), slotSaveOptions(), and slotSetupFilters().

KAction* KShowMailApp::m_actionRefresh [private]

refresh messages action; connected with slotRefresh()

Definition at line 110 of file kshowmail.h.

Referenced by initActions(), and KShowMailApp().

ConfigList KShowMailApp::m_ConfigList [private]

Contains the application and account settings. The account settings are stored in ConfigElem objects.

Definition at line 116 of file kshowmail.h.

Referenced by askCloseConfirmation(), event(), initFirstRefresh(), initNextRefresh(), KShowMailApp(), UniqueApp::newInstance(), queryClose(), slotAccountActivated(), KshowmailView::slotAccountClicked(), slotConfChanged(), slotDelete(), slotRefresh(), slotRefreshReady(), slotRefreshView(), slotSaveOptions(), slotSetupAccount(), slotShowHeader(), slotShowMessage(), and slotStop().

AlertDialog* KShowMailApp::m_pAlertDialog [private]

Message box which will be shown, when new mail has arrived.

Definition at line 121 of file kshowmail.h.

Referenced by KShowMailApp(), slotAlertDestroyed(), and slotRefreshReady().

KShowMailDock* KShowMailApp::m_pDockWindow [private]

The window into the system tray.

Definition at line 126 of file kshowmail.h.

Referenced by KShowMailApp(), slotRefreshView(), timerEvent(), and ~KShowMailApp().

QTimer* KShowMailApp::m_pTimer [private]

The refresh timer. Its timeout signal is connected with slotRefresh().

Definition at line 131 of file kshowmail.h.

Referenced by delayNextRefresh(), initFirstRefresh(), initNextRefresh(), KShowMailApp(), stopRefreshTimer(), and ~KShowMailApp().

Types::State_Type KShowMailApp::m_state [private]

Application state during the run time. Shows what KShowMail is doing :-) .

Definition at line 136 of file kshowmail.h.

Referenced by KShowMailApp(), slotDelete(), slotDeletionReady(), slotRefresh(), slotRefreshReady(), slotSetup(), slotSetupAccount(), slotSetupFilters(), slotShowHeader(), slotShowMessage(), slotShowMessageReady(), slotStop(), and timerEvent().

unsigned long KShowMailApp::m_nSecondsToGo [private]

Number of seconds until the next refresh

Definition at line 141 of file kshowmail.h.

Referenced by delayNextRefresh(), initFirstRefresh(), initNextRefresh(), stopRefreshTimer(), and timerEvent().

KAboutData * KShowMailApp::m_pAbout [static]

Contains information about KShowMail, including author, license, version etc. This is accessed in main() when calling KShowMailApp::initMenuBar() to create the help menu.

Definition at line 160 of file kshowmail.h.


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