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 TDEPopupMenu;
35 class TQPoint;
36 
41 class KMSystemTray : public KSystemTray
42 {
43  Q_OBJECT
44 
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  void resizeEvent(TQResizeEvent *);
73 
74  TQString prettyName(KMFolder *);
75 
76 private:
77 
78  bool mParentVisible;
79  TQPoint mPosOfMainWin;
80  int mDesktopOfMainWin;
81 
82  int mMode;
83  int mCount;
84  int mNewMessagePopupId;
85 
86  TDEPopupMenu * mPopupMenu;
87  TQPixmap mDefaultIcon;
88  TQImage mLightIconImage;
89 
90  TQValueVector<KMFolder*> mPopupFolders;
91  TQMap<TQGuardedPtr<KMFolder>, int> mFoldersWithUnread;
92  TQMap<TQGuardedPtr<KMFolder>, bool> mPendingUpdates;
93  TQTimer *mUpdateTimer;
94  time_t mLastUpdate;
95 };
96 
97 #endif