kmail

kmsystemtray.h

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   bool hasUnreadMail() const;
00055 
00056 public slots:
00057   void foldersChanged();
00058 
00059 private slots:
00060   void updateNewMessageNotification(KMFolder * folder);
00061   void selectedAccount(int);
00062   void updateNewMessages();
00063 
00064 protected:
00065   void mousePressEvent(QMouseEvent *);
00066   bool mainWindowIsOnCurrentDesktop();
00067   void showKMail();
00068   void buildPopupMenu();
00069   void updateCount();
00070 
00071   QString prettyName(KMFolder *);
00072 
00073 private:
00074 
00075   bool mParentVisible;
00076   QPoint mPosOfMainWin;
00077   int mDesktopOfMainWin;
00078 
00079   int mMode;
00080   int mCount;
00081   int mNewMessagePopupId;
00082 
00083   KPopupMenu * mPopupMenu;
00084   QPixmap mDefaultIcon;
00085   QImage mLightIconImage;
00086 
00087   QValueVector<KMFolder*> mPopupFolders;
00088   QMap<QGuardedPtr<KMFolder>, int> mFoldersWithUnread;
00089   QMap<QGuardedPtr<KMFolder>, bool> mPendingUpdates;
00090   QTimer *mUpdateTimer;
00091   time_t mLastUpdate;
00092 };
00093 
00094 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys