deea30001340a880bd4f017c375a5ce4e98b8c67
[vuplus_dvbapp] / 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         // 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;
79 public:
80         eListboxPythonStringContent();
81         ~eListboxPythonStringContent();
82
83         void setList(PyObject *list);
84         PyObject *getCurrentSelection();
85 #ifndef SWIG
86 protected:
87         void cursorHome();
88         void cursorEnd();
89         int cursorMove(int count=1);
90         int cursorValid();
91         int cursorSet(int n);
92         int cursorGet();
93         
94         void cursorSave();
95         void cursorRestore();
96         int size();
97         
98         RESULT connectItemChanged(const Slot0<void> &itemChanged, ePtr<eConnection> &connection);
99         
100         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
101         void setSize(const eSize &size);
102         
103                 /* the following functions always refer to the selected item */
104         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
105
106 private:
107         PyObject *m_list;
108         int m_cursor, m_saved_cursor;
109         eSize m_itemsize;
110 #endif
111 };
112
113 #endif