7ef6011616a192f61000957ba06cdb2ecd6c8206
[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;
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;
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         RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
59         
60         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
61         void setSize(const eSize &size);
62         
63                 /* the following functions always refer to the selected item */
64         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
65 private:
66         typedef std::list<std::string> list;
67         
68         list m_list;
69         list::iterator m_cursor, m_saved_cursor;
70         
71         int m_cursor_number, m_saved_cursor_number;
72         int m_size;
73         
74         eSize m_itemsize;
75 #endif
76 };
77
78 class eListboxPythonStringContent: public virtual iListboxContent
79 {
80         DECLARE_REF;
81 public:
82         eListboxPythonStringContent();
83         ~eListboxPythonStringContent();
84
85         void setList(PyObject *list);
86         PyObject *getCurrentSelection();
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         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
107
108 private:
109         PyObject *m_list;
110         int m_cursor, m_saved_cursor;
111         eSize m_itemsize;
112 #endif
113 };
114
115 #endif