statuslabel.h 2.06 KB
Newer Older
1 2
/***************************************************************************
    begin                : Fri Oct 18 2002
3
    copyright            : (C) 2002 - 2004 by Scott Wheeler
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
    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 STATUSLABEL_H
#define STATUSLABEL_H

19 20
#include "playlistinterface.h"

Laurent Montel's avatar
Laurent Montel committed
21
#include <khbox.h>
Laurent Montel's avatar
Laurent Montel committed
22 23 24
//Added by qt3to4:
#include <QLabel>
#include <QEvent>
25 26

class QLabel;
27
class KSqueezedTextLabel;
28

29
class FileHandle;
30

Laurent Montel's avatar
Laurent Montel committed
31
class StatusLabel : public KHBox, public PlaylistObserver
32 33 34
{
    Q_OBJECT

35
public:
36
    explicit StatusLabel(PlaylistInterface *playlist, QWidget *parent = 0);
37
    virtual ~StatusLabel();
38
    virtual void updateCurrent();
39

40
public slots:
41 42 43
    /**
     * This just sets internal variables that are used by setItemCurrentTime().
     * Please call that method to display the time.
44
     */
45 46
    void setItemTotalTime(int time) { m_itemTotalTime = time; }
    void setItemCurrentTime(int time) { m_itemCurrentTime = time; updateTime(); }
47
    virtual void updateData();
48

49 50 51
signals:
    void jumpButtonClicked();

52
private:
53 54
    void updateTime();
    virtual bool eventFilter(QObject *o, QEvent *e);
55

56 57
    static QString formatTime(int minutes, int seconds);

58 59 60
    int m_itemTotalTime;
    int m_itemCurrentTime;
    bool m_showTimeRemaining;
61

62 63
    KSqueezedTextLabel *m_playlistLabel;
    KSqueezedTextLabel *m_trackLabel;
64
    QLabel *m_itemTimeLabel;
65 66 67
};

#endif
68 69

// vim: set et sw=4 tw=0 sta: