summaryrefslogtreecommitdiff
path: root/libtemplate/template.h
blob: a4ef238b95bb65fc723073c00523634bd329b037 (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
#ifndef __TEMPLATE_H
#define __TEMPLATE_H

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

#include "globals.h"
#include "templateview.h"
#include "templateviewelement.h"
#include "templatepixmap.h"
#include "templatefunction.h"

using namespace std;

// --- cTemplate -------------------------------------------------------------
enum eViewType {
    vtDisplayChannel,
    vtDisplayMenu,
    vtDisplayReplay,
    vtDisplayVolume,
    vtDisplayAudioTracks,
    vtDisplayMessage
};

class cTemplate {
private:
    eViewType viewType;
    void CacheImage(cTemplateFunction *func);
protected:
    cGlobals *globals;
    cTemplateView *rootView;
    void CreateView(void);
    void GetUsedFonts(cTemplateView *view, vector< pair<string, int> > &usedFonts);
    void CacheImages(cTemplateView *view);
public:
    cTemplate(eViewType viewType);
    virtual ~cTemplate(void);
    bool ReadFromXML(void);
    void SetGlobals(cGlobals *globals);
    cTemplateView *GetRootView(void) { return rootView; };
    void Translate(void);
    void PreCache(void);
    //get fonts for pre caching
    vector< pair<string, int> > GetUsedFonts(void);
    void CacheImages(void);
    //Debug
    void Debug(void);
};

#endif //__TEMPLATE_H