1 /***************************************************************************
2 kmsystemtray.h - description
4 begin : Fri Aug 31 22:38:44 EDT 2001
5 copyright : (C) 2001 by Ryan Breen
6 email : ryan@porivo.com
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
18 #ifndef KMSYSTEMTRAY_H
19 #define KMSYSTEMTRAY_H
21 #include <AkonadiCore/collection.h>
23 #include <kstatusnotifieritem.h>
26 #include <QAbstractItemModel>
31 * KMSystemTray extends KStatusNotifierItem and handles system
32 * tray notification for KMail
36 class KMSystemTray
: public KStatusNotifierItem
41 explicit KMSystemTray(QObject
*parent
= Q_NULLPTR
);
45 void setShowUnreadCount(bool showUnreadCount
);
48 * Use this method to disable any systray icon changing.
49 * By default this is enabled and you'll see the "new e-mail" icon whenever there's
52 void setSystrayIconNotificationsEnabled(bool enable
);
54 void setMode(int mode
);
58 bool hasUnreadMail() const;
60 void updateSystemTray();
64 void slotContextMenuAboutToShow();
65 void slotSelectCollection(QAction
*act
);
66 void initListOfCollection();
67 void slotCollectionStatisticsChanged(Akonadi::Collection::Id
, const Akonadi::CollectionStatistics
&);
68 void slotGeneralPaletteChanged();
69 void slotGeneralFontChanged();
72 bool mainWindowIsOnCurrentDesktop();
73 bool buildPopupMenu();
75 void fillFoldersMenu(QMenu
*menu
, const QAbstractItemModel
*model
, const QString
&parentName
= QString(), const QModelIndex
&parentIndex
= QModelIndex());
76 void unreadMail(const QAbstractItemModel
*model
, const QModelIndex
&parentIndex
= QModelIndex());
77 bool excludeFolder(const Akonadi::Collection
&collection
) const;
78 bool ignoreNewMailInFolder(const Akonadi::Collection
&collection
);
83 int mDesktopOfMainWin
;
88 bool mShowUnreadMailCount
;
89 bool mIconNotificationsEnabled
;
91 QMenu
*mNewMessagesPopup
;