abbdc48e7e8055892b2cc0745ec28f7518a86455
[enigma2.git] / lib / components / listboxepg.h
1 #ifndef __lib_components_listboxepg_h
2 #define __lib_components_listboxepg_h
3
4 #include <lib/gui/elistbox.h>
5 #include <lib/service/iservice.h>
6
7 #include <set>
8
9 class eListboxEPGContent: public virtual iListboxContent
10 {
11         DECLARE_REF(eListboxEPGContent);
12 public:
13         eListboxEPGContent();
14         void setRoot(const eServiceReference &ref);
15         void getCurrent(ePtr<eServiceEvent>&);
16
17                 /* only in complex mode: */
18         enum {
19                 celBeginTime,
20                 celTitle,
21                 celElements
22         };
23
24         void setElementPosition(int element, eRect where);
25         void setElementFont(int element, gFont *font);
26
27         void sort();
28
29 protected:
30         void cursorHome();
31         void cursorEnd();
32         int cursorMove(int count=1);
33         int cursorValid();
34         int cursorSet(int n);
35         int cursorGet();
36
37         void cursorSave();
38         void cursorRestore();
39         int size();
40         
41         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
42         void setSize(const eSize &size);
43
44                 /* the following functions always refer to the selected item */
45         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
46
47         eRect m_element_position[celElements];
48         ePtr<gFont> m_element_font[celElements];
49 private:
50         typedef std::list<ePtr<eServiceEvent> > list;
51
52         list m_list;
53         list::iterator m_cursor, m_saved_cursor;
54
55         int m_cursor_number, m_saved_cursor_number;
56         int m_size;
57
58         eSize m_itemsize;
59
60         eServiceReference m_root;
61 };
62
63 #endif