summaryrefslogtreecommitdiff
path: root/libtemplate/templateviewelement.h
blob: cbc29116b7ae4178a67174db3aa23c20cb14ad36 (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
#ifndef __TEMPLATEVIEWELEMENT_H
#define __TEMPLATEVIEWELEMENT_H

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <sstream>

#include "templatepixmap.h"
#include "templatefunction.h"

using namespace std;

// --- cTemplateViewElement -------------------------------------------------------------

enum eViewElement {
    //Common ViewElements
    veUndefined,
    veBackground,
    veDateTime,
    veTime,
    veMessage,
    veSortMode,
    veDevices,
    veCurrentWeather,
    veCustomTokens,
    //DisplayChannel ViewElements
    veChannelInfo,
    veChannelGroup,
    veEpgInfo,
    veProgressBar,
    veProgressBarBack,
    veStatusInfo,
    veAudioInfo,
    veScreenResolution,
    veSignalQuality,
    veSignalQualityBack,
    veScraperContent,
    veEcmInfo,
    //DisplayMenu ViewElements
    veHeader,
    veButtons,
    veDiscUsage,
    veSystemLoad,
    veSystemMemory,
    veVDRStats,
    veTemperatures,
    veTimers,
    veLastRecordings,
    veCurrentSchedule,
    veMenuItem,
    veMenuCurrentItemDetail,
    veScrollbar,
    veDetailHeader,
    veTabLabels,
    //DisplayReplay ViewElements
    veRecTitle,
    veRecInfo,
    veRecCurrent,
    veRecTotal,
    veRecEnd,
    veRecProgressBar,
    veCuttingMarks,
    veControlIcons,
    veControlIconsModeOnly,
    veBackgroundModeOnly,
    veRecJump,
    veOnPause,
    veOnPauseModeOnly,
    //DisplayVolume ViewElements
    veVolume
};

enum ePluginInteralViewElements {
    pveScrollbar = -1,
    pveTablabels = -2,
    pveUndefined = 0
};

class cTemplateViewElement {
protected:
    bool debugTokens;
    cGlobals *globals;
    cTemplateFunction *parameters;
    int containerX;
    int containerY;
    int containerWidth;
    int containerHeight;
    vector<cTemplatePixmapNode*> viewPixmapNodes;
    vector<cTemplatePixmapNode*>::iterator pixmapNodeIterator;
    cTemplatePixmap *pixmapIterator;
    cTemplatePixmapContainer *currentNode;
    int pixOffset;
public:
    cTemplateViewElement(void);
    virtual ~cTemplateViewElement(void);
    void SetContainer(int x, int y, int width, int height);
    virtual void SetGlobals(cGlobals *globals);
    void SetParameters(vector<pair<string, string> > &params);
    bool CalculateParameters(void);
    virtual bool CalculatePixmapParameters(void);
    bool CalculatePixmapParametersList(int orientation, int numElements);    
    void AddPixmap(cTemplatePixmapNode *pix) { viewPixmapNodes.push_back(pix); };
    int GetNumericParameter(eParamType type);
    void SetPixOffset(int offset) { pixOffset = offset; };
    int GetPixOffset(void) { return pixOffset; };
    virtual int GetNumPixmaps(void);
    void InitPixmapNodeIterator(void);
    cTemplatePixmapNode *GetNextPixmapNode(void);
    void InitPixmapIterator(void);
    cTemplatePixmap *GetNextPixmap(void);
    cTemplateFunction *GetFunction(string name);
    bool Execute(void);
    bool Detach(void);
    string GetMode(void);
    bool DebugTokens(void);
    virtual void Debug(void);
};

#endif //__TEMPLATEVIEWELEMENT_H