don't leak events when the vnc connection has been killed
[kdenetwork.git] / kget / ui / tray.h
blob24c46bffcfd3502c65a0b25c4807972913baaa19
1 /* This file is part of the KDE project
3 Copyright (C) 2002 by Patrick Charbonnier <pch@freeshell.org>
4 Based On Caitoo v.0.7.3 (c) 1998 - 2000, Matej Koss
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
12 #ifndef TRAY_H
13 #define TRAY_H
15 #include <ksystemtrayicon.h>
17 #include "core/observer.h"
19 class MainWindow;
20 class KGet;
21 class QTimer;
22 class QPixmap;
24 /**
25 * This class implements the main tray icon for kget. It has a popup
26 * from which the user can open a new transfer, configure kget,
27 * minimize/restore or quit the app (default behavior).
29 * @short KGet's system tray icon.
30 **/
32 class Tray : public KSystemTrayIcon, public ModelObserver
34 Q_OBJECT
35 public:
36 Tray( MainWindow * parent );
37 ~Tray();
39 void setDownloading( bool );
41 private:
42 /**
43 * Repaints trayIcon showing progress (and overlay if present)
45 void paintIcon( int mergePixels = -1, bool force = false );
46 /**
47 * Blend an overlay icon over 'sourcePixmap' and repaint trayIcon
49 void blendOverlay( QPixmap * sourcePixmap );
51 QTimer *blinkTimer;
52 QPixmap *baseIcon, *grayedIcon, *alternateIcon;
53 QPixmap *playOverlay, *stopOverlay;
54 QPixmap *overlay; //!< The current overlay (may be NULL)
55 bool iconOn;
56 bool overlayVisible;
58 private slots:
59 void slotActivated( QSystemTrayIcon::ActivationReason reason );
60 void slotTimeout();
63 #endif