KVIrc  4.9.2
DeveloperAPIs
libkvitrayicon.h
Go to the documentation of this file.
1 #ifndef _KVI_TRAYICON_H_
2 #define _KVI_TRAYICON_H_
3 //=============================================================================
4 //
5 // File : libkvitrayicon.h
6 // Creation date : Tue Jan 02 2001 14:34:12 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)
10 // Copyright (C) 2007 Alexey Uzhva (wizard at opendoor dot ru)
11 // Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)
12 //
13 // This program is FREE software. You can redistribute it and/or
14 // modify it under the terms of the GNU General Public License
15 // as published by the Free Software Foundation; either version 2
16 // of the License, or (at your option) any later version.
17 //
18 // This program is distributed in the HOPE that it will be USEFUL,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 // See the GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program. If not, write to the Free Software Foundation,
25 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 //
27 //=============================================================================
28 
29 #include "kvi_settings.h"
30 #include "KviDynamicToolTip.h"
31 #include "KviMainWindow.h"
32 #include "KviTrayIcon.h"
33 
34 #include <QSystemTrayIcon>
35 #include <QLabel>
36 
37 class QPixmap;
38 class QTimer;
39 class QMenu;
40 
41 class KviTrayIconWidget : public QSystemTrayIcon, public KviTrayIcon
42 {
43  Q_OBJECT
44 public:
47 
48 protected:
50  QMenu * m_pContextPopup;
51  QMenu * m_pAwayPopup;
52 #ifndef COMPILE_ON_MAC
53  QLabel * m_pTitleLabel;
54 #endif
55 
56  QAction * m_pToggleFrame;
57  QAction * m_pAwayMenuId;
58 
59  bool m_bFlashed;
60  bool m_bHidden;
61 
62  QPixmap m_CurrentPixmap;
63 
64  QTimer * m_pFlashingTimer;
65  unsigned int m_iConsoles;
66  unsigned int m_iChannels;
67  unsigned int m_iQueries;
68  unsigned int m_iOther;
69 
70 public:
71  virtual void refresh();
72  virtual void die();
73  void updateIcon();
74 
75 protected:
76  void grabActivityInfo();
77  virtual bool event(QEvent * e);
78 protected slots:
79  void fillContextPopup();
80  void toggleParentFrame();
81  void doAway(bool);
82  void flashingTimerShot();
83  void activatedSlot(QSystemTrayIcon::ActivationReason reason);
84  void executeInternalCommand(bool);
85  void disableTrayIcon();
86 };
87 
88 #endif //_KVI_TRAYICON_H_
Definition: KviDynamicToolTip.h:49
virtual void die()
Definition: libkvitrayicon.cpp:161
unsigned int m_iConsoles
Definition: libkvitrayicon.h:65
QPixmap m_CurrentPixmap
Definition: libkvitrayicon.h:62
unsigned int m_iOther
Definition: libkvitrayicon.h:68
unsigned int m_iChannels
Definition: libkvitrayicon.h:66
void flashingTimerShot()
Definition: libkvitrayicon.cpp:166
~KviTrayIconWidget()
Definition: libkvitrayicon.cpp:128
void doAway(bool)
Definition: libkvitrayicon.cpp:254
QTimer * m_pFlashingTimer
Definition: libkvitrayicon.h:64
void grabActivityInfo()
Definition: libkvitrayicon.cpp:501
virtual void refresh()
Definition: libkvitrayicon.cpp:426
virtual bool event(QEvent *e)
Definition: libkvitrayicon.cpp:202
#define e
Definition: detector.cpp:69
void toggleParentFrame()
Definition: libkvitrayicon.cpp:374
KviDynamicToolTip m_Tip
Definition: libkvitrayicon.h:49
void executeInternalCommand(bool)
Definition: libkvitrayicon.cpp:143
Definition: libkvitrayicon.h:41
void activatedSlot(QSystemTrayIcon::ActivationReason reason)
Definition: libkvitrayicon.cpp:477
bool m_bHidden
Definition: libkvitrayicon.h:60
QAction * m_pAwayMenuId
Definition: libkvitrayicon.h:57
QMenu * m_pContextPopup
Definition: libkvitrayicon.h:50
unsigned int m_iQueries
Definition: libkvitrayicon.h:67
bool m_bFlashed
Definition: libkvitrayicon.h:59
The KviTrayIcon class.
Definition: KviTrayIcon.h:37
void disableTrayIcon()
Definition: libkvitrayicon.cpp:172
QMenu * m_pAwayPopup
Definition: libkvitrayicon.h:51
QLabel * m_pTitleLabel
Definition: libkvitrayicon.h:53
void fillContextPopup()
Definition: libkvitrayicon.cpp:313
This file contains compile time settings.
QAction * m_pToggleFrame
Definition: libkvitrayicon.h:56
KviTrayIconWidget()
Definition: libkvitrayicon.cpp:70
void updateIcon()
Definition: libkvitrayicon.cpp:620