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
|
/*
Copyright (C) 2009-2010 ProFUSION embedded systems
Copyright (C) 2009-2012 Samsung Electronics
Copyright (C) 2012 Intel Corporation
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/**
* @file ewk_view.h
* @brief WebKit main smart object.
*
* This object allows the high level access to WebKit-EFL component.
* It is responsible for managing the main frame and other
* critical resources.
*
* Every ewk_view has at least one frame, called "main frame" and
* retrieved with ewk_view_frame_main_get(). Direct frame access is
* often discouraged, it is recommended to use ewk_view functions
* instead.
*
* The following signals (see evas_object_smart_callback_add()) are emitted:
*
* - "colorchooser,create", Ewk_Color: a new color chooser should be created.
* - "colorchooser,willdelete", void: reports that a previously created color
* chooser will be deleted.
* - "colorchooser,color,changed", Ewk_Color: the value at the color input widget
* corresponding to the color chooser has changed.
* - "download,request", Ewk_Download: reports a download is being requested
* - "editorclient,contents,changed", void: reports to the view that editor
* client's contents were changed
* - "frame,created", Evas_Object*: a new frame is created.
* - "icon,received", void: main frame received an icon.
* - "inputmethod,changed", Eina_Bool: reports that input method was changed and
* it gives a boolean value whether it's enabled or not as an argument.
* - "inspector,view,close", Evas_Object*: request to close the view for inspector.
* - "inspector,view,create", void: request to create the new view for inspector.
* - "js,windowobject,clear", void: Report that the JS window object has been cleared.
* - "link,hover,in", const char *link[2]: reports mouse is over a link.
* It gives the url in link[0] and link's title in link[1] as an argument.
* - "link,hover,out", void: reports mouse moved out from a link.
* - "load,document,finished", Evas_Object*: a DOM document object in a frame has finished loading.
* - "load,error", const Ewk_Frame_Load_Error*: reports load failed
* - "load,finished", const Ewk_Frame_Load_Error*: reports load
* finished and it gives @c NULL on success or pointer to
* structure defining the error.
* - "load,newwindow,show", void: reports that a new window was created and can be shown.
* and it gives a pointer to structure defining the error as an argument.
* - "load,progress", double*: load progress is changed (overall value
* from 0.0 to 1.0, connect to individual frames for fine grained).
* - "load,provisional", void: view started provisional load.
* - "load,provisional,failed", Ewk_Frame_Load_Error*: view provisional load failed.
* - "load,resource,finished", unsigned long*: reports resource load finished and it gives
* a pointer to its identifier.
* - "load,resource,failed", Ewk_Frame_Load_Error*: reports resource load failure and it
* gives a pointer to structure defining the error as an argument.
* - "load,started", Evas_Object*: frame started loading the document.
* - "menubar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if menubar is
* visible; @c EINA_FALSE, otherwise.
* - "menubar,visible,set", Eina_Bool: sets menubar visibility.
* - "mixedcontent,displayed", void: any of the containing frames has loaded and displayed mixed content.
* - "mixedcontent,run", void: any of the containing frames has loaded and run mixed content.
* - "navigate,with,data", Ewk_View_Navigation_Data*: reports that view did navigation and gives the navigation details.
* - "perform,client,redirect", Ewk_View_Redirection_Data*: reports that view performed a client redirect and gives the redirection details.
* - "perform,server,redirect", Ewk_View_Redirection_Data*: reports that view performed a server redirect and gives the redirection details.
* - "protocolhandler,registration,requested", Ewk_Custom_Handler_Data: add a handler url for the given protocol.
* - "protocolhandler,isregistered", Ewk_Custom_Handler_Data: query whether the handler is registered or not.
* - "protocolhandler,unregistration,requested", Ewk_Custom_Handler_Data: remove a handler url for the given protocol.
* - "onload,event", Evas_Object*: a frame onload event has been received.
* - "populate,visited,links": tells the client to fill the visited links set.
* - "ready", void: page is fully loaded.
* - "resource,request,new", Ewk_Frame_Resource_Request*: reports that
* there's a new resource request.
* - "resource,request,willsend", Ewk_Frame_Resource_Messages*: a resource will be requested.
* and the possible redirect response.
* - "resource,response,received", Ewk_Frame_Resource_Response*: the network response for a resource.
* - "scrollbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if scrollbars
* are visible; @c EINA_FALSE, otherwise.
* - "scrollbars,visible,set", Eina_Bool: sets scrollbars visibility.
* - "statusbar,text,set", const char *: sets statusbar text.
* - "statusbar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if statusbar is
* visible; @c EINA_FALSE, otherwise.
* - "statusbar,visible,set", Eina_Bool: sets statusbar visibility.
* - "title,changed", Ewk_Text_With_Direction*: title of the main frame was changed.
* - "toolbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if toolbar
* is visible; @c EINA_FALSE, otherwise.
* - "toolbars,visible,set", Eina_Bool: sets toolbar visibility.
* - "popup,create", Ewk_Menu: reports that a new menu was created.
* - "popup,willdeleted", Ewk_Menu: reports that a previously created menu
* will be deleted.
* - "restore", Evas_Object *: reports that view should be restored to default conditions
* and it gives a frame that originated restore as an argument.
* - "tooltip,text,set", const char*: tooltip was set.
* - "tooltip,text,unset", void: tooltip was unset.
* - "uri,changed", const char*: uri of the main frame was changed.
* - "view,resized", void: view object's size was changed.
* - "viewport,changed", void: reports that viewport was changed.
* - "zoom,animated,end", void: requested animated zoom is finished.
*/
#ifndef ewk_view_h
#define ewk_view_h
#include "ewk_contextmenu.h"
#include "ewk_file_chooser.h"
#include "ewk_frame.h"
#include "ewk_history.h"
#include "ewk_js.h"
#include "ewk_window_features.h"
#include <Evas.h>
#include <cairo.h>
#include <libsoup/soup.h>
#ifdef __cplusplus
extern "C" {
#endif
/// Creates a type name for @a _Ewk_View_Smart_Data.
typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data;
/// Creates a type name for a Resource Handler Callback
typedef void* (*Ewk_View_Resource_Handler_Cb)(const char *, size_t *, char **, void *);
/// Creates a type name for @a _Ewk_View_Smart_Class.
typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class;
// Defines the direction of focus change. Keep in sync with
// WebCore::FocusDirection.
enum _Ewk_Focus_Direction {
EWK_FOCUS_DIRECTION_FORWARD = 1,
EWK_FOCUS_DIRECTION_BACKWARD,
};
typedef enum _Ewk_Focus_Direction Ewk_Focus_Direction;
/// Ewk view's class, to be overridden by sub-classes.
struct _Ewk_View_Smart_Class {
Evas_Smart_Class sc; /**< All but 'data' is free to be changed. */
unsigned long version;
Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
void (*window_close)(Ewk_View_Smart_Data *sd); /**< closes a window */
// hooks to allow different backing stores
Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */
Eina_Bool (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
Eina_Bool (*repaints_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
Eina_Bool (*contents_resize)(Ewk_View_Smart_Data *sd, int w, int h);
Eina_Bool (*zoom_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
Eina_Bool (*zoom_weak_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
void (*zoom_weak_smooth_scale_set)(Ewk_View_Smart_Data *sd, Eina_Bool smooth_scale);
void (*bg_color_set)(Ewk_View_Smart_Data *sd, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha);
void (*flush)(Ewk_View_Smart_Data *sd);
Eina_Bool (*pre_render_region)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
Eina_Bool (*pre_render_relative_radius)(Ewk_View_Smart_Data *sd, unsigned int n, float zoom);
Eina_Bool (*pre_render_start)(Ewk_View_Smart_Data *sd);
void (*pre_render_cancel)(Ewk_View_Smart_Data *sd);
Eina_Bool (*disable_render)(Ewk_View_Smart_Data *sd);
Eina_Bool (*enable_render)(Ewk_View_Smart_Data *sd);
// event handling:
// - returns true if handled
// - if overridden, have to call parent method if desired
Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
Eina_Bool (*fullscreen_enter)(Ewk_View_Smart_Data *sd);
Eina_Bool (*fullscreen_exit)(Ewk_View_Smart_Data *sd);
Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
void (*add_console_message)(Ewk_View_Smart_Data *sd, const char *message, unsigned int lineNumber, const char *sourceID);
void (*run_javascript_alert)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
Eina_Bool (*run_before_unload_confirm)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
Eina_Bool (*run_javascript_prompt)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message, const char *defaultValue, const char **value);
Eina_Bool (*should_interrupt_javascript)(Ewk_View_Smart_Data *sd);
int64_t (*exceeded_application_cache_quota)(Ewk_View_Smart_Data *sd, Ewk_Security_Origin* origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded);
uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Ewk_File_Chooser *file_chooser, Eina_List **selected_filenames);
Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request, Ewk_Navigation_Type navigation_type);
Eina_Bool (*focus_can_cycle)(Ewk_View_Smart_Data *sd, Ewk_Focus_Direction direction);
};
/**
* The version you have to put into the version field
* in the @a Ewk_View_Smart_Class structure.
*/
#define EWK_VIEW_SMART_CLASS_VERSION 7UL
/**
* Initializes a whole @a Ewk_View_Smart_Class structure.
*
* @param smart_class_init initializer to use for the "base" field
* @a Evas_Smart_Class
*
* @see EWK_VIEW_SMART_CLASS_INIT_NULL
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
*/
#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/**
* Initializes to zero a whole @a Ewk_View_Smart_Class structure.
*
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT
*/
#define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
/**
* Initializes to zero a whole @a Ewk_View_Smart_Class structure
* and sets the version.
*
* Similar to @a EWK_VIEW_SMART_CLASS_INIT_NULL, but it sets the version field of
* @a Evas_Smart_Class (base field) to latest @a EVAS_SMART_CLASS_VERSION.
*
* @see EWK_VIEW_SMART_CLASS_INIT_NULL
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT
*/
#define EWK_VIEW_SMART_CLASS_INIT_VERSION EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_VERSION)
/**
* Initializes to zero a whole @a Ewk_View_Smart_Class structure
* and sets the name and version.
*
* Similar to @a EWK_VIEW_SMART_CLASS_INIT_NULL, but it sets the version field of
* @a Evas_Smart_Class (base field) to latest @a EVAS_SMART_CLASS_VERSION
* and the name to the specific value.
*
* It will keep a reference to the name field as a "const char *", that is,
* name must be available while the structure is used (hint: static or global!)
* and it will not be modified.
*
* @see EWK_VIEW_SMART_CLASS_INIT_NULL
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT
*/
#define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
/// Defines the input method hints.
enum _Ewk_Imh {
EWK_IMH_TELEPHONE = (1 << 0),
EWK_IMH_NUMBER = (1 << 1),
EWK_IMH_EMAIL = (1 << 2),
EWK_IMH_URL = (1 << 3),
EWK_IMH_PASSWORD = (1 << 4)
};
/// Creates a type name for @a _Ewk_Imh.
typedef enum _Ewk_Imh Ewk_Imh;
/// Creates a type name for @a _Ewk_View_Private_Data.
typedef struct _Ewk_View_Private_Data Ewk_View_Private_Data;
/// Defines the types of the items for the context menu.
enum _Ewk_Menu_Item_Type {
EWK_MENU_SEPARATOR,
EWK_MENU_GROUP,
EWK_MENU_OPTION
};
/// Creates a type name for @a _Ewk_Menu_Item_Type.
typedef enum _Ewk_Menu_Item_Type Ewk_Menu_Item_Type;
/// Creates a type name for @a _Ewk_Menu_Item.
typedef struct _Ewk_Menu_Item Ewk_Menu_Item;
/// Contains data of each menu item.
struct _Ewk_Menu_Item {
const char *text; /**< Text of the item. */
Ewk_Menu_Item_Type type; /** Type of the item. */
};
/// Creates a type name for @a _Ewk_Menu.
typedef struct _Ewk_Menu Ewk_Menu;
/// Contains Popup menu data.
struct _Ewk_Menu {
Eina_List *items; /**< List of items. */
int x; /**< The horizontal position of Popup menu. */
int y; /**< The vertical position of Popup menu. */
int width; /**< Popup menu width. */
int height; /**< Popup menu height. */
};
/// Creates a type name for @a _Ewk_Download.
typedef struct _Ewk_Download Ewk_Download;
/// Contains Download data.
struct _Ewk_Download {
const char *url; /**< URL of resource. */
const char *suggested_name; /**< suggested name from download attributes */
/* to be extended */
};
/// Creates a type name for @a _Ewk_View_Navigation_Data.
typedef struct _Ewk_View_Navigation_Data Ewk_View_Navigation_Data;
/**
* @brief Structure containing details about a view navigation.
*
* Details of a view navigation. It is used in "navigate,with,data" signal.
*/
struct _Ewk_View_Navigation_Data {
const char *url; /**< URL for the history. */
const char *title; /**< Title of the navigated page. */
Ewk_Frame_Resource_Request *request; /**< Navigation request. */
Ewk_Frame_Resource_Response *response; /**< Navigation response. */
Eina_Bool has_substitute_data; /**< Data substitution flag. */
const char *client_redirect_source; /**< Client redirect source URL. */
};
/// Creates a type name for @a _Ewk_View_Redirection_Data.
typedef struct _Ewk_View_Redirection_Data Ewk_View_Redirection_Data;
/**
* @brief Structure containing details about a view redirection.
*
* Details of a client or server redirection. It is used in "perform,client,redirect" and "perform,server,redirect" signals.
*/
struct _Ewk_View_Redirection_Data {
const char *source_url; /**< Redirect source URL. */
const char *destination_url; /**< Redirect destination URL. */
};
/// Creates a type name for @a _Ewk_Color.
typedef struct _Ewk_Color Ewk_Color;
/// Represents a color using the RGBA format.
struct _Ewk_Color {
unsigned char r; /**< Red channel. */
unsigned char g; /**< Green channel. */
unsigned char b; /**< Blue channel. */
unsigned char a; /**< Alpha channel. */
};
/// Defines the handler states.
enum _Ewk_Custom_Handlers_State {
EWK_CUSTOM_HANDLERS_NEW,
EWK_CUSTOM_HANDLERS_REGISTERED,
EWK_CUSTOM_HANDLERS_DECLINED
};
/// Creates a type name for @a _Ewk_Custom_Handlers_State.
typedef enum _Ewk_Custom_Handlers_State Ewk_Custom_Handlers_State;
/// Creates a type name for @a _Ewk_Custom_Handler_Data.
typedef struct _Ewk_Custom_Handler_Data Ewk_Custom_Handler_Data;
/// Contains the target scheme and the url which take care of the target.
struct _Ewk_Custom_Handler_Data {
Evas_Object *ewkView; /**< Reference to the view object. */
const char *scheme; /**< Reference to the scheme that will be handled. (eg. "application/x-soup") */
const char *base_url; /**< Reference to the resolved url if the url is relative url. (eg. "https://www.example.com/") */
const char *url; /**< Reference to the url which will handle the given protocol. (eg. "soup?url=%s") */
const char *title; /**< Reference to the descriptive title of the handler. (eg. "SoupWeb") */
Ewk_Custom_Handlers_State result; /**< Result of the query that the protocol handler is registered or not. */
};
/**
* @brief Contains an internal View data.
*
* It is to be considered private by users, but may be extended or
* changed by sub-classes (that's why it's in the public header file).
*/
struct _Ewk_View_Smart_Data {
Evas_Object_Smart_Clipped_Data base;
const Ewk_View_Smart_Class *api; /**< Reference to casted class instance. */
Evas_Object *self; /**< Reference to owner object. */
Evas_Object *main_frame; /**< Reference to main frame object. */
Evas_Object *backing_store; /**< Reference to backing store. */
Evas_Object *events_rect; /**< The rectangle that receives mouse events. */
Ewk_View_Private_Data *_priv; /**< Should @b never be accessed, c++ stuff. */
struct {
Evas_Coord x, y, w, h;
} view; /**< Contains the position and size of last used viewport. */
struct {
struct {
float start;
float end;
float current; /**< if > 0.0, then doing animated zoom. */
} zoom;
} animated_zoom;
struct {
unsigned char r, g, b, a;
} bg_color; /**< Keeps the background color. */
Eina_Bool zoom_weak_smooth_scale:1;
struct {
Eina_Bool any:1;
Eina_Bool size:1;
Eina_Bool position:1;
Eina_Bool frame_rect:1;
} changed; /**< Keeps what changed since last smart_calculate. */
struct {
Evas_Coord x, y;
float zoom;
} previousView;
};
/// Defines the modes of view.
enum _Ewk_View_Mode {
EWK_VIEW_MODE_INVALID,
EWK_VIEW_MODE_WINDOWED,
EWK_VIEW_MODE_FLOATING,
EWK_VIEW_MODE_FULLSCREEN,
EWK_VIEW_MODE_MAXIMIZED,
EWK_VIEW_MODE_MINIMIZED
};
/// Creates a type name for @a _Ewk_View_Mode.
typedef enum _Ewk_View_Mode Ewk_View_Mode;
/// Defines the font families.
enum _Ewk_Font_Family {
EWK_FONT_FAMILY_STANDARD = 0,
EWK_FONT_FAMILY_CURSIVE,
EWK_FONT_FAMILY_FANTASY,
EWK_FONT_FAMILY_MONOSPACE,
EWK_FONT_FAMILY_SERIF,
EWK_FONT_FAMILY_SANS_SERIF
};
/// Creates a type name for @a _Ewk_Font_Family.
typedef enum _Ewk_Font_Family Ewk_Font_Family;
/// Contains commands to execute.
enum _Ewk_Editor_Command {
EWK_EDITOR_COMMAND_NONE = -1,
EWK_EDITOR_COMMAND_UNDO = 0,
EWK_EDITOR_COMMAND_REDO,
EWK_EDITOR_COMMAND_TOGGLE_BOLD,
EWK_EDITOR_COMMAND_TOGGLE_ITALIC,
EWK_EDITOR_COMMAND_TOGGLE_UNDERLINE,
EWK_EDITOR_COMMAND_TOGGLE_STRIKETHROUGH,
EWK_EDITOR_COMMAND_TOGGLE_SUBSCRIPT,
EWK_EDITOR_COMMAND_TOGGLE_SUPERSCRIPT,
EWK_EDITOR_COMMAND_INDENT,
EWK_EDITOR_COMMAND_OUTDENT,
EWK_EDITOR_COMMAND_INSERT_ORDEREDLIST,
EWK_EDITOR_COMMAND_INSERT_UNORDEREDLIST,
EWK_EDITOR_COMMAND_INSERT_IMAGE,
EWK_EDITOR_COMMAND_INSERT_TEXT,
EWK_EDITOR_COMMAND_INSERT_HTML,
EWK_EDITOR_COMMAND_INSERT_PARAGRAPH,
EWK_EDITOR_COMMAND_INSERT_PARAGRAPH_SEPARATOR,
EWK_EDITOR_COMMAND_INSERT_LINE_SEPARATOR,
EWK_EDITOR_COMMAND_BACK_COLOR,
EWK_EDITOR_COMMAND_FORE_COLOR,
EWK_EDITOR_COMMAND_HILITE_COLOR,
EWK_EDITOR_COMMAND_FONT_SIZE,
EWK_EDITOR_COMMAND_ALIGN_CENTER,
EWK_EDITOR_COMMAND_ALIGN_JUSTIFIED,
EWK_EDITOR_COMMAND_ALIGN_LEFT,
EWK_EDITOR_COMMAND_ALIGN_RIGHT,
EWK_EDITOR_COMMAND_MOVE_TO_NEXT_CHAR,
EWK_EDITOR_COMMAND_MOVE_TO_PREVIOUS_CHAR,
EWK_EDITOR_COMMAND_MOVE_TO_NEXT_WORD,
EWK_EDITOR_COMMAND_MOVE_TO_PREVIOUS_WORD,
EWK_EDITOR_COMMAND_MOVE_TO_NEXT_LINE,
EWK_EDITOR_COMMAND_MOVE_TO_PREVIOUS_LINE,
EWK_EDITOR_COMMAND_MOVE_TO_BEGINNING_OF_LINE,
EWK_EDITOR_COMMAND_MOVE_TO_END_OF_LINE,
EWK_EDITOR_COMMAND_MOVE_TO_BEGINNING_OF_PARAGRAPH,
EWK_EDITOR_COMMAND_MOVE_TO_END_OF_PARAGRAPH,
EWK_EDITOR_COMMAND_MOVE_TO_BEGINNING_OF_DOCUMENT,
EWK_EDITOR_COMMAND_MOVE_TO_END_OF_DOCUMENT,
EWK_EDITOR_COMMAND_SELECT_NONE,
EWK_EDITOR_COMMAND_SELECT_ALL,
EWK_EDITOR_COMMAND_SELECT_PARAGRAPH,
EWK_EDITOR_COMMAND_SELECT_SENTENCE,
EWK_EDITOR_COMMAND_SELECT_LINE,
EWK_EDITOR_COMMAND_SELECT_WORD,
EWK_EDITOR_COMMAND_SELECT_NEXT_CHAR,
EWK_EDITOR_COMMAND_SELECT_PREVIOUS_CHAR,
EWK_EDITOR_COMMAND_SELECT_NEXT_WORD,
EWK_EDITOR_COMMAND_SELECT_PREVIOUS_WORD,
EWK_EDITOR_COMMAND_SELECT_NEXT_LINE,
EWK_EDITOR_COMMAND_SELECT_PREVIOUS_LINE,
EWK_EDITOR_COMMAND_SELECT_START_OF_LINE,
EWK_EDITOR_COMMAND_SELECT_END_OF_LINE,
EWK_EDITOR_COMMAND_SELECT_START_OF_PARAGRAPH,
EWK_EDITOR_COMMAND_SELECT_END_OF_PARAGRAPH,
EWK_EDITOR_COMMAND_SELECT_START_OF_DOCUMENT,
EWK_EDITOR_COMMAND_SELECT_END_OF_DOCUMENT,
EWK_EDITOR_COMMAND_DELETE_WORD_BACKWARD,
EWK_EDITOR_COMMAND_DELETE_WORD_FORWARD
};
/// Creates a type name for @a _Ewk_Editor_Command.
typedef enum _Ewk_Editor_Command Ewk_Editor_Command;
/**
* @brief Creates a type name for @a _Ewk_Tile_Unused_Cache.
*
* Cache (pool) that contains unused tiles for ewk_view_tiled.
*
* This cache will maintain unused tiles and flush them when the total
* memory exceeds the set amount when
* ewk_tile_unused_cache_auto_flush() or explicitly set value when
* ewk_tile_unused_cache_flush() is called.
*
* The tile may be shared among different ewk_view_tiled instances to
* group maximum unused memory resident in the system.
*/
typedef struct _Ewk_Tile_Unused_Cache Ewk_Tile_Unused_Cache;
/**
* Changes cache capacity of unused tiles.
*
* @param tuc cache of unused tiles to set a new capacity of unused tiles
*
* @param max a new capacity of cache, in bytes
*
* @note This will not flush cache, use ewk_tile_unused_cache_flush() or
* ewk_tile_unused_cache_auto_flush() to do so.
*/
EAPI void ewk_tile_unused_cache_max_set(Ewk_Tile_Unused_Cache *tuc, size_t max);
/**
* Retrieves maximum cache capacity of unused tiles.
*
* @param tuc cache of unused tiles to get maximum cache capacity of unused tiles
*
* @return maximum cache capacity, in bytes on success or @c 0 on failure
*/
EAPI size_t ewk_tile_unused_cache_max_get(const Ewk_Tile_Unused_Cache *tuc);
/**
* Retrieves the used cache capacity of unused tiles.
*
* @param tuc cache of unused tiles to get used cache capacity of unused tiles
*
* @return used cache capacity, in bytes on success or @c 0 on failure
*/
EAPI size_t ewk_tile_unused_cache_used_get(const Ewk_Tile_Unused_Cache *tuc);
/**
* Flushes given amount of bytes from cache of unused tiles.
*
* After calling this function, near @a bytes are freed from cache. It
* may be less if cache did not contain that amount of bytes (ie: an
* empty cache has nothing to free!) or more if the cache just
* contained objects that were larger than the requested amount (this
* is usually the case).
*
* @param tuc cache of unused tiles to flush @bytes from cache
* @param bytes amount bytes to free
*
* @return amount really freed bytes
*
* @see ewk_tile_unused_cache_used_get()
*/
EAPI size_t ewk_tile_unused_cache_flush(Ewk_Tile_Unused_Cache *tuc, size_t bytes);
/**
* Flushes enough bytes to make cache of unused tiles usage lower than maximum.
*
* Just like ewk_tile_unused_cache_flush(), but this will make the cache
* free enough tiles to respect maximum cache size as defined with
* ewk_tile_unused_cache_max_set().
*
* This function is usually called when system becomes idle. This way
* we keep memory low but do not impact performance when
* creating/deleting tiles.
*
* @param tuc cache of unused tiles to flush cache of unused tiles
*/
EAPI void ewk_tile_unused_cache_auto_flush(Ewk_Tile_Unused_Cache *tuc);
/**
* Sets the smart class api without any backing store, enabling view
* to be inherited.
*
* @param api class definition to set, all members with the
* exception of @a Evas_Smart_Class->data may be overridden, must
* @b not be @c NULL
*
* @note @a Evas_Smart_Class->data is used to implement type checking and
* is not supposed to be changed/overridden. If you need extra
* data for your smart class to work, just extend
* Ewk_View_Smart_Class instead.
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
* version mismatch)
*
* @see ewk_view_single_smart_set()
* @see ewk_view_tiled_smart_set()
*/
EAPI Eina_Bool ewk_view_base_smart_set(Ewk_View_Smart_Class *api);
/**
* Sets the smart class api using single backing store, enabling view
* to be inherited.
*
* @param api class definition to set, all members with the
* exception of @a Evas_Smart_Class->data may be overridden, must
* @b not be @c NULL
*
* @note @a Evas_Smart_Class->data is used to implement type checking and
* is not supposed to be changed/overridden. If you need extra
* data for your smart class to work, just extend
* @a Ewk_View_Smart_Class instead.
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
* version mismatch)
*
* @see ewk_view_base_smart_set()
*/
EAPI Eina_Bool ewk_view_single_smart_set(Ewk_View_Smart_Class *api);
/**
* Sets the smart class api using tiled backing store, enabling view
* to be inherited.
*
* @param api class definition to set, all members with the
* exception of @a Evas_Smart_Class->data may be overridden, must
* @b not be @c NULL
*
* @note @a Evas_Smart_Class->data is used to implement type checking and
* is not supposed to be changed/overridden. If you need extra
* data for your smart class to work, just extend
* Ewk_View_Smart_Class instead.
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure (probably
* version mismatch)
*
* @see ewk_view_base_smart_set()
*/
EAPI Eina_Bool ewk_view_tiled_smart_set(Ewk_View_Smart_Class *api);
/**
* Creates a new EFL WebKit View object.
*
* View objects are the recommended way to deal with EFL WebKit as it
* abstracts the complex pieces of the process.
*
* Each view is composed by a set of frames. The set has at least one
* frame, called 'main_frame'. See ewk_view_frame_main_get() and
* ewk_view_frame_focused_get().
*
* @param e canvas object where to create the view object
*
* @return view object on success or @c NULL on failure
*
* @see ewk_view_uri_set()
*/
EAPI Evas_Object *ewk_view_single_add(Evas *e);
/**
* Creates a new EFL WebKit View object using tiled backing store.
*
* View objects are the recommended way to deal with EFL WebKit as it
* abstracts the complex pieces of the process.
*
* This object is almost the same as the one returned by the ewk_view_single_add()
* function, but it uses the tiled backing store instead of the default
* backing store.
*
* @param e canvas object where to create the view object
*
* @return the view object on success or @c NULL on failure
*
* @see ewk_view_uri_set()
*/
EAPI Evas_Object *ewk_view_tiled_add(Evas *e);
/**
* Gets the cache object of unused tiles used by this view.
*
* @param o the view object to get the cache object
*
* @return the cache object of unused tiles or @c NULL on failure
*/
EAPI Ewk_Tile_Unused_Cache *ewk_view_tiled_unused_cache_get(const Evas_Object *o);
/**
* Sets the cache object of unused tiles used by this view.
*
* It can be used to share a single cache amongst different views.
* The tiles from one view will not be used by the other!
* This is just to limit the group with amount of unused memory.
*
* @note If @c NULL is provided as a @a cache, then a new one is created.
*
* @param o the view object to set the cache object
* @param the cache object of unused tiles
*/
EAPI void ewk_view_tiled_unused_cache_set(Evas_Object *o, Ewk_Tile_Unused_Cache *cache);
/**
* Sets a fixed layout size to be used, dissociating it from viewport size.
*
* Setting a width different than zero enables fixed layout on that
* size. It's automatically scaled based on zoom, but will not change
* if viewport changes.
*
* Setting both @a w and @a h to zero will disable fixed layout.
*
* @param o view object to change fixed layout
* @param w fixed width to use, this size will be automatically scaled
* based on zoom level
* @param h fixed height to use, this size will be automatically scaled
* based on zoom level
*/
EAPI void ewk_view_fixed_layout_size_set(Evas_Object *o, Evas_Coord w, Evas_Coord h);
/**
* Gets fixed layout size.
*
* @param o view object to get fixed layout size
* @param w the pointer to store fixed width, returns @c NULL on failure or if there is no
* fixed layout in use
* @param h the pointer to store fixed height, returns @c NULL on failure or if there is no
* fixed layout in use
*/
EAPI void ewk_view_fixed_layout_size_get(const Evas_Object *o, Evas_Coord *w, Evas_Coord *h);
/**
* Sets the theme path that will be used by this view.
*
* This also sets the theme on the main frame. As frames inherit theme
* from their parent, this will have all frames with unset theme to
* use this one.
*
* @param o view object to change theme
* @param path theme path
*/
EAPI void ewk_view_theme_set(Evas_Object *o, const char *path);
/**
* Gets the theme set on this view.
*
* This returns the value set by ewk_view_theme_set().
*
* @param o view object to get theme path
*
* @return the theme path, may be @c NULL if not set
*/
EAPI const char *ewk_view_theme_get(const Evas_Object *o);
/**
* Gets the object that represents the main frame.
*
* @param o view object to get main frame
*
* @return frame smart object or @c NULL if none yet
*/
EAPI Evas_Object *ewk_view_frame_main_get(const Evas_Object *o);
/**
* Gets the currently focused frame object.
*
* @param o view object to get focused frame
*
* @return frame smart object or @c NULL if none yet
*/
EAPI Evas_Object *ewk_view_frame_focused_get(const Evas_Object *o);
/**
* Asks the main frame to load the given URI.
*
* @param o view object to load @a uri
* @param uri uniform resource identifier to load
*
* @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_uri_set(Evas_Object *o, const char *uri);
/**
* Gets the current uri loaded by main frame.
*
* It returns a internal string and should not
* be modified. The string is guaranteed to be stringshared.
*
* @param o view object to get current uri.
*
* @return current uri on success or @c NULL on failure
*/
EAPI const char *ewk_view_uri_get(const Evas_Object *o);
/**
* Gets the current title of the main frame.
*
* It returns a internal string and should not
* be modified. The string is guaranteed to be stringshared.
*
* @param o view object to get current title
*
* @return current title on success or @c NULL on failure
*/
EAPI const Ewk_Text_With_Direction *ewk_view_title_get(const Evas_Object *o);
/**
* Queries if the main frame is editable.
*
* @param o view object to query editable state
*
* @return @c EINA_TRUE if the main frame is editable, @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_editable_get(const Evas_Object *o);
/**
* Sets if main frame is editable.
*
* @param o view object to set editable state
* @param editable a new state to set
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_editable_set(Evas_Object *o, Eina_Bool editable);
/**
* Sets the background color and transparency of the view.
*
* Just as in Evas, colors are pre-multiplied, so 50% red is
* (128, 0, 0, 128) and not (255, 0, 0, 128)!
*
* @warning Watch out performance issues with transparency! Object
* will be handled as transparent image by evas even if the
* webpage specifies a background color. That mean you'll pay
* a price even if it's not really transparent, thus
* scrolling/panning and zooming will be likely slower than
* if transparency is off.
*
* @param o view object to change the background color
* @param r red color component
* @param g green color component
* @param b blue color component
* @param a transparency
*/
EAPI void ewk_view_bg_color_set(Evas_Object *o, int r, int g, int b, int a);
/**
* Gets the background color of the view.
*
* Just as in Evas, colors are pre-multiplied, so 50% red is
* (128, 0, 0, 128) and not (255, 0, 0, 128)!
*
* @param o view object to get the background color
* @param r the pointer to store red color component
* @param g the pointer to store green color component
* @param b the pointer to store blue color component
* @param a the pointer to store alpha value
*/
EAPI void ewk_view_bg_color_get(const Evas_Object *o, int *r, int *g, int *b, int *a);
/**
* Gets the copy of the selected text.
*
* The returned string @b should be freed by eina_stringshare_del() after use.
*
* @param o view object to get selected text
*
* @return a newly allocated string or @c NULL if nothing is selected or on failure
*/
EAPI const char *ewk_view_selection_get(const Evas_Object *o);
/**
* Forwards a request of a new Context Menu to WebCore.
*
* @param o view object to forward a request of a new Context Menu
* @param ev mouse down event data
*
* @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_context_menu_forward_event(Evas_Object *o, const Evas_Event_Mouse_Down *ev);
/**
* Executes editor command.
*
* @param o view object to execute command
* @param command editor command to execute
* @param value the value to be passed into command
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_editor_command_execute(const Evas_Object *o, const Ewk_Editor_Command command, const char *value);
/**
* Destroys a previously created color chooser.
*
* Before destroying, it informs client that color chooser's data is ready to be
* destroyed by sending a "colorchooser,willdelete". Then it removes any reference
* to the color chooser inside webkit. It's safe to call this function either from
* inside webkit or from browser.
*
* @param o view object
*
* @return @c EINA_TRUE in case color chooser was successfully destroyed or @c EINA_TRUE in
* case there wasn't any color chooser to be destroyed
*/
EAPI Eina_Bool ewk_view_color_chooser_destroy(Evas_Object* o);
/**
* Changes the selected color.
*
* Changes the color selected in the color input widget. The browser should call
* this when the user chooses a new color. It's likely that ewk_view_color_chooser_destroy
* will be called afterwards.
*
* @param o view object
* @param r red color component
* @param g green color component
* @param b blue color component
*/
EAPI void ewk_view_color_chooser_color_set(Evas_Object* o, int r, int g, int b);
/**
* Changes currently selected item.
*
* Changes the option selected in select widget. This is called by browser
* whenever user has chosen a different item. Most likely after calling this, a
* call to ewk_view_popup_destroy might be made in order to close the popup.
*
* @param o view object to change currently selected item
* @index index a new index to set
*/
EAPI void ewk_view_popup_selected_set(Evas_Object *o, int index);
/**
* Destroys a previously created menu.
*
* Before destroying, it informs client that menu's data is ready to be
* destroyed by sending a "popup,willdelete" with a list of menu items. Then it
* removes any reference to menu inside webkit. It's safe to call this
* function either from inside webkit or from browser.
*
* @param o view object
*
* @return @c EINA_TRUE in case menu was successfully destroyed or @c EINA_TRUE in
* case there wasn't any menu to be destroyed
*/
EAPI Eina_Bool ewk_view_popup_destroy(Evas_Object *o);
/**
* Searches the given string in a document.
*
* @param o view object where to search the text
* @param string reference string to search
* @param case_sensitive if search should be case sensitive or not
* @param forward if search is from cursor and on or backwards
* @param wrap if search should wrap at the end
*
* @return @c EINA_TRUE if the given string was found, @c EINA_FALSE if not or failure
*/
EAPI Eina_Bool ewk_view_text_search(const Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
/**
* Marks matches the given string in a document.
*
* @param o view object where to search text
* @param string reference string to match
* @param case_sensitive if match should be case sensitive or not
* @param highlight if matches should be highlighted
* @param limit maximum amount of matches, or zero to unlimited
*
* @return number of matched @a string
*/
EAPI unsigned int ewk_view_text_matches_mark(Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
/**
* Unmarks all marked matches in a document.
*
* Reverses the effect of ewk_frame_text_matches_mark().
*
* @param o view object where to unmark matches
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_text_matches_unmark_all(Evas_Object *o);
/**
* Sets if should highlight matches marked with ewk_frame_text_matches_mark().
*
* @param o view object where to set if matches are highlighted or not
* @param highlight @c EINA_TRUE if matches are highlighted, @c EINA_FALSE if not
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);
/**
* Gets if should highlight matches marked with ewk_frame_text_matches_mark().
*
* @param o view object to query if matches are highlighted or not
*
* @return @c EINA_TRUE if matches are highlighted, @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_text_matches_highlight_get(const Evas_Object *o);
/**
* Gets the current load progress of page.
*
* The progress estimates from 0.0 to 1.0.
*
* @param o view object to get the current progress
*
* @return the load progres of page, value from 0.0 to 1.0 on success
* or -1.0 on failure
*/
EAPI double ewk_view_load_progress_get(const Evas_Object *o);
/**
* Asks the main frame to stop loading.
*
* @param o view object to stop loading
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
*/
EAPI Eina_Bool ewk_view_stop(Evas_Object *o);
/**
* Asks the main frame to reload the current document.
*
* @param o view object to reload current document
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*
* @see ewk_view_reload_full()
*/
EAPI Eina_Bool ewk_view_reload(Evas_Object *o);
/**
* Asks the main frame to fully reload the current document, using no caches.
*
* @param o view object to reload current document
*
* @return @c EINA_TRUE on success o r@c EINA_FALSE otherwise
*
* @see ewk_view_reload()
*/
EAPI Eina_Bool ewk_view_reload_full(Evas_Object *o);
/**
* Asks the frame to navigate back in the history.
*
* @param o view object to navigate back
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*
* @see ewk_frame_back()
*/
EAPI Eina_Bool ewk_view_back(Evas_Object *o);
/**
* Asks frame to navigate forward in the history.
*
* @param o view object to navigate forward
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*
* @see ewk_frame_forward()
*/
EAPI Eina_Bool ewk_view_forward(Evas_Object *o);
/**
* Navigates back or forward in the history.
*
* @param o view object to navigate in the history
* @param steps if positive navigates that amount forwards, if negative
* does backwards
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*
* @see ewk_frame_navigate()
*/
EAPI Eina_Bool ewk_view_navigate(Evas_Object *o, int steps);
/**
* Queries if it's possible to navigate backwards one item in the history.
*
* @param o view object to query if backward navigation is possible
*
* @return @c EINA_TRUE if it's possible to navigate backward one item in the history, @c EINA_FALSE otherwise
* @see ewk_view_navigate_possible()
*/
EAPI Eina_Bool ewk_view_back_possible(Evas_Object *o);
/**
* Queries if it's possible to navigate forwards one item in the history.
*
* @param o view object to query if forward navigation is possible
*
* @return @c EINA_TRUE if it's possible to navigate forwards in the history, @c EINA_FALSE otherwise
*
* @see ewk_view_navigate_possible()
*/
EAPI Eina_Bool ewk_view_forward_possible(Evas_Object *o);
/**
* Queries if it's possible to navigate given @a steps in the history.
*
* @param o view object to query if it's possible to navigate @a steps in the history
* @param steps if positive navigates that amount forwards, if negative
* does backwards
*
* @return @c EINA_TRUE if it's possible to navigate @a steps in the history, @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_navigate_possible(Evas_Object *o, int steps);
/**
* Queries if navigation in the history (back-forward lists) is enabled.
*
* @param o view object to query if navigation history is enabled
*
* @return @c EINA_TRUE if view keeps history, @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_history_enable_get(const Evas_Object *o);
/**
* Enables/disables navigation in the history (back-forward lists).
*
* @param o view object to enable/disable navigation in the history
* @param enable @c EINA_TRUE to enable navigation in the history,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_history_enable_set(Evas_Object *o, Eina_Bool enable);
/**
* Gets the history (back-forward list) associated with this view.
*
* The returned instance is unique for this view and thus multiple calls
* to this function with the same view as parameter returns the same
* handle. This handle is alive while view is alive, thus one
* might want to listen for EVAS_CALLBACK_DEL on given view
* (@a o) to know when to stop using returned handle.
*
* @param o view object to get navigation history
*
* @return the history instance handle associated with this
* view on succes or @c NULL on failure (including when the history
* navigation is not enabled with ewk_view_history_enable_set())
*
* @see ewk_view_history_enable_set()
*/
EAPI Ewk_History *ewk_view_history_get(const Evas_Object *o);
/**
* Adds @a visited_url to the view's visited links cache.
*
* This function is to be invoked by the client managing persistent history storage
* when "populate,visited,links" signal is received.
*
* @param o view object to add visited links data.
* @param visited_url visited url.
*
* @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
*/
EAPI Eina_Bool ewk_view_visited_link_add(Evas_Object *o, const char *visited_url);
/**
* Gets the current page zoom level of the main frame.
*
* @param o view object to get the zoom level
*
* @return current zoom level in use on success or @c -1.0 on failure
*/
EAPI float ewk_view_page_zoom_get(const Evas_Object *o);
/**
* Sets the current page zoom level of the main frame.
*
* @param o view object to set the zoom level
* @param page_zoom_factor a new level to set
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_page_zoom_set(Evas_Object *o, float page_zoom_factor);
/**
* Gets the current scale factor of the page.
*
* @param o view object to get the scale factor
*
* @return current scale factor in use on success or @c -1.0 on failure
*/
EAPI float ewk_view_scale_get(const Evas_Object *o);
/**
* Scales the current page, centered at the given point.
*
* @param o view object to set the zoom level
* @param scale_factor a new level to set
* @param cx x of center coordinate
* @param cy y of center coordinate
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_scale_set(Evas_Object *o, float scale_factor, Evas_Coord cx, Evas_Coord cy);
/**
* Gets the current text zoom level of the main frame.
*
* @param o view object to get the zoom level
*
* @return current zoom level in use on success or @c -1.0 on failure
*/
EAPI float ewk_view_text_zoom_get(const Evas_Object *o);
/**
* Sets the current text zoom level of the main frame.
*
* @param o view object to set the zoom level
* @param textZoomFactor a new level to set
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_text_zoom_set(Evas_Object *o, float text_zoom_factor);
/**
* Gets the current zoom level of the main frame.
*
* @param o view object to get the zoom level
*
* @return current zoom level in use on success or @c -1.0 on failure
*/
EAPI float ewk_view_zoom_get(const Evas_Object *o);
/**
* Sets the current zoom level of the main frame, centered at the given point.
*
* @param o view object to set the zoom level
* @param zoom a new level to set
* @param cx x of center coordinate
* @param cy y of center coordinate
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_zoom_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy);
/**
* Queries if the smooth scale is enabled while the weak zoom.
*
* @param o view object to query if the smooth scale is enabled while the weak zoom
*
* @return @c EINA_TRUE if the smooth scale is enabled while the weak zoom, or
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_zoom_weak_smooth_scale_get(const Evas_Object *o);
/**
* Enables/disables the smooth scale while the weak zoom.
*
* @param o view object to set the smooth scale while the weak zoom
* @param smooth_scale @c EINA_TRUE to enable the smooth scale
* @c EINA_FALSE to disable
*/
EAPI void ewk_view_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale);
/**
* Sets the current zoom level of backing store, centered at given point.
*
* Unlike ewk_view_zoom_set(), this call do not ask WebKit to render
* at new size, but scale what is already rendered, being much faster
* but worse quality.
*
* Often one should use ewk_view_zoom_animated_set(), it will call the
* same machinery internally.
*
* @note this will set variables used by ewk_view_zoom_animated_set()
* so sub-classes will not reset internal state on their
* "calculate" phase. To unset those and enable sub-classes to
* reset their internal state, call
* ewk_view_zoom_animated_mark_stop(). Namely, this call will
* set ewk_view_zoom_animated_mark_start() to actual webkit zoom
* level, ewk_view_zoom_animated_mark_end() and
* ewk_view_zoom_animated_mark_current() to given zoom level.
*
* @param o view object to set the weak zoom level
* @param zoom a new level to scale backing store
* @param cx horizontal center offset, relative to object (w/2 is middle)
* @param cy vertical center offset, relative to object (h/2 is middle)
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_zoom_weak_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy);
/**
* Sets start of an internal zoom animation state to the given zoom.
*
* This does not modify any actual zoom in WebKit or backing store,
* just set needed flag so sub-classes knows they should not reset
* their an internal state.
*
* @param o view object to set start of an internal zoom animation
* @param zoom a new start value
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*
* @see ewk_view_zoom_animated_set()
* @see ewk_view_zoom_weak_set()
* @see ewk_view_zoom_animated_mark_stop()
* @see ewk_view_zoom_animated_mark_end()
* @see ewk_view_zoom_animated_mark_current()
*/
EAPI Eina_Bool ewk_view_zoom_animated_mark_start(Evas_Object *o, float zoom);
/**
* Sets end of an internal zoom animation state to given zoom.
*
* This does not modify any actual zoom in WebKit or backing store,
* just set needed flag so sub-classes knows they should not reset
* their an internal state.
*
* @param o view object to set end of an internal zoom animation
* @param zoom a new end value
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*
* @see ewk_view_zoom_animated_set()
* @see ewk_view_zoom_weak_set()
* @see ewk_view_zoom_animated_mark_stop()
* @see ewk_view_zoom_animated_mark_start()
* @see ewk_view_zoom_animated_mark_current()
*/
EAPI Eina_Bool ewk_view_zoom_animated_mark_end(Evas_Object *o, float zoom);
/**
* Sets an internal current zoom animation state to given zoom.
*
* This does not modify any actual zoom in WebKit or backing store,
* just set needed flag so sub-classes knows they should not reset
* their an internal state.
*
* @param o view object to set an internal current zoom animation
* @param zoom a new current value
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*
* @see ewk_view_zoom_animated_set()
* @see ewk_view_zoom_weak_set()
* @see ewk_view_zoom_animated_mark_stop()
* @see ewk_view_zoom_animated_mark_start()
* @see ewk_view_zoom_animated_mark_end()
*/
EAPI Eina_Bool ewk_view_zoom_animated_mark_current(Evas_Object *o, float zoom);
/**
* Unmarks an internal zoom animation state.
*
* The start, end and current values of an internal zoom animation are zeroed.
*
* @param o view object to unmark an internal zoom animation state
*
* @see ewk_view_zoom_animated_mark_start()
* @see ewk_view_zoom_animated_mark_end()
* @see ewk_view_zoom_animated_mark_current()
* @see ewk_view_zoom_weak_set()
*/
EAPI Eina_Bool ewk_view_zoom_animated_mark_stop(Evas_Object *o);
/**
* Sets the current zoom level while animating.
*
* If the view was already animating to another zoom, it will start
* from current point to the next provided zoom (@a zoom parameter)
* and duration (@a duration parameter).
*
* This is the recommended way to do transitions from one level to
* another. However, one may wish to do those from outside, in that
* case use ewk_view_zoom_weak_set() and later control intermediate
* states with ewk_view_zoom_animated_mark_current(),
* ewk_view_zoom_animated_mark_end() and
* ewk_view_zoom_animated_mark_stop().
*
* @param o view object to animate
* @param zoom final zoom level to use
* @param duration time in seconds the animation should take.
* @param cx offset inside object that defines zoom center. 0 is left side
* @param cy offset inside object that defines zoom center. 0 is top side
* @return @c EINA_TRUE if animation will be started, @c EINA_FALSE if not
* because zoom is too small/big
*/
EAPI Eina_Bool ewk_view_zoom_animated_set(Evas_Object *o, float zoom, float duration, Evas_Coord cx, Evas_Coord cy);
/**
* Asks engine to pre-render region.
*
* Engines and backing store might be able to pre-render regions in
* order to speed up zooming or scrolling to that region. Not all
* engines might implement that and they will return @c EINA_FALSE
* in that case.
*
* The given region is a hint. Engines might do bigger or smaller area
* that covers that region. Pre-render might not be immediate, it may
* be postponed to a thread, operated cooperatively in the main loop
* and may be even ignored or cancelled afterwards.
*
* Multiple requests might be queued by engines. One can clear/forget
* about them with ewk_view_pre_render_cancel().
*
* @param o view to ask pre-render of given region
* @param x absolute coordinate (0=left) to pre-render at zoom
* @param y absolute coordinate (0=top) to pre-render at zoom
* @param w width to pre-render starting from @a x at zoom
* @param h height to pre-render starting from @a y at zoom
* @param zoom desired zoom
*
* @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
* otherwise (errors, pre-render feature not supported, etc)
*
* @see ewk_view_pre_render_cancel()
*/
EAPI Eina_Bool ewk_view_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
/**
* Asks engine to pre-render region, given @a n extra cols/rows.
*
* This is an alternative method to ewk_view_pre_render_region(). It does not
* make sense in all engines and therefore it might not be implemented at all.
*
* It's only useful if engine divide the area being rendered in smaller tiles,
* forming a grid. Then, browser could call this function to pre-render @a n
* rows/cols involving the current viewport.
*
* @param o view to ask pre-render
* @param n number of cols/rows that must be part of the region pre-rendered
*
* @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
* otherwise (errors, pre-render feature not supported, etc)
*
* @see ewk_view_pre_render_region()
*/
EAPI Eina_Bool ewk_view_pre_render_relative_radius(Evas_Object *o, unsigned int n);
/**
* Asks engine to start pre-rendering.
*
* This is an alternative method to pre-render around the view area.
* The first step is to find the center view area where to start pre-rendering.
* And then from the center of the view area the backing store append the render request
* outward in spiral order. So that the tiles which are close to view area are displayed
* sooner than outside.
*
* @param o view to ask pre-render
*
* @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
* otherwise (errors, pre-render feature not supported, etc)
*
*/
EAPI Eina_Bool ewk_view_pre_render_start(Evas_Object *o);
/**
* Cancels and clears previous the pre-render requests.
*
* @param o view to clear pre-render requests
*/
EAPI void ewk_view_pre_render_cancel(Evas_Object *o);
/**
* Enables (resumes) rendering.
*
* @param o view object to enable rendering
*
* @return @c EINA_TRUE if rendering was enabled, @c EINA_FALSE
* otherwise (errors, rendering suspension feature not supported)
*
* @see ewk_view_disable_render()
*/
EAPI Eina_Bool ewk_view_enable_render(const Evas_Object *o);
/**
* Disables (suspends) rendering.
*
* @param o view object to disable rendering
*
* @return @c EINA_TRUE if rendering was disabled, @c EINA_FALSE
* otherwise (errors, rendering suspension not supported)
*/
EAPI Eina_Bool ewk_view_disable_render(const Evas_Object *o);
/**
* Gets the input method hints.
*
* @param o view object to get the input method hints
*
* @see Ewk_Imh
*
* @return the input method hints as @a Ewk_Imh bits-field
*/
EAPI unsigned int ewk_view_imh_get(const Evas_Object *o);
/**
* Gets the user agent string.
*
* @param o view object to get the user agent string
*
* @return the user agent string
*/
EAPI const char *ewk_view_setting_user_agent_get(const Evas_Object *o);
/**
* Sets the user agent string.
*
* @param o view object to set the user agent string
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_user_agent_set(Evas_Object *o, const char *user_agent);
/**
* Queries if the images are loaded automatically.
*
* @param o view object to query if the images are loaded automatically
*
* @return @c EINA_TRUE if the images are loaded automatically,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_auto_load_images_get(const Evas_Object *o);
/**
* Enables/disables auto loading of the images.
*
* @param o view object to set auto loading of the images
* @param automatic @c EINA_TRUE to enable auto loading of the images,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_auto_load_images_set(Evas_Object *o, Eina_Bool automatic);
/**
* Queries if the images are shrinked automatically
*
* @param o view object to query if the images are shrinked automatically
*
* @return @c EINA_TRUE if the images are shrinked automatically,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_auto_shrink_images_get(const Evas_Object *o);
/**
* Enables/disables auto shrinking of the images.
*
* @param o view object to set auto shrinking of the images
* @param automatic @c EINA_TRUE to enable auto shrinking of the images,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_auto_shrink_images_set(Evas_Object *o, Eina_Bool automatic);
/**
* Queries if the view can be resized automatically.
*
* @param o view object to query if the view can be resized automatically
*
* @return @c EINA_TRUE if view can be resized automatically,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_auto_resize_window_get(const Evas_Object *o);
/**
* Enables/disables if the view can be resized automatically.
*
* @param o view object to set if the view can be resized automatically
* @param resizable @c EINA_TRUE if view can be resizable automatically,
* @c EINA_TRUE if not
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_auto_resize_window_set(Evas_Object *o, Eina_Bool resizable);
/**
* Queries if the scripts can be executed.
*
* @param o view object to query if the scripts can be executed
*
* @return @c EINA_TRUE if the scripts can be executed
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_scripts_get(const Evas_Object *o);
/**
* Enables/disables scripts executing.
*
* @param o view object to set script executing
* @param enable @c EINA_TRUE to enable scripts executing
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_scripts_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the plug-ins are enabled.
*
* @param o view object to query if the plug-ins are enabled
*
* @return @c EINA_TRUE if the plugins are enabled
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_plugins_get(const Evas_Object *o);
/**
* Enables/disables the plug-ins.
*
* @param o view object to set the plug-ins
* @param enable @c EINA_TRUE to enable the plug-ins
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_plugins_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the frame flattening feature is enabled.
*
* @param o view object to query if the frame flattening feature is enabled
*
* @return @c EINA_TRUE if the frame flattening feature is enabled,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_frame_flattening_get(const Evas_Object *o);
/**
* Enables/disables the frame flattening feature.
*
* @param o view object to set the frame flattening feature
* @param enable @c EINA_TRUE to enable the frame flattening feature
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_frame_flattening_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the scripts can open the new windows.
*
* @param o view object to query if the scripts can open the new windows
*
* @return @c EINA_TRUE if the scripts can open the new windows
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_scripts_can_open_windows_get(const Evas_Object *o);
/**
* Enables/disables if the scripts can open the new windows.
*
* @param o view object to set if the scripts can open the new windows
* @param allow @c EINA_TRUE if the scripts can open the new windows
* @c EINA_FALSE if not
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure (scripts are disabled)
*
* @see ewk_view_setting_enable_scripts_set
*/
EAPI Eina_Bool ewk_view_setting_scripts_can_open_windows_set(Evas_Object *o, Eina_Bool allow);
/**
* Returns whether scripts can close windows automatically.
*
* @param o View whose settings to check.
*
* @return @c EINA_TRUE if scripts can close windows, @c EINA_FALSE otherwise.
*/
EAPI Eina_Bool ewk_view_setting_scripts_can_close_windows_get(const Evas_Object *o);
/**
* Sets whether scripts are allowed to close windows automatically.
*
* @param o View whose settings to change.
* @param allow @c EINA_TRUE to allow scripts to close windows,
* @c EINA_FALSE otherwise.
*
* @return @c EINA_TRUE if the setting could be changed successfully,
* @c EINA_FALSE in case an error occurred.
*/
EAPI Eina_Bool ewk_view_setting_scripts_can_close_windows_set(Evas_Object *o, Eina_Bool allow);
/**
* Returns whether scripts can access clipboard.
*
* @param o View whose settings to check.
*
* @return @c EINA_TRUE if scripts can access clipboard, @c EINA_FALSE otherwise.
*/
EAPI Eina_Bool ewk_view_setting_scripts_can_access_clipboard_get(const Evas_Object *o);
/**
* Sets whether scripts are allowed to access clipboard.
*
* The default value is @c EINA_FALSE. If set to @c EINA_TRUE, document.execCommand()
* allows cut, copy and paste commands.
*
* @param o View whose settings to change.
* @param allow @c EINA_TRUE to allow scripts access clipboard,
* @c EINA_FALSE otherwise.
*
* @return @c EINA_TRUE if the setting could be changed successfully,
* @c EINA_FALSE in case an error occurred.
*/
EAPI Eina_Bool ewk_view_setting_scripts_can_access_clipboard_set(Evas_Object *o, Eina_Bool allow);
/**
* Queries if HTML elements @c textarea can be resizable.
*
* @param o view object to query if the textarea elements can be resizable
*
* @return @c EINA_TRUE if the textarea elements can be resizable
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_resizable_textareas_get(const Evas_Object *o);
/**
* Enables/disables if HTML elements @c textarea can be resizable.
*
* @param o view object to set if the textarea elements can be resizable
* @param enable @c EINA_TRUE if the textarea elements can be resizable
* @c EINA_FALSE if not
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_resizable_textareas_set(Evas_Object *o, Eina_Bool enable);
/**
* Gets the user style sheet.
*
* @param o view object to get the user style sheet
*
* @return the user style sheet
*/
EAPI const char *ewk_view_setting_user_stylesheet_get(const Evas_Object *o);
/**
* Sets the user style sheet.
*
* @param o view object to set the user style sheet
* @param uri uniform resource identifier to user style sheet
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_user_stylesheet_set(Evas_Object *o, const char *uri);
/**
* Queries if the private browsing feature is enabled.
*
* @param o view object to query if the private browsing feature is enabled
*
* @return @c EINA_TRUE if the private browsing feature is enabled, or
* @c EINA_FALSE if not or on failure
*
* @see ewk_view_setting_private_browsing_set
*/
EAPI Eina_Bool ewk_view_setting_private_browsing_get(const Evas_Object *o);
/**
* Enables/disables the private browsing feature.
*
* When this option is set, WebCore will avoid storing any record of browsing
* activity that may persist on disk or remain displayed when the
* option is reset.
*
* This option does not affect the storage of such information in RAM.
*
* The following functions respect this setting:
* - HTML5/DOM Storage
* - Icon Database
* - Console Messages
* - MemoryCache
* - Application Cache
* - Back/Forward Page History
* - Page Search Results
* - HTTP Cookies
* - Plug-ins (that support NPNVprivateModeBool)
*
* @param o view object to set the private browsing feature
* @param enable @c EINA_TRUE to enable the private browsing feature
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_private_browsing_set(Evas_Object *o, Eina_Bool enable);
/**
* Returns whether HTML5 application cache support is enabled for this view.
*
* The Offline Application Caching APIs are part of HTML5 and allow applications to store data locally that is accessed
* when the network cannot be reached.
*
* Application cache support is enabled by default.
*
* @param o view object whose settings to query
*
* @return @c EINA_TRUE if the application cache is enabled,
* @c EINA_FALSE if not or on failure
*
* @sa ewk_settings_application_cache_path_set
*/
EAPI Eina_Bool ewk_view_setting_application_cache_get(const Evas_Object *o);
/**
* Enables/disables the HTML5 application cache for this view.
*
* The Offline Application Caching APIs are part of HTML5 and allow applications to store data locally that is accessed
* when the network cannot be reached.
*
* Application cache support is enabled by default.
*
* @param o view object whose settings to change
* @param enable @c EINA_TRUE to enable the application cache,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*
* @sa ewk_settings_application_cache_path_set
*/
EAPI Eina_Bool ewk_view_setting_application_cache_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the caret browsing feature is enabled.
*
* @param o view object to query if the caret browsing feature is enabled
*
* @return @c EINA_TRUE if the caret browsing feature is enabled,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_caret_browsing_get(const Evas_Object *o);
/**
* Enables/disables the caret browsing feature.
*
* @param o view object to set caret browsing feature
* @param enable @c EINA_TRUE to enable the caret browsing feature
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_caret_browsing_set(Evas_Object *o, Eina_Bool enable);
/**
* Gets the current encoding.
*
* @param o view object to get the current encoding
*
* @return @c eina_strinshare containing the current encoding, or
* @c NULL if it's not set
*/
EAPI const char *ewk_view_setting_encoding_custom_get(const Evas_Object *o);
/**
* Sets the encoding and reloads the page.
*
* @param o view to set the encoding
* @param encoding the new encoding to set or @c NULL to restore the default one
*
* @return @c EINA_TRUE on success @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object *o, const char *encoding);
/**
* Gets the default encoding.
*
* @param o view object to get the default encoding
*
* @return @c eina_strinshare containing the default encoding, or
* @c NULL if it's not set
*/
EAPI const char *ewk_view_setting_encoding_default_get(const Evas_Object *o);
/**
* Sets the default encoding.
*
* @param o view to set the default encoding
* @param encoding the new encoding to set
*
* @return @c EINA_TRUE on success @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object *o, const char *encoding);
/**
* Gets the minimum font size.
*
* @param o view object to get the minimum font size
*
* @return the minimum font size, or @c 0 on failure
*/
EAPI int ewk_view_setting_font_minimum_size_get(const Evas_Object *o);
/**
* Sets the minimum font size.
*
* @param o view object to set the minimum font size
* @param size a new minimum font size to set
*
* @return @c EINA_TRUE on success @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_setting_font_minimum_size_set(Evas_Object *o, int size);
/**
* Gets the minimum logical font size.
*
* @param o view object to get the minimum logical font size
*
* @return the minimum logical font size, or @c 0 on failure
*/
EAPI int ewk_view_setting_font_minimum_logical_size_get(const Evas_Object *o);
/**
* Sets the minimum logical font size.
*
* @param o view object to set the minimum font size
* @param size a new minimum logical font size to set
*
* @return @c EINA_TRUE on success @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_setting_font_minimum_logical_size_set(Evas_Object *o, int size);
/**
* Gets the default font size.
*
* @param o view object to get the default font size
*
* @return the default font size, or @c 0 on failure
*/
EAPI int ewk_view_setting_font_default_size_get(const Evas_Object *o);
/**
* Sets the default font size.
*
* @param o view object to set the default font size
* @param size a new default font size to set
*
* @return @c EINA_TRUE on success @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_setting_font_default_size_set(Evas_Object *o, int size);
/**
* Gets the Monospace font size.
*
* @param o view object to get the Monospace font size
*
* @return the Monospace font size, or @c 0 on failure
*/
EAPI int ewk_view_setting_font_monospace_size_get(const Evas_Object *o);
/**
* Sets the Monospace font size.
*
* @param o view object to set the Monospace font size
* @param size a new Monospace font size to set
*
* @return @c EINA_TRUE on success @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_setting_font_monospace_size_set(Evas_Object *o, int size);
/**
* Gets the name of font for the given font family.
*
* @param o view object to get name of font the for font family
* @param font_family the font family as @a Ewk_Font_Family enum to get font name
*
* @return the name of font family
*/
EAPI const char *ewk_view_font_family_name_get(const Evas_Object *o, Ewk_Font_Family font_family);
/**
* Sets the font for the given family.
*
* @param o view object to set font for the given family
* @param font_family the font family as @a Ewk_Font_Family enum
* @param name the font name to set
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_font_family_name_set(Evas_Object *o, Ewk_Font_Family font_family, const char *name);
/**
* Queries if the spatial naviagtion feature is enabled.
*
* @param o view object to query if spatial navigation feature is enabled
*
* @return @c EINA_TRUE if spatial navigation is enabled,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_spatial_navigation_get(const Evas_Object *o);
/**
* Enables/disables the spatial navigation feature.
*
* @param o view object to set spatial navigation feature
* @param enable @c EINA_TRUE to enable the spatial navigation feature,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the local storage feature of HTML5 is enabled.
*
* @param o view object to query if the local storage feature is enabled
*
* @return @c EINA_TRUE if local storage is enabled,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_local_storage_get(const Evas_Object *o);
/**
* Enables/disables the local storage feature of HTML5.
*
* Please notice that by default there is no storage path specified for the database.
* This means that the contents of @c window.localStorage will not be saved to disk and
* will be lost when the view is removed.
* To set the path where the storage database will be stored, use
* ewk_view_setting_local_storage_database_path_set.
*
* @param o view object to set if local storage is enabled
* @param enable @c EINA_TRUE to enable the local storage feature,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*
* @sa ewk_view_setting_local_storage_database_path_set
*/
EAPI Eina_Bool ewk_view_setting_local_storage_set(Evas_Object *o, Eina_Bool enable);
/**
* Returns the path where the HTML5 local storage database is stored on disk.
*
* By default, there is no path set, which means changes to @c window.localStorage will not
* be saved to disk whatsoever.
*
* @param o view object to get the database path to the local storage feature
*
* @return @c eina_stringshare containing the database path to the local storage feature, or
* @c NULL if it's not set
*
* @sa ewk_view_setting_local_storage_database_path_set
*/
EAPI const char *ewk_view_setting_local_storage_database_path_get(const Evas_Object *o);
/**
* Sets the path where the HTML5 local storage database is stored on disk.
*
* By default, there is no path set, which means changes to @c window.localStorage will not
* be saved to disk whatsoever.
*
* @param o view object to set the database path to the local storage feature
* @param path a new database path to the local storage feature
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*
* @sa ewk_view_setting_local_storage_set
*/
EAPI Eina_Bool ewk_view_setting_local_storage_database_path_set(Evas_Object *o, const char *path);
/**
* Queries if the page cache feature is enabled.
*
* @param o view object to query if page cache feature is enabled
*
* @return @c EINA_TRUE if page cache is enabled,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_page_cache_get(const Evas_Object *o);
/**
* Enables/disables the page cache feature.
*
* @param o view object to set page cache feature
* @param enable @c EINA_TRUE to enable the page cache feature,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_page_cache_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the encoding detector is enabled.
*
* @param o view object to query if the encoding detector is enabled
*
* @return @c EINA_TRUE if the encoding feature is enabled,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_encoding_detector_get(const Evas_Object *o);
/**
* Enables/disables the encoding detector.
*
* @param o view object to set the encoding detector
* @param enable @c EINA_TRUE to enable the encoding detector,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_setting_encoding_detector_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if developer extensions are enabled.
*
* Currently, this is used to know whether the Web Inspector is enabled for a
* given view.
*
* @param o view object to query if developer extensions are enabled
*
* @return @c EINA_TRUE if developer extensions are enabled, @c EINA_FALSE
* otherwise
*/
EAPI Eina_Bool ewk_view_setting_enable_developer_extras_get(const Evas_Object *o);
/**
* Enables/disables developer extensions.
*
* This currently controls whether the Web Inspector should be enabled.
*
* @param o view object to set developer extensions
* @param enable @c EINA_TRUE to enable developer extras, @c EINA_FALSE to
* disable
*
* @return @c EINA_TRUE on success or @EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_developer_extras_set(Evas_Object *o, Eina_Bool enable);
/**
* Sets the minimum interval for DOMTimers on current page.
*
* @param o view object to set the minimum interval
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_minimum_timer_interval_set(Evas_Object *o, double interval);
/**
* Gets the minimum interval for DOMTimers on current page.
*
* @param o view object to get the minimum interval
*
* @return the minimum interval on success or @c -1.0 on failure
*/
EAPI double ewk_view_setting_minimum_timer_interval_get(const Evas_Object *o);
/**
* Queries whether WebGL support is enabled.
*
* WebGL support is enabled by default.
*
* @param o view object to query whether WebGL support is enabled
*
* @return @c EINA_TRUE if WebGL support enabled,
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_webgl_get(const Evas_Object *o);
/**
* Enables/disables WebGL support.
*
* WebGL support is enabled by default.
*
* @param o view object to set WebGL
* @param enable @c EINA_TRUE to enable WebGL support,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_webgl_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if tab key focusing of page elements is enabled.
*
* When this setting is enabled, the elements in the page (links and form controls) will be cycled through by pressing the tab key.
* Tab key focusing of page elements is enabled by default.
*
* @param o view object to query if tab key focusing of page elements is enabled
*
* @return @c EINA_TRUE if tab key focusing of page elements is enabled, @c EINA_FALSE
* otherwise
*/
EAPI Eina_Bool ewk_view_setting_include_links_in_focus_chain_get(const Evas_Object *o);
/**
* Enables/disables tab key focusing of page elements.
*
* When this setting is enabled, the elements in the page (links and form controls) will be cycled through by pressing the tab key.
* Tab key focusing of page elements is enabled by default.
*
* @param o view object to set tab key focusing of page elements
* @param enable @c EINA_TRUE to enable tab key focusing of page elements, @c EINA_FALSE to
* disable
*
* @return @c EINA_TRUE on success or @EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_include_links_in_focus_chain_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if hyperlink auditing is enabled.
*
* Hyperlink auditing is used if a hyperlink created by an @c a or @c area element has a @c ping attribute.
* Please refer to the hyperlink auditing specification at http://www.whatwg.org/specs/web-apps/current-work/#hyperlink-auditing.
* Hyperlink auditing is disabled by default.
*
* @param o view object to query if hyperlink auditing is enabled
*
* @return @c EINA_TRUE if hyperlink auditing is enabled, @c EINA_FALSE
* otherwise
*/
EAPI Eina_Bool ewk_view_setting_enable_hyperlink_auditing_get(const Evas_Object *o);
/**
* Enables/disables hyperlink auditing.
*
* Hyperlink auditing is used if a hyperlink created by an @c a or @c area element has a @c ping attribute.
* Please refer to the hyperlink auditing specification at http://www.whatwg.org/specs/web-apps/current-work/#hyperlink-auditing.
* Hyperlink auditing is disabled by default.
*
* @param o view object to set hyperlink auditing
* @param enable @c EINA_TRUE to enable hyperlink auditing, @c EINA_FALSE to
* disable
*
* @return @c EINA_TRUE on success or @EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_hyperlink_auditing_set(Evas_Object *o, Eina_Bool enable);
/**
* Enables/disables allowing universal access from file URLs.
*
* This setting specifies whether locally loaded documents are allowed to access remote urls.
* By default this setting is enabled.
*
* @param o view object to set allowing universal access from file URLs
* @param enable @c EINA_TRUE to enable universal access from file URLs,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_allow_universal_access_from_file_urls_set(Evas_Object *o, Eina_Bool flag);
/**
* Gets if allowing universal access from file URLs is enabled.
*
* @param o view object to query if allowing universal access from file URLs is enabled.
*
* @return @c EINA_TRUE if allowing universal access from file URLs is enabled, @c EINA_FALSE
* otherwise
*
* @see ewk_view_setting_allow_universal_access_from_file_urls_set()
*/
EAPI Eina_Bool ewk_view_setting_allow_universal_access_from_file_urls_get(const Evas_Object *o);
/**
* Enables/disables allowing file access from file URLs.
*
* This setting specifies whether locally loaded documents are allowed to access other local urls.
* By default this setting is enabled.
*
* @param o view object to set allowing file access from file URLs
* @param enable @c EINA_TRUE to enable file access from file URLs,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_allow_file_access_from_file_urls_set(Evas_Object *o, Eina_Bool flag);
/**
* Gets if allowing file access from file URLs is enabled.
*
* @param o view object to query if allowing file access from file URLs is enabled.
*
* @return @c EINA_TRUE if allowing file access from file URLs is enabled, @c EINA_FALSE
* otherwise
*
* @see ewk_view_setting_allow_file_access_from_file_urls_set()
*/
EAPI Eina_Bool ewk_view_setting_allow_file_access_from_file_urls_get(const Evas_Object *o);
/**
* Gets the internal data of @a o.
*
* This is similar to evas_object_smart_data_get(), but additionally does type checking.
*
* @param o view object to get the internal data
*
* @return the internal data of @a o, or @c NULL on failure
*/
EAPI Ewk_View_Smart_Data *ewk_view_smart_data_get(const Evas_Object *o);
/**
* Process scrolls.
*
* @param priv the pointer to the private data of the view to process scrolls
*
* @note This is not for general use but just for subclasses that want
* to define their own backing store.
*/
EAPI void ewk_view_scrolls_process(Ewk_View_Smart_Data *sd);
/**
* Paints using given graphics context the given area.
*
* This uses viewport relative area and will also handle scrollbars
* and other extra elements. See ewk_view_paint_contents() for the
* alternative function.
*
* @param priv the pointer to the private data of the view to use as paint source
* @param cr the cairo context to use as paint destination, its state will
* be saved before operation and restored afterwards
* @param area viewport relative geometry to paint
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*
* @note This is an easy to use version, but internal structures are
* always created, then graphics context is clipped, then
* painted, restored and destroyed. This might not be optimum,
* so using @a Ewk_View_Paint_Context may be a better solutions
* for large number of operations.
*
* @see ewk_view_paint_contents()
* @see ewk_view_paint_context_paint()
*
* @note This is not for general use but just for subclasses that want
* to define their own backing store.
*/
EAPI Eina_Bool ewk_view_paint(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
/**
* Paints just contents using given graphics context the given area.
*
* This uses absolute coordinates for area and will just handle
* contents, no scrollbars or extras. See ewk_view_paint() for the
* alternative solution.
*
* @param priv the pointer to the private data of the view to use as paint source
* @param cr the cairo context to use as paint destination, its state will
* be saved before operation and restored afterwards
* @param area absolute geometry to paint
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*
* @note This is an easy to use version, but internal structures are
* always created, then graphics context is clipped, then
* painted, restored and destroyed. This might not be optimum,
* so using @a Ewk_View_Paint_Context may be a better solutions
* for large number of operations.
*
* @see ewk_view_paint()
* @see ewk_view_paint_context_paint_contents()
*
* @note This is not for general use but just for subclasses that want
* to define their own backing store.
*/
EAPI Eina_Bool ewk_view_paint_contents(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
/**
* Gets the attributes of the viewport meta tag.
*
* Properties are returned in the respective pointers. Passing @c NULL to any of
* these pointers will make that property to not be returned.
*
* @param o view object to get the viewport attributes
* @param w the pointer to store the width of the viewport
* @param h the pointer to store the height of the viewport
* @param init_scale the pointer to store the initial scale value
* @param max_scale the pointer to store the maximum scale value
* @param min_scale the pointer to store the minimum scale value
* @param device_pixel_ratio the pointer to store the device pixel ratio value
* @param user_scalable the pointer to store if user can scale viewport
*/
EAPI void ewk_view_viewport_attributes_get(const Evas_Object *o, int *w, int *h, float *init_scale, float *max_scale, float *min_scale, float *device_pixel_ratio , Eina_Bool *user_scalable);
/**
* Sets the zoom range.
*
* @param o view object to set the zoom range
* @param min_scale the minimum value of the zoom range
* @param max_scale the maximum value of the zoom range
*
* @return @c EINA_TRUE on success, @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_zoom_range_set(Evas_Object *o, float min_scale, float max_scale);
/**
* Gets the minimum value of the zoom range.
*
* @param o view object to get the minimum value of the zoom range
*
* @return the minimum value of the zoom range on success, or
* @c -1 on failure
*/
EAPI float ewk_view_zoom_range_min_get(const Evas_Object *o);
/**
* Gets the maximum value of the zoom range.
*
* @param o view object to get the maximum value of the zoom range
*
* @return the maximum value of the zoom range on success, or
* @c -1.0 on failure
*/
EAPI float ewk_view_zoom_range_max_get(const Evas_Object *o);
/**
* Enables/disables the zoom.
*
* @param o view to set zoom
* @param user_scalable @c EINA_TRUE to enable zoom, @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_user_scalable_set(Evas_Object *o, Eina_Bool user_scalable);
/**
* Queries if the zoom is enabled.
*
* @param o view to query if zoom is enabled
*
* @return @c EINA_TRUE if the zoom is enabled, @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_user_scalable_get(const Evas_Object *o);
/**
* Queries the ratio between the CSS units and device pixels when the content is unscaled.
*
* When designing touch-friendly contents, knowing the approximated target size on a device
* is important for contents providers in order to get the intented layout and element
* sizes.
*
* As most first generation touch devices had a PPI of approximately 160, this became a
* de-facto value, when used in conjunction with the viewport meta tag.
*
* Devices with a higher PPI learning towards 240 or 320, applies a pre-scaling on all
* content, of either 1.5 or 2.0, not affecting the CSS scale or pinch zooming.
*
* This value can be set using this property and it is exposed to CSS media queries using
* the -webkit-device-pixel-ratio query.
*
* For instance, if you want to load an image without having it upscaled on a web view
* using a device pixel ratio of 2.0 it can be done by loading an image of say 100x100
* pixels but showing it at half the size.
*
* @media (-webkit-min-device-pixel-ratio: 1.5) {
* .icon {
* width: 50px;
* height: 50px;
* url: "/images/icon@2x.png"; // This is actually a 100x100 image
* }
* }
*
* If the above is used on a device with device pixel ratio of 1.5, it will be scaled
* down but still provide a better looking image.
*
* @param o view object to get device pixel ratio
*
* @return the ratio between the CSS units and device pixels,
* or @c -1.0 on failure
*/
EAPI float ewk_view_device_pixel_ratio_get(const Evas_Object *o);
/**
* Sets the ratio between the CSS units and device pixels when the content is unscaled.
*
* @param o view object to set device pixel ratio
*
* @return @c EINA_TRUE if the device pixel ratio was set, @c EINA_FALSE otherwise
*
* @see ewk_view_device_pixel_ratio_get()
*/
EAPI Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object *o, float ratio);
/**
* Changes the text direction of the selected input node.
*
* @param o view object to set text direction.
* @param direction text direction.
*/
EAPI void ewk_view_text_direction_set(Evas_Object *o, Ewk_Text_Direction direction);
/**
* Sets the view mode.
*
* The view-mode media feature describes the mode in which the
* Web application is being shown as a running application.
*
* @param o view object to change the view mode
* @param view_mode page view mode to set
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
EAPI Eina_Bool ewk_view_mode_set(Evas_Object *o, Ewk_View_Mode view_mode);
/**
* Gets the view mode.
*
* @param o view object to get the view mode
*
* @return enum value of @a Ewk_View_Mode that indicates current view mode on success or
* EWK_VIEW_MODE_INVALID otherwise
*
* @see ewk_view_mode_set()
*/
EAPI Ewk_View_Mode ewk_view_mode_get(const Evas_Object *o);
/**
* Creates a JS object named @a obj_name as property of the window object. This should be called on a callback connectedto the
* js,windowobject,clear signal.
*
* @param o view.
* @param obj object that will be added(see: @a ewk_js_object_new).
* @param obj_name name of the object.
*
* @return @c EINA_TRUE if object was added, @c EINA_FALSE if not.
*/
EAPI Eina_Bool ewk_view_js_object_add(Evas_Object *o, Ewk_JS_Object *obj, const char *obj_name);
/// Defines the page visibility status.
enum _Ewk_Page_Visibility_State {
EWK_PAGE_VISIBILITY_STATE_VISIBLE,
EWK_PAGE_VISIBILITY_STATE_HIDDEN,
EWK_PAGE_VISIBILITY_STATE_PRERENDER,
EWK_PAGE_VISIBILITY_STATE_UNLOADED
};
/// Creates a type name for @a _Ewk_Page_Visibility_State.
typedef enum _Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
/**
* Sets the visibility state of the page.
*
* This function let WebKit knows the visibility status of the page.
* WebKit will save the current status, and fire a "visibilitychange"
* event which web application can listen. Web application could slow
* down or stop itself when it gets a "visibilitychange" event and its
* visibility state is hidden. If its visibility state is visible, then
* the web application could use more resources.
*
* This feature makes that web application could use the resources efficiently,
* such as power, CPU, and etc.
*
* If more detailed description is needed, please see the specification.
* (http://www.w3.org/TR/page-visibility)
*
* @param o view object to set the visibility state.
* @param page_visible_state the visible state of the page to set.
* @param initial_state @c EINA_TRUE if this function is called at page initialization time,
* @c EINA_FALSE otherwise.
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
*/
EAPI Eina_Bool ewk_view_visibility_state_set(Evas_Object *o, Ewk_Page_Visibility_State page_visible_state, Eina_Bool initial_state);
/**
* Gets the visibility state of the page.
*
* @param o view object
*
* @return enum value of @a Ewk_Page_Visibility_State that indicates current visibility status of the page.
*
* @see ewk_view_visibility_state_set()
*/
EAPI Ewk_Page_Visibility_State ewk_view_visibility_state_get(const Evas_Object *o);
/**
* Returns whether the view has displayed mixed content.
*
* When a view has displayed mixed content, any of its frames has loaded an HTTPS URI
* which has itself loaded and displayed a resource (such as an image) from an insecure,
* that is, non-HTTPS, URI.
*
* The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
*
* When one of the containing frames displays mixed content, the view emits the "mixedcontent,displayed" signal.
*
* @param o The view to query.
*
* @sa ewk_frame_mixed_content_displayed_get
*/
EAPI Eina_Bool ewk_view_mixed_content_displayed_get(const Evas_Object *o);
/**
* Returns whether the view has run mixed content.
*
* When a view has run mixed content, any of its frames has loaded an HTTPS URI
* which has itself loaded and run a resource (such as an image) from an insecure,
* that is, non-HTTPS, URI.
*
* The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
*
* When one of the containing frames runs mixed content, the view emits the "mixedcontent,run" signal.
*
* @param o The view to query.
*
* @sa ewk_frame_mixed_content_run_get
*/
EAPI Eina_Bool ewk_view_mixed_content_run_get(const Evas_Object *o);
/**
* Returns the SoupSession associated with this view.
*
* By default, all views share the same, default soup session also available
* by calling ewk_network_default_soup_session_get.
*
* @param o The view to query.
*
* @sa ewk_view_soup_session_set, ewk_network_default_soup_session_get
*/
EAPI SoupSession* ewk_view_soup_session_get(const Evas_Object *o);
/**
* Associates a new SoupSession with this view.
*
* Only sessions of type SoupSessionAsync are supported.
*
* @note Changing the SoupSession should not be needed in most cases. If
* a different SoupSession is used, the cookie management and some
* network functions in ewk will not have any effect on it.
*
* @param o The view to change.
* @param session The new SoupSession.
*
* @sa ewk_view_soup_session_get, ewk_network_default_soup_session_get
*/
EAPI void ewk_view_soup_session_set(Evas_Object *o, SoupSession *session);
/**
* Returns whether XSSAuditor feature is enabled.
*
* @param o view object to query whether XSSAuditor feature is enabled.
*
* @return @c EINA_TRUE if the XSSAuditor feature is enabled,
* @c EINA_FALSE if not or on failure.
*/
EAPI Eina_Bool ewk_view_setting_enable_xss_auditor_get(const Evas_Object *o);
/**
* Enables/disables the XSSAuditor feature.
*
* The XSSAuditor (cross-site scripting protection) feature provides protection
* from reflected XSS attacks on vulnerable web sites. When XSS is encountered
* in the page, frame sends a signal "xss,detected" with additional information
* on whether the entire page was blocked or only injected scripts were removed.
* This feature is enabled by default.
*
* @param o view object to set the XSSAuditor feature.
* @param enable @c EINA_TRUE to enable the XSSAuditor feature,
* @c EINA_FALSE to disable.
*/
EAPI void ewk_view_setting_enable_xss_auditor_set(Evas_Object *o, Eina_Bool enable);
/**
* Returns whether video captions display feature is enabled.
*
* Video captions display is disabled by default.
*
* @param o view object to query whether video captions display feature is enabled.
*
* @return @c EINA_TRUE if the video captions display feature is enabled,
* @c EINA_FALSE if not or on failure.
*/
EAPI Eina_Bool ewk_view_setting_should_display_captions_get(const Evas_Object *o);
/**
* Enables/disables the video captions display feature.
*
* The video captions display feature is part of track support for HTML5 video.
*
* @param o view object to set the video captions display feature.
* @param enable @c EINA_TRUE to enable the video captions display feature,
* @c EINA_FALSE to disable.
*/
EAPI void ewk_view_setting_should_display_captions_set(Evas_Object *o, Eina_Bool enable);
/**
* Returns whether video subtitles display feature is enabled.
*
* Video subtitles display is disabled by default.
*
* @param o view object to query whether video subtitles display feature is enabled.
*
* @return @c EINA_TRUE if the video subtitles display feature is enabled,
* @c EINA_FALSE if not or on failure.
*/
EAPI Eina_Bool ewk_view_setting_should_display_subtitles_get(const Evas_Object *o);
/**
* Enables/disables the video subtitles display feature.
*
* The video subtitles display feature is part of track support for HTML5 video.
*
* @param o view object to set the video subtitles display feature.
* @param enable @c EINA_TRUE to enable the video subtitles display feature,
* @c EINA_FALSE to disable.
*/
EAPI void ewk_view_setting_should_display_subtitles_set(Evas_Object *o, Eina_Bool enable);
/**
* Returns whether video text descriptions display feature is enabled.
*
* Video text descriptions display is disabled by default.
*
* @param o view object to query whether video text descriptions display feature is enabled.
*
* @return @c EINA_TRUE if the video text descriptions display feature is enabled,
* @c EINA_FALSE if not or on failure.
*/
EAPI Eina_Bool ewk_view_setting_should_display_text_descriptions_get(const Evas_Object *o);
/**
* Enables/disables the video text descriptions display feature.
*
* The video text descriptions display feature is part of track support for HTML5 video.
*
* @param o view object to set the video text descriptions display feature.
* @param enable @c EINA_TRUE to enable the video text descriptions display feature,
* @c EINA_FALSE to disable.
*/
EAPI void ewk_view_setting_should_display_text_descriptions_set(Evas_Object *o, Eina_Bool enable);
/**
* Show the inspector to debug a web page.
*
* The following signals are emiited.
* "inspector,view,create" and "inspector,view,close"
* The first one will be called to request the view for inspector on view that will be inspected.
* This callback should create the view for inspector and set the view with ewk_view_inspector_view_set().
* The second one will be called to close the view for inspector on view having the inspector after disconnecting frontend
* This callback should remove the view for inspector.
*
* When the view having the inspector is removed,
* please emit the "inspector,view,destroy" signal on view for inspector.
*
* @param o The view to show the inspector.
*
* @see ewk_view_inspector_close()
* @see ewk_view_inspector_view_set()
*/
EAPI void ewk_view_inspector_show(const Evas_Object *o);
/**
* Close the inspector view
*
* @param o The view to close the inspector.
*
* @see ewk_view_inspector_show()
* @see ewk_view_inspector_view_get()
*/
EAPI void ewk_view_inspector_close(const Evas_Object *o);
/**
* Get the view of inspector.
*
* @param o The view that is inspected.
*
* @return view object on success or @c NULL on failure
*/
EAPI Evas_Object* ewk_view_inspector_view_get(const Evas_Object *o);
/**
* Set the view of inspector.
*
* @param o The view that is inspected.
* @param inspector_view The view of inspector.
*/
EAPI void ewk_view_inspector_view_set(Evas_Object *o, Evas_Object *inspector_view);
/**
* Enables/disables the fullscreen mode by javascript fullscreen API.
* The javascript API allows to request full screen mode, for more information see:
* http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
*
* Default value for javascript fullscreen API setting is @c EINA_TRUE.
*
* @param o view object to enable javascript fullscreen API
* @param enable @c EINA_TRUE to enable javascript fullscreen API or
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_fullscreen_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the fullscreen mode is enabled.
*
* @param o view object to query whether javascript fullscreen API is enabled
*
* @return @c EINA_TRUE if the javascript fullscreen API is enabled
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_enable_fullscreen_get(const Evas_Object *o);
/**
* Enables/disables the WebCore's tiled backing store.
*
* @param o view object
* @oaram enable Enable or Disable WebCore's tiled backing store for given View
*
* @return true on success, or false on failure
*
* @note this is not for general use. It should be used for single view only.
*/
EAPI Eina_Bool ewk_view_setting_tiled_backing_store_enabled_set(Evas_Object *o, Eina_Bool enable);
/**
* Queries if the WebCore's tiled backing store is enabled.
*
* @param o view object to query
*
* @return @c EINA_TRUE if the WebCore's tiled backing store is enabled
* @c EINA_FALSE if not or on failure
*/
EAPI Eina_Bool ewk_view_setting_tiled_backing_store_enabled_get(Evas_Object *o);
/**
* Gets the context menu object.
* @param o The view that contains context menu.
*
* @return context menu structure on success or @c NULL on failure
*/
EAPI Ewk_Context_Menu *ewk_view_context_menu_get(const Evas_Object *o);
#ifdef __cplusplus
}
#endif
#endif // ewk_view_h
|