kmail

kmsystemtray.h
1 /***************************************************************************
2  kmsystemtray.h - description
3  -------------------
4  begin : Fri Aug 31 22:38:44 EDT 2001
5  copyright : (C) 2001 by Ryan Breen
6  email : ryan@porivo.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef KMSYSTEMTRAY_H
19 #define KMSYSTEMTRAY_H
20 
21 #include <ksystemtray.h>
22 
23 #include <tqmap.h>
24 #include <tqguardedptr.h>
25 #include <tqvaluevector.h>
26 #include <tqpixmap.h>
27 #include <tqimage.h>
28 
29 #include <time.h>
30 
31 class KMFolder;
32 class KMMainWidget;
33 class TQMouseEvent;
34 class KPopupMenu;
35 class TQPoint;
36 
41 class KMSystemTray : public KSystemTray
42 {
43  Q_OBJECT
44  TQ_OBJECT
45 public:
47  KMSystemTray(TQWidget* parent=0, const char *name=0);
49  ~KMSystemTray();
50 
51  void setMode(int mode);
52  int mode() const;
53 
54  void hideKMail();
55  bool hasUnreadMail() const;
56 
57 public slots:
58  void foldersChanged();
59 
60 private slots:
61  void updateNewMessageNotification(KMFolder * folder);
62  void selectedAccount(int);
63  void updateNewMessages();
64  void tray_quit();
65 
66 protected:
67  void mousePressEvent(TQMouseEvent *);
68  bool mainWindowIsOnCurrentDesktop();
69  void showKMail();
70  void buildPopupMenu();
71  void updateCount();
72 
73  TQString prettyName(KMFolder *);
74 
75 private:
76 
77  bool mParentVisible;
78  TQPoint mPosOfMainWin;
79  int mDesktopOfMainWin;
80 
81  int mMode;
82  int mCount;
83  int mNewMessagePopupId;
84 
85  KPopupMenu * mPopupMenu;
86  TQPixmap mDefaultIcon;
87  TQImage mLightIconImage;
88 
89  TQValueVector<KMFolder*> mPopupFolders;
90  TQMap<TQGuardedPtr<KMFolder>, int> mFoldersWithUnread;
91  TQMap<TQGuardedPtr<KMFolder>, bool> mPendingUpdates;
92  TQTimer *mUpdateTimer;
93  time_t mLastUpdate;
94 };
95 
96 #endif