- small cut&pase typo
[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 #include <set>
8 class eServiceCenter;
9
10 class eListboxServiceContent: public virtual iListboxContent
11 {
12         DECLARE_REF(eListboxServiceContent);
13 public:
14         eListboxServiceContent();
15         void setRoot(const eServiceReference &ref);
16         void getCurrent(eServiceReference &ref);
17         
18                 /* support for marked services */
19         void initMarked();
20         void addMarked(const eServiceReference &ref);
21         void removeMarked(const eServiceReference &ref);
22         int isMarked(const eServiceReference &ref);
23         int lookupService(const eServiceReference &ref);
24
25
26 protected:
27         void cursorHome();
28         void cursorEnd();
29         int cursorMove(int count=1);
30         int cursorValid();
31         int cursorSet(int n);
32         int cursorGet();
33         
34         void cursorSave();
35         void cursorRestore();
36         int size();
37         
38         // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
39         void setSize(const eSize &size);
40         
41                 /* the following functions always refer to the selected item */
42         void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
43 private:
44         typedef std::list<eServiceReference> list;
45         
46         list m_list;
47         list::iterator m_cursor, m_saved_cursor;
48         
49         int m_cursor_number, m_saved_cursor_number;
50         int m_size;
51         
52         eSize m_itemsize;
53         ePtr<eServiceCenter> m_service_center;
54         
55         eServiceReference m_root;
56         
57                 /* support for marked services */
58         std::set<eServiceReference> m_marked;
59 };
60
61 #endif