summaryrefslogtreecommitdiff
path: root/libskindesigner/skindesignerosdbase.h
blob: 060ec11ef22cf9e7b898b636c8c80e56b63f7782 (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
#ifndef __SKINDESIGNEROSDBASE_H
#define __SKINDESIGNEROSDBASE_H

#include <string>
#include <vector>
#include <map>
#include <set>
#include <sstream>
#include <vdr/osdbase.h>
#include <vdr/plugin.h>
#include "services.h"

class cOsdView;

/**********************************************************************
* cSkindesignerOsdObject
**********************************************************************/
class cSkindesignerOsdObject : public cOsdObject {
protected:
    string pluginName;
    cPlugin *pSkinDesigner;
    bool InitSkindesignerInterface(string pluginName);
    cOsdView *GetOsdView(int viewID, int subViewID = -1);
public:
    cSkindesignerOsdObject(void);
    virtual ~cSkindesignerOsdObject();
    virtual void Show(void) {};
};

/**********************************************************************
* cSkindesignerOsdItem
**********************************************************************/
class cSkindesignerOsdItem : public cOsdItem {
private:
    cSDDisplayMenu *sdDisplayMenu;
    map < string, string > stringTokens;
    map < string, int > intTokens;
    map < string, vector< map< string, string > > > loopTokens;
protected:
public:
    cSkindesignerOsdItem(eOSState State = osUnknown);
    cSkindesignerOsdItem(const char *Text, eOSState State = osUnknown, bool Selectable = true);
    virtual ~cSkindesignerOsdItem();
    virtual void SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable);
    void SetDisplayMenu(cSDDisplayMenu *sdDisplayMenu) { this->sdDisplayMenu = sdDisplayMenu; };
    void AddStringToken(string key, string value);
    void AddIntToken(string key, int value);
    void AddLoopToken(string loopName, map<string, string> &tokens);
};

/**********************************************************************
* cSkindesignerOsdMenu
**********************************************************************/
class cSkindesignerOsdMenu : public cOsdMenu {
private:
    bool init;
    bool displayText;
    string pluginName;
    cSDDisplayMenu *sdDisplayMenu;
    string text;
    map < string, string > stringTokens;
    map < string, int > intTokens;
    map < string, vector< map< string, string > > > loopTokens;
    bool SetSkinDesignerDisplayMenu(void);
protected:
    void ClearTokens(void);
    void SetPluginName(string name) {pluginName = name; };
    void SetPluginMenu(int menu, eMenuType type);
    void SetText(string text) { this->text = text; };
    void AddStringToken(string key, string value);
    void AddIntToken(string key, int value);
    void AddLoopToken(string loopName, map<string, string> &tokens);
    void TextKeyLeft(void);
    void TextKeyRight(void);
    void TextKeyUp(void);
    void TextKeyDown(void);
public:
    cSkindesignerOsdMenu(const char *Title, int c0 = 0, int c1 = 0, int c2 = 0, int c3 = 0, int c4 = 0);
    virtual ~cSkindesignerOsdMenu();
    virtual void Display(void);
};

#endif // __SKINDESIGNEROSDBASE_H