- fixed lib/Makefile.am for "components" directory
[enigma2.git] / lib / service / listboxservice.h
1 #ifndef __lib_service_listboxservice_h
2 #define __lib_service_listboxservice_h
3
4 #include <lib/gui/elistbox.h>
5 #include <lib/service/iservice.h>
6
7 class eServiceCenter;
8
9 class eListboxServiceContent: public virtual iListboxContent
10 {
11         DECLARE_REF;
12 public:
13         eListboxServiceContent();
14         void setRoot(const eServiceReference &ref);
15
16 protected:
17         void cursorHome();
18         void cursorEnd();
19         int cursorMove(int count=1);
20         int cursorValid();
21         int cursorSet(int n);
22         int cursorGet();
23         
24         void cursorSave();
25         void cursorRestore();
26         int size();
27         
28         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
29         void setSize(const eSize &size);
30         
31                 /* the following functions always refer to the selected item */
32         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
33 private:
34         typedef std::list<eServiceReference> list;
35         
36         list m_list;
37         list::iterator m_cursor, m_saved_cursor;
38         
39         int m_cursor_number, m_saved_cursor_number;
40         int m_size;
41         
42         eSize m_itemsize;
43         ePtr<eServiceCenter> m_service_center;
44         
45         eServiceReference m_root;
46 };
47
48 #endif