00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KSHOWMAIL_H
00019 #define KSHOWMAIL_H
00020
00021 class KShowmailView;
00022 class MailViewModel;
00023
00024
00025 #include <QListIterator>
00026 #include <QSortFilterProxyModel>
00027 #include <QList>
00028 #include <QStringList>
00029 #include <QPointer>
00030
00031
00032 #include <kstatusbar.h>
00033 #include <KDE/KLocale>
00034 #include <kxmlguiwindow.h>
00035 #include <kaction.h>
00036 #include <KStandardAction>
00037 #include <KActionCollection>
00038 #include <KDebug>
00039 #include <KApplication>
00040 #include <KCMultiDialog>
00041 #include <KMessageBox>
00042 #include <KSystemTrayIcon>
00043 #include <Phonon/AudioOutput>
00044 #include <Phonon/MediaObject>
00045 #include <KProcess>
00046
00047
00048 #include "kshowmailview.h"
00049 #include "accountlist.h"
00050 #include "accountviewmodel.h"
00051 #include "mailviewmodel.h"
00052 #include "mail.h"
00053 #include "types.h"
00054 #include "filterlogview.h"
00055 #include "showheaderdialog.h"
00056 #include "showmaildialog.h"
00057 #include "systemtrayicon.h"
00058 #include "accountsetupdialogcontext.h"
00059 #include "newmaildialog.h"
00060
00061 using namespace Types;
00062
00070 class KShowmail : public KXmlGuiWindow
00071 {
00072 Q_OBJECT
00073
00074 public:
00075
00079 KShowmail();
00080
00084 virtual ~KShowmail();
00085
00086 protected:
00087
00091 void initActions();
00092
00097 void showStatusMessage( const QString& text );
00098
00103 virtual bool queryClose();
00104
00108 void initStatusBar();
00109
00113 void refreshFilterStatusBar();
00114
00118 FilterLog fLog;
00119
00124 void startAutomaticRefresh( bool initiate = false );
00125
00129 void stopAutomaticRefresh();
00130
00134 void handleNewMails();
00135
00139 void handleNoNewMails();
00140
00145 bool askCloseConfirmation();
00146
00147
00148 protected slots:
00149
00154 void slotRefresh();
00155
00159 void slotShowHeader();
00160
00165 void slotShowMessage();
00166
00171 void slotDelete();
00172
00177 void slotStop();
00178
00182 void slotShowFilterLog();
00183
00187 void slotAddToWhitelist();
00188
00192 void slotAddToBlacklist();
00193
00198 void slotSetup();
00199
00203 void slotSendFeedbackMail();
00204
00208 void slotFileQuit();
00209
00214 void slotConfChanged();
00215
00221 void slotRefreshReady();
00222
00229 void slotNormalCursor();
00230
00237 void slotWaitingCursor();
00238
00246 void slotDeletionReady();
00247
00254 void slotShowMessageReady();
00255
00260 void slotRefreshTimer();
00261
00267 void slotSetupAccount();
00268
00273 void slotShowMainWindow();
00274
00275 private:
00276
00280 KShowmailView* view;
00281
00285 KAction* actionRefresh;
00286
00291 KAction* actionShowHeader;
00292
00297 KAction* actionShowMessage;
00298
00303 KAction* actionDelete;
00304
00309 KAction* actionStop;
00310
00315 KAction* actionShowFilterLog;
00316
00321 KAction* actionAddWhitelist;
00322
00327 KAction* actionAddBlacklist;
00328
00333 KAction* actionSetupAccount;
00334
00338 AccountList* accounts;
00339
00343 KCMultiDialog* setupDialog;
00344
00348 KSharedConfigPtr config;
00349
00353 KConfigGroup* configGeneral;
00354
00358 State_Type state;
00359
00363 QItemSelectionModel* mailSelectModel;
00364
00368 QItemSelectionModel* accountSelectModel;
00369
00373 MailViewModel* mailModel;
00374
00378 AccountViewModel* accountModel;
00379
00383 SystemTrayIcon* trayIcon;
00384
00388 QTimer* refreshTimer;
00389
00393 unsigned int timeToRefresh;
00394
00399 Phonon::MediaObject *mediaObject;
00400
00405 Phonon::AudioOutput *audioOutput;
00406
00411 NewMailDialog* newMailDlg;
00412
00416 bool forceExit;
00417
00418 };
00419
00420 #endif // _KSHOWMAIL_H_