Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / kopete / systemtray.h
bloba4464e24a9bafe73dfc45304e936f6072bd881ca
1 /*
2 systemtray.h - Kopete Tray Dock Icon
4 Copyright (c) 2002 by Nick Betcher <nbetcher@kde.org>
5 Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
6 Copyright (c) 2003 by Olivier Goffart <ogoffart@kde.org>
8 Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
10 *************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 *************************************************************************
20 #ifndef SYSTEMTRAY_H
21 #define SYSTEMTRAY_H
23 #include <QtGui/QIcon>
24 #include <QtGui/QMovie>
26 #include <KSystemTrayIcon>
28 #include "kopetemessageevent.h"
30 class QTimer;
31 class KMenu;
33 /**
34 * @author Nick Betcher <nbetcher@kde.org>
36 * NOTE: This class is for use ONLY in libkopete! It is not public API, and
37 * is NOT supposed to remain binary compatible in the future!
39 class KopeteSystemTray : public KSystemTrayIcon
41 Q_OBJECT
43 public:
44 /**
45 * Retrieve the system tray instance
47 static KopeteSystemTray* systemTray( QWidget* parent = 0);
49 ~KopeteSystemTray();
51 // One method, multiple interfaces :-)
52 void startBlink( const QString &icon );
53 void startBlink( const QIcon &icon );
54 void startBlink();
56 void stopBlink();
57 bool isBlinking() const { return mIsBlinking || (movie() && movie()->state() == QMovie::Running); }
59 Q_SIGNALS:
60 void aboutToShowMenu(KMenu *am);
62 private Q_SLOTS:
63 void slotAboutToShowMenu();
64 void slotActivated( QSystemTrayIcon::ActivationReason reason );
66 void slotBlink();
67 void slotNewEvent(Kopete::MessageEvent*);
68 void slotEventDone(Kopete::MessageEvent *);
69 void slotConfigChanged();
70 void slotReevaluateAccountStates();
72 private:
73 KopeteSystemTray( QWidget* parent );
74 QString squashMessage( const Kopete::Message& msgText );
76 QTimer *mBlinkTimer;
77 QIcon mKopeteIcon;
78 QIcon mBlinkIcon;
79 QMovie *mMovie;
81 bool mIsBlinkIcon;
82 bool mIsBlinking;
84 static KopeteSystemTray* s_systemTray;
86 QList<Kopete::MessageEvent*> mEventList;
89 #endif
91 // vim: set noet ts=4 sts=4 sw=4: