forked from twinther/xbmcstubs
-
Notifications
You must be signed in to change notification settings - Fork 46
/
xbmcgui.py
4890 lines (3836 loc) · 161 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
# This file is generated from Kodi source code and post-edited
# to correct code style and docstrings formatting.
# License: GPL v.3 <https://www.gnu.org/licenses/gpl-3.0.en.html>
"""
**GUI functions on Kodi.**
Offers classes and functions that manipulate the Graphical User Interface
through windows, dialogs, and various control widgets.
"""
from typing import Union, List, Dict, Tuple, Optional
__kodistubs__ = True
ACTION_ANALOG_FORWARD = 113
ACTION_ANALOG_MOVE = 49
ACTION_ANALOG_MOVE_X_LEFT = 601
ACTION_ANALOG_MOVE_X_RIGHT = 602
ACTION_ANALOG_MOVE_Y_DOWN = 604
ACTION_ANALOG_MOVE_Y_UP = 603
ACTION_ANALOG_REWIND = 114
ACTION_ANALOG_SEEK_BACK = 125
ACTION_ANALOG_SEEK_FORWARD = 124
ACTION_ASPECT_RATIO = 19
ACTION_AUDIO_DELAY = 161
ACTION_AUDIO_DELAY_MIN = 54
ACTION_AUDIO_DELAY_PLUS = 55
ACTION_AUDIO_NEXT_LANGUAGE = 56
ACTION_BACKSPACE = 110
ACTION_BIG_STEP_BACK = 23
ACTION_BIG_STEP_FORWARD = 22
ACTION_BROWSE_SUBTITLE = 247
ACTION_BUILT_IN_FUNCTION = 122
ACTION_CALIBRATE_RESET = 48
ACTION_CALIBRATE_SWAP_ARROWS = 47
ACTION_CHANGE_RESOLUTION = 57
ACTION_CHANNEL_DOWN = 185
ACTION_CHANNEL_NUMBER_SEP = 192
ACTION_CHANNEL_SWITCH = 183
ACTION_CHANNEL_UP = 184
ACTION_CHAPTER_OR_BIG_STEP_BACK = 98
ACTION_CHAPTER_OR_BIG_STEP_FORWARD = 97
ACTION_CONTEXT_MENU = 117
ACTION_COPY_ITEM = 81
ACTION_CREATE_BOOKMARK = 96
ACTION_CREATE_EPISODE_BOOKMARK = 95
ACTION_CURSOR_LEFT = 120
ACTION_CURSOR_RIGHT = 121
ACTION_CYCLE_SUBTITLE = 99
ACTION_CYCLE_TONEMAP_METHOD = 261
ACTION_DECREASE_PAR = 220
ACTION_DECREASE_RATING = 137
ACTION_DELETE_ITEM = 80
ACTION_ENTER = 135
ACTION_ERROR = 998
ACTION_FILTER = 233
ACTION_FILTER_CLEAR = 150
ACTION_FILTER_SMS2 = 151
ACTION_FILTER_SMS3 = 152
ACTION_FILTER_SMS4 = 153
ACTION_FILTER_SMS5 = 154
ACTION_FILTER_SMS6 = 155
ACTION_FILTER_SMS7 = 156
ACTION_FILTER_SMS8 = 157
ACTION_FILTER_SMS9 = 158
ACTION_FIRST_PAGE = 159
ACTION_FORWARD = 16
ACTION_GESTURE_ABORT = 505
ACTION_GESTURE_BEGIN = 501
ACTION_GESTURE_END = 599
ACTION_GESTURE_NOTIFY = 500
ACTION_GESTURE_PAN = 504
ACTION_GESTURE_ROTATE = 503
ACTION_GESTURE_SWIPE_DOWN = 541
ACTION_GESTURE_SWIPE_DOWN_TEN = 550
ACTION_GESTURE_SWIPE_LEFT = 511
ACTION_GESTURE_SWIPE_LEFT_TEN = 520
ACTION_GESTURE_SWIPE_RIGHT = 521
ACTION_GESTURE_SWIPE_RIGHT_TEN = 530
ACTION_GESTURE_SWIPE_UP = 531
ACTION_GESTURE_SWIPE_UP_TEN = 540
ACTION_GESTURE_ZOOM = 502
ACTION_GUIPROFILE_BEGIN = 204
ACTION_HDR_TOGGLE = 260
ACTION_HIGHLIGHT_ITEM = 8
ACTION_INCREASE_PAR = 219
ACTION_INCREASE_RATING = 136
ACTION_INPUT_TEXT = 244
ACTION_JUMP_SMS2 = 142
ACTION_JUMP_SMS3 = 143
ACTION_JUMP_SMS4 = 144
ACTION_JUMP_SMS5 = 145
ACTION_JUMP_SMS6 = 146
ACTION_JUMP_SMS7 = 147
ACTION_JUMP_SMS8 = 148
ACTION_JUMP_SMS9 = 149
ACTION_LAST_PAGE = 160
ACTION_MENU = 163
ACTION_MOUSE_DOUBLE_CLICK = 103
ACTION_MOUSE_DRAG = 106
ACTION_MOUSE_DRAG_END = 109
ACTION_MOUSE_END = 109
ACTION_MOUSE_LEFT_CLICK = 100
ACTION_MOUSE_LONG_CLICK = 108
ACTION_MOUSE_MIDDLE_CLICK = 102
ACTION_MOUSE_MOVE = 107
ACTION_MOUSE_RIGHT_CLICK = 101
ACTION_MOUSE_START = 100
ACTION_MOUSE_WHEEL_DOWN = 105
ACTION_MOUSE_WHEEL_UP = 104
ACTION_MOVE_DOWN = 4
ACTION_MOVE_ITEM = 82
ACTION_MOVE_ITEM_DOWN = 116
ACTION_MOVE_ITEM_UP = 115
ACTION_MOVE_LEFT = 1
ACTION_MOVE_RIGHT = 2
ACTION_MOVE_UP = 3
ACTION_MUTE = 91
ACTION_NAV_BACK = 92
ACTION_NEXT_CHANNELGROUP = 186
ACTION_NEXT_CONTROL = 181
ACTION_NEXT_ITEM = 14
ACTION_NEXT_LETTER = 140
ACTION_NEXT_PICTURE = 28
ACTION_NEXT_SCENE = 138
ACTION_NEXT_SUBTITLE = 26
ACTION_NONE = 0
ACTION_NOOP = 999
ACTION_PAGE_DOWN = 6
ACTION_PAGE_UP = 5
ACTION_PARENT_DIR = 9
ACTION_PASTE = 180
ACTION_PAUSE = 12
ACTION_PLAYER_DEBUG = 27
ACTION_PLAYER_DEBUG_VIDEO = 262
ACTION_PLAYER_FORWARD = 77
ACTION_PLAYER_PLAY = 79
ACTION_PLAYER_PLAYPAUSE = 229
ACTION_PLAYER_PROCESS_INFO = 69
ACTION_PLAYER_PROGRAM_SELECT = 70
ACTION_PLAYER_RESET = 248
ACTION_PLAYER_RESOLUTION_SELECT = 71
ACTION_PLAYER_REWIND = 78
ACTION_PREVIOUS_CHANNELGROUP = 187
ACTION_PREVIOUS_MENU = 10
ACTION_PREV_CONTROL = 182
ACTION_PREV_ITEM = 15
ACTION_PREV_LETTER = 141
ACTION_PREV_PICTURE = 29
ACTION_PREV_SCENE = 139
ACTION_PVR_ANNOUNCE_REMINDERS = 193
ACTION_PVR_PLAY = 188
ACTION_PVR_PLAY_RADIO = 190
ACTION_PVR_PLAY_TV = 189
ACTION_PVR_SHOW_TIMER_RULE = 191
ACTION_QUEUE_ITEM = 34
ACTION_QUEUE_ITEM_NEXT = 251
ACTION_RECORD = 170
ACTION_RELOAD_KEYMAPS = 203
ACTION_REMOVE_ITEM = 35
ACTION_RENAME_ITEM = 87
ACTION_REWIND = 17
ACTION_ROTATE_PICTURE_CCW = 51
ACTION_ROTATE_PICTURE_CW = 50
ACTION_SCAN_ITEM = 201
ACTION_SCROLL_DOWN = 112
ACTION_SCROLL_UP = 111
ACTION_SELECT_ITEM = 7
ACTION_SETTINGS_LEVEL_CHANGE = 242
ACTION_SETTINGS_RESET = 241
ACTION_SET_RATING = 164
ACTION_SHIFT = 118
ACTION_SHOW_FULLSCREEN = 36
ACTION_SHOW_GUI = 18
ACTION_SHOW_INFO = 11
ACTION_SHOW_OSD = 24
ACTION_SHOW_OSD_TIME = 123
ACTION_SHOW_PLAYLIST = 33
ACTION_SHOW_SUBTITLES = 25
ACTION_SHOW_VIDEOMENU = 134
ACTION_SMALL_STEP_BACK = 76
ACTION_STEP_BACK = 21
ACTION_STEP_FORWARD = 20
ACTION_STEREOMODE_NEXT = 235
ACTION_STEREOMODE_PREVIOUS = 236
ACTION_STEREOMODE_SELECT = 238
ACTION_STEREOMODE_SET = 240
ACTION_STEREOMODE_TOGGLE = 237
ACTION_STEREOMODE_TOMONO = 239
ACTION_STOP = 13
ACTION_SUBTITLE_ALIGN = 232
ACTION_SUBTITLE_DELAY = 162
ACTION_SUBTITLE_DELAY_MIN = 52
ACTION_SUBTITLE_DELAY_PLUS = 53
ACTION_SUBTITLE_VSHIFT_DOWN = 231
ACTION_SUBTITLE_VSHIFT_UP = 230
ACTION_SWITCH_PLAYER = 234
ACTION_SYMBOLS = 119
ACTION_TAKE_SCREENSHOT = 85
ACTION_TELETEXT_BLUE = 218
ACTION_TELETEXT_GREEN = 216
ACTION_TELETEXT_RED = 215
ACTION_TELETEXT_YELLOW = 217
ACTION_TOGGLE_COMMSKIP = 246
ACTION_TOGGLE_DIGITAL_ANALOG = 202
ACTION_TOGGLE_FONT = 249
ACTION_TOGGLE_FULLSCREEN = 199
ACTION_TOGGLE_SOURCE_DEST = 32
ACTION_TOGGLE_WATCHED = 200
ACTION_TOUCH_LONGPRESS = 411
ACTION_TOUCH_LONGPRESS_TEN = 420
ACTION_TOUCH_TAP = 401
ACTION_TOUCH_TAP_TEN = 410
ACTION_TRIGGER_OSD = 243
ACTION_VIDEO_NEXT_STREAM = 250
ACTION_VIS_PRESET_LOCK = 130
ACTION_VIS_PRESET_NEXT = 128
ACTION_VIS_PRESET_PREV = 129
ACTION_VIS_PRESET_RANDOM = 131
ACTION_VIS_PRESET_SHOW = 126
ACTION_VIS_RATE_PRESET_MINUS = 133
ACTION_VIS_RATE_PRESET_PLUS = 132
ACTION_VOICE_RECOGNIZE = 300
ACTION_VOLAMP = 90
ACTION_VOLAMP_DOWN = 94
ACTION_VOLAMP_UP = 93
ACTION_VOLUME_DOWN = 89
ACTION_VOLUME_SET = 245
ACTION_VOLUME_UP = 88
ACTION_VSHIFT_DOWN = 228
ACTION_VSHIFT_UP = 227
ACTION_ZOOM_IN = 31
ACTION_ZOOM_LEVEL_1 = 38
ACTION_ZOOM_LEVEL_2 = 39
ACTION_ZOOM_LEVEL_3 = 40
ACTION_ZOOM_LEVEL_4 = 41
ACTION_ZOOM_LEVEL_5 = 42
ACTION_ZOOM_LEVEL_6 = 43
ACTION_ZOOM_LEVEL_7 = 44
ACTION_ZOOM_LEVEL_8 = 45
ACTION_ZOOM_LEVEL_9 = 46
ACTION_ZOOM_LEVEL_NORMAL = 37
ACTION_ZOOM_OUT = 30
ALPHANUM_HIDE_INPUT = 2
CONTROL_TEXT_OFFSET_X = 10
CONTROL_TEXT_OFFSET_Y = 2
DLG_YESNO_CUSTOM_BTN = 12
DLG_YESNO_NO_BTN = 10
DLG_YESNO_YES_BTN = 11
HORIZONTAL = 0
ICON_OVERLAY_HD = 6
ICON_OVERLAY_LOCKED = 3
ICON_OVERLAY_NONE = 0
ICON_OVERLAY_RAR = 1
ICON_OVERLAY_UNWATCHED = 4
ICON_OVERLAY_WATCHED = 5
ICON_OVERLAY_ZIP = 2
ICON_TYPE_FILES = 106
ICON_TYPE_MUSIC = 103
ICON_TYPE_NONE = 101
ICON_TYPE_PICTURES = 104
ICON_TYPE_PROGRAMS = 102
ICON_TYPE_SETTINGS = 109
ICON_TYPE_VIDEOS = 105
ICON_TYPE_WEATHER = 107
INPUT_ALPHANUM = 0
INPUT_DATE = 2
INPUT_IPADDRESS = 4
INPUT_NUMERIC = 1
INPUT_PASSWORD = 5
INPUT_TIME = 3
INPUT_TYPE_DATE = 4
INPUT_TYPE_IPADDRESS = 5
INPUT_TYPE_NUMBER = 1
INPUT_TYPE_PASSWORD = 6
INPUT_TYPE_PASSWORD_MD5 = 7
INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW = 10
INPUT_TYPE_SECONDS = 2
INPUT_TYPE_TEXT = 0
INPUT_TYPE_TIME = 3
KEY_APPCOMMAND = 53248
KEY_BUTTON_A = 256
KEY_BUTTON_B = 257
KEY_BUTTON_BACK = 275
KEY_BUTTON_BLACK = 260
KEY_BUTTON_DPAD_DOWN = 271
KEY_BUTTON_DPAD_LEFT = 272
KEY_BUTTON_DPAD_RIGHT = 273
KEY_BUTTON_DPAD_UP = 270
KEY_BUTTON_LEFT_ANALOG_TRIGGER = 278
KEY_BUTTON_LEFT_THUMB_BUTTON = 276
KEY_BUTTON_LEFT_THUMB_STICK = 264
KEY_BUTTON_LEFT_THUMB_STICK_DOWN = 281
KEY_BUTTON_LEFT_THUMB_STICK_LEFT = 282
KEY_BUTTON_LEFT_THUMB_STICK_RIGHT = 283
KEY_BUTTON_LEFT_THUMB_STICK_UP = 280
KEY_BUTTON_LEFT_TRIGGER = 262
KEY_BUTTON_RIGHT_ANALOG_TRIGGER = 279
KEY_BUTTON_RIGHT_THUMB_BUTTON = 277
KEY_BUTTON_RIGHT_THUMB_STICK = 265
KEY_BUTTON_RIGHT_THUMB_STICK_DOWN = 267
KEY_BUTTON_RIGHT_THUMB_STICK_LEFT = 268
KEY_BUTTON_RIGHT_THUMB_STICK_RIGHT = 269
KEY_BUTTON_RIGHT_THUMB_STICK_UP = 266
KEY_BUTTON_RIGHT_TRIGGER = 263
KEY_BUTTON_START = 274
KEY_BUTTON_WHITE = 261
KEY_BUTTON_X = 258
KEY_BUTTON_Y = 259
KEY_INVALID = 65535
KEY_MOUSE_CLICK = 57344
KEY_MOUSE_DOUBLE_CLICK = 57360
KEY_MOUSE_DRAG = 57604
KEY_MOUSE_DRAG_END = 57606
KEY_MOUSE_DRAG_START = 57605
KEY_MOUSE_END = 61439
KEY_MOUSE_LONG_CLICK = 57376
KEY_MOUSE_MIDDLECLICK = 57346
KEY_MOUSE_MOVE = 57603
KEY_MOUSE_NOOP = 61439
KEY_MOUSE_RDRAG = 57607
KEY_MOUSE_RDRAG_END = 57609
KEY_MOUSE_RDRAG_START = 57608
KEY_MOUSE_RIGHTCLICK = 57345
KEY_MOUSE_START = 57344
KEY_MOUSE_WHEEL_DOWN = 57602
KEY_MOUSE_WHEEL_UP = 57601
KEY_UNICODE = 61952
KEY_VKEY = 61440
KEY_VMOUSE = 61439
NOTIFICATION_ERROR = 'error'
NOTIFICATION_INFO = 'info'
NOTIFICATION_WARNING = 'warning'
PASSWORD_VERIFY = 1
REMOTE_0 = 58
REMOTE_1 = 59
REMOTE_2 = 60
REMOTE_3 = 61
REMOTE_4 = 62
REMOTE_5 = 63
REMOTE_6 = 64
REMOTE_7 = 65
REMOTE_8 = 66
REMOTE_9 = 67
VERTICAL = 1
class Control:
"""
**Code based skin access.**
Offers classes and functions that manipulate the add-on gui controls.
**Code based skin access.**
Kodi is noted as having a very flexible and robust framework for its GUI, making
theme-skinning and personal customization very accessible. Users can create
their own skin (or modify an existing skin) and share it with others.
Kodi includes a new GUI library written from scratch. This library allows you to
skin/change everything you see in Kodi, from the images, the sizes and positions
of all controls, colours, fonts, and text, through to altering navigation and
even adding new functionality. The skin system is quite complex, and this
portion of the manual is dedicated to providing in depth information on how it
all works, along with tips to make the experience a little more pleasant.
"""
def __init__(self) -> None:
pass
def getId(self) -> int:
"""
Returns the control's current id as an integer.
:return: int - Current id
Example::
...
id = self.button.getId()
...
"""
return 0
def getX(self) -> int:
"""
Returns the control's current X position.
:return: int - Current X position
Example::
...
posX = self.button.getX()
...
"""
return 0
def getY(self) -> int:
"""
Returns the control's current Y position.
:return: int - Current Y position
Example::
...
posY = self.button.getY()
...
"""
return 0
def getHeight(self) -> int:
"""
Returns the control's current height as an integer.
:return: int - Current height
Example::
...
height = self.button.getHeight()
...
"""
return 0
def getWidth(self) -> int:
"""
Returns the control's current width as an integer.
:return: int - Current width
Example::
...
width = self.button.getWidth()
...
"""
return 0
def setEnabled(self, enabled: bool) -> None:
"""
Sets the control's enabled/disabled state.
:param enabled: bool - True=enabled / False=disabled.
Example::
...
self.button.setEnabled(False)
...
"""
pass
def setVisible(self, visible: bool) -> None:
"""
Sets the control's visible/hidden state.
:param visible: bool - True=visible / False=hidden.
@python_v19 You can now define the visible state of a control before
it being added to a window. This value will be taken into account when
the control is later added.
Example::
...
self.button.setVisible(False)
...
"""
pass
def isVisible(self) -> bool:
"""
Get the control's visible/hidden state with respect to the container/window
.. note::
If a given control is set visible (c.f.`setVisible()` but was not
yet added to a window, this method will return ``False`` (the
control is not visible yet since it was not added to the window).
@python_v18 New function added.
Example::
...
if self.button.isVisible():
...
"""
return True
def setVisibleCondition(self, visible: str,
allowHiddenFocus: bool = False) -> None:
"""
Sets the control's visible condition.
Allows Kodi to control the visible status of the control.
List of Conditions: https://kodi.wiki/view/List_of_boolean_conditions
:param visible: string - Visible condition
:param allowHiddenFocus: [opt] bool - True = gains focus even if hidden
Example::
...
# setVisibleCondition(visible[,allowHiddenFocus])
self.button.setVisibleCondition('[Control.IsVisible(41) + !Control.IsVisible(12)]', True)
...
"""
pass
def setEnableCondition(self, enable: str) -> None:
"""
Sets the control's enabled condition.
Allows Kodi to control the enabled status of the control.
List of Conditions
:param enable: string - Enable condition.
Example::
...
# setEnableCondition(enable)
self.button.setEnableCondition('System.InternetState')
...
"""
pass
def setAnimations(self, eventAttr: List[Tuple[str, str]]) -> None:
"""
Sets the control's animations.
**[(event,attr,)*]**: list - A list of tuples consisting of event and attributes
pairs.
Animating your skin
:param event: string - The event to animate.
:param attr: string - The whole attribute string separated by spaces.
Example::
...
# setAnimations([(event, attr,)*])
self.button.setAnimations([('focus', 'effect=zoom end=90,247,220,56 time=0',)])
...
"""
pass
def setPosition(self, x: int, y: int) -> None:
"""
Sets the controls position.
:param x: integer - x coordinate of control.
:param 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 setWidth(self, width: int) -> None:
"""
Sets the controls width.
:param width: integer - width of control.
Example::
...
self.image.setWidth(100)
...
"""
pass
def setHeight(self, height: int) -> None:
"""
Sets the controls height.
:param height: integer - height of control.
Example::
...
self.image.setHeight(100)
...
"""
pass
def setNavigation(self, up: 'Control',
down: 'Control',
left: 'Control',
right: 'Control') -> None:
"""
Sets the controls navigation.
:param up: control object - control to navigate to on up.
:param down: control object - control to navigate to on down.
:param left: control object - control to navigate to on left.
:param right: control object - control to navigate to on right.
:raises TypeError: if one of the supplied arguments is not a control type.
:raises ReferenceError: if one of the controls is not added to a window.
.. note::
Same
as `controlUp()`,`controlDown()`,`controlLeft()`,`controlRight()`.
Set to self to disable navigation for that direction.
Example::
...
self.button.setNavigation(self.button1, self.button2, self.button3, self.button4)
...
"""
pass
def controlUp(self, up: 'Control') -> None:
"""
Sets the controls up navigation.
:param control: control object - control to navigate to on up.
:raises TypeError: if one of the supplied arguments is not a control type.
:raises ReferenceError: if one of the controls is not added to a window.
.. note::
You can also use `setNavigation()`. Set to self to disable
navigation.
Example::
...
self.button.controlUp(self.button1)
...
"""
pass
def controlDown(self, control: 'Control') -> None:
"""
Sets the controls down navigation.
:param control: control object - control to navigate to on down.
:raises TypeError: if one of the supplied arguments is not a control type.
:raises ReferenceError: if one of the controls is not added to a window.
.. note::
You can also use `setNavigation()`. Set to self to disable
navigation.
Example::
...
self.button.controlDown(self.button1)
...
"""
pass
def controlLeft(self, control: 'Control') -> None:
"""
Sets the controls left navigation.
:param control: control object - control to navigate to on left.
:raises TypeError: if one of the supplied arguments is not a control type.
:raises ReferenceError: if one of the controls is not added to a window.
.. note::
You can also use `setNavigation()`. Set to self to disable
navigation.
Example::
...
self.button.controlLeft(self.button1)
...
"""
pass
def controlRight(self, control: 'Control') -> None:
"""
Sets the controls right navigation.
:param control: control object - control to navigate to on right.
:raises TypeError: if one of the supplied arguments is not a control type.
:raises ReferenceError: if one of the controls is not added to a window.
.. note::
You can also use `setNavigation()`. Set to self to disable
navigation.
Example::
...
self.button.controlRight(self.button1)
...
"""
pass
class ControlSpin(Control):
"""
**Used for cycling up/down controls.**
Offers classes and functions that manipulate the add-on gui controls.
**Code based skin access.**
The spin control is used for when a list of options can be chosen (such as a
page up/down control). You can choose the position, size, and look of the spin
control.
.. note::
This class include also all calls from `Control`
**Not working yet**. You can't create this object, it is returned by objects
like `ControlTextBox` and `ControlList`.
"""
def __init__(self) -> None:
pass
def setTextures(self, up: str,
down: str,
upFocus: str,
downFocus: str,
upDisabled: str,
downDisabled: str) -> None:
"""
Sets textures for this control.
Texture are image files that are used for example in the skin
**Not working yet**.
:param up: label - for the up arrow when it doesn't have focus.
:param down: label - for the down button when it is not focused.
:param upFocus: label - for the up button when it has focus.
:param downFocus: label - for the down button when it has focus.
:param upDisabled: label - for the up arrow when the button is disabled.
:param downDisabled: label - for the up arrow when the button is disabled.
Example::
...
# setTextures(up, down, upFocus, downFocus, upDisabled, downDisabled)
...
"""
pass
class ControlLabel(Control):
"""
**Used to show some lines of text.**
The label control is used for displaying text in Kodi. You can choose the font,
size, colour, location and contents of the text to be displayed.
.. note::
This class include also all calls from `Control`
:param x: integer - x coordinate of control.
:param y: integer - y coordinate of control.
:param width: integer - width of control.
:param height: integer - height of control.
:param label: string or unicode - text string.
:param font: [opt] string - font used for label text. (e.g. 'font13')
:param textColor: [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')
:param disabledColor: [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')
:param alignment: [opt] integer - alignment of label Flags for alignment used as bits
to have several together:
================ ========== ==============
Definition name Bitflag Description
================ ========== ==============
XBFONT_LEFT 0x00000000 Align X left
XBFONT_RIGHT 0x00000001 Align X right
XBFONT_CENTER_X 0x00000002 Align X center
XBFONT_CENTER_Y 0x00000004 Align Y center
XBFONT_TRUNCATED 0x00000008 Truncated text
XBFONT_JUSTIFIED 0x00000010 Justify text
================ ========== ==============
:param hasPath: [opt] bool - True=stores a path / False=no path
:param angle: [opt] integer - angle of control. (**+** rotates CCW, **-** rotates C)
Example::
...
# ControlLabel(x, y, width, height, label[, font, textColor,
# disabledColor, alignment, hasPath, angle])
self.label = xbmcgui.ControlLabel(100, 250, 125, 75, 'Status', angle=45)
...
"""
def __init__(self, x: int,
y: int,
width: int,
height: int,
label: str,
font: Optional[str] = None,
textColor: Optional[str] = None,
disabledColor: Optional[str] = None,
alignment: int = 0,
hasPath: bool = False,
angle: int = 0) -> None:
pass
def getLabel(self) -> str:
"""
Returns the text value for this label.
:return: This label
Example::
...
label = self.label.getLabel()
...
"""
return ""
def setLabel(self, label: str = "",
font: Optional[str] = None,
textColor: Optional[str] = None,
disabledColor: Optional[str] = None,
shadowColor: Optional[str] = None,
focusedColor: Optional[str] = None,
label2: str = "") -> None:
"""
Sets text for this label.
:param label: string or unicode - text string.
:param font: [opt] string - font used for label text. (e.g. 'font13')
:param textColor: [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')
:param disabledColor: [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')
:param shadowColor: [opt] hexstring - color of button's label's shadow. (e.g.
'0xFF000000')
:param focusedColor: [opt] hexstring - color of focused button's label. (e.g. '0xFF00FFFF')
:param label2: [opt] string or unicode - text string.
Example::
...
self.label.setLabel('Status')
...
"""
pass
class ControlEdit(Control):
"""
**Used as an input control for the osd keyboard and other input fields.**
The edit control allows a user to input text in Kodi. You can choose the font,
size, colour, location and header of the text to be displayed.
.. note::
This class include also all calls from `Control`
:param x: integer - x coordinate of control.
:param y: integer - y coordinate of control.
:param width: integer - width of control.
:param height: integer - height of control.
:param label: string or unicode - text string.
:param font: [opt] string - font used for label text. (e.g. 'font13')
:param textColor: [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')
:param disabledColor: [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')
:param alignment: [opt] integer - alignment of label Flags for alignment used as bits
to have several together:
================ ========== ==============
Definition name Bitflag Description
================ ========== ==============
XBFONT_LEFT 0x00000000 Align X left
XBFONT_RIGHT 0x00000001 Align X right
XBFONT_CENTER_X 0x00000002 Align X center
XBFONT_CENTER_Y 0x00000004 Align Y center
XBFONT_TRUNCATED 0x00000008 Truncated text
XBFONT_JUSTIFIED 0x00000010 Justify text
================ ========== ==============
:param focusTexture: [opt] string - filename for focus texture.
:param noFocusTexture: [opt] string - filename for no focus texture.
.. note::
You can use the above as keywords for arguments and skip certain
optional arguments. Once you use a keyword, all following
arguments require the keyword. After you create the control, you
need to add it to the window with addControl().
@python_v18 Deprecated **isPassword**
@python_v19 Removed **isPassword**
Example::
...
self.edit = xbmcgui.ControlEdit(100, 250, 125, 75, 'Status')
...
"""
def __init__(self, x: int,
y: int,
width: int,
height: int,
label: str,
font: Optional[str] = None,
textColor: Optional[str] = None,
disabledColor: Optional[str] = None,
_alignment: int = 0,
focusTexture: Optional[str] = None,
noFocusTexture: Optional[str] = None) -> None:
pass
def setLabel(self, label: str = "",
font: Optional[str] = None,
textColor: Optional[str] = None,
disabledColor: Optional[str] = None,
shadowColor: Optional[str] = None,
focusedColor: Optional[str] = None,
label2: str = "") -> None:
"""
Sets text heading for this edit control.
:param label: string or unicode - text string.
:param font: [opt] string - font used for label text. (e.g. 'font13')
:param textColor: [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')
:param disabledColor: [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')
:param shadowColor: [opt] hexstring - color of button's label's shadow. (e.g.
'0xFF000000')
:param focusedColor: [opt] hexstring - color of focused button's label. (e.g. '0xFF00FFFF')
:param label2: [opt] string or unicode - text string.
Example::
...
self.edit.setLabel('Status')
...
"""
pass
def getLabel(self) -> str:
"""
Returns the text heading for this edit control.
:return: Heading text
Example::
...
label = self.edit.getLabel()
...
"""
return ""
def setText(self, text: str) -> None:
"""
Sets text value for this edit control.
:param value: string or unicode - text string.
Example::
...
self.edit.setText('online')
...
"""
pass
def getText(self) -> str:
"""
Returns the text value for this edit control.
:return: Text value of control
@python_v14 New function added.
Example::
...
value = self.edit.getText()
...
"""
return ""
def setType(self, type: int, heading: str) -> None:
"""
Sets the type of this edit control.
:param type: integer - type of the edit control.
============================================= ===========================================
Param Definition
============================================= ===========================================