summaryrefslogtreecommitdiff
path: root/menuitem.h
blob: fd001d6a15d9cbde9ea93e26747323f6900c2956 (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
#ifndef __NOPACITY_MENUITEM_H
#define __NOPACITY_MENUITEM_H

class cNopacityMenuItem : public cListObject {
protected:
	cOsd *osd;
	cPixmap *pixmap;
	cPixmap *pixmapIcon;
	bool hasIcon;
	bool iconDrawn;
	int *handleBackgrounds;
	const char *Text;
	bool selectable;
	bool current;
	cFont *font;
	int width, height;
	cString *itemTabs;
	int *tabWidth;
	int numTabs;
	void DrawDelimiter(const char *del, const char *icon, int handleBgrd);
public:
	cNopacityMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
	virtual ~cNopacityMenuItem(void);
	void CreatePixmap(int top, int space, int index, int width, int height);
	void CreatePixmapIcon(int top, int space, int index, int itemHeight, int iconWidth, int iconHeight);
	void SetFont(cFont *font) {this->font = font;}
	void SetCurrent(bool cur) {current = cur;}
	void SetAlpha(int alpha) {this->pixmap->SetAlpha(alpha);}
	void SetAlphaIcon(int alpha) {if (hasIcon) this->pixmapIcon->SetAlpha(alpha);}
	void SetTabs(cString *tabs, int *tabWidths, int numtabs);
	void SetBackgrounds(int *handleBackgrounds);
	virtual void Render() = 0;
};

class cNopacityMainMenuItem : public cNopacityMenuItem {
private:
	cString menuNumber;
	cString menuEntry;
	void SplitMenuItem();
	static std::string items[6];
	cString GetIconName();
public:
	cNopacityMainMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
	~cNopacityMainMenuItem(void);
	void Render();
};

enum eMenuSubCategory { mcSubUndefined = -1, mcSubSchedule = 0, mcSubScheduleWhatsOn, mcSubScheduleTimer, mcSubChannels, mcSubChannelEdit};

class cNopacityScheduleMenuItem : public cNopacityMenuItem {
private:
	eMenuSubCategory subCategory;
	void DrawRemaining(cString remaining, int x, int y, int width);
public:
	cNopacityScheduleMenuItem(cOsd *osd, const char *text, bool cur, bool sel, eMenuSubCategory subCat);
	~cNopacityScheduleMenuItem(void);
	void Render();
};

class cNopacityChannelMenuItem : public cNopacityMenuItem {
private:
public:
	cNopacityChannelMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
	~cNopacityChannelMenuItem(void);
	void Render();
};

class cNopacityDefaultMenuItem : public cNopacityMenuItem {
private:
public:
	cNopacityDefaultMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
	~cNopacityDefaultMenuItem(void);
	void Render();
};

class cNopacityTrackMenuItem : public cNopacityMenuItem {
private:
public:
	cNopacityTrackMenuItem(cOsd *osd, const char *text, bool cur);
	~cNopacityTrackMenuItem(void);
	void Render();
};
#endif //__NOPACITY_MENUITEM_H