- add markedQuery
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 22 Jul 2005 21:30:39 +0000 (21:30 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 22 Jul 2005 21:30:39 +0000 (21:30 +0000)
lib/service/listboxservice.cpp
lib/service/listboxservice.h

index db4f6b8..24090f7 100644 (file)
@@ -54,6 +54,19 @@ int eListboxServiceContent::isMarked(const eServiceReference &ref)
        return m_marked.find(ref) != m_marked.end();
 }
 
        return m_marked.find(ref) != m_marked.end();
 }
 
+void eListboxServiceContent::markedQueryStart()
+{
+       m_marked_iterator = m_marked.begin();
+}
+
+int eListboxServiceContent::markedQueryNext(eServiceReference &ref)
+{
+       if (m_marked_iterator == m_marked.end())
+               return -1;
+       ref = *m_marked_iterator++;
+       return 0;
+}
+
 int eListboxServiceContent::lookupService(const eServiceReference &ref)
 {
                /* shortcut for cursor */
 int eListboxServiceContent::lookupService(const eServiceReference &ref)
 {
                /* shortcut for cursor */
index d524193..36bb5bb 100644 (file)
@@ -20,9 +20,13 @@ public:
        void addMarked(const eServiceReference &ref);
        void removeMarked(const eServiceReference &ref);
        int isMarked(const eServiceReference &ref);
        void addMarked(const eServiceReference &ref);
        void removeMarked(const eServiceReference &ref);
        int isMarked(const eServiceReference &ref);
-       int lookupService(const eServiceReference &ref);
-
+       
+               /* this is NOT thread safe! */
+       void markedQueryStart();
+       int markedQueryNext(eServiceReference &ref);
 
 
+       int lookupService(const eServiceReference &ref);
+       
 protected:
        void cursorHome();
        void cursorEnd();
 protected:
        void cursorHome();
        void cursorEnd();
@@ -56,6 +60,8 @@ private:
        
                /* support for marked services */
        std::set<eServiceReference> m_marked;
        
                /* support for marked services */
        std::set<eServiceReference> m_marked;
+       
+       std::set<eServiceReference>::const_iterator m_marked_iterator;
 };
 
 #endif
 };
 
 #endif