changed default fontsize(s)
[enigma2.git] / lib / gui / elistboxcontent.h
1 #ifndef __lib_gui_elistboxcontent_h
2 #define __lib_gui_elistboxcontent_h
3
4 #include <lib/python/python.h>
5 #include <lib/gui/elistbox.h>
6
7 class eListboxTestContent: public virtual iListboxContent
8 {
9         DECLARE_REF(eListboxTestContent);
10 public:
11
12 #ifndef SWIG
13 protected:
14         void cursorHome();
15         void cursorEnd();
16         int cursorMove(int count=1);
17         int cursorValid();
18         int cursorSet(int n);
19         int cursorGet();
20         
21         void cursorSave();
22         void cursorRestore();
23         int size();
24         
25         RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
26         
27         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
28         void setSize(const eSize &size);
29         
30                 /* the following functions always refer to the selected item */
31         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
32 private:
33         int m_cursor, m_saved_cursor;
34         eSize m_size;
35 #endif
36 };
37
38 class eListboxStringContent: public virtual iListboxContent
39 {
40         DECLARE_REF(eListboxStringContent);
41 public:
42         eListboxStringContent();
43         void setList(std::list<std::string> &list);
44 #ifndef SWI
45 protected:
46         
47         void cursorHome();
48         void cursorEnd();
49         int cursorMove(int count=1);
50         int cursorValid();
51         int cursorSet(int n);
52         int cursorGet();
53         
54         void cursorSave();
55         void cursorRestore();
56         int size();
57         
58         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
59         void setSize(const eSize &size);
60         
61                 /* the following functions always refer to the selected item */
62         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
63 private:
64         typedef std::list<std::string> list;
65         
66         list m_list;
67         list::iterator m_cursor, m_saved_cursor;
68         
69         int m_cursor_number, m_saved_cursor_number;
70         int m_size;
71         
72         eSize m_itemsize;
73 #endif
74 };
75
76 class eListboxPythonStringContent: public virtual iListboxContent
77 {
78         DECLARE_REF(eListboxPythonStringContent);
79 public:
80         eListboxPythonStringContent();
81         ~eListboxPythonStringContent();
82
83         void setList(PyObject *list);
84         PyObject *getCurrentSelection();
85         int getCurrentSelectionIndex() { return m_cursor; }
86         void invalidateEntry(int index);
87 #ifndef SWIG
88 protected:
89         void cursorHome();
90         void cursorEnd();
91         int cursorMove(int count=1);
92         int cursorValid();
93         int cursorSet(int n);
94         int cursorGet();
95         
96         void cursorSave();
97         void cursorRestore();
98         int size();
99         
100         RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
101         
102         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
103         void setSize(const eSize &size);
104         
105                 /* the following functions always refer to the selected item */
106         virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
107
108 protected:
109         PyObject *m_list;
110         int m_cursor, m_saved_cursor;
111         eSize m_itemsize;
112 #endif
113 };
114
115 class eListboxPythonConfigContent: public eListboxPythonStringContent
116 {
117 public:
118         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
119         void setSeperation(int sep) { m_seperation = sep; }
120 private:
121         int m_seperation;
122 };
123
124 class eListboxPythonMultiContent: public eListboxPythonStringContent
125 {
126 public:
127         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
128         
129         void setFont(int fnt, gFont *fnt);
130 private:
131         std::map<int, ePtr<gFont> > m_font;
132 };
133
134 #endif