EPGView.hpp 2.06 KB
Newer Older
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
/*****************************************************************************
 * EPGView.h : EPGView
 ****************************************************************************
 * Copyright © 2009-2010 VideoLAN
 * $Id$
 *
 * Authors: Ludovic Fauvet <etix@l0cal.com>
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef EPGVIEW_H
#define EPGVIEW_H

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
27
28
#include "EPGEvent.hpp"

29
30
31
32
33
#include <QGraphicsView>
#include <QList>

#define TRACKS_HEIGHT 75

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
34
class QDateTime;
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class EPGView : public QGraphicsView
{
Q_OBJECT

public:
    explicit EPGView( QWidget *parent = 0 );

    void            setScale( double scaleFactor );

    void            setStartTime( const QDateTime& startTime );
    const QDateTime& startTime();

    void            addEvent( EPGEvent* event );
    void            updateEvent( EPGEvent* event );
    void            delEvent( EPGEvent* event );
    void            updateDuration();

52
53
    QList<QString>  getChannelList();

54
55
56
signals:
    void            startTimeChanged( const QDateTime& startTime );
    void            durationChanged( int seconds );
57
    void            eventFocusedChanged( EPGEvent * );
58
59
60
61
62
63
protected:

    QList<QString>  m_channels;
    QDateTime       m_startTime;
    int             m_scaleFactor;
    int             m_duration;
64
65
66

public slots:
    void eventFocused( EPGEvent * );
67
68
69
};

#endif // EPGVIEW_H