kmail

kmsystemtray.h

Go to the documentation of this file.
00001 /***************************************************************************
00002               kmsystemtray.h  -  description
00003                -------------------
00004   begin                : Fri Aug 31 22:38:44 EDT 2001
00005   copyright            : (C) 2001 by Ryan Breen
00006   email                : ryan@porivo.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef KMSYSTEMTRAY_H
00019 #define KMSYSTEMTRAY_H
00020 
00021 #include <ksystemtray.h>
00022 
00023 #include <qmap.h>
00024 #include <qguardedptr.h>
00025 #include <qvaluevector.h>
00026 #include <qpixmap.h>
00027 #include <qimage.h>
00028 
00029 #include <time.h>
00030 
00031 class KMFolder;
00032 class KMMainWidget;
00033 class QMouseEvent;
00034 class KPopupMenu;
00035 class QPoint;
00036 
00041 class KMSystemTray : public KSystemTray
00042 {
00043   Q_OBJECT
00044 public:
00046   KMSystemTray(QWidget* parent=0, const char *name=0);
00048   ~KMSystemTray();
00049 
00050   void setMode(int mode);
00051   int mode() const;
00052 
00053   void hideKMail();
00054 
00055 private slots:
00056   void updateNewMessageNotification(KMFolder * folder);
00057   void foldersChanged();
00058   void selectedAccount(int);
00059   void updateNewMessages();
00060 
00061 protected:
00062   void mousePressEvent(QMouseEvent *);
00063   bool mainWindowIsOnCurrentDesktop();
00064   void showKMail();
00065   void buildPopupMenu();
00066   void updateCount();
00067 
00068   QString prettyName(KMFolder *);
00069 
00070 private:
00071 
00072   bool mParentVisible;
00073   QPoint mPosOfMainWin;
00074   int mDesktopOfMainWin;
00075 
00076   int mMode;
00077   int mCount;
00078   int mNewMessagePopupId;
00079 
00080   KPopupMenu * mPopupMenu;
00081   QPixmap mDefaultIcon;
00082   QImage mLightIconImage;
00083 
00084   QValueVector<KMFolder*> mPopupFolders;
00085   QMap<QGuardedPtr<KMFolder>, int> mFoldersWithUnread;
00086   QMap<QGuardedPtr<KMFolder>, bool> mPendingUpdates;
00087   QTimer *mUpdateTimer;
00088   time_t mLastUpdate;
00089 };
00090 
00091 #endif