1 #ifndef __lib_service_listboxservice_h
2 #define __lib_service_listboxservice_h
4 #include <lib/gdi/gpixmap.h>
5 #include <lib/gui/elistbox.h>
6 #include <lib/service/iservice.h>
9 class eListboxServiceContent: public virtual iListboxContent
11 DECLARE_REF(eListboxServiceContent);
13 eListboxServiceContent();
15 void addService(const eServiceReference &ref, bool beforeCurrent=false);
19 void setIgnoreService( const eServiceReference &service );
20 void setRoot(const eServiceReference &ref, bool justSet=false);
21 void getCurrent(eServiceReference &ref);
23 int getNextBeginningWithChar(char c);
24 int getPrevMarkerPos();
25 int getNextMarkerPos();
27 /* support for marked services */
29 void addMarked(const eServiceReference &ref);
30 void removeMarked(const eServiceReference &ref);
31 int isMarked(const eServiceReference &ref);
33 /* this is NOT thread safe! */
34 void markedQueryStart();
35 int markedQueryNext(eServiceReference &ref);
37 int lookupService(const eServiceReference &ref);
38 void setCurrent(const eServiceReference &ref);
45 void setVisualMode(int mode);
47 /* only in complex mode: */
52 celServiceEventProgressbar,
55 celServiceInfo, // "now" event
66 picServiceEventProgressbar,
70 void setElementPosition(int element, eRect where);
71 void setElementFont(int element, gFont *font);
72 void setPixmap(int type, ePtr<gPixmap> &pic);
76 int setCurrentMarked(bool);
78 void setNumberOffset(int offset) { m_numberoffset = offset; }
80 int getItemHeight() { return m_itemheight; }
81 void setItemHeight(int height);
85 markedForegroundSelected,
87 markedBackgroundSelected,
89 serviceEventProgressbarColor,
90 serviceEventProgressbarColorSelected,
91 serviceEventProgressbarBorderColor,
92 serviceEventProgressbarBorderColorSelected,
93 serviceDescriptionColor,
94 serviceDescriptionColorSelected,
98 void setColor(int color, gRGB &col);
102 int cursorMove(int count=1);
104 int cursorSet(int n);
108 void cursorRestore();
111 // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
112 void setSize(const eSize &size);
114 /* the following functions always refer to the selected item */
115 void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
118 /* for complex mode */
119 eRect m_element_position[celElements];
120 ePtr<gFont> m_element_font[celElements];
121 ePtr<gPixmap> m_pixmaps[picElements];
122 gRGB m_color[colorElements];
123 bool m_color_set[colorElements];
125 typedef std::list<eServiceReference> list;
128 list::iterator m_cursor, m_saved_cursor;
130 int m_cursor_number, m_saved_cursor_number;
134 ePtr<iServiceHandler> m_service_center;
135 ePtr<iListableService> m_lst;
137 eServiceReference m_root;
139 /* support for marked services */
140 std::set<eServiceReference> m_marked;
141 std::set<eServiceReference>::const_iterator m_marked_iterator;
143 /* support for movemode */
144 bool m_current_marked;
148 eServiceReference m_is_playable_ignore;