- add mark in channellist
[enigma2.git] / lib / python / Components / ServiceList.py
1 from HTMLComponent import *
2 from GUIComponent import *
3
4 from enigma import *
5
6 class ServiceList(HTMLComponent, GUIComponent):
7         def __init__(self):
8                 GUIComponent.__init__(self)
9                 self.l = eListboxServiceContent()
10                 
11         def getCurrent(self):
12                 r = eServiceReference()
13                 self.l.getCurrent(r)
14                 return r
15                 
16         def moveUp(self):
17                 self.instance.moveSelection(self.instance.moveUp)
18
19         def moveDown(self):
20                 self.instance.moveSelection(self.instance.moveDown)
21
22         def GUIcreate(self, parent):
23                 self.instance = eListbox(parent)
24                 self.instance.setContent(self.l)
25         
26         def GUIdelete(self):
27                 self.instance = None
28
29         def setRoot(self, root):
30                 self.l.setRoot(root)
31                 
32                 # mark stuff
33         def clearMarked(self):
34                 self.l.clearMarked()
35                 
36         def clearMarks(self):
37                 self.l.initMarked()
38         
39         def isMarked(self, ref):
40                 return self.l.isMarked(ref)
41
42         def addMarked(self, ref):
43                 self.l.addMarked(ref)
44         
45         def removeMarked(self, ref):
46                 self.l.removeMarked(ref)
47
48         def getMarked(self):
49                 i = self.l
50                 i.markedQueryStart()
51                 ref = eServiceReference()
52                 marked = [ ]
53                 while i.markedQueryNext(ref) == 0:
54                         marked.append(ref)
55                         ref = eServiceReference()
56
57                 return marked