forked from romanvm/Kodistubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xbmcgui.py
2019 lines (1566 loc) · 64.9 KB
/
xbmcgui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## @package xbmcgui
# Classes and functions to work with XBMC GUI.
#
#noinspection PyUnusedLocal
class Window(object):
"""Create a new Window to draw on."""
def __init__(self, windowId=-1):
"""
Create a new Window to draw on.
Specify an id to use an existing window.
Raises:
ValueError: If supplied window Id does not exist.
Exception: If more then 200 windows are created.
Deleting this window will activate the old window that was active
and resets (not delete) all controls that are associated with this window.
"""
pass
def show(self):
"""Show this window.
Shows this window by activating it, calling close() after it wil activate the current window again.
Note:
If your script ends this window will be closed to. To show it forever,
make a loop at the end of your script and use doModal() instead.
"""
pass
def close(self):
"""Closes this window.
Closes this window by activating the old window.
The window is not deleted with this method.
"""
pass
def onAction(self, action):
"""onAction method.
This method will recieve all actions that the main program will send to this window.
By default, only the PREVIOUS_MENU action is handled.
Overwrite this method to let your script handle all actions.
Don't forget to capture ACTION_PREVIOUS_MENU, else the user can't close this window.
"""
pass
def onClick(self, control):
"""onClick method.
This method will recieve all click events that the main program will send to this window.
"""
pass
def onDoubleClick():
pass
def onControl(self, control):
"""
onControl method.
This method will recieve all control events that the main program will send to this window.
'control' is an instance of a Control object.
"""
pass
def onFocus(self, control):
"""onFocus method.
This method will recieve all focus events that the main program will send to this window.
"""
pass
def onInit(self):
"""onInit method.
This method will be called to initialize the window.
"""
pass
def doModal(self):
"""Display this window until close() is called."""
pass
def addControl(self, control):
"""Add a Control to this window.
Raises:
TypeError: If supplied argument is not a Control type.
ReferenceError: If control is already used in another window.
RuntimeError: Should not happen :-)
The next controls can be added to a window atm:
ControlLabel
ControlFadeLabel
ControlTextBox
ControlButton
ControlCheckMark
ControlList
ControlGroup
ControlImage
ControlRadioButton
ControlProgress
"""
pass
def addControls(self, controls):
"""
addControls(self, List)--Add a list of Controls to this window.
*Throws:
- TypeError, if supplied argument is not ofList type, or a control is not ofControl type
- ReferenceError, if control is already used in another window
- RuntimeError, should not happen :-)
"""
pass
def getControl(self, controlId):
"""Get's the control from this window.
Raises:
Exception: If Control doesn't exist
controlId doesn't have to be a python control, it can be a control id
from a xbmc window too (you can find id's in the xml files).
Note:
Not python controls are not completely usable yet.
You can only use the Control functions.
"""
return object
def setFocus(self, Control):
"""Give the supplied control focus.
Raises:
TypeError: If supplied argument is not a Control type.
SystemError: On Internal error.
RuntimeError: If control is not added to a window.
"""
pass
def setFocusId(self, int):
"""Gives the control with the supplied focus.
Raises:
SystemError: On Internal error.
RuntimeError: If control is not added to a window.
"""
pass
def getFocus(self):
"""Returns the control which is focused.
Raises:
SystemError: On Internal error.
RuntimeError: If no control has focus.
"""
return object
def getFocusId(self):
"""Returns the id of the control which is focused.
Raises:
SystemError: On Internal error.
RuntimeError: If no control has focus.
"""
return long
def removeControl(self, control):
"""Removes the control from this window.
Raises:
TypeError: If supplied argument is not a Control type.
RuntimeError: If control is not added to this window.
This will not delete the control. It is only removed from the window.
"""
pass
def removeControls(self, controls):
pass
def getHeight(self):
"""Returns the height of this screen."""
return long
def getWidth(self):
"""Returns the width of this screen."""
return long
def getResolution(self):
"""Returns the resolution of the screen.
The returned value is one of the following:
0 - 1080i (1920x1080)
1 - 720p (1280x720)
2 - 480p 4:3 (720x480)
3 - 480p 16:9 (720x480)
4 - NTSC 4:3 (720x480)
5 - NTSC 16:9 (720x480)
6 - PAL 4:3 (720x576)
7 - PAL 16:9 (720x576)
8 - PAL60 4:3 (720x480)
9 - PAL60 16:9 (720x480)
Note: this info is outdated. XBMC 12+ returns different vaulues.
"""
return long
def setCoordinateResolution(self, resolution):
"""Sets the resolution that the coordinates of all controls are defined in.
Allows XBMC to scale control positions and width/heights to whatever resolution
XBMC is currently using.
resolution is one of the following:
0 - 1080i (1920x1080)
1 - 720p (1280x720)
2 - 480p 4:3 (720x480)
3 - 480p 16:9 (720x480)
4 - NTSC 4:3 (720x480)
5 - NTSC 16:9 (720x480)
6 - PAL 4:3 (720x576)
7 - PAL 16:9 (720x576)
8 - PAL60 4:3 (720x480)
9 - PAL60 16:9 (720x480)
Note: default is 720p (1280x720)
Note 2: this is not an actual display resulution. This is the resolution of the coordinate grid
all controls are placed on.
"""
pass
def setProperty(self, key, value):
"""Sets a window property, similar to an infolabel.
key: string - property name.
value: string or unicode - value of property.
Note:
key is NOT case sensitive. Setting value to an empty string is equivalent to clearProperty(key).
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.setProperty('Category', 'Newest')
"""
pass
def getProperty(self, key):
"""Returns a window property as a string, similar to an infolabel.
key: string - property name.
Note:
key is NOT case sensitive.
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
category = win.getProperty('Category')
"""
return str
def clearProperty(self, key):
"""Clears the specific window property.
key: string - property name.
Note:
key is NOT case sensitive. Equivalent to setProperty(key,'').
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.clearProperty('Category')
"""
pass
def clearProperties(self):
"""Clears all window properties.
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.clearProperties()
"""
pass
#noinspection PyUnusedLocal
class WindowDialog(Window):
"""
Create a new WindowDialog with transparent background, unlike Window.
WindowDialog always stays on top of XBMC UI.
"""
def __init__(self):
pass
#noinspection PyUnusedLocal
class WindowXML(Window):
"""Create a new WindowXML script."""
def __init__(self, xmlFilename, scriptPath, defaultSkin='Default', defaultRes='720p'):
"""
xmlFilename: string - the name of the xml file to look for.
scriptPath: string - path to script. used to fallback to if the xml doesn't exist in the current skin.
(eg os.getcwd())
defaultSkin: string - name of the folder in the skins path to look in for the xml.
defaultRes: string - default skins resolution.
Note:
Skin folder structure is eg(resources/skins/Default/720p).
Example:
ui = GUI('script-Lyrics-main.xml', os.getcwd(), 'LCARS', 'PAL')
ui.doModal()
del ui
"""
pass
def removeItem(self, position):
"""Removes a specified item based on position, from the Window List.
position: integer - position of item to remove.
"""
pass
def addItem(self, item, position=32767):
"""Add a new item to this Window List.
item: string, unicode or ListItem - item to add.
position: integer - position of item to add. (NO Int = Adds to bottom,0 adds to top, 1 adds to one below from top,-1 adds to one above from bottom etc etc)
If integer positions are greater than list size, negative positions will add to top of list, positive positions will add to bottom of list.
Example:
self.addItem('Reboot XBMC', 0)
"""
pass
def clearList(self):
"""Clear the Window List."""
pass
def setCurrentListPosition(self, position):
"""Set the current position in the Window List.
position: integer - position of item to set.
"""
pass
def getCurrentListPosition(self):
"""Gets the current position in the Window List."""
return long
def getListItem(self, position):
"""Returns a given ListItem in this Window List.
position: integer - position of item to return.
"""
return ListItem
def getListSize(self):
"""Returns the number of items in this Window List."""
return long
def setProperty(self, key, value):
"""Sets a container property, similar to an infolabel.
key: string - property name.
value: string or unicode - value of property.
Note:
Key is NOT case sensitive.
Example:
self.setProperty('Category', 'Newest')
"""
pass
#noinspection PyUnusedLocal
class WindowXMLDialog(WindowXML):
"""Create a new WindowXMLDialog script."""
def __init__(self, xmlFilename, scriptPath, defaultSkin="Default", defaultRes="720p"):
"""
xmlFilename: string - the name of the xml file to look for.
scriptPath: string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg os.getcwd())
defaultSkin: string - name of the folder in the skins path to look in for the xml.
defaultRes: string - default skins resolution.
Note:
Skin folder structure is eg(resources/skins/Default/720p).
Example:
ui = GUI('script-Lyrics-main.xml', os.getcwd(), 'LCARS', 'PAL')
ui.doModal()
del ui
"""
pass
#noinspection PyUnusedLocal
class Control(object):
"""
Parent for control classes. The problem here is that Python uses references to this class in a dynamic typing way.
For example, you will find this type of python code frequently:
window.getControl( 100 ).setLabel( "Stupid Dynamic Type")
Notice that the 'getControl' call returns a 'Control ' object.
In a dynamically typed language, the subsequent call to setLabel works if the specific type of control has the method.
The script writer is often in a position to know more than the code about the specificControl type
(in the example, that control id 100 is a 'ControlLabel ') where the C++ code is not.
SWIG doesn't support this type of dynamic typing. The 'Control ' wrapper that's returned will wrap aControlLabel
but will not have the 'setLabel' method on it. The only way to handle this is to add all possible subclass methods
to the parent class. This is ugly but the alternative is nearly as ugly.
It's particularly ugly here because the majority of the methods are unique to the particular subclass.
If anyone thinks they have a solution then let me know. The alternative would be to have a set of 'getContol'
methods, each one coresponding to a type so that the downcast can be done in the native code.
IOW rather than a simple 'getControl' there would be a 'getControlLabel', 'getControlRadioButton',
'getControlButton', etc.
TODO:This later solution should be implemented for future scripting languages
while the former will remain as deprecated functionality for Python.
"""
def addItem(self):
pass
def addItems(self):
pass
def canAcceptMessages(self):
pass
def controlDown(self, control=None):
"""
controlDown(control)--Set's the controls down navigation.
control : control object - control to navigate to on down.
*Note, You can also usesetNavigation() . Set to self to disable navigation.
Throws:
- TypeError, if one of the supplied arguments is not a control type.
- ReferenceError, if one of the controls is not added to a window.
example:
- self.button.controlDown(self.button1)
"""
pass
def controlLeft(self, control=None):
"""
controlLeft(control)--Set's the controls left navigation.
control : control object - control to navigate to on left.
*Note, You can also usesetNavigation() . Set to self to disable navigation.
Throws:
- TypeError, if one of the supplied arguments is not a control type.
- ReferenceError, if one of the controls is not added to a window.
example:
- self.button.controlLeft(self.button1)
"""
pass
def controlRight(self, control=None):
"""
controlRight(control)--Set's the controls right navigation.
control : control object - control to navigate to on right.
*Note, You can also usesetNavigation() . Set to self to disable navigation.
Throws:
- TypeError, if one of the supplied arguments is not a control type.
- ReferenceError, if one of the controls is not added to a window.
example:
- self.button.controlRight(self.button1)
"""
pass
def controlUp(self, control=None):
"""
controlUp(control)--Set's the controls up navigation.
control : control object - control to navigate to on up.
*Note, You can also usesetNavigation() . Set to self to disable navigation.
Throws:
- TypeError, if one of the supplied arguments is not a control type.
- ReferenceError, if one of the controls is not added to a window.
example:
- self.button.controlUp(self.button1)
"""
pass
def getHeight(self):
"""
getHeight() --Returns the control's current height as an integer.
example:
- height = self.button.getHeight()
"""
return int
def getId(self):
"""
getId() --Returns the control's current id as an integer.
example:
- id = self.button.getId()
"""
return int
def getPosition(self):
"""
getPosition() --Returns the control's current position as a x,y integer tuple.
example:
- pos = self.button.getPosition()
"""
return (int, int)
def getWidth(self):
"""
getWidth() --Returns the control's current width as an integer.
example:
- width = self.button.getWidth()
"""
return int
def getX(self):
"""
Get X coordinate of a control as an integer.
"""
return int
def getY(self):
"""
Get Y coordinate of a control as an integer.
"""
return int
def setAnimations(self, event_attr=[()]):
"""
setAnimations([(event, attr,)*])--Set's the control's animations.
[(event,attr,)*] : list - A list of tuples consisting of event and attributes pairs.
- event : string - The event to animate.
- attr : string - The whole attribute string separated by spaces.
Animating your skin -http://wiki.xbmc.org/?title=Animating_Your_Skin
example:
- self.button.setAnimations([('focus', 'effect=zoom end=90,247,220,56 time=0',)])
"""
pass
def setEnableCondition(self, enable):
"""
setEnableCondition(enable)--Set's the control's enabled condition.
Allows XBMC to control the enabled status of the control.
enable : string - Enable condition.
List of Conditions -http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions
example:
- self.button.setEnableCondition('System.InternetState')
"""
pass
def setEnabled(self, enabled=True):
"""
setEnabled(enabled)--Set's the control's enabled/disabled state.
enabled : bool - True=enabled / False=disabled.
example:
- self.button.setEnabled(False)
"""
pass
def setHeight(self, height):
"""
setHeight(height)--Set's the controls height.
height : integer - height of control.
example:
- self.image.setHeight(100)
"""
pass
def setNavigation(self, up=None, down=None, left=None, right=None):
"""
setNavigation(up, down, left, right)--Set's the controls navigation.
up : control object - control to navigate to on up.
down : control object - control to navigate to on down.
left : control object - control to navigate to on left.
right : control object - control to navigate to on right.
*Note, Same ascontrolUp() ,controlDown() ,controlLeft() ,controlRight() . Set to self to disable navigation for that direction.
Throws:
- TypeError, if one of the supplied arguments is not a control type.
- ReferenceError, if one of the controls is not added to a window.
example:
- self.button.setNavigation(self.button1, self.button2, self.button3, self.button4)
"""
pass
def setPosition(self, x, y):
"""
setPosition(x, y)--Set's the controls position.
x : integer - x coordinate of control.
y : integer - y coordinate of control.
*Note, You may use negative integers. (e.g sliding a control into view)
example:
- self.button.setPosition(100, 250)
"""
pass
def setVisible(self, visible):
"""
setVisible(visible)--Set's the control's visible/hidden state.
visible : bool - True=visible / False=hidden.
example:
- self.button.setVisible(False)
"""
pass
def setVisibleCondition(self, condition, allowHiddenFocus=False):
"""
setVisibleCondition(visible[,allowHiddenFocus])--Set's the control's visible condition.
Allows XBMC to control the visible status of the control.
visible : string - Visible condition.
allowHiddenFocus : bool - True=gains focus even if hidden.
List of Conditions -http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions
example:
- self.button.setVisibleCondition('[Control.IsVisible(41) + !Control.IsVisible(12)]', True)
"""
pass
def setWidth(self, width):
"""
setWidth(width)--Set's the controls width.
width : integer - width of control.
example:
- self.image.setWidth(100)
"""
pass
#noinspection PyUnusedLocal
class ListItem(object):
"""Creates a new ListItem."""
def __init__(self, label='', label2='', iconImage=None, thumbnailImage=None, path=None):
"""
label: string or unicode - label1 text.
label2: string or unicode - label2 text.
iconImage: string - icon filename.
thumbnailImage: string - thumbnail filename.
path: string or unicode - listitem's path.
Example:
listitem = xbmcgui.ListItem('Casino Royale', '[PG-13]', 'blank-poster.tbn', 'poster.tbn', path='f:\\movies\\casino_royale.mov')
"""
pass
def addStreamInfo(type, values):
"""
addStreamInfo(type, values) -- Add a stream with details.
type : string - type of stream(video/audio/subtitle).
values : dictionary - pairs of { label: value }.
Video Values:
codec : string (h264)
aspect : float (1.78)
width : integer (1280)
height : integer (720)
duration : integer (seconds)
Audio Values:
codec : string (dts)
language : string (en)
channels : integer (2)
Subtitle Values:
language : string (en)
example:
- self.list.getSelectedItem().addStreamInfo('video', { 'Codec': 'h264', 'Width' : 1280 })
"""
pass
def getLabel(self):
"""Returns the listitem label."""
return str
def getLabel2(self):
"""Returns the listitem's second label."""
return str
def setLabel(self, label):
"""Sets the listitem's label.
label: string or unicode - text string.
"""
pass
def setLabel2(self, label2):
"""Sets the listitem's second label.
label2: string or unicode - text string.
"""
pass
def setIconImage(self, icon):
"""Sets the listitem's icon image.
icon: string or unicode - image filename.
"""
pass
def setThumbnailImage(self, thumb):
"""Sets the listitem's thumbnail image.
thumb: string or unicode - image filename.
"""
pass
def select(self, selected):
"""Sets the listitem's selected status.
selected: bool - True=selected/False=not selected.
"""
pass
def isSelected(self):
"""Returns the listitem's selected status."""
return bool
def setInfo(self, type, infoLabels):
"""Sets the listitem's infoLabels.
type: string - type of media(video/music/pictures).
infoLabels: dictionary - pairs of { label: value }.
Note:
To set pictures exif info, prepend 'exif:' to the label. Exif values must be passed
as strings, separate value pairs with a comma. (eg. {'exif:resolution': '720,480'}
See CPictureInfoTag::TranslateString in PictureInfoTag.cpp for valid strings.
General Values that apply to all types:
count: integer (12) - can be used to store an id for later, or for sorting purposes
size: long (1024) - size in bytes
date: string (%d.%m.%Y / 01.01.2009) - file date
Video Values:
genre: string (Comedy)
year: integer (2009)
episode: integer (4)
season: integer (1)
top250: integer (192)
tracknumber: integer (3)
rating: float (6.4) - range is 0..10
watched: depreciated - use playcount instead
playcount: integer (2) - number of times this item has been played
overlay: integer (2) - range is 0..8. See GUIListItem.h for values
cast: list (Michal C. Hall)
castandrole: list (Michael C. Hall|Dexter)
director: string (Dagur Kari)
mpaa: string (PG-13)
plot: string (Long Description)
plotoutline: string (Short Description)
title: string (Big Fan)
originaltitle: string (Big Fan)
duration: string (3:18)
studio: string (Warner Bros.)
tagline: string (An awesome movie) - short description of movie
writer: string (Robert D. Siegel)
tvshowtitle: string (Heroes)
premiered: string (2005-03-04)
status: string (Continuing) - status of a TVshow
code: string (tt0110293) - IMDb code
aired: string (2008-12-07)
credits: string (Andy Kaufman) - writing credits
lastplayed: string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)
album: string (The Joshua Tree)
votes: string (12345 votes)
trailer: string (/home/user/trailer.avi)
Music Values:
tracknumber: integer (8)
duration: integer (245) - duration in seconds
year: integer (1998)
genre: string (Rock)
album: string (Pulse)
artist: string (Muse)
title: string (American Pie)
rating: string (3) - single character between 0 and 5
lyrics: string (On a dark desert highway...)
playcount: integer (2) - number of times this item has been played
lastplayed: string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)
Picture Values:
title: string (In the last summer-1)
picturepath: string (/home/username/pictures/img001.jpg)
exif*: string (See CPictureInfoTag::TranslateString in PictureInfoTag.cpp for valid strings)
Example:
self.list.getSelectedItem().setInfo('video', { 'Genre': 'Comedy' })
"""
pass
def setProperty(self, key, value):
"""Sets a listitem property, similar to an infolabel.
key: string - property name.
value: string or unicode - value of property.
Note:
Key is NOT case sensitive.
Some of these are treated internally by XBMC, such as the 'StartOffset' property, which is
the offset in seconds at which to start playback of an item. Others may be used in the skin
to add extra information, such as 'WatchedCount' for tvshow items
Example:
self.list.getSelectedItem().setProperty('AspectRatio', '1.85 : 1')
self.list.getSelectedItem().setProperty('StartOffset', '256.4')
"""
pass
def getProperty(self, key):
"""Returns a listitem property as a string, similar to an infolabel.
key: string - property name.
Note:
Key is NOT case sensitive.
"""
return str
def addContextMenuItems(self, list, replaceItems=False):
"""Adds item(s) to the context menu for media lists.
items: list - [(label, action)] A list of tuples consisting of label and action pairs.
label: string or unicode - item's label.
action: string or unicode - any built-in function to perform.
replaceItems: bool - True=only your items will show/False=your items will be added to context menu.
List of functions: http://wiki.xbmc.org/?title=List_of_Built_In_Functions
Example:
listitem.addContextMenuItems([('Theater Showtimes', 'XBMC.RunScript(special://home/scripts/showtimes/default.py,Iron Man)')])
"""
pass
def setPath(self, path):
"""
setPath(path) -- Sets the listitem's path.
path : string or unicode - path, activated when item is clicked.
*Note, You can use the above as keywords for arguments.
example:
- self.list.getSelectedItem().setPath(path='ActivateWindow(Weather)')
"""
pass
#noinspection PyUnusedLocal
class ControlLabel(Control):
"""
ControlLabel class.
Creates a text label.
"""
def __init__(self, x, y, width, height, label, font=None, textColor=None, disabledColor=None, alignment=None,
hasPath=None, angle=None):
"""
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
label: string or unicode - text string.
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')
disabledColor: hexstring - color of disabled label's label. (e.g. '0xFFFF3300')
alignment: integer - alignment of label - *Note, see xbfont.h
hasPath: bool - True=stores a path / False=no path.
angle: integer - angle of control. (+ rotates CCW, - rotates CW)"
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.label = xbmcgui.ControlLabel(100, 250, 125, 75, 'Status', angle=45)
"""
pass
def setLabel(self, label):
"""Set's text for this label.
label: string or unicode - text string.
"""
pass
def getLabel(self):
"""Returns the text value for this label."""
return str
#noinspection PyUnusedLocal
class ControlFadeLabel(Control):
"""Control which scrolls long label text."""
def __init__(self, x, y, width, height, font=None, textColor=None, _alignment=None):
"""
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of fadelabel's labels. (e.g. '0xFFFFFFFF')
_alignment: integer - alignment of label - *Note, see xbfont.h
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.fadelabel = xbmcgui.ControlFadeLabel(100, 250, 200, 50, textColor='0xFFFFFFFF')
"""
pass
def addLabel(self, label):
"""Add a label to this control for scrolling.
label: string or unicode - text string.
"""
pass
def reset(self):
"""Clears this fadelabel."""
pass
#noinspection PyUnusedLocal
class ControlTextBox(Control):
"""
ControlTextBox class.
Creates a box for multi-line text.
"""
def __init__(self, x, y, width, height, font=None, textColor=None):
"""
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
font: string - font used for text. (e.g. 'font13')
textColor: hexstring - color of textbox's text. (e.g. '0xFFFFFFFF')
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.textbox = xbmcgui.ControlTextBox(100, 250, 300, 300, textColor='0xFFFFFFFF')
"""
pass
def setText(self, text):
"""Set's the text for this textbox.
text: string or unicode - text string.
"""