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);
22 void getPrev(eServiceReference &ref);
23 void getNext(eServiceReference &ref);
26 int getNextBeginningWithChar(char c);
27 int getPrevMarkerPos();
28 int getNextMarkerPos();
30 /* support for marked services */
32 void addMarked(const eServiceReference &ref);
33 void removeMarked(const eServiceReference &ref);
34 int isMarked(const eServiceReference &ref);
36 /* this is NOT thread safe! */
37 void markedQueryStart();
38 int markedQueryNext(eServiceReference &ref);
40 int lookupService(const eServiceReference &ref);
41 void setCurrent(const eServiceReference &ref);
48 void setVisualMode(int mode);
50 /* only in complex mode: */
55 celServiceEventProgressbar,
58 celServiceInfo, // "now" event
69 picServiceEventProgressbar,
73 void setElementPosition(int element, eRect where);
74 void setElementFont(int element, gFont *font);
75 void setPixmap(int type, ePtr<gPixmap> &pic);
79 int setCurrentMarked(bool);
81 void setNumberOffset(int offset) { m_numberoffset = offset; }
83 int getItemHeight() { return m_itemheight; }
84 void setItemHeight(int height);
88 markedForegroundSelected,
90 markedBackgroundSelected,
92 serviceEventProgressbarColor,
93 serviceEventProgressbarColorSelected,
94 serviceEventProgressbarBorderColor,
95 serviceEventProgressbarBorderColorSelected,
96 serviceDescriptionColor,
97 serviceDescriptionColorSelected,
101 void setColor(int color, gRGB &col);
105 int cursorMove(int count=1);
107 int cursorSet(int n);
111 void cursorRestore();
114 // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
115 void setSize(const eSize &size);
117 /* the following functions always refer to the selected item */
118 void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
121 /* for complex mode */
122 eRect m_element_position[celElements];
123 ePtr<gFont> m_element_font[celElements];
124 ePtr<gPixmap> m_pixmaps[picElements];
125 gRGB m_color[colorElements];
126 bool m_color_set[colorElements];
128 typedef std::list<eServiceReference> list;
131 list::iterator m_cursor, m_saved_cursor;
133 int m_cursor_number, m_saved_cursor_number;
137 ePtr<iServiceHandler> m_service_center;
138 ePtr<iListableService> m_lst;
140 eServiceReference m_root;
142 /* support for marked services */
143 std::set<eServiceReference> m_marked;
144 std::set<eServiceReference>::const_iterator m_marked_iterator;
146 /* support for movemode */
147 bool m_current_marked;
151 eServiceReference m_is_playable_ignore;