File indexing completed on 2024-04-21 04:55:18
0001 /* 0002 This file is part of Choqok, the KDE micro-blogging client 0003 0004 SPDX-FileCopyrightText: 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com> 0005 0006 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #ifndef SYSTRAYICON_H 0010 #define SYSTRAYICON_H 0011 0012 #include <KStatusNotifierItem> 0013 0014 #include "choqoktypes.h" 0015 #include "mainwindow.h" 0016 0017 /** 0018 System tray icon! 0019 0020 @author Mehrdad Momeny \<mehrdad.momeny@gmail.com\> 0021 */ 0022 class SysTrayIcon : public KStatusNotifierItem 0023 { 0024 Q_OBJECT 0025 public: 0026 SysTrayIcon(Choqok::UI::MainWindow *parent); 0027 ~SysTrayIcon(); 0028 int unreadCount() const; 0029 0030 public Q_SLOTS: 0031 void setTimeLineUpdatesEnabled(bool isEnabled); 0032 void slotJobDone(Choqok::JobResult result); 0033 void updateUnreadCount(int changeOfUnreadPosts); 0034 void resetUnreadCount(); 0035 0036 protected Q_SLOTS: 0037 void slotRestoreIcon(); 0038 0039 private: 0040 QString currentIconName(); 0041 int unread; 0042 0043 Choqok::UI::MainWindow *_mainwin; 0044 bool isOffline; 0045 }; 0046 0047 #endif