summaryrefslogtreecommitdiff
path: root/menudetailview.h
blob: d3dd0387c2c3508301b510cd7aa538b2680eedb9 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef __NOPACITY_MENUDETAILVIEW_H
#define __NOPACITY_MENUDETAILVIEW_H

#include <vdr/recording.h>
#include <vdr/skins.h>

#include <vector>
#include <string>
#include "services/scraper2vdr.h"
#include "services/tvscraper.h"
#include "imagecache.h"

class cNopacityMenuDetailView : public cThread {
protected:
    cOsd *osd;
    cImageCache *imgCache;
    bool hasScrollbar;
    int x, width, height, top;
    int headerHeight;
    int contentWidth;
    int contentX;
    int contentHeight;
    int contentDrawPortHeight;
    int widthPoster;
    int border;
    int yBanner;
    int yEPGText;
    int yActors;
    int yScrapInfo;
    int yFanart;
    int yAddInf;
    int yEPGPics;
    int actorThumbWidth;
    int actorThumbHeight;
    cFont *font, *fontSmall, *fontHeader, *fontHeaderLarge;
    cPixmap *pixmapHeader;
    cPixmap *pixmapLogo;
    cPixmap *pixmapContent;
    cPixmap *pixmapPoster;
    bool hasManualPoster;
    cString manualPosterPath;
    cMovie movie;
    cSeries series;
    bool isMovie;
    bool isSeries;
    cTextWrapper scrapInfo;
    TVScraperGetFullInformation mediaInfo;
    bool hasAdditionalMedia;
    void DrawTextWrapper(cTextWrapper *wrapper, int top);
    int HeightActorPics(void);
    int HeightScraperInfo(void);
    int HeightFanart(void);
    void DrawPoster(void);
    void DrawBanner(int height);
    void DrawAdditionalBanners(int top, int bottom);
    void DrawActors(int height);
    void DrawFanart(int height);
    virtual void Action(void) {};
public:
    cNopacityMenuDetailView(cOsd *osd, cImageCache *imgCache);
    virtual ~cNopacityMenuDetailView(void);
    void SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight);
    virtual void SetFonts(void) = 0;
    bool Scrollable(void) {return hasScrollbar;}
    double ScrollbarSize(void);
    double Offset(void);
    bool Scroll(bool Up, bool Page);
    virtual void SetContent(void) = 0;
    virtual void SetContentHeight(void) = 0;
    virtual void CreatePixmaps(void) = 0;
    virtual void Render(void) = 0;
};

class cNopacityMenuDetailEventView : public cNopacityMenuDetailView {
private:
    const cEvent *event;
    cTextWrapper epgText;
    cTextWrapper reruns;
    int numEPGPics;
    void DrawHeader(void);
    void LoadReruns(void);
    int HeightEPGPics(void);
    void DrawEPGPictures(int height);
    void Action(void);
public:
    cNopacityMenuDetailEventView(cOsd *osd, cImageCache *imgCache, const cEvent *Event);
    virtual ~cNopacityMenuDetailEventView(void);
    void SetContent(void);
    void SetContentHeight(void);
    void CreatePixmaps(void);
    void SetFonts(void);
    void Render(void);
};

class cNopacityMenuDetailRecordingView : public cNopacityMenuDetailView {
private:
    const cRecording *recording;
    const cRecordingInfo *info;
    cTextWrapper recInfo;
    cTextWrapper additionalInfo;
    void DrawHeader(void);
    void LoadRecordingInformation(void);
    std::string StripXmlTag(std::string &Line, const char *Tag);
    int ReadSizeVdr(const char *strPath);
    std::vector<std::string> epgpics;
    bool LoadEPGPics(void);
    int HeightEPGPics(void);
    void DrawEPGPictures(int height);
    void Action(void);
public:
    cNopacityMenuDetailRecordingView(cOsd *osd, const cRecording *Recording);
    virtual ~cNopacityMenuDetailRecordingView(void);
    void SetContent(void);
    void SetContentHeight(void);
    void CreatePixmaps(void);
    void SetFonts(void);
    void Render(void);
};

class cNopacityMenuDetailTextView : public cNopacityMenuDetailView {
private:
    const char *text;
    cTextWrapper content;
public:
    cNopacityMenuDetailTextView(cOsd *osd, const char *text);
    virtual ~cNopacityMenuDetailTextView(void);
    void SetContent(void);
    void SetContentHeight(void);
    void CreatePixmaps(void);
    void SetFonts(void);
    void Render(void);
};
#endif //__NOPACITY_MENUDETAILVIEW_H