summaryrefslogtreecommitdiff
path: root/epggrid.h
blob: 5922f38b30d8f1fb77a59dec143309bd1ba6d50f (plain)
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
73
#ifndef __TVGUIDE_EPGGRID_H
#define __TVGUIDE_EPGGRID_H

#include "config.h"
#include "channelepg.h"
#include "timeline.h"
#include "channelgroups.h"
#include "channeljump.h"
#include <libskindesignerapi/skindesignerosdbase.h>

class cEpgGrid {
private:
    int lastSecond;
    int channelsPerPage;
    int channelGroupLast;
    long oldActiveGridId;
    skindesignerapi::cOsdView *rootView;
    cTimeManager *timeManager;
    skindesignerapi::cViewElement *back;
    skindesignerapi::cViewElement *header;
    skindesignerapi::cViewElement *watch;
    skindesignerapi::cViewElement *footer;
    skindesignerapi::cViewGrid *channelsGrid;
    skindesignerapi::cViewGrid *epgGrid;
    cTimeline *timeline;
    cChannelgroups *channelGroups;
    cList<cChannelEpg> channels;
    cGridElement *active;
    set<int> deletedChannels;
    void SetActiveGrid(cGridElement *newActive);
    void ScrollForward(void);
    void ScrollBack(void);
    const cChannel *SeekChannelForward(int num);
    const cChannel *SeekChannelBack(int num);
    void ClearOutdatedChannelHeaders(void);
public:
    cEpgGrid(skindesignerapi::cOsdView *rootView, cTimeManager *timeManager);
    virtual ~cEpgGrid(void);
    void Deactivate(bool hide) { lastSecond = -1; rootView->Deactivate(hide); };
    void Activate(void) { DrawTime(); rootView->Activate(); };
    void Init(const cChannel *startChannel);
    void CreateChannels(const cChannel *startChannel, int activeChannel);
    void Clear(void);
    void SetTimers(void);
    void RebuildEpgGrid(void);
    bool TimeForward(void);
    bool TimeBack(void);
    bool ChannelForward(void);
    bool ChannelBack(void);
    const cChannel *GetNextChannelNumJump(void);
    const cChannel *GetPrevChannelNumJump(void);
    const cChannel *GetNextChannelGroupJump(void);
    const cChannel *GetPrevChannelGroupJump(void);
    bool IsFirstGroup(void);
    bool IsLastGroup(void);
    bool IsSecondLastGroup(void);
    const cChannel *GetCurrentChannel(void);
    int GetLastValidChannel(void);
    const cEvent *GetCurrentEvent(void);
    void DrawChannelHeaders(void);
    void DrawTimeline(void);
    void DrawGrid(void);
    void UpdateActive(void);
    void DrawHeader(void);
    void DrawFooter(void);
    void DrawChannelgroups(void);
    bool DrawTime(void);
    void Flush(void) { rootView->Display(); };
    cChannelJump *GetChannelJumper(void);
    void Debug(void);
};

#endif //__TVGUIDE_EPGGRID_H