don't kill if thread isn't alive
[enigma2.git] / lib / service / listboxservice.h
index 9d0cb7217744830716e0ea7dbb8c83609bdb5d61..234cd39014e5e85b01cc0bc6fc4748041029b0ba 100644 (file)
@@ -3,17 +3,60 @@
 
 #include <lib/gui/elistbox.h>
 #include <lib/service/iservice.h>
 
 #include <lib/gui/elistbox.h>
 #include <lib/service/iservice.h>
-
-class eServiceCenter;
+#include <set>
 
 class eListboxServiceContent: public virtual iListboxContent
 {
 
 class eListboxServiceContent: public virtual iListboxContent
 {
-       DECLARE_REF;
+       DECLARE_REF(eListboxServiceContent);
 public:
        eListboxServiceContent();
 public:
        eListboxServiceContent();
-       void setRoot(const eServiceReference &ref);
+
+       void addService(const eServiceReference &ref);
+       void FillFinished();
+
+       void setIgnoreService( const eServiceReference &service );
+       void setRoot(const eServiceReference &ref, bool justSet=false);
        void getCurrent(eServiceReference &ref);
        void getCurrent(eServiceReference &ref);
+       
+       int getNextBeginningWithChar(char c);
+
+               /* support for marked services */
+       void initMarked();
+       void addMarked(const eServiceReference &ref);
+       void removeMarked(const eServiceReference &ref);
+       int isMarked(const eServiceReference &ref);
+
+               /* this is NOT thread safe! */
+       void markedQueryStart();
+       int markedQueryNext(eServiceReference &ref);
+
+       int lookupService(const eServiceReference &ref);
+       void setCurrent(const eServiceReference &ref);
+
+       enum {
+               visModeSimple,
+               visModeComplex
+       };
+       
+       void setVisualMode(int mode);
+       
+               /* only in complex mode: */
+       enum {
+               celIcon,
+               celServiceNumber,
+               celServiceName,
+               celServiceInfo, // "now" event
+               celElements
+       };
+       
+       void setElementPosition(int element, eRect where);
+       void setElementFont(int element, gFont *font);
+       
+       void sort();
+
+       int setCurrentMarked(bool);
 
 
+       void setNumberOffset(int offset) { m_numberoffset = offset; }
 protected:
        void cursorHome();
        void cursorEnd();
 protected:
        void cursorHome();
        void cursorEnd();
@@ -21,7 +64,7 @@ protected:
        int cursorValid();
        int cursorSet(int n);
        int cursorGet();
        int cursorValid();
        int cursorSet(int n);
        int cursorGet();
-       
+
        void cursorSave();
        void cursorRestore();
        int size();
        void cursorSave();
        void cursorRestore();
        int size();
@@ -31,6 +74,11 @@ protected:
        
                /* the following functions always refer to the selected item */
        void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
        
                /* the following functions always refer to the selected item */
        void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
+       
+       int m_visual_mode;
+               /* for complex mode */
+       eRect m_element_position[celElements];
+       ePtr<gFont> m_element_font[celElements];
 private:
        typedef std::list<eServiceReference> list;
        
 private:
        typedef std::list<eServiceReference> list;
        
@@ -41,9 +89,20 @@ private:
        int m_size;
        
        eSize m_itemsize;
        int m_size;
        
        eSize m_itemsize;
-       ePtr<eServiceCenter> m_service_center;
+       ePtr<iServiceHandler> m_service_center;
        
        eServiceReference m_root;
        
        eServiceReference m_root;
+
+               /* support for marked services */
+       std::set<eServiceReference> m_marked;
+       std::set<eServiceReference>::const_iterator m_marked_iterator;
+
+               /* support for movemode */
+       bool m_current_marked;
+
+       int m_numberoffset;
+
+       eServiceReference m_is_playable_ignore;
 };
 
 #endif
 };
 
 #endif