* maximal -> maximum
[kdenetwork.git] / kget / ui / tray.h
blobd9243f1239a2e649254aa8779593382296337e5d
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 running);
41 bool isDownloading();
43 private:
44 /**
45 * Repaints trayIcon showing progress (and overlay if present)
47 void paintIcon( int mergePixels = -1, bool force = false );
48 /**
49 * Blend an overlay icon over 'sourcePixmap' and repaint trayIcon
51 void blendOverlay( QPixmap * sourcePixmap );
53 QTimer *blinkTimer;
54 QPixmap *baseIcon, *grayedIcon, *alternateIcon;
55 QPixmap *playOverlay, *stopOverlay;
56 QPixmap *overlay; //!< The current overlay (may be NULL)
57 bool iconOn;
58 bool overlayVisible;
59 bool m_running;
61 private slots:
62 void slotActivated( QSystemTrayIcon::ActivationReason reason );
63 void slotTimeout();
66 #endif