6219cec6b59c1eea5cfeebb5e515c285cab1629d
[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
6 class eListboxTestContent: public virtual iListboxContent
7 {
8         DECLARE_REF;
9 public:
10         void cursorHome();
11         void cursorEnd();
12         int cursorMove(int count=1);
13         int cursorValid();
14         int cursorSet(int n);
15         int cursorGet();
16         
17         void cursorSave();
18         void cursorRestore();
19         int size();
20         
21         RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
22         
23         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
24         void setSize(const eSize &size);
25         
26                 /* the following functions always refer to the selected item */
27         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
28 private:
29         int m_cursor, m_saved_cursor;
30         eSize m_size;
31 };
32
33 class eListboxStringContent: public virtual iListboxContent
34 {
35         DECLARE_REF;
36 public:
37         eListboxStringContent();
38         
39         void cursorHome();
40         void cursorEnd();
41         int cursorMove(int count=1);
42         int cursorValid();
43         int cursorSet(int n);
44         int cursorGet();
45         
46         void cursorSave();
47         void cursorRestore();
48         int size();
49         
50         RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
51         
52         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
53         void setSize(const eSize &size);
54         
55                 /* the following functions always refer to the selected item */
56         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
57         
58         void setList(std::list<std::string> &list);
59 private:
60         typedef std::list<std::string> list;
61         
62         list m_list;
63         list::iterator m_cursor, m_saved_cursor;
64         
65         int m_cursor_number, m_saved_cursor_number;
66         int m_size;
67         
68         eSize m_itemsize;
69 };
70
71 class eListboxPythonStringContent: public virtual iListboxContent
72 {
73         DECLARE_REF;
74 public:
75         eListboxPythonStringContent();
76         ~eListboxPythonStringContent();
77         void cursorHome();
78         void cursorEnd();
79         int cursorMove(int count=1);
80         int cursorValid();
81         int cursorSet(int n);
82         int cursorGet();
83         
84         void cursorSave();
85         void cursorRestore();
86         int size();
87         
88         RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
89         
90         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
91         void setSize(const eSize &size);
92         
93                 /* the following functions always refer to the selected item */
94         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
95         
96         void setList(PyObject *list);
97         
98         PyObject *getCurrentSelection();
99         
100 private:
101         PyObject *m_list;
102         int m_cursor, m_saved_cursor;
103         eSize m_itemsize;
104 };
105
106 #endif