~neon/juk/master

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/***************************************************************************
    copyright            : (C) 2002 by Daniel Molkentin
    email                : molkentin@kde.org

    copyright            : (C) 2002 - 2004 by Scott Wheeler
    email                : wheeler@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SYSTEMTRAY_H
#define SYSTEMTRAY_H

#include <ksystemtray.h>

#include <qvaluevector.h>

class FlickerFreeLabel;
class QTimer;
class KPassivePopup;

class SystemTray : public KSystemTray
{
    Q_OBJECT

public:
    SystemTray(QWidget *parent = 0, const char *name = 0);
    virtual ~SystemTray();

private:
    virtual void wheelEvent(QWheelEvent *e);
    void createPopup();
    void setToolTip(const QString &tip = QString::null);
    void mousePressEvent(QMouseEvent *e);
    bool buttonsToLeft() const;
    QPixmap createPixmap(const QString &pixName);

    void createButtonBox(QWidget *parent);
    void addSeparatorLine(QWidget *parent);
    void addCoverButton(QWidget *parent, const QPixmap &cover);

private slots:
    void slotPlay();
    void slotTogglePopup();
    void slotPause() { setPixmap(m_pausePix); }
    void slotStop();
    void slotClearLabels();
    void slotNextStep();
    void slotPopupLargeCover();

private:
    QPixmap m_playPix;
    QPixmap m_pausePix;
    QPixmap m_currentPix;
    QPixmap m_backPix;
    QPixmap m_forwardPix;
    QPixmap m_appPix;

    KPassivePopup *m_popup;
    QLabel *m_currentLabel;
    QValueVector<FlickerFreeLabel *> m_labels;
    int m_step;
};

#endif // SYSTEMTRAY_H