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: */
54 celServiceInfo, // "now" event
68 void setElementPosition(int element, eRect where);
69 void setElementFont(int element, gFont *font);
70 void setPixmap(int type, ePtr<gPixmap> &pic);
74 int setCurrentMarked(bool);
76 void setNumberOffset(int offset) { m_numberoffset = offset; }
78 int getItemHeight() { return m_itemheight; }
79 void setItemHeight(int height);
83 markedForegroundSelected,
85 markedBackgroundSelected,
90 void setColor(int color, gRGB &col);
94 int cursorMove(int count=1);
100 void cursorRestore();
103 // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
104 void setSize(const eSize &size);
106 /* the following functions always refer to the selected item */
107 void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
110 /* for complex mode */
111 eRect m_element_position[celElements];
112 ePtr<gFont> m_element_font[celElements];
113 ePtr<gPixmap> m_pixmaps[picElements];
114 gRGB m_color[colorElements];
115 bool m_color_set[colorElements];
117 typedef std::list<eServiceReference> list;
120 list::iterator m_cursor, m_saved_cursor;
122 int m_cursor_number, m_saved_cursor_number;
126 ePtr<iServiceHandler> m_service_center;
127 ePtr<iListableService> m_lst;
129 eServiceReference m_root;
131 /* support for marked services */
132 std::set<eServiceReference> m_marked;
133 std::set<eServiceReference>::const_iterator m_marked_iterator;
135 /* support for movemode */
136 bool m_current_marked;
140 eServiceReference m_is_playable_ignore;