summaryrefslogtreecommitdiff
path: root/layout.h
blob: 95269a830aae9d4daaadf745bd7c7303c119fd28 (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
/*
 * GraphLCD plugin for Video Disc Recorder
 *
 * layout.h  -  layout classes
 *
 * This file is released under the GNU General Public License. Refer
 * to the COPYING file distributed with this package.
 *
 * (c) 2005 Andreas Regel <andreas.regel AT powarman.de>
 */

#include <list>
#include <string>

#include <glcdgraphics/font.h>

typedef enum
{
    ftFNT,
    ftFT2
} eFontTypes;

class cFontElement
{
private:
    std::string name;
    int type;
    std::string file;
    int size;
    GLCD::cFont font;
public:
    cFontElement(const std::string & fontName);
    bool Load(const std::string & url);

    const std::string & Name() const { return name; }
    int Type() const { return type; }
    const std::string & File() const { return file; }
    int Size() const { return size; }
    const GLCD::cFont * Font() const { return &font; }
};


class cFontList
{
private:
    std::list <cFontElement *> fonts;
public:
    cFontList();
    ~cFontList();
    bool Load(const std::string & fileName);
    bool Parse(const std::string & line);

    const GLCD::cFont * GetFont(const std::string & name) const;
};