- add "getCurrent" to service listbox
[vuplus_dvbapp] / 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         void getCurrent(eServiceReference &ref);
16
17 protected:
18         void cursorHome();
19         void cursorEnd();
20         int cursorMove(int count=1);
21         int cursorValid();
22         int cursorSet(int n);
23         int cursorGet();
24         
25         void cursorSave();
26         void cursorRestore();
27         int size();
28         
29         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
30         void setSize(const eSize &size);
31         
32                 /* the following functions always refer to the selected item */
33         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
34 private:
35         typedef std::list<eServiceReference> list;
36         
37         list m_list;
38         list::iterator m_cursor, m_saved_cursor;
39         
40         int m_cursor_number, m_saved_cursor_number;
41         int m_size;
42         
43         eSize m_itemsize;
44         ePtr<eServiceCenter> m_service_center;
45         
46         eServiceReference m_root;
47 };
48
49 #endif