1 #ifndef __lib_service_listboxservice_h
2 #define __lib_service_listboxservice_h
4 #include <lib/gui/elistbox.h>
5 #include <lib/service/iservice.h>
9 class eListboxServiceContent: public virtual iListboxContent
11 DECLARE_REF(eListboxServiceContent);
13 eListboxServiceContent();
14 void setRoot(const eServiceReference &ref);
15 void getCurrent(eServiceReference &ref);
17 /* support for marked services */
19 void addMarked(const eServiceReference &ref);
20 void removeMarked(const eServiceReference &ref);
21 int isMarked(const eServiceReference &ref);
23 /* this is NOT thread safe! */
24 void markedQueryStart();
25 int markedQueryNext(eServiceReference &ref);
27 int lookupService(const eServiceReference &ref);
28 void setCurrent(const eServiceReference &ref);
35 void setVisualMode(int mode);
37 /* only in complex mode: */
42 celServiceInfo, // "now" event
46 void setElementPosition(int element, eRect where);
47 void setElementFont(int element, gFont *font);
51 int setCurrentMarked(bool);
53 void setNumberOffset(int offset) { m_numberoffset = offset; }
57 int cursorMove(int count=1);
66 // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
67 void setSize(const eSize &size);
69 /* the following functions always refer to the selected item */
70 void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
73 /* for complex mode */
74 eRect m_element_position[celElements];
75 ePtr<gFont> m_element_font[celElements];
77 typedef std::list<eServiceReference> list;
80 list::iterator m_cursor, m_saved_cursor;
82 int m_cursor_number, m_saved_cursor_number;
86 ePtr<iServiceHandler> m_service_center;
88 eServiceReference m_root;
90 /* support for marked services */
91 std::set<eServiceReference> m_marked;
92 std::set<eServiceReference>::const_iterator m_marked_iterator;
94 /* support for movemode */
95 bool m_current_marked;
96 list::iterator m_swap;