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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "Alternative.h"
#include "ListItem.h"
#include "Tuple.h"
#include "guilib/GUIControl.h"
#include "guilib/GUIFont.h"
#include "input/Key.h"
#include "swighelper.h"
#include "utils/ColorUtils.h"
#include <vector>
// hardcoded offsets for button controls (and controls that use button controls)
// ideally they should be dynamically read in as with all the other properties.
#define CONTROL_TEXT_OFFSET_X 10
#define CONTROL_TEXT_OFFSET_Y 2
namespace XBMCAddon
{
namespace xbmcgui
{
/// \defgroup python_xbmcgui_control Control
/// \ingroup python_xbmcgui
/// @{
/// @brief **Code based skin access.**
///
/// Offers classes and functions that manipulate the add-on gui controls.
///
///-------------------------------------------------------------------------
///
/// \python_class{ Control() }
///
/// **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.
///
///-------------------------------------------------------------------------
//
class Control : public AddonClass
{
protected:
Control() = default;
public:
~Control() override;
#ifndef SWIG
virtual CGUIControl* Create();
#endif
// currently we only accept messages from a button or controllist with a select action
virtual bool canAcceptMessages(int actionId) { return false; }
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ getId() }
/// Returns the control's current id as an integer.
///
/// @return int - Current id
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// id = self.button.getId()
/// ...
/// ~~~~~~~~~~~~~
///
getId()
#else
virtual int getId() { return iControlId; }
#endif
inline bool operator==(const Control& other) const { return iControlId == other.iControlId; }
inline bool operator>(const Control& other) const { return iControlId > other.iControlId; }
inline bool operator<(const Control& other) const { return iControlId < other.iControlId; }
// hack this because it returns a tuple
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ getPosition() }
/// Returns the control's current position as a x,y integer tuple.
///
/// @return Current position as a x,y integer tuple
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// pos = self.button.getPosition()
/// ...
/// ~~~~~~~~~~~~~
///
getPosition();
#else
virtual std::vector<int> getPosition();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ getX() }
/// Returns the control's current X position.
///
/// @return int - Current X position
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// posX = self.button.getX()
/// ...
/// ~~~~~~~~~~~~~
///
getX();
#else
int getX() { return dwPosX; }
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ getY() }
/// Returns the control's current Y position.
///
/// @return int - Current Y position
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// posY = self.button.getY()
/// ...
/// ~~~~~~~~~~~~~
///
getY();
#else
int getY() { return dwPosY; }
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ getHeight() }
/// Returns the control's current height as an integer.
///
/// @return int - Current height
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// height = self.button.getHeight()
/// ...
/// ~~~~~~~~~~~~~
///
getHeight();
#else
virtual int getHeight() { return dwHeight; }
#endif
// getWidth() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ getWidth() }
/// Returns the control's current width as an integer.
///
/// @return int - Current width
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// width = self.button.getWidth()
/// ...
/// ~~~~~~~~~~~~~
///
getWidth();
#else
virtual int getWidth() { return dwWidth; }
#endif
// setEnabled() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setEnabled(enabled) }
/// Sets the control's enabled/disabled state.
///
/// @param enabled bool - True=enabled / False=disabled.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.setEnabled(False)
/// ...
/// ~~~~~~~~~~~~~
///
setEnabled(...);
#else
virtual void setEnabled(bool enabled);
#endif
// setVisible() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setVisible(visible) }
/// Sets the control's visible/hidden state.
/// \anchor python_xbmcgui_control_setVisible
///
/// @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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.setVisible(False)
/// ...
/// ~~~~~~~~~~~~~
///
setVisible(...);
#else
virtual void setVisible(bool visible);
#endif
// isVisible() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ isVisible() }
/// Get the control's visible/hidden state with respect to the container/window
///
/// @note If a given control is set visible (c.f. \ref python_xbmcgui_control_setVisible "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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// if self.button.isVisible():
/// ...
/// ~~~~~~~~~~~~~
///
isVisible(...);
#else
virtual bool isVisible();
#endif
// setVisibleCondition() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setVisibleCondition(visible[,allowHiddenFocus]) }
/// Sets the control's visible condition.
///
/// Allows Kodi to control the visible status of the control.
///
/// [List of Conditions](http://kodi.wiki/view/List_of_Boolean_Conditions)
///
/// @param visible string - Visible condition
/// @param allowHiddenFocus [opt] bool - True=gains focus even if
/// hidden
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setVisibleCondition(visible[,allowHiddenFocus])
/// self.button.setVisibleCondition('[Control.IsVisible(41) + !Control.IsVisible(12)]', True)
/// ...
/// ~~~~~~~~~~~~~
///
setVisibleCondition(...);
#else
virtual void setVisibleCondition(const char* visible, bool allowHiddenFocus = false);
#endif
// setEnableCondition() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setEnableCondition(enable) }
/// Sets the control's enabled condition.
///
/// Allows Kodi to control the enabled status of the control.
///
/// [List of Conditions](http://kodi.wiki/view/List_of_Boolean_Conditions)
///
/// @param enable string - Enable condition.
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setEnableCondition(enable)
/// self.button.setEnableCondition('System.InternetState')
/// ...
/// ~~~~~~~~~~~~~
///
setEnableCondition(...);
#else
virtual void setEnableCondition(const char* enable);
#endif
// setAnimations() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setAnimations([(event, attr,)*]) }
/// Sets the control's animations.
///
/// <b>[(event,attr,)*]</b>: list - A list of tuples consisting of event
/// and attributes pairs.
///
/// [Animating your skin](http://kodi.wiki/view/Animating_Your_Skin)
///
/// @param event string - The event to animate.
/// @param attr string - The whole attribute string
/// separated by spaces.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setAnimations([(event, attr,)*])
/// self.button.setAnimations([('focus', 'effect=zoom end=90,247,220,56 time=0',)])
/// ...
/// ~~~~~~~~~~~~~
///
setAnimations(...);
#else
virtual void setAnimations(const std::vector< Tuple<String,String> >& eventAttr);
#endif
// setPosition() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setPosition(x, y) }
/// 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.setPosition(100, 250)
/// ...
/// ~~~~~~~~~~~~~
///
setPosition(...);
#else
virtual void setPosition(long x, long y);
#endif
// setWidth() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setWidth(width) }
/// Sets the controls width.
///
/// @param width integer - width of control.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.image.setWidth(100)
/// ...
/// ~~~~~~~~~~~~~
///
setWidth(...);
#else
virtual void setWidth(long width);
#endif
// setHeight() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setHeight(height) }
/// Sets the controls height.
///
/// @param height integer - height of control.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.image.setHeight(100)
/// ...
/// ~~~~~~~~~~~~~
///
setHeight(...);
#else
virtual void setHeight(long height);
#endif
// setNavigation() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ setNavigation(up, down, left, right) }
/// 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.
/// @throw TypeError if one of the supplied arguments is not a
/// control type.
/// @throw 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.setNavigation(self.button1, self.button2, self.button3, self.button4)
/// ...
/// ~~~~~~~~~~~~~
//
setNavigation(...);
#else
virtual void setNavigation(const Control* up, const Control* down,
const Control* left, const Control* right);
#endif
// controlUp() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ controlUp(control) }
/// Sets the controls up navigation.
///
/// @param control control object - control to navigate to on up.
/// @throw TypeError if one of the supplied arguments is not a
/// control type.
/// @throw 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.controlUp(self.button1)
/// ...
/// ~~~~~~~~~~~~~
///
controlUp(...);
#else
virtual void controlUp(const Control* up);
#endif
// controlDown() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ controlDown(control) }
/// Sets the controls down navigation.
///
/// @param control control object - control to navigate to on down.
/// @throw TypeError if one of the supplied arguments is not a
/// control type.
/// @throw 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.controlDown(self.button1)
/// ...
/// ~~~~~~~~~~~~~
///
controlDown(...);
#else
virtual void controlDown(const Control* control);
#endif
// controlLeft() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ controlLeft(control) }
/// Sets the controls left navigation.
///
/// @param control control object - control to navigate to on left.
/// @throw TypeError if one of the supplied arguments is not a
/// control type.
/// @throw 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.controlLeft(self.button1)
/// ...
/// ~~~~~~~~~~~~~
///
controlLeft(...);
#else
virtual void controlLeft(const Control* control);
#endif
// controlRight() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control
/// @brief \python_func{ controlRight(control) }
/// Sets the controls right navigation.
///
/// @param control control object - control to navigate to on right.
/// @throw TypeError if one of the supplied arguments is not a
/// control type.
/// @throw 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.button.controlRight(self.button1)
/// ...
/// ~~~~~~~~~~~~~
///
controlRight(...);
#else
virtual void controlRight(const Control* control);
#endif
#ifndef SWIG
int iControlId = 0;
int iParentId = 0;
int dwPosX = 0;
int dwPosY = 0;
int dwWidth = 0;
int dwHeight = 0;
int iControlUp = 0;
int iControlDown = 0;
int iControlLeft = 0;
int iControlRight = 0;
std::string m_label{};
bool m_visible{true};
CGUIControl* pGUIControl = nullptr;
#endif
};
/// @}
/// \defgroup python_xbmcgui_control_spin Subclass - ControlSpin
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used for cycling up/down controls.**
///
/// Offers classes and functions that manipulate the add-on gui controls.
///
///-------------------------------------------------------------------------
///
/// \python_class{ ControlSpin() }
///
/// **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 \ref python_xbmcgui_control "Control"
///
/// @warning **Not working yet**.
/// You can't create this object, it is returned by objects like ControlTextBox and ControlList.
///
///
///-------------------------------------------------------------------------
///
///
class ControlSpin : public Control
{
public:
~ControlSpin() override;
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_spin
/// @brief \python_func{ setTextures(up, down, upFocus, downFocus) }
/// Sets textures for this control.
///
/// Texture are image files that are used for example in the skin
///
/// @warning **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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setTextures(up, down, upFocus, downFocus, upDisabled, downDisabled)
///
/// ...
/// ~~~~~~~~~~~~~
///
setTextures(...);
#else
virtual void setTextures(const char* up, const char* down,
const char* upFocus,
const char* downFocus,
const char* upDisabled, const char* downDisabled);
#endif
#ifndef SWIG
UTILS::COLOR::Color color;
std::string strTextureUp;
std::string strTextureDown;
std::string strTextureUpFocus;
std::string strTextureDownFocus;
std::string strTextureUpDisabled;
std::string strTextureDownDisabled;
#endif
private:
ControlSpin();
friend class Window;
friend class ControlList;
};
/// @}
/// \defgroup python_xbmcgui_control_label Subclass - ControlLabel
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used to show some lines of text.**
///
/// \python_class{ ControlLabel(x, y, width, height, label[, font, textColor,
/// disabledColor, alignment, hasPath, angle]) }
///
/// 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 \ref python_xbmcgui_control "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
/// - \ref kodi_gui_font_alignment "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.
/// (<b>+</b> rotates CCW, <b>-</b> rotates C)
///
///
///-------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # ControlLabel(x, y, width, height, label[, font, textColor,
/// # disabledColor, alignment, hasPath, angle])
/// self.label = xbmcgui.ControlLabel(100, 250, 125, 75, 'Status', angle=45)
/// ...
/// ~~~~~~~~~~~~~
///
class ControlLabel : public Control
{
public:
ControlLabel(long x, long y, long width, long height, const String& label,
const char* font = NULL, const char* textColor = NULL,
const char* disabledColor = NULL,
long alignment = XBFONT_LEFT,
bool hasPath = false, long angle = 0);
~ControlLabel() override;
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_label
/// @brief \python_func{ getLabel() }
/// Returns the text value for this label.
///
/// @return This label
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// label = self.label.getLabel()
/// ...
/// ~~~~~~~~~~~~~
///
getLabel();
#else
virtual String getLabel();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_label
/// @brief \python_func{ setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor, label2]) }
/// 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.label.setLabel('Status')
/// ...
/// ~~~~~~~~~~~~~
///
setLabel(...);
#else
virtual void setLabel(const String& label = emptyString,
const char* font = NULL,
const char* textColor = NULL,
const char* disabledColor = NULL,
const char* shadowColor = NULL,
const char* focusedColor = NULL,
const String& label2 = emptyString);
#endif
#ifndef SWIG
ControlLabel() = default;
std::string strFont;
std::string strText;
UTILS::COLOR::Color textColor;
UTILS::COLOR::Color disabledColor;
uint32_t align;
bool bHasPath = false;
int iAngle = 0;
CGUIControl* Create() override;
#endif
};
/// @}
// ControlEdit class
/// \defgroup python_xbmcgui_control_edit Subclass - ControlEdit
/// \ingroup python_xbmcgui_control
/// @{
/// **Used as an input control for the osd keyboard and other input fields.**
///
/// \python_class{ ControlEdit(x, y, width, height, label[, font, textColor,
/// disabledColor, alignment, focusTexture, noFocusTexture]) }
///
/// 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 \ref python_xbmcgui_control "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
/// - \ref kodi_gui_font_alignment "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.\n
/// Once you use a keyword, all following arguments require the keyword.\n
/// After you create the control, you need to add it to the window with
/// addControl().\n
///
///
///
///-------------------------------------------------------------------------
/// @python_v18 Deprecated **isPassword**
/// @python_v19 Removed **isPassword**
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.edit = xbmcgui.ControlEdit(100, 250, 125, 75, 'Status')
/// ...
/// ~~~~~~~~~~~~~
///
class ControlEdit : public Control
{
public:
ControlEdit(long x, long y, long width, long height, const String& label,
const char* font = NULL, const char* textColor = NULL,
const char* disabledColor = NULL,
long _alignment = XBFONT_LEFT, const char* focusTexture = NULL,
const char* noFocusTexture = NULL);
// setLabel() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_edit
/// @brief \python_func{ setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor, label2]) }
/// 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:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.edit.setLabel('Status')
/// ...
/// ~~~~~~~~~~~~~
///
setLabel(...);
#else
virtual void setLabel(const String& label = emptyString,
const char* font = NULL,
const char* textColor = NULL,
const char* disabledColor = NULL,
const char* shadowColor = NULL,
const char* focusedColor = NULL,
const String& label2 = emptyString);
#endif
// getLabel() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_edit
/// @brief \python_func{ getLabel() }
/// Returns the text heading for this edit control.
///
/// @return Heading text
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// label = self.edit.getLabel()
/// ...
/// ~~~~~~~~~~~~~
///
getLabel();
#else
virtual String getLabel();
#endif
// setText() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_edit
/// @brief \python_func{ setText(value) }
/// Sets text value for this edit control.
///
/// @param value string or unicode - text string.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.edit.setText('online')
/// ...
/// ~~~~~~~~~~~~~
///
setText(...);
#else
virtual void setText(const String& text);
#endif
// getText() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_edit
/// @brief \python_func{ getText() }
/// Returns the text value for this edit control.
///
/// @return Text value of control
///
///
///-----------------------------------------------------------------------
/// @python_v14 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// value = self.edit.getText()
/// ...
/// ~~~~~~~~~~~~~
///
getText();
#else
virtual String getText();
#endif
#ifndef SWIG
ControlEdit() = default;
std::string strFont;
std::string strText;
std::string strTextureFocus;
std::string strTextureNoFocus;
UTILS::COLOR::Color textColor;
UTILS::COLOR::Color disabledColor;
uint32_t align;
CGUIControl* Create() override;
#endif
// setType() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_edit
/// @brief \python_func{ setType(type, heading) }
/// Sets the type of this edit control.
///
/// @param type integer - type of the edit control.
/// | Param | Definition |
/// |-----------------------------------------------|:--------------------------------------------|
/// | xbmcgui.INPUT_TYPE_TEXT | (standard keyboard)
/// | xbmcgui.INPUT_TYPE_NUMBER | (format: #)
/// | xbmcgui.INPUT_TYPE_DATE | (format: DD/MM/YYYY)
/// | xbmcgui.INPUT_TYPE_TIME | (format: HH:MM)
/// | xbmcgui.INPUT_TYPE_IPADDRESS | (format: #.#.#.#)
/// | xbmcgui.INPUT_TYPE_PASSWORD | (input is masked)
/// | xbmcgui.INPUT_TYPE_PASSWORD_MD5 | (input is masked, return md5 hash of input)
/// | xbmcgui.INPUT_TYPE_SECONDS | (format: SS or MM:SS or HH:MM:SS or MM min)
/// | xbmcgui.INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW | (numeric input is masked)
/// @param heading string or unicode - heading that will be used for to numeric or
/// keyboard dialog when the edit control is clicked.
///
///
///-----------------------------------------------------------------------
/// @python_v18 New function added.
/// @python_v19 New option added to mask numeric input.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.edit.setType(xbmcgui.INPUT_TYPE_TIME, 'Please enter the time')
/// ...
/// ~~~~~~~~~~~~~
///
setType(...);
#else
virtual void setType(int type, const String& heading);
#endif
};
/// @}
// ControlList class
/// \defgroup python_xbmcgui_control_list Subclass - ControlList
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used for a scrolling lists of items. Replaces the list control.**
///
/// \python_class{ ControlList(x, y, width, height[, font, textColor, buttonTexture, buttonFocusTexture,
/// selectedColor, imageWidth, imageHeight, itemTextXOffset, itemTextYOffset,
/// itemHeight, space, alignmentY, shadowColor]) }
///
/// The list container is one of several containers used to display items
/// from file lists in various ways. The list container is very
/// flexible - it's only restriction is that it is a list - i.e. a single
/// column or row of items. The layout of the items is very flexible and
/// is up to the skinner.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 font [opt] string - font used for items label. (e.g. 'font13')
/// @param textColor [opt] hexstring - color of items label. (e.g. '0xFFFFFFFF')
/// @param buttonTexture [opt] string - filename for focus texture.
/// @param buttonFocusTexture [opt] string - filename for no focus texture.
/// @param selectedColor [opt] integer - x offset of label.
/// @param imageWidth [opt] integer - width of items icon or thumbnail.
/// @param imageHeight [opt] integer - height of items icon or thumbnail.
/// @param itemTextXOffset [opt] integer - x offset of items label.
/// @param itemTextYOffset [opt] integer - y offset of items label.
/// @param itemHeight [opt] integer - height of items.
/// @param space [opt] integer - space between items.
/// @param alignmentY [opt] integer - Y-axis alignment of items label
/// - \ref kodi_gui_font_alignment "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 shadowColor [opt] hexstring - color of items
/// label's shadow. (e.g. '0xFF000000')
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the
/// keyword.\n
/// After you create the control, you need to add it to the window
/// with addControl().
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.cList = xbmcgui.ControlList(100, 250, 200, 250, 'font14', space=5)
/// ...
/// ~~~~~~~~~~~~~
///
class ControlList : public Control
{
void internAddListItem(const AddonClass::Ref<ListItem>& listitem, bool sendMessage);
public:
ControlList(long x, long y, long width, long height, const char* font = NULL,
const char* textColor = NULL, const char* buttonTexture = NULL,
const char* buttonFocusTexture = NULL,
const char* selectedColor = NULL,
long _imageWidth=10, long _imageHeight=10, long _itemTextXOffset = CONTROL_TEXT_OFFSET_X,
long _itemTextYOffset = CONTROL_TEXT_OFFSET_Y, long _itemHeight = 27, long _space = 2,
long _alignmentY = XBFONT_CENTER_Y);
~ControlList() override;
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ addItem(item) }
/// Add a new item to this list control.
///
/// @param item string, unicode or ListItem - item to add.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.addItem('Reboot Kodi')
/// ...
/// ~~~~~~~~~~~~~
///
addItem(...);
#else
virtual void addItem(const Alternative<String, const XBMCAddon::xbmcgui::ListItem* > & item, bool sendMessage = true);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ addItems(items) }
/// Adds a list of listitems or strings to this list control.
///
/// @param items List - list of strings, unicode objects or ListItems to add.
///
/// @note You can use the above as keywords for arguments.
///
/// Large lists benefit considerably, than using the standard addItem()
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.addItems(items=listitems)
/// ...
/// ~~~~~~~~~~~~~
///
addItems(...);
#else
virtual void addItems(const std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > > & items);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ selectItem(item) }
/// Select an item by index number.
///
/// @param item integer - index number of the item to select.
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.selectItem(12)
/// ...
/// ~~~~~~~~~~~~~
///
selectItem(...);
#else
virtual void selectItem(long item);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ removeItem(index) }
/// Remove an item by index number.
///
/// @param index integer - index number of the item to remove.
///
///
///-----------------------------------------------------------------------
/// @python_v13 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.removeItem(12)
/// ...
/// ~~~~~~~~~~~~~
///
removeItem(...);
#else
virtual void removeItem(int index);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ reset() }
/// Clear all ListItems in this control list.
///
/// @warning Calling `reset()` will destroy any `ListItem` objects in the
/// `ControlList` if not hold by any other class. Make sure you
/// you don't call `addItems()` with the previous `ListItem` references
/// after calling `reset()`. If you need to preserve the `ListItem` objects after
/// `reset()` make sure you store them as members of your `WindowXML` class (see examples).
///
///
///-----------------------------------------------------------------------
///
/// **Examples:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.reset()
/// ...
/// ~~~~~~~~~~~~~
///
/// The below example shows you how you can reset the `ControlList` but this time avoiding `ListItem` object
/// destruction. The example assumes `self` as a `WindowXMLDialog` instance containing a `ControlList`
/// with id = 800. The class preserves the `ListItem` objects in a class member variable.
///
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # Get all the ListItem objects in the control
/// self.list_control = self.getControl(800) # ControlList object
/// self.listitems = [self.list_control.getListItem(item) for item in range(0, self.list_control.size())]
/// # Reset the ControlList control
/// self.list_control.reset()
/// #
/// # do something with your ListItem objects here (e.g. sorting.)
/// # ...
/// #
/// # Add them again to the ControlList
/// self.list_control.addItems(self.listitems)
/// ...
/// ~~~~~~~~~~~~~
///
reset();
#else
virtual void reset();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ getSpinControl() }
/// Returns the associated ControlSpin object.
///
/// @warning Not working completely yet\n
/// After adding this control list to a window it is not possible to change
/// the settings of this spin control.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// ctl = cList.getSpinControl()
/// ...
/// ~~~~~~~~~~~~~
///
getSpinControl();
#else
virtual Control* getSpinControl();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ getSelectedPosition() }
/// Returns the position of the selected item as an integer.
///
/// @note Returns -1 for empty lists.
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// pos = cList.getSelectedPosition()
/// ...
/// ~~~~~~~~~~~~~
///
getSelectedPosition();
#else
virtual long getSelectedPosition();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ getSelectedItem() }
/// Returns the selected item as a ListItem object.
///
/// @return The selected item
///
///
/// @note Same as getSelectedPosition(), but instead of an integer a ListItem object
/// is returned. Returns None for empty lists.\n
/// See windowexample.py on how to use this.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// item = cList.getSelectedItem()
/// ...
/// ~~~~~~~~~~~~~
///
getSelectedItem();
#else
virtual XBMCAddon::xbmcgui::ListItem* getSelectedItem();
#endif
// setImageDimensions() method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ setImageDimensions(imageWidth, imageHeight) }
/// Sets the width/height of items icon or thumbnail.
///
/// @param imageWidth [opt] integer - width of items icon or thumbnail.
/// @param imageHeight [opt] integer - height of items icon or thumbnail.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.setImageDimensions(18, 18)
/// ...
/// ~~~~~~~~~~~~~
///
setImageDimensions(...);
#else
virtual void setImageDimensions(long imageWidth,long imageHeight);
#endif
// setItemHeight() method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// @brief \python_func{ setItemHeight(itemHeight) }
/// Sets the height of items.
///
/// @param itemHeight integer - height of items.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.setItemHeight(25)
/// ...
/// ~~~~~~~~~~~~~
///
setItemHeight(...);
#else
virtual void setItemHeight(long height);
#endif
// setSpace() method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ setSpace(space) }
/// Sets the space between items.
///
/// @param space [opt] integer - space between items.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.setSpace(5)
/// ...
/// ~~~~~~~~~~~~~
///
setSpace(...);
#else
virtual void setSpace(int space);
#endif
// setPageControlVisible() method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ setPageControlVisible(visible) }
/// Sets the spin control's visible/hidden state.
///
/// @param visible boolean - True=visible / False=hidden.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.setPageControlVisible(True)
/// ...
/// ~~~~~~~~~~~~~
///
setPageControlVisible(...);
#else
virtual void setPageControlVisible(bool visible);
#endif
// size() method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ size() }
/// Returns the total number of items in this list control as an integer.
///
/// @return Total number of items
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cnt = cList.size()
/// ...
/// ~~~~~~~~~~~~~
///
size();
#else
virtual long size();
#endif
// getItemHeight() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ getItemHeight() }
/// Returns the control's current item height as an integer.
///
/// @return Current item heigh
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ..
/// item_height = self.cList.getItemHeight()
/// ...
/// ~~~~~~~~~~~~~
///
getItemHeight();
#else
virtual long getItemHeight();
#endif
// getSpace() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ getSpace() }
/// Returns the control's space between items as an integer.
///
/// @return Space between items
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// gap = self.cList.getSpace()
/// ...
/// ~~~~~~~~~~~~~
///
getSpace();
#else
virtual long getSpace();
#endif
// getListItem() method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ getListItem(index) }
/// Returns a given ListItem in this List.
///
/// @param index integer - index number of item to return.
/// @return List item
/// @throw ValueError if index is out of range.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// listitem = cList.getListItem(6)
/// ...
/// ~~~~~~~~~~~~~
///
getListItem(...);
#else
virtual XBMCAddon::xbmcgui::ListItem* getListItem(int index);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_list
/// @brief \python_func{ setStaticContent(items) }
/// Fills a static list with a list of listitems.
///
/// @param items List - list of listitems to add.
///
/// @note You can use the above as keywords for arguments.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// cList.setStaticContent(items=listitems)
/// ...
/// ~~~~~~~~~~~~~
///
setStaticContent(...);
#else
virtual void setStaticContent(const ListItemList* items);
#endif
#ifndef SWIG
void sendLabelBind(int tail);
bool canAcceptMessages(int actionId) override
{ return ((actionId == ACTION_SELECT_ITEM) | (actionId == ACTION_MOUSE_LEFT_CLICK)); }
// This is called from AddonWindow.cpp but shouldn't be available
// to the scripting languages.
ControlList() = default;
std::vector<AddonClass::Ref<ListItem> > vecItems;
std::string strFont;
AddonClass::Ref<ControlSpin> pControlSpin;
UTILS::COLOR::Color textColor;
UTILS::COLOR::Color selectedColor;
std::string strTextureButton;
std::string strTextureButtonFocus;
int imageHeight = 0;
int imageWidth = 0;
int itemHeight = 0;
int space = 0;
int itemTextOffsetX = 0;
int itemTextOffsetY = 0;
uint32_t alignmentY;
CGUIControl* Create() override;
#endif
};
/// @}
// ControlFadeLabel class
///
/// \defgroup python_xbmcgui_control_fadelabel Subclass - ControlFadeLabel
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used to show multiple pieces of text in the same position, by
/// fading from one to the other.**
///
/// \python_class{ ControlFadeLabel(x, y, width, height[, font, textColor, alignment]) }
///
/// The fade label control is used for displaying multiple pieces of text
/// in the same space in Kodi. You can choose the font, size, colour,
/// location and contents of the text to be displayed. The first piece of
/// information to display fades in over 50 frames, then scrolls off to
/// the left. Once it is finished scrolling off screen, the second piece
/// of information fades in and the process repeats. A fade label control
/// is not supported in a list container.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 font [opt] string - font used for label text. (e.g. 'font13')
/// @param textColor [opt] hexstring - color of fadelabel's labels. (e.g. '0xFFFFFFFF')
/// @param alignment [opt] integer - alignment of label
/// - \ref kodi_gui_font_alignment "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
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the
/// keyword.\n
/// After you create the control, you need to add it to the window
/// with addControl().
///
///
///-------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.fadelabel = xbmcgui.ControlFadeLabel(100, 250, 200, 50, textColor='0xFFFFFFFF')
/// ...
/// ~~~~~~~~~~~~~
///
class ControlFadeLabel : public Control
{
public:
ControlFadeLabel(long x, long y, long width, long height,
const char* font = NULL,
const char* textColor = NULL,
long _alignment = XBFONT_LEFT);
// addLabel() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
/// \ingroup python_xbmcgui_control_fadelabel
/// @brief \python_func{ addLabel(label) }
/// Add a label to this control for scrolling.
///
/// @param label string or unicode - text string to add.
///
/// @note To remove added text use `reset()` for them.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.fadelabel.addLabel('This is a line of text that can scroll.')
/// ...
/// ~~~~~~~~~~~~~
///
addLabel(...);
#else
virtual void addLabel(const String& label);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_fadelabel
/// @brief \python_func{ setScrolling(scroll) }
/// Set scrolling. If set to false, the labels won't scroll.
/// Defaults to true.
///
/// @param scroll boolean - True = enabled / False = disabled
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.fadelabel.setScrolling(False)
/// ...
/// ~~~~~~~~~~~~~
///
setScrolling(...);
#else
virtual void setScrolling(bool scroll);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_label
/// @brief \python_func{ reset() }
/// Clear this fade label.
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.fadelabel.reset()
/// ...
/// ~~~~~~~~~~~~~
///
reset();
#else
virtual void reset();
#endif
#ifndef SWIG
std::string strFont;
UTILS::COLOR::Color textColor;
std::vector<std::string> vecLabels;
uint32_t align;
CGUIControl* Create() override;
ControlFadeLabel() = default;
#endif
};
/// @}
// ControlTextBox class
///
/// \defgroup python_xbmcgui_control_textbox Subclass - ControlTextBox
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used to show a multi-page piece of text.**
///
/// \python_class{ ControlTextBox(x, y, width, height[, font, textColor]) }
///
/// The text box is used for showing a large multipage piece of text in Kodi.
/// You can choose the position, size, and look of the text.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 font [opt] string - font used for text. (e.g. 'font13')
/// @param textColor [opt] hexstring - color of textbox's text. (e.g. '0xFFFFFFFF')
///
/// @note You can use the above as keywords for arguments and skip certain optional arguments.\n
/// Once you use a keyword, all following arguments require the keyword.\n
/// After you create the control, you need to add it to the window with addControl().
///
///
///-------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # ControlTextBox(x, y, width, height[, font, textColor])
/// self.textbox = xbmcgui.ControlTextBox(100, 250, 300, 300, textColor='0xFFFFFFFF')
/// ...
/// ~~~~~~~~~~~~~
///
/// As stated above, the GUI control is only created once added to a window. The example
/// below shows how a ControlTextBox can be created, added to the current window and
/// have some of its properties changed.
///
/// **Extended example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// textbox = xbmcgui.ControlTextBox(100, 250, 300, 300, textColor='0xFFFFFFFF')
/// window = xbmcgui.Window(xbmcgui.getCurrentWindowId())
/// window.addControl(textbox)
/// textbox.setText("My Text Box")
/// textbox.scroll()
/// ...
/// ~~~~~~~~~~~~~
///
class ControlTextBox : public Control
{
public:
ControlTextBox(long x, long y, long width, long height,
const char* font = NULL,
const char* textColor = NULL);
// SetText() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_textbox
/// @brief \python_func{ setText(text) }
/// Sets the text for this textbox.
/// \anchor python_xbmcgui_control_textbox_settext
///
/// @param text string - text string.
///
///-----------------------------------------------------------------------
///
/// @python_v19 setText can now be used before adding the control to the window (the defined
/// value is taken into consideration when the control is created)
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setText(text)
/// self.textbox.setText('This is a line of text that can wrap.')
/// ...
/// ~~~~~~~~~~~~~
///
setText(...);
#else
virtual void setText(const String& text);
#endif
// getText() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_textbox
/// @brief \python_func{ getText() }
/// Returns the text value for this textbox.
///
/// @return To get text from box
///
///-----------------------------------------------------------------------
///
/// @python_v19 getText() can now be used before adding the control to the window
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # getText()
/// text = self.text.getText()
/// ...
/// ~~~~~~~~~~~~~
///
getText();
#else
virtual String getText();
#endif
// reset() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_textbox
/// @brief \python_func{ reset() }
/// Clear's this textbox.
///
///-----------------------------------------------------------------------
/// @python_v19 reset() will reset any text defined for this control even before you add the control to the window
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # reset()
/// self.textbox.reset()
/// ...
/// ~~~~~~~~~~~~~
///
reset();
#else
virtual void reset();
#endif
// scroll() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_textbox
/// @brief \python_func{ scroll(id) }
/// Scrolls to the given position.
///
/// @param id integer - position to scroll to.
///
/// @note scroll() only works after the control is added to a window.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # scroll(position)
/// self.textbox.scroll(10)
/// ...
/// ~~~~~~~~~~~~~
///
scroll(...);
#else
virtual void scroll(long id);
#endif
// autoScroll() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_textbox
/// @brief \python_func{ autoScroll(delay, time, repeat) }
/// Set autoscrolling times.
///
/// @param delay integer - Scroll delay (in ms)
/// @param time integer - Scroll time (in ms)
/// @param repeat integer - Repeat time
///
/// @note autoScroll only works after you add the control to a window.
///
///-----------------------------------------------------------------------
///
/// @python_v15 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.textbox.autoScroll(1, 2, 1)
/// ...
/// ~~~~~~~~~~~~~
///
autoScroll(...);
#else
virtual void autoScroll(int delay, int time, int repeat);
#endif
#ifndef SWIG
std::string strFont;
UTILS::COLOR::Color textColor;
CGUIControl* Create() override;
ControlTextBox() = default;
#endif
};
/// @}
// ControlImage class
///
/// \defgroup python_xbmcgui_control_image Subclass - ControlImage
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used to show an image.**
///
/// \python_class{ ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse]) }
///
/// The image control is used for displaying images in Kodi. You can choose
/// the position, size, transparency and contents of the image to be
/// displayed.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 filename string - image filename.
/// @param aspectRatio [opt] integer - (values 0 = stretch
/// (default), 1 = scale up (crops),
/// 2 = scale down (black bar)
/// @param colorDiffuse hexString - (example, '0xC0FF0000' (red tint))
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the
/// keyword.\n
/// After you create the control, you need to add it to the window with
/// addControl().
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
/// self.image = xbmcgui.ControlImage(100, 250, 125, 75, aspectRatio=2)
/// ...
/// ~~~~~~~~~~~~~
///
class ControlImage : public Control
{
public:
ControlImage(long x, long y, long width, long height,
const char* filename, long aspectRatio = 0,
const char* colorDiffuse = NULL);
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_image
/// @brief \python_func{ setImage(filename[, useCache]) }
/// Changes the image.
///
/// @param filename string - image filename.
/// @param useCache [opt] bool - True=use cache (default) /
/// False=don't use cache.
///
///
///-----------------------------------------------------------------------
/// @python_v13 Added new option **useCache**.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setImage(filename[, useCache])
/// self.image.setImage('special://home/scripts/test.png')
/// self.image.setImage('special://home/scripts/test.png', False)
/// ...
/// ~~~~~~~~~~~~~
///
setImage(...);
#else
virtual void setImage(const char* imageFilename, const bool useCache = true);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_image
/// @brief \python_func{ setColorDiffuse(colorDiffuse) }
/// Changes the images color.
///
/// @param colorDiffuse hexString - (example, '0xC0FF0000'
/// (red tint))
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setColorDiffuse(colorDiffuse)
/// self.image.setColorDiffuse('0xC0FF0000')
/// ...
/// ~~~~~~~~~~~~~
///
setColorDiffuse(...);
#else
virtual void setColorDiffuse(const char* hexString);
#endif
#ifndef SWIG
ControlImage() = default;
std::string strFileName;
int aspectRatio = 0;
UTILS::COLOR::Color colorDiffuse;
CGUIControl* Create() override;
#endif
};
/// @}
// ControlImage class
///
/// \defgroup python_xbmcgui_control_progress Subclass - ControlProgress
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used to show the progress of a particular operation.**
///
/// \python_class{ ControlProgress(x, y, width, height, filename[, texturebg, textureleft, texturemid, textureright, textureoverlay]) }
///
/// The progress control is used to show the progress of an item that may
/// take a long time, or to show how far through a movie you are. You can
/// choose the position, size, and look of the progress control.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 filename string - image filename.
/// @param texturebg [opt] string - specifies the image file
/// whichshould be displayed in the
/// background of the progress control.
/// @param textureleft [opt] string - specifies the image file
/// whichshould be displayed for the left
/// side of the progress bar. This is
/// rendered on the left side of the bar.
/// @param texturemid [opt] string - specifies the image file
/// which should be displayed for the middl
/// portion of the progress bar. This is
/// the `fill` texture used to fill up the
/// bar. It's positioned on the right of
/// the `<lefttexture>` texture, and fills
/// the gap between the `<lefttexture>` and
/// `<righttexture>` textures, depending on
/// how far progressed the item is.
/// @param textureright [opt] string - specifies the image file
/// which should be displayed for the right
/// side of the progress bar. This is
/// rendered on the right side of the bar.
/// @param textureoverlay [opt] string - specifies the image file
/// which should be displayed over the top of
/// all other images in the progress bar. It
/// is centered vertically and horizontally
/// within the space taken up by the
/// background image.
///
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the
/// keyword.\n
/// After you create the control, you need to add it to the window
/// with addControl().
///
///
///-------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # ControlProgress(x, y, width, height, filename[, texturebg, textureleft, texturemid, textureright, textureoverlay])
/// self.image = xbmcgui.ControlProgress(100, 250, 250, 30, 'special://home/scripts/test.png')
/// ...
/// ~~~~~~~~~~~~~
///
class ControlProgress : public Control
{
public:
ControlProgress(long x, long y, long width, long height,
const char* texturebg = NULL,
const char* textureleft = NULL,
const char* texturemid = NULL,
const char* textureright = NULL,
const char* textureoverlay = NULL);
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_progress
/// @brief \python_func{ setPercent(percent) }
/// Sets the percentage of the progressbar to show.
///
/// @param percent float - percentage of the bar to show.
///
///
/// @note valid range for percent is 0-100
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setPercent(percent)
/// self.progress.setPercent(60)
/// ...
/// ~~~~~~~~~~~~~
///
setPercent(...);
#else
virtual void setPercent(float pct);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_progress
/// @brief \python_func{ getPercent() }
/// Returns a float of the percent of the progress.
///
/// @return Percent position
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # getPercent()
/// print(self.progress.getPercent())
/// ...
/// ~~~~~~~~~~~~~
///
getPercent();
#else
virtual float getPercent();
#endif
#ifndef SWIG
std::string strTextureLeft;
std::string strTextureMid;
std::string strTextureRight;
std::string strTextureBg;
std::string strTextureOverlay;
int aspectRatio = 0;
UTILS::COLOR::Color colorDiffuse;
CGUIControl* Create() override;
ControlProgress() = default;
#endif
};
/// @}
// ControlButton class
///
/// \defgroup python_xbmcgui_control_button Subclass - ControlButton
/// \ingroup python_xbmcgui_control
/// @{
/// @brief <b>A standard push button control.</b>
///
/// \python_class{ ControlButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY,
/// alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor]) }
///
/// The button control is used for creating push buttons in Kodi. You can
/// choose the position, size, and look of the button, as well as choosing
/// what action(s) should be performed when pushed.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 focusTexture [opt] string - filename for focus
/// texture.
/// @param noFocusTexture [opt] string - filename for no focus
/// texture.
/// @param textOffsetX [opt] integer - x offset of label.
/// @param textOffsetY [opt] integer - y offset of label.
/// @param alignment [opt] integer - alignment of label
/// - \ref kodi_gui_font_alignment "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 font [opt] string - font used for label text.
/// (e.g. 'font13')
/// @param textColor [opt] hexstring - color of enabled
/// button's label. (e.g. '0xFFFFFFFF')
/// @param disabledColor [opt] hexstring - color of disabled
/// button's label. (e.g. '0xFFFF3300')
/// @param angle [opt] integer - angle of control.
/// (+ rotates CCW, - rotates CW)
/// @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')
///
/// @note You can use the above as keywords for arguments and skip
/// certain optional arguments.\n
/// Once you use a keyword, all following arguments require
/// the keyword.\n
/// After you create the control, you need to add it to the
/// window with addControl().
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # ControlButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY,
/// # alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor])
/// self.button = xbmcgui.ControlButton(100, 250, 200, 50, 'Status', font='font14')
/// ...
/// ~~~~~~~~~~~~~
///
class ControlButton : public Control
{
public:
ControlButton(long x, long y, long width, long height, const String& label,
const char* focusTexture = NULL, const char* noFocusTexture = NULL,
long textOffsetX = CONTROL_TEXT_OFFSET_X,
long textOffsetY = CONTROL_TEXT_OFFSET_Y,
long alignment = (XBFONT_LEFT | XBFONT_CENTER_Y),
const char* font = NULL, const char* textColor = NULL,
const char* disabledColor = NULL, long angle = 0,
const char* shadowColor = NULL, const char* focusedColor = NULL);
// setLabel() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_button
/// @brief \python_func{ setLabel([label, font, textColor, disabledColor, shadowColor, focusedColor, label2]) }
/// Sets this buttons text attributes.
///
/// @param label [opt] string or unicode - text string.
/// @param font [opt] string - font used for label text. (e.g. 'font13')
/// @param textColor [opt] hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')
/// @param disabledColor [opt] hexstring - color of disabled button'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. '0xFFFFFF00')
/// @param label2 [opt] string or unicode - text string.
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the keyword.
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setLabel([label, font, textColor, disabledColor, shadowColor, focusedColor])
/// self.button.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')
/// ...
/// ~~~~~~~~~~~~~
///
setLabel(...);
#else
virtual void setLabel(const String& label = emptyString,
const char* font = NULL,
const char* textColor = NULL,
const char* disabledColor = NULL,
const char* shadowColor = NULL,
const char* focusedColor = NULL,
const String& label2 = emptyString);
#endif
// setDisabledColor() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_button
/// @brief \python_func{ setDisabledColor(disabledColor) }
/// Sets this buttons disabled color.
///
/// @param disabledColor hexstring - color of disabled button's label. (e.g. '0xFFFF3300')
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setDisabledColor(disabledColor)
/// self.button.setDisabledColor('0xFFFF3300')
/// ...
/// ~~~~~~~~~~~~~
///
setDisabledColor(...);
#else
virtual void setDisabledColor(const char* color);
#endif
// getLabel() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_button
/// @brief \python_func{ getLabel() }
/// Returns the buttons label as a unicode string.
///
/// @return Unicode string
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # getLabel()
/// label = self.button.getLabel()
/// ...
/// ~~~~~~~~~~~~~
///
getLabel();
#else
virtual String getLabel();
#endif
// getLabel2() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_button
/// @brief \python_func{ getLabel2() }
/// Returns the buttons label2 as a string.
///
/// @return string of label 2
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # getLabel2()
/// label = self.button.getLabel2()
/// ...
/// ~~~~~~~~~~~~~
///
getLabel2();
#else
virtual String getLabel2();
#endif
#ifndef SWIG
bool canAcceptMessages(int actionId) override { return true; }
int textOffsetX = 0;
int textOffsetY = 0;
UTILS::COLOR::Color align;
std::string strFont;
UTILS::COLOR::Color textColor;
UTILS::COLOR::Color disabledColor;
int iAngle = 0;
int shadowColor = 0;
int focusedColor = 0;
std::string strText;
std::string strText2;
std::string strTextureFocus;
std::string strTextureNoFocus;
CGUIControl* Create() override;
ControlButton() = default;
#endif
};
/// @}
// ControlGroup class
///
/// \defgroup python_xbmcgui_control_group Subclass - ControlGroup
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used to group controls together..**
///
/// \python_class{ ControlGroup(x, y, width, height) }
///
/// The group control is one of the most important controls. It allows you
/// to group controls together, applying attributes to all of them at once.
/// It also remembers the last navigated button in the group, so you can set
/// the <b>`<onup>`</b> of a control to a group of controls to have it always
/// go back to the one you were at before. It also allows you to position
/// controls more accurately relative to each other, as any controls within
/// a group take their coordinates from the group's top left corner (or from
/// elsewhere if you use the <b>"r"</b> attribute). You can have as many
/// groups as you like within the skin, and groups within groups are handled
/// with no issues.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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.
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.group = xbmcgui.ControlGroup(100, 250, 125, 75)
/// ...
/// ~~~~~~~~~~~~~
///
class ControlGroup : public Control
{
public:
ControlGroup(long x, long y, long width, long height);
#ifndef SWIG
CGUIControl* Create() override;
inline ControlGroup() = default;
#endif
};
/// @}
// ControlRadioButton class
///
/// \defgroup python_xbmcgui_control_radiobutton Subclass - ControlRadioButton
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **A radio button control (as used for on/off settings).**
///
/// \python_class{ ControlRadioButton(x, y, width, height, label[, focusOnTexture, noFocusOnTexture,
/// focusOffTexture, noFocusOffTexture, focusTexture, noFocusTexture,
/// textOffsetX, textOffsetY, alignment, font, textColor, disabledColor]) }
///
/// The radio button control is used for creating push button on/off
/// settings in Kodi. You can choose the position, size, and look of the
/// button, as well as the focused and unfocused radio textures. Used
/// for settings controls.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 focusOnTexture [opt] string - filename for radio ON
/// focused texture.
/// @param noFocusOnTexture [opt] string - filename for radio ON not
/// focused texture.
/// @param focusOfTexture [opt] string - filename for radio OFF
/// focused texture.
/// @param noFocusOffTexture [opt] string - filename for radio OFF
/// not focused texture.
/// @param focusTexture [opt] string - filename for focused button
/// texture.
/// @param noFocusTexture [opt] string - filename for not focused button
/// texture.
/// @param textOffsetX [opt] integer - horizontal text offset
/// @param textOffsetY [opt] integer - vertical text offset
/// @param alignment [opt] integer - alignment of label
/// - \ref kodi_gui_font_alignment "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 font [opt] string - font used for label text.
/// (e.g. 'font13')
/// @param textColor [opt] hexstring - color of label when control
/// is enabled.
/// radiobutton's label. (e.g. '0xFFFFFFFF')
/// @param disabledColor [opt] hexstring - color of label when control
/// is disabled. (e.g. '0xFFFF3300')
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the
/// keyword.\n
/// After you create the control, you need to add it to the window with
/// addControl().
///
///
///--------------------------------------------------------------------------
/// @python_v13 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.radiobutton = xbmcgui.ControlRadioButton(100, 250, 200, 50, 'Enable', font='font14')
/// ...
/// ~~~~~~~~~~~~~
///
class ControlRadioButton : public Control
{
public:
ControlRadioButton(long x, long y, long width, long height, const String& label,
const char* focusOnTexture = NULL, const char* noFocusOnTexture = NULL,
const char* focusOffTexture = NULL, const char* noFocusOffTexture = NULL,
const char* focusTexture = NULL, const char* noFocusTexture = NULL,
long textOffsetX = CONTROL_TEXT_OFFSET_X,
long textOffsetY = CONTROL_TEXT_OFFSET_Y,
long _alignment = (XBFONT_LEFT | XBFONT_CENTER_Y),
const char* font = NULL, const char* textColor = NULL,
const char* disabledColor = NULL, long angle = 0,
const char* shadowColor = NULL, const char* focusedColor = NULL,
const char* disabledOnTexture = NULL, const char* disabledOffTexture = NULL);
// setSelected() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_radiobutton
/// @brief \python_func{ setSelected(selected) }
/// **Sets the radio buttons's selected status.**
///
/// @param selected bool - True=selected (on) / False=not
/// selected (off)
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the keyword.
///
///
///--------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.radiobutton.setSelected(True)
/// ...
/// ~~~~~~~~~~~~~
///
setSelected(...);
#else
virtual void setSelected(bool selected);
#endif
// isSelected() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_radiobutton
/// @brief \python_func{ isSelected() }
/// Returns the radio buttons's selected status.
///
/// @return True if selected on
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// is = self.radiobutton.isSelected()
/// ...
/// ~~~~~~~~~~~~~
///
isSelected();
#else
virtual bool isSelected();
#endif
// setLabel() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_radiobutton
/// @brief \python_func{ setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor]) }
/// Sets the radio buttons text attributes.
///
/// @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 radio
/// button's label. (e.g. '0xFFFFFFFF')
/// @param disabledColor [opt] hexstring - color of disabled
/// radio button's label. (e.g. '0xFFFF3300')
/// @param shadowColor [opt] hexstring - color of radio
/// button's label's shadow.
/// (e.g. '0xFF000000')
/// @param focusedColor [opt] hexstring - color of focused radio
/// button's label. (e.g. '0xFFFFFF00')
///
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the
/// keyword.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// # setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor])
/// self.radiobutton.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')
/// ...
/// ~~~~~~~~~~~~~
///
setLabel(...);
#else
virtual void setLabel(const String& label = emptyString,
const char* font = NULL,
const char* textColor = NULL,
const char* disabledColor = NULL,
const char* shadowColor = NULL,
const char* focusedColor = NULL,
const String& label2 = emptyString);
#endif
// setRadioDimension() Method
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_radiobutton
/// @brief \python_func{ setRadioDimension(x, y, width, height) }
/// Sets the radio buttons's radio texture's position and size.
///
/// @param x integer - x coordinate of radio texture.
/// @param y integer - y coordinate of radio texture.
/// @param width integer - width of radio texture.
/// @param height integer - height of radio texture.
///
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the keyword.
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.radiobutton.setRadioDimension(x=100, y=5, width=20, height=20)
/// ...
/// ~~~~~~~~~~~~~
///
setRadioDimension(...);
#else
virtual void setRadioDimension(long x, long y, long width, long height);
#endif
#ifndef SWIG
bool canAcceptMessages(int actionId) override { return true; }
std::string strFont;
std::string strText;
std::string strTextureFocus;
std::string strTextureNoFocus;
std::string strTextureRadioOnFocus;
std::string strTextureRadioOnNoFocus;
std::string strTextureRadioOffFocus;
std::string strTextureRadioOffNoFocus;
std::string strTextureRadioOnDisabled;
std::string strTextureRadioOffDisabled;
UTILS::COLOR::Color textColor;
UTILS::COLOR::Color disabledColor;
int textOffsetX = 0;
int textOffsetY = 0;
uint32_t align;
int iAngle = 0;
UTILS::COLOR::Color shadowColor;
UTILS::COLOR::Color focusedColor;
CGUIControl* Create() override;
ControlRadioButton() = default;
#endif
};
/// @}
/// \defgroup python_xbmcgui_control_slider Subclass - ControlSlider
/// \ingroup python_xbmcgui_control
/// @{
/// @brief **Used for a volume slider.**
///
/// \python_class{ ControlSlider(x, y, width, height[, textureback, texture, texturefocus, orientation]) }
///
/// The slider control is used for things where a sliding bar best represents
/// the operation at hand (such as a volume control or seek control). You can
/// choose the position, size, and look of the slider control.
///
/// @note This class include also all calls from \ref python_xbmcgui_control "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 textureback [opt] string - image filename
/// @param texture [opt] string - image filename
/// @param texturefocus [opt] string - image filename
/// @param orientation [opt] integer - orientation of slider (xbmcgui.HORIZONTAL / xbmcgui.VERTICAL (default))
///
///
/// @note You can use the above as keywords for arguments and skip certain
/// optional arguments.\n
/// Once you use a keyword, all following arguments require the
/// keyword.\n
/// After you create the control, you need to add it to the window
/// with addControl().
///
///
///--------------------------------------------------------------------------
/// @python_v17 **orientation** option added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.slider = xbmcgui.ControlSlider(100, 250, 350, 40)
/// ...
/// ~~~~~~~~~~~~~
class ControlSlider : public Control
{
public:
ControlSlider(long x, long y, long width, long height,
const char* textureback = NULL,
const char* texture = NULL,
const char* texturefocus = NULL, int orientation = 1);
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_slider
/// @brief \python_func{ getPercent() }
/// Returns a float of the percent of the slider.
///
/// @return float - Percent of slider
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// print(self.slider.getPercent())
/// ...
/// ~~~~~~~~~~~~~
///
getPercent();
#else
virtual float getPercent();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_slider
/// @brief \python_func{ setPercent(pct) }
/// Sets the percent of the slider.
///
/// @param pct float - Percent value of slider
///
///
///-----------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.slider.setPercent(50)
/// ...
/// ~~~~~~~~~~~~~
///
setPercent(...);
#else
virtual void setPercent(float pct);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_slider
/// @brief \python_func{ getInt() }
/// Returns the value of the slider.
///
/// @return int - value of slider
///
///
///-----------------------------------------------------------------------
/// @python_v18 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// print(self.slider.getInt())
/// ...
/// ~~~~~~~~~~~~~
///
getInt();
#else
virtual int getInt();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_slider
/// @brief \python_func{ setInt(value, min, delta, max) }
/// Sets the range, value and step size of the slider.
///
/// @param value int - value of slider
/// @param min int - min of slider
/// @param delta int - step size of slider
/// @param max int - max of slider
///
///
///-----------------------------------------------------------------------
/// @python_v18 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.slider.setInt(450, 200, 10, 900)
/// ...
/// ~~~~~~~~~~~~~
///
setInt(...);
#else
virtual void setInt(int value, int min, int delta, int max);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_slider
/// @brief \python_func{ getFloat() }
/// Returns the value of the slider.
///
/// @return float - value of slider
///
///
///-----------------------------------------------------------------------
/// @python_v18 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// print(self.slider.getFloat())
/// ...
/// ~~~~~~~~~~~~~
///
getFloat();
#else
virtual float getFloat();
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
///
/// \ingroup python_xbmcgui_control_slider
/// @brief \python_func{ setFloat(value, min, delta, max) }
/// Sets the range, value and step size of the slider.
///
/// @param value float - value of slider
/// @param min float - min of slider
/// @param delta float - step size of slider
/// @param max float - max of slider
///
///
///-----------------------------------------------------------------------
/// @python_v18 New function added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// self.slider.setFloat(15.0, 10.0, 1.0, 20.0)
/// ...
/// ~~~~~~~~~~~~~
///
setFloat(...);
#else
virtual void setFloat(float value, float min, float delta, float max);
#endif
#ifndef SWIG
std::string strTextureBack;
std::string strTexture;
std::string strTextureFoc;
int iOrientation;
CGUIControl* Create() override;
inline ControlSlider() = default;
#endif
};
/// @}
}
}
|