1 module webkit2.Settings; 2 3 private import glib.ConstructionException; 4 private import glib.Str; 5 private import gobject.ObjectG; 6 private import webkit2.c.functions; 7 public import webkit2.c.types; 8 9 10 /** 11 * #WebKitSettings can be applied to a #WebKitWebView to control text charset, 12 * color, font sizes, printing mode, script support, loading of images and various 13 * other things on a #WebKitWebView. After creation, a #WebKitSettings object 14 * contains default settings. 15 * 16 * <informalexample><programlisting> 17 * /<!-- -->* Disable JavaScript. *<!-- -->/ 18 * WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group); 19 * webkit_settings_set_enable_javascript (settings, FALSE); 20 * 21 * </programlisting></informalexample> 22 */ 23 public class Settings : ObjectG 24 { 25 /** the main Gtk struct */ 26 protected WebKitSettings* webKitSettings; 27 28 /** Get the main Gtk struct */ 29 public WebKitSettings* getSettingsStruct(bool transferOwnership = false) 30 { 31 if (transferOwnership) 32 ownedRef = false; 33 return webKitSettings; 34 } 35 36 /** the main Gtk struct as a void* */ 37 protected override void* getStruct() 38 { 39 return cast(void*)webKitSettings; 40 } 41 42 /** 43 * Sets our main struct and passes it to the parent class. 44 */ 45 public this (WebKitSettings* webKitSettings, bool ownedRef = false) 46 { 47 this.webKitSettings = webKitSettings; 48 super(cast(GObject*)webKitSettings, ownedRef); 49 } 50 51 52 /** */ 53 public static GType getType() 54 { 55 return webkit_settings_get_type(); 56 } 57 58 /** 59 * Creates a new #WebKitSettings instance with default values. It must 60 * be manually attached to a #WebKitWebView. 61 * See also webkit_settings_new_with_settings(). 62 * 63 * Returns: a new #WebKitSettings instance. 64 * 65 * Throws: ConstructionException GTK+ fails to create the object. 66 */ 67 public this() 68 { 69 auto __p = webkit_settings_new(); 70 71 if(__p is null) 72 { 73 throw new ConstructionException("null returned by new"); 74 } 75 76 this(cast(WebKitSettings*) __p, true); 77 } 78 79 /** 80 * Convert @points to the equivalent value in pixels, based on the current 81 * screen DPI. Applications can use this function to convert font size values 82 * in points to font size values in pixels when setting the font size properties 83 * of #WebKitSettings. 84 * 85 * Params: 86 * points = the font size in points to convert to pixels 87 * 88 * Returns: the equivalent font size in pixels. 89 * 90 * Since: 2.20 91 */ 92 public static uint fontSizeToPixels(uint points) 93 { 94 return webkit_settings_font_size_to_pixels(points); 95 } 96 97 /** 98 * Convert @pixels to the equivalent value in points, based on the current 99 * screen DPI. Applications can use this function to convert font size values 100 * in pixels to font size values in points when getting the font size properties 101 * of #WebKitSettings. 102 * 103 * Params: 104 * pixels = the font size in pixels to convert to points 105 * 106 * Returns: the equivalent font size in points. 107 * 108 * Since: 2.20 109 */ 110 public static uint fontSizeToPoints(uint pixels) 111 { 112 return webkit_settings_font_size_to_points(pixels); 113 } 114 115 /** 116 * Get the #WebKitSettings:allow-file-access-from-file-urls property. 117 * 118 * Returns: %TRUE If file access from file URLs is allowed or %FALSE otherwise. 119 * 120 * Since: 2.10 121 */ 122 public bool getAllowFileAccessFromFileUrls() 123 { 124 return webkit_settings_get_allow_file_access_from_file_urls(webKitSettings) != 0; 125 } 126 127 /** 128 * Get the #WebKitSettings:allow-modal-dialogs property. 129 * 130 * Returns: %TRUE if it's allowed to create and run modal dialogs or %FALSE otherwise. 131 */ 132 public bool getAllowModalDialogs() 133 { 134 return webkit_settings_get_allow_modal_dialogs(webKitSettings) != 0; 135 } 136 137 /** 138 * Get the #WebKitSettings:allow-top-navigation-to-data-urls property. 139 * 140 * Returns: %TRUE If navigation to data URLs from the top frame is allowed or %FALSE\ 141 * otherwise. 142 * 143 * Since: 2.28 144 */ 145 public bool getAllowTopNavigationToDataUrls() 146 { 147 return webkit_settings_get_allow_top_navigation_to_data_urls(webKitSettings) != 0; 148 } 149 150 /** 151 * Get the #WebKitSettings:allow-universal-access-from-file-urls property. 152 * 153 * Returns: %TRUE If universal access from file URLs is allowed or %FALSE otherwise. 154 * 155 * Since: 2.14 156 */ 157 public bool getAllowUniversalAccessFromFileUrls() 158 { 159 return webkit_settings_get_allow_universal_access_from_file_urls(webKitSettings) != 0; 160 } 161 162 /** 163 * Get the #WebKitSettings:auto-load-images property. 164 * 165 * Returns: %TRUE If auto loading of images is enabled or %FALSE otherwise. 166 */ 167 public bool getAutoLoadImages() 168 { 169 return webkit_settings_get_auto_load_images(webKitSettings) != 0; 170 } 171 172 /** 173 * Gets the #WebKitSettings:cursive-font-family property. 174 * 175 * Returns: The default font family used to display content marked with cursive font. 176 */ 177 public string getCursiveFontFamily() 178 { 179 return Str.toString(webkit_settings_get_cursive_font_family(webKitSettings)); 180 } 181 182 /** 183 * Gets the #WebKitSettings:default-charset property. 184 * 185 * Returns: Default charset. 186 */ 187 public string getDefaultCharset() 188 { 189 return Str.toString(webkit_settings_get_default_charset(webKitSettings)); 190 } 191 192 /** */ 193 public string getDefaultFontFamily() 194 { 195 return Str.toString(webkit_settings_get_default_font_family(webKitSettings)); 196 } 197 198 /** 199 * Gets the #WebKitSettings:default-font-size property. 200 * 201 * Returns: The default font size, in pixels. 202 */ 203 public uint getDefaultFontSize() 204 { 205 return webkit_settings_get_default_font_size(webKitSettings); 206 } 207 208 /** 209 * Gets the #WebKitSettings:default-monospace-font-size property. 210 * 211 * Returns: Default monospace font size, in pixels. 212 */ 213 public uint getDefaultMonospaceFontSize() 214 { 215 return webkit_settings_get_default_monospace_font_size(webKitSettings); 216 } 217 218 /** 219 * Get the #WebKitSettings:draw-compositing-indicators property. 220 * 221 * Returns: %TRUE If compositing borders are drawn or %FALSE otherwise. 222 */ 223 public bool getDrawCompositingIndicators() 224 { 225 return webkit_settings_get_draw_compositing_indicators(webKitSettings) != 0; 226 } 227 228 /** 229 * Get the #WebKitSettings:enable-accelerated-2d-canvas property. 230 * 231 * Returns: %TRUE if accelerated 2D canvas is enabled or %FALSE otherwise. 232 * 233 * Since: 2.2 234 */ 235 public bool getEnableAccelerated2dCanvas() 236 { 237 return webkit_settings_get_enable_accelerated_2d_canvas(webKitSettings) != 0; 238 } 239 240 /** 241 * Get the #WebKitSettings:enable-back-forward-navigation-gestures property. 242 * 243 * Returns: %TRUE if horizontal swipe gesture will trigger back-forward navigaiton or %FALSE otherwise. 244 * 245 * Since: 2.24 246 */ 247 public bool getEnableBackForwardNavigationGestures() 248 { 249 return webkit_settings_get_enable_back_forward_navigation_gestures(webKitSettings) != 0; 250 } 251 252 /** 253 * Get the #WebKitSettings:enable-caret-browsing property. 254 * 255 * Returns: %TRUE If caret browsing is enabled or %FALSE otherwise. 256 */ 257 public bool getEnableCaretBrowsing() 258 { 259 return webkit_settings_get_enable_caret_browsing(webKitSettings) != 0; 260 } 261 262 /** 263 * Get the #WebKitSettings:enable-developer-extras property. 264 * 265 * Returns: %TRUE If developer extras is enabled or %FALSE otherwise. 266 */ 267 public bool getEnableDeveloperExtras() 268 { 269 return webkit_settings_get_enable_developer_extras(webKitSettings) != 0; 270 } 271 272 /** 273 * Get the #WebKitSettings:enable-dns-prefetching property. 274 * 275 * Returns: %TRUE If DNS prefetching is enabled or %FALSE otherwise. 276 */ 277 public bool getEnableDnsPrefetching() 278 { 279 return webkit_settings_get_enable_dns_prefetching(webKitSettings) != 0; 280 } 281 282 /** 283 * Get the #WebKitSettings:enable-encrypted-media property. 284 * 285 * Returns: %TRUE if EncryptedMedia support is enabled or %FALSE otherwise. 286 * 287 * Since: 2.20 288 */ 289 public bool getEnableEncryptedMedia() 290 { 291 return webkit_settings_get_enable_encrypted_media(webKitSettings) != 0; 292 } 293 294 /** 295 * Get the #WebKitSettings:enable-frame-flattening property. 296 * 297 * Returns: %TRUE If frame flattening is enabled or %FALSE otherwise. 298 */ 299 public bool getEnableFrameFlattening() 300 { 301 return webkit_settings_get_enable_frame_flattening(webKitSettings) != 0; 302 } 303 304 /** 305 * Get the #WebKitSettings:enable-fullscreen property. 306 * 307 * Returns: %TRUE If fullscreen support is enabled or %FALSE otherwise. 308 */ 309 public bool getEnableFullscreen() 310 { 311 return webkit_settings_get_enable_fullscreen(webKitSettings) != 0; 312 } 313 314 /** 315 * Get the #WebKitSettings:enable-html5-database property. 316 * 317 * Returns: %TRUE if IndexedDB support is enabled or %FALSE otherwise. 318 */ 319 public bool getEnableHtml5Database() 320 { 321 return webkit_settings_get_enable_html5_database(webKitSettings) != 0; 322 } 323 324 /** 325 * Get the #WebKitSettings:enable-html5-local-storage property. 326 * 327 * Returns: %TRUE If HTML5 local storage support is enabled or %FALSE otherwise. 328 */ 329 public bool getEnableHtml5LocalStorage() 330 { 331 return webkit_settings_get_enable_html5_local_storage(webKitSettings) != 0; 332 } 333 334 /** 335 * Get the #WebKitSettings:enable-hyperlink-auditing property. 336 * 337 * Returns: %TRUE If hyper link auditing is enabled or %FALSE otherwise. 338 */ 339 public bool getEnableHyperlinkAuditing() 340 { 341 return webkit_settings_get_enable_hyperlink_auditing(webKitSettings) != 0; 342 } 343 344 /** 345 * Get the #WebKitSettings:enable-java property. 346 * 347 * Returns: %TRUE If Java is enabled or %FALSE otherwise. 348 */ 349 public bool getEnableJava() 350 { 351 return webkit_settings_get_enable_java(webKitSettings) != 0; 352 } 353 354 /** 355 * Get the #WebKitSettings:enable-javascript property. 356 * 357 * Returns: %TRUE If JavaScript is enabled or %FALSE otherwise. 358 */ 359 public bool getEnableJavascript() 360 { 361 return webkit_settings_get_enable_javascript(webKitSettings) != 0; 362 } 363 364 /** 365 * Get the #WebKitSettings:enable-javascript-markup property. 366 * 367 * Returns: %TRUE if JavaScript markup is enabled or %FALSE otherwise. 368 * 369 * Since: 2.24 370 */ 371 public bool getEnableJavascriptMarkup() 372 { 373 return webkit_settings_get_enable_javascript_markup(webKitSettings) != 0; 374 } 375 376 /** 377 * Get the #WebKitSettings:enable-media property. 378 * 379 * Returns: %TRUE if media support is enabled or %FALSE otherwise. 380 * 381 * Since: 2.26 382 */ 383 public bool getEnableMedia() 384 { 385 return webkit_settings_get_enable_media(webKitSettings) != 0; 386 } 387 388 /** 389 * Get the #WebKitSettings:enable-media-capabilities property. 390 * 391 * Returns: %TRUE if MediaCapabilities support is enabled or %FALSE otherwise. 392 * 393 * Since: 2.22 394 */ 395 public bool getEnableMediaCapabilities() 396 { 397 return webkit_settings_get_enable_media_capabilities(webKitSettings) != 0; 398 } 399 400 /** 401 * Get the #WebKitSettings:enable-media-stream property. 402 * 403 * Returns: %TRUE If mediastream support is enabled or %FALSE otherwise. 404 * 405 * Since: 2.4 406 */ 407 public bool getEnableMediaStream() 408 { 409 return webkit_settings_get_enable_media_stream(webKitSettings) != 0; 410 } 411 412 /** 413 * Get the #WebKitSettings:enable-mediasource property. 414 * 415 * Returns: %TRUE If MediaSource support is enabled or %FALSE otherwise. 416 * 417 * Since: 2.4 418 */ 419 public bool getEnableMediasource() 420 { 421 return webkit_settings_get_enable_mediasource(webKitSettings) != 0; 422 } 423 424 /** 425 * Get the #WebKitSettings:enable-mock-capture-devices property. 426 * 427 * Returns: %TRUE If mock capture devices is enabled or %FALSE otherwise. 428 * 429 * Since: 2.24 430 */ 431 public bool getEnableMockCaptureDevices() 432 { 433 return webkit_settings_get_enable_mock_capture_devices(webKitSettings) != 0; 434 } 435 436 /** 437 * Get the #WebKitSettings:enable-offline-web-application-cache property. 438 * 439 * Returns: %TRUE If HTML5 offline web application cache support is enabled or %FALSE otherwise. 440 */ 441 public bool getEnableOfflineWebApplicationCache() 442 { 443 return webkit_settings_get_enable_offline_web_application_cache(webKitSettings) != 0; 444 } 445 446 /** 447 * Get the #WebKitSettings:enable-page-cache property. 448 * 449 * Returns: %TRUE if page cache enabled or %FALSE otherwise. 450 */ 451 public bool getEnablePageCache() 452 { 453 return webkit_settings_get_enable_page_cache(webKitSettings) != 0; 454 } 455 456 /** 457 * Get the #WebKitSettings:enable-plugins property. 458 * 459 * Returns: %TRUE If plugins are enabled or %FALSE otherwise. 460 */ 461 public bool getEnablePlugins() 462 { 463 return webkit_settings_get_enable_plugins(webKitSettings) != 0; 464 } 465 466 /** 467 * Get the #WebKitSettings:enable-private-browsing property. 468 * 469 * Deprecated: Use #WebKitWebView:is-ephemeral or #WebKitWebContext:is-ephemeral instead. 470 * 471 * Returns: %TRUE If private browsing is enabled or %FALSE otherwise. 472 */ 473 public bool getEnablePrivateBrowsing() 474 { 475 return webkit_settings_get_enable_private_browsing(webKitSettings) != 0; 476 } 477 478 /** 479 * Get the #WebKitSettings:enable-resizable-text-areas property. 480 * 481 * Returns: %TRUE If text areas can be resized or %FALSE otherwise. 482 */ 483 public bool getEnableResizableTextAreas() 484 { 485 return webkit_settings_get_enable_resizable_text_areas(webKitSettings) != 0; 486 } 487 488 /** 489 * Get the #WebKitSettings:enable-site-specific-quirks property. 490 * 491 * Returns: %TRUE if site specific quirks are enabled or %FALSE otherwise. 492 */ 493 public bool getEnableSiteSpecificQuirks() 494 { 495 return webkit_settings_get_enable_site_specific_quirks(webKitSettings) != 0; 496 } 497 498 /** 499 * Get the #WebKitSettings:enable-smooth-scrolling property. 500 * 501 * Returns: %TRUE if smooth scrolling is enabled or %FALSE otherwise. 502 */ 503 public bool getEnableSmoothScrolling() 504 { 505 return webkit_settings_get_enable_smooth_scrolling(webKitSettings) != 0; 506 } 507 508 /** 509 * Get the #WebKitSettings:enable-spatial-navigation property. 510 * 511 * Returns: %TRUE If HTML5 spatial navigation support is enabled or %FALSE otherwise. 512 * 513 * Since: 2.2 514 */ 515 public bool getEnableSpatialNavigation() 516 { 517 return webkit_settings_get_enable_spatial_navigation(webKitSettings) != 0; 518 } 519 520 /** 521 * Get the #WebKitSettings:enable-tabs-to-links property. 522 * 523 * Returns: %TRUE If tabs to link is enabled or %FALSE otherwise. 524 */ 525 public bool getEnableTabsToLinks() 526 { 527 return webkit_settings_get_enable_tabs_to_links(webKitSettings) != 0; 528 } 529 530 /** 531 * Get the #WebKitSettings:enable-webaudio property. 532 * 533 * Returns: %TRUE If webaudio support is enabled or %FALSE otherwise. 534 */ 535 public bool getEnableWebaudio() 536 { 537 return webkit_settings_get_enable_webaudio(webKitSettings) != 0; 538 } 539 540 /** 541 * Get the #WebKitSettings:enable-webgl property. 542 * 543 * Returns: %TRUE If WebGL support is enabled or %FALSE otherwise. 544 */ 545 public bool getEnableWebgl() 546 { 547 return webkit_settings_get_enable_webgl(webKitSettings) != 0; 548 } 549 550 /** 551 * Get the #WebKitSettings:enable-write-console-messages-to-stdout property. 552 * 553 * Returns: %TRUE if writing console messages to stdout is enabled or %FALSE 554 * otherwise. 555 * 556 * Since: 2.2 557 */ 558 public bool getEnableWriteConsoleMessagesToStdout() 559 { 560 return webkit_settings_get_enable_write_console_messages_to_stdout(webKitSettings) != 0; 561 } 562 563 /** 564 * Get the #WebKitSettings:enable-xss-auditor property. 565 * 566 * Returns: %TRUE If XSS auditing is enabled or %FALSE otherwise. 567 */ 568 public bool getEnableXssAuditor() 569 { 570 return webkit_settings_get_enable_xss_auditor(webKitSettings) != 0; 571 } 572 573 /** 574 * Gets the #WebKitSettings:fantasy-font-family property. 575 * 576 * Returns: The default font family used to display content marked with fantasy font. 577 */ 578 public string getFantasyFontFamily() 579 { 580 return Str.toString(webkit_settings_get_fantasy_font_family(webKitSettings)); 581 } 582 583 /** 584 * Get the #WebKitSettings:hardware-acceleration-policy property. 585 * 586 * Returns: a #WebKitHardwareAccelerationPolicy 587 * 588 * Since: 2.16 589 */ 590 public WebKitHardwareAccelerationPolicy getHardwareAccelerationPolicy() 591 { 592 return webkit_settings_get_hardware_acceleration_policy(webKitSettings); 593 } 594 595 /** 596 * Get the #WebKitSettings:javascript-can-access-clipboard property. 597 * 598 * Returns: %TRUE If javascript-can-access-clipboard is enabled or %FALSE otherwise. 599 */ 600 public bool getJavascriptCanAccessClipboard() 601 { 602 return webkit_settings_get_javascript_can_access_clipboard(webKitSettings) != 0; 603 } 604 605 /** 606 * Get the #WebKitSettings:javascript-can-open-windows-automatically property. 607 * 608 * Returns: %TRUE If JavaScript can open window automatically or %FALSE otherwise. 609 */ 610 public bool getJavascriptCanOpenWindowsAutomatically() 611 { 612 return webkit_settings_get_javascript_can_open_windows_automatically(webKitSettings) != 0; 613 } 614 615 /** 616 * Get the #WebKitSettings:load-icons-ignoring-image-load-setting property. 617 * 618 * Returns: %TRUE If site icon can be loaded irrespective of image loading preference or %FALSE otherwise. 619 */ 620 public bool getLoadIconsIgnoringImageLoadSetting() 621 { 622 return webkit_settings_get_load_icons_ignoring_image_load_setting(webKitSettings) != 0; 623 } 624 625 /** 626 * Gets the #WebKitSettings:media-content-types-requiring-hardware-support property. 627 * 628 * Returns: Media content types requiring hardware support, or %NULL. 629 * 630 * Since: 2.30 631 */ 632 public string getMediaContentTypesRequiringHardwareSupport() 633 { 634 return Str.toString(webkit_settings_get_media_content_types_requiring_hardware_support(webKitSettings)); 635 } 636 637 /** 638 * Get the #WebKitSettings:media-playback-allows-inline property. 639 * 640 * Returns: %TRUE If inline playback is allowed for media 641 * or %FALSE if only fullscreen playback is allowed. 642 */ 643 public bool getMediaPlaybackAllowsInline() 644 { 645 return webkit_settings_get_media_playback_allows_inline(webKitSettings) != 0; 646 } 647 648 /** 649 * Get the #WebKitSettings:media-playback-requires-user-gesture property. 650 * 651 * Returns: %TRUE If an user gesture is needed to play or load media 652 * or %FALSE if no user gesture is needed. 653 */ 654 public bool getMediaPlaybackRequiresUserGesture() 655 { 656 return webkit_settings_get_media_playback_requires_user_gesture(webKitSettings) != 0; 657 } 658 659 /** 660 * Gets the #WebKitSettings:minimum-font-size property. 661 * 662 * Returns: Minimum font size, in pixels. 663 */ 664 public uint getMinimumFontSize() 665 { 666 return webkit_settings_get_minimum_font_size(webKitSettings); 667 } 668 669 /** 670 * Gets the #WebKitSettings:monospace-font-family property. 671 * 672 * Returns: Default font family used to display content marked with monospace font. 673 */ 674 public string getMonospaceFontFamily() 675 { 676 return Str.toString(webkit_settings_get_monospace_font_family(webKitSettings)); 677 } 678 679 /** 680 * Gets the #WebKitSettings:pictograph-font-family property. 681 * 682 * Returns: The default font family used to display content marked with pictograph font. 683 */ 684 public string getPictographFontFamily() 685 { 686 return Str.toString(webkit_settings_get_pictograph_font_family(webKitSettings)); 687 } 688 689 /** 690 * Get the #WebKitSettings:print-backgrounds property. 691 * 692 * Returns: %TRUE If background images should be printed or %FALSE otherwise. 693 */ 694 public bool getPrintBackgrounds() 695 { 696 return webkit_settings_get_print_backgrounds(webKitSettings) != 0; 697 } 698 699 /** 700 * Gets the #WebKitSettings:sans-serif-font-family property. 701 * 702 * Returns: The default font family used to display content marked with sans-serif font. 703 */ 704 public string getSansSerifFontFamily() 705 { 706 return Str.toString(webkit_settings_get_sans_serif_font_family(webKitSettings)); 707 } 708 709 /** 710 * Gets the #WebKitSettings:serif-font-family property. 711 * 712 * Returns: The default font family used to display content marked with serif font. 713 */ 714 public string getSerifFontFamily() 715 { 716 return Str.toString(webkit_settings_get_serif_font_family(webKitSettings)); 717 } 718 719 /** 720 * Get the #WebKitSettings:user-agent property. 721 * 722 * Returns: The current value of the user-agent property. 723 */ 724 public string getUserAgent() 725 { 726 return Str.toString(webkit_settings_get_user_agent(webKitSettings)); 727 } 728 729 /** 730 * Get the #WebKitSettings:zoom-text-only property. 731 * 732 * Returns: %TRUE If zoom level of the view should only affect the text 733 * or %FALSE if all view contents should be scaled. 734 */ 735 public bool getZoomTextOnly() 736 { 737 return webkit_settings_get_zoom_text_only(webKitSettings) != 0; 738 } 739 740 /** 741 * Set the #WebKitSettings:allow-file-access-from-file-urls property. 742 * 743 * Params: 744 * allowed = Value to be set 745 * 746 * Since: 2.10 747 */ 748 public void setAllowFileAccessFromFileUrls(bool allowed) 749 { 750 webkit_settings_set_allow_file_access_from_file_urls(webKitSettings, allowed); 751 } 752 753 /** 754 * Set the #WebKitSettings:allow-modal-dialogs property. 755 * 756 * Params: 757 * allowed = Value to be set 758 */ 759 public void setAllowModalDialogs(bool allowed) 760 { 761 webkit_settings_set_allow_modal_dialogs(webKitSettings, allowed); 762 } 763 764 /** 765 * Set the #WebKitSettings:allow-top-navigation-to-data-urls property. 766 * 767 * Params: 768 * allowed = Value to be set 769 * 770 * Since: 2.28 771 */ 772 public void setAllowTopNavigationToDataUrls(bool allowed) 773 { 774 webkit_settings_set_allow_top_navigation_to_data_urls(webKitSettings, allowed); 775 } 776 777 /** 778 * Set the #WebKitSettings:allow-universal-access-from-file-urls property. 779 * 780 * Params: 781 * allowed = Value to be set 782 * 783 * Since: 2.14 784 */ 785 public void setAllowUniversalAccessFromFileUrls(bool allowed) 786 { 787 webkit_settings_set_allow_universal_access_from_file_urls(webKitSettings, allowed); 788 } 789 790 /** 791 * Set the #WebKitSettings:auto-load-images property. 792 * 793 * Params: 794 * enabled = Value to be set 795 */ 796 public void setAutoLoadImages(bool enabled) 797 { 798 webkit_settings_set_auto_load_images(webKitSettings, enabled); 799 } 800 801 /** 802 * Set the #WebKitSettings:cursive-font-family property. 803 * 804 * Params: 805 * cursiveFontFamily = the new default cursive font family 806 */ 807 public void setCursiveFontFamily(string cursiveFontFamily) 808 { 809 webkit_settings_set_cursive_font_family(webKitSettings, Str.toStringz(cursiveFontFamily)); 810 } 811 812 /** 813 * Set the #WebKitSettings:default-charset property. 814 * 815 * Params: 816 * defaultCharset = default charset to be set 817 */ 818 public void setDefaultCharset(string defaultCharset) 819 { 820 webkit_settings_set_default_charset(webKitSettings, Str.toStringz(defaultCharset)); 821 } 822 823 /** 824 * Set the #WebKitSettings:default-font-family property. 825 * 826 * Params: 827 * defaultFontFamily = the new default font family 828 */ 829 public void setDefaultFontFamily(string defaultFontFamily) 830 { 831 webkit_settings_set_default_font_family(webKitSettings, Str.toStringz(defaultFontFamily)); 832 } 833 834 /** 835 * Set the #WebKitSettings:default-font-size property. 836 * 837 * Params: 838 * fontSize = default font size to be set in pixels 839 */ 840 public void setDefaultFontSize(uint fontSize) 841 { 842 webkit_settings_set_default_font_size(webKitSettings, fontSize); 843 } 844 845 /** 846 * Set the #WebKitSettings:default-monospace-font-size property. 847 * 848 * Params: 849 * fontSize = default monospace font size to be set in pixels 850 */ 851 public void setDefaultMonospaceFontSize(uint fontSize) 852 { 853 webkit_settings_set_default_monospace_font_size(webKitSettings, fontSize); 854 } 855 856 /** 857 * Set the #WebKitSettings:draw-compositing-indicators property. 858 * 859 * Params: 860 * enabled = Value to be set 861 */ 862 public void setDrawCompositingIndicators(bool enabled) 863 { 864 webkit_settings_set_draw_compositing_indicators(webKitSettings, enabled); 865 } 866 867 /** 868 * Set the #WebKitSettings:enable-accelerated-2d-canvas property. 869 * 870 * Params: 871 * enabled = Value to be set 872 * 873 * Since: 2.2 874 */ 875 public void setEnableAccelerated2dCanvas(bool enabled) 876 { 877 webkit_settings_set_enable_accelerated_2d_canvas(webKitSettings, enabled); 878 } 879 880 /** 881 * Set the #WebKitSettings:enable-back-forward-navigation-gestures property. 882 * 883 * Params: 884 * enabled = value to be set 885 * 886 * Since: 2.24 887 */ 888 public void setEnableBackForwardNavigationGestures(bool enabled) 889 { 890 webkit_settings_set_enable_back_forward_navigation_gestures(webKitSettings, enabled); 891 } 892 893 /** 894 * Set the #WebKitSettings:enable-caret-browsing property. 895 * 896 * Params: 897 * enabled = Value to be set 898 */ 899 public void setEnableCaretBrowsing(bool enabled) 900 { 901 webkit_settings_set_enable_caret_browsing(webKitSettings, enabled); 902 } 903 904 /** 905 * Set the #WebKitSettings:enable-developer-extras property. 906 * 907 * Params: 908 * enabled = Value to be set 909 */ 910 public void setEnableDeveloperExtras(bool enabled) 911 { 912 webkit_settings_set_enable_developer_extras(webKitSettings, enabled); 913 } 914 915 /** 916 * Set the #WebKitSettings:enable-dns-prefetching property. 917 * 918 * Params: 919 * enabled = Value to be set 920 */ 921 public void setEnableDnsPrefetching(bool enabled) 922 { 923 webkit_settings_set_enable_dns_prefetching(webKitSettings, enabled); 924 } 925 926 /** 927 * Set the #WebKitSettings:enable-encrypted-media property. 928 * 929 * Params: 930 * enabled = Value to be set 931 * 932 * Since: 2.20 933 */ 934 public void setEnableEncryptedMedia(bool enabled) 935 { 936 webkit_settings_set_enable_encrypted_media(webKitSettings, enabled); 937 } 938 939 /** 940 * Set the #WebKitSettings:enable-frame-flattening property. 941 * 942 * Params: 943 * enabled = Value to be set 944 */ 945 public void setEnableFrameFlattening(bool enabled) 946 { 947 webkit_settings_set_enable_frame_flattening(webKitSettings, enabled); 948 } 949 950 /** 951 * Set the #WebKitSettings:enable-fullscreen property. 952 * 953 * Params: 954 * enabled = Value to be set 955 */ 956 public void setEnableFullscreen(bool enabled) 957 { 958 webkit_settings_set_enable_fullscreen(webKitSettings, enabled); 959 } 960 961 /** 962 * Set the #WebKitSettings:enable-html5-database property. 963 * 964 * Params: 965 * enabled = Value to be set 966 */ 967 public void setEnableHtml5Database(bool enabled) 968 { 969 webkit_settings_set_enable_html5_database(webKitSettings, enabled); 970 } 971 972 /** 973 * Set the #WebKitSettings:enable-html5-local-storage property. 974 * 975 * Params: 976 * enabled = Value to be set 977 */ 978 public void setEnableHtml5LocalStorage(bool enabled) 979 { 980 webkit_settings_set_enable_html5_local_storage(webKitSettings, enabled); 981 } 982 983 /** 984 * Set the #WebKitSettings:enable-hyperlink-auditing property. 985 * 986 * Params: 987 * enabled = Value to be set 988 */ 989 public void setEnableHyperlinkAuditing(bool enabled) 990 { 991 webkit_settings_set_enable_hyperlink_auditing(webKitSettings, enabled); 992 } 993 994 /** 995 * Set the #WebKitSettings:enable-java property. 996 * 997 * Params: 998 * enabled = Value to be set 999 */ 1000 public void setEnableJava(bool enabled) 1001 { 1002 webkit_settings_set_enable_java(webKitSettings, enabled); 1003 } 1004 1005 /** 1006 * Set the #WebKitSettings:enable-javascript property. 1007 * 1008 * Params: 1009 * enabled = Value to be set 1010 */ 1011 public void setEnableJavascript(bool enabled) 1012 { 1013 webkit_settings_set_enable_javascript(webKitSettings, enabled); 1014 } 1015 1016 /** 1017 * Set the #WebKitSettings:enable-javascript-markup property. 1018 * 1019 * Params: 1020 * enabled = Value to be set 1021 * 1022 * Since: 2.24 1023 */ 1024 public void setEnableJavascriptMarkup(bool enabled) 1025 { 1026 webkit_settings_set_enable_javascript_markup(webKitSettings, enabled); 1027 } 1028 1029 /** 1030 * Set the #WebKitSettings:enable-media property. 1031 * 1032 * Params: 1033 * enabled = Value to be set 1034 * 1035 * Since: 2.26 1036 */ 1037 public void setEnableMedia(bool enabled) 1038 { 1039 webkit_settings_set_enable_media(webKitSettings, enabled); 1040 } 1041 1042 /** 1043 * Set the #WebKitSettings:enable-media-capabilities property. 1044 * 1045 * Params: 1046 * enabled = Value to be set 1047 * 1048 * Since: 2.22 1049 */ 1050 public void setEnableMediaCapabilities(bool enabled) 1051 { 1052 webkit_settings_set_enable_media_capabilities(webKitSettings, enabled); 1053 } 1054 1055 /** 1056 * Set the #WebKitSettings:enable-media-stream property. 1057 * 1058 * Params: 1059 * enabled = Value to be set 1060 * 1061 * Since: 2.4 1062 */ 1063 public void setEnableMediaStream(bool enabled) 1064 { 1065 webkit_settings_set_enable_media_stream(webKitSettings, enabled); 1066 } 1067 1068 /** 1069 * Set the #WebKitSettings:enable-mediasource property. 1070 * 1071 * Params: 1072 * enabled = Value to be set 1073 * 1074 * Since: 2.4 1075 */ 1076 public void setEnableMediasource(bool enabled) 1077 { 1078 webkit_settings_set_enable_mediasource(webKitSettings, enabled); 1079 } 1080 1081 /** 1082 * Set the #WebKitSettings:enable-mock-capture-devices property. 1083 * 1084 * Params: 1085 * enabled = Value to be set 1086 * 1087 * Since: 2.4 1088 */ 1089 public void setEnableMockCaptureDevices(bool enabled) 1090 { 1091 webkit_settings_set_enable_mock_capture_devices(webKitSettings, enabled); 1092 } 1093 1094 /** 1095 * Set the #WebKitSettings:enable-offline-web-application-cache property. 1096 * 1097 * Params: 1098 * enabled = Value to be set 1099 */ 1100 public void setEnableOfflineWebApplicationCache(bool enabled) 1101 { 1102 webkit_settings_set_enable_offline_web_application_cache(webKitSettings, enabled); 1103 } 1104 1105 /** 1106 * Set the #WebKitSettings:enable-page-cache property. 1107 * 1108 * Params: 1109 * enabled = Value to be set 1110 */ 1111 public void setEnablePageCache(bool enabled) 1112 { 1113 webkit_settings_set_enable_page_cache(webKitSettings, enabled); 1114 } 1115 1116 /** 1117 * Set the #WebKitSettings:enable-plugins property. 1118 * 1119 * Params: 1120 * enabled = Value to be set 1121 */ 1122 public void setEnablePlugins(bool enabled) 1123 { 1124 webkit_settings_set_enable_plugins(webKitSettings, enabled); 1125 } 1126 1127 /** 1128 * Set the #WebKitSettings:enable-private-browsing property. 1129 * 1130 * Deprecated: Use #WebKitWebView:is-ephemeral or #WebKitWebContext:is-ephemeral instead. 1131 * 1132 * Params: 1133 * enabled = Value to be set 1134 */ 1135 public void setEnablePrivateBrowsing(bool enabled) 1136 { 1137 webkit_settings_set_enable_private_browsing(webKitSettings, enabled); 1138 } 1139 1140 /** 1141 * Set the #WebKitSettings:enable-resizable-text-areas property. 1142 * 1143 * Params: 1144 * enabled = Value to be set 1145 */ 1146 public void setEnableResizableTextAreas(bool enabled) 1147 { 1148 webkit_settings_set_enable_resizable_text_areas(webKitSettings, enabled); 1149 } 1150 1151 /** 1152 * Set the #WebKitSettings:enable-site-specific-quirks property. 1153 * 1154 * Params: 1155 * enabled = Value to be set 1156 */ 1157 public void setEnableSiteSpecificQuirks(bool enabled) 1158 { 1159 webkit_settings_set_enable_site_specific_quirks(webKitSettings, enabled); 1160 } 1161 1162 /** 1163 * Set the #WebKitSettings:enable-smooth-scrolling property. 1164 * 1165 * Params: 1166 * enabled = Value to be set 1167 */ 1168 public void setEnableSmoothScrolling(bool enabled) 1169 { 1170 webkit_settings_set_enable_smooth_scrolling(webKitSettings, enabled); 1171 } 1172 1173 /** 1174 * Set the #WebKitSettings:enable-spatial-navigation property. 1175 * 1176 * Params: 1177 * enabled = Value to be set 1178 * 1179 * Since: 2.2 1180 */ 1181 public void setEnableSpatialNavigation(bool enabled) 1182 { 1183 webkit_settings_set_enable_spatial_navigation(webKitSettings, enabled); 1184 } 1185 1186 /** 1187 * Set the #WebKitSettings:enable-tabs-to-links property. 1188 * 1189 * Params: 1190 * enabled = Value to be set 1191 */ 1192 public void setEnableTabsToLinks(bool enabled) 1193 { 1194 webkit_settings_set_enable_tabs_to_links(webKitSettings, enabled); 1195 } 1196 1197 /** 1198 * Set the #WebKitSettings:enable-webaudio property. 1199 * 1200 * Params: 1201 * enabled = Value to be set 1202 */ 1203 public void setEnableWebaudio(bool enabled) 1204 { 1205 webkit_settings_set_enable_webaudio(webKitSettings, enabled); 1206 } 1207 1208 /** 1209 * Set the #WebKitSettings:enable-webgl property. 1210 * 1211 * Params: 1212 * enabled = Value to be set 1213 */ 1214 public void setEnableWebgl(bool enabled) 1215 { 1216 webkit_settings_set_enable_webgl(webKitSettings, enabled); 1217 } 1218 1219 /** 1220 * Set the #WebKitSettings:enable-write-console-messages-to-stdout property. 1221 * 1222 * Params: 1223 * enabled = Value to be set 1224 * 1225 * Since: 2.2 1226 */ 1227 public void setEnableWriteConsoleMessagesToStdout(bool enabled) 1228 { 1229 webkit_settings_set_enable_write_console_messages_to_stdout(webKitSettings, enabled); 1230 } 1231 1232 /** 1233 * Set the #WebKitSettings:enable-xss-auditor property. 1234 * 1235 * Params: 1236 * enabled = Value to be set 1237 */ 1238 public void setEnableXssAuditor(bool enabled) 1239 { 1240 webkit_settings_set_enable_xss_auditor(webKitSettings, enabled); 1241 } 1242 1243 /** 1244 * Set the #WebKitSettings:fantasy-font-family property. 1245 * 1246 * Params: 1247 * fantasyFontFamily = the new default fantasy font family 1248 */ 1249 public void setFantasyFontFamily(string fantasyFontFamily) 1250 { 1251 webkit_settings_set_fantasy_font_family(webKitSettings, Str.toStringz(fantasyFontFamily)); 1252 } 1253 1254 /** 1255 * Set the #WebKitSettings:hardware-acceleration-policy property. 1256 * 1257 * Params: 1258 * policy = a #WebKitHardwareAccelerationPolicy 1259 * 1260 * Since: 2.16 1261 */ 1262 public void setHardwareAccelerationPolicy(WebKitHardwareAccelerationPolicy policy) 1263 { 1264 webkit_settings_set_hardware_acceleration_policy(webKitSettings, policy); 1265 } 1266 1267 /** 1268 * Set the #WebKitSettings:javascript-can-access-clipboard property. 1269 * 1270 * Params: 1271 * enabled = Value to be set 1272 */ 1273 public void setJavascriptCanAccessClipboard(bool enabled) 1274 { 1275 webkit_settings_set_javascript_can_access_clipboard(webKitSettings, enabled); 1276 } 1277 1278 /** 1279 * Set the #WebKitSettings:javascript-can-open-windows-automatically property. 1280 * 1281 * Params: 1282 * enabled = Value to be set 1283 */ 1284 public void setJavascriptCanOpenWindowsAutomatically(bool enabled) 1285 { 1286 webkit_settings_set_javascript_can_open_windows_automatically(webKitSettings, enabled); 1287 } 1288 1289 /** 1290 * Set the #WebKitSettings:load-icons-ignoring-image-load-setting property. 1291 * 1292 * Params: 1293 * enabled = Value to be set 1294 */ 1295 public void setLoadIconsIgnoringImageLoadSetting(bool enabled) 1296 { 1297 webkit_settings_set_load_icons_ignoring_image_load_setting(webKitSettings, enabled); 1298 } 1299 1300 /** 1301 * Set the #WebKitSettings:media-content-types-requiring-hardware-support property. 1302 * 1303 * Params: 1304 * contentTypes = list of media content types requiring hardware support split by semicolons (:) or %NULL to use the default value. 1305 * 1306 * Since: 2.30 1307 */ 1308 public void setMediaContentTypesRequiringHardwareSupport(string contentTypes) 1309 { 1310 webkit_settings_set_media_content_types_requiring_hardware_support(webKitSettings, Str.toStringz(contentTypes)); 1311 } 1312 1313 /** 1314 * Set the #WebKitSettings:media-playback-allows-inline property. 1315 * 1316 * Params: 1317 * enabled = Value to be set 1318 */ 1319 public void setMediaPlaybackAllowsInline(bool enabled) 1320 { 1321 webkit_settings_set_media_playback_allows_inline(webKitSettings, enabled); 1322 } 1323 1324 /** 1325 * Set the #WebKitSettings:media-playback-requires-user-gesture property. 1326 * 1327 * Params: 1328 * enabled = Value to be set 1329 */ 1330 public void setMediaPlaybackRequiresUserGesture(bool enabled) 1331 { 1332 webkit_settings_set_media_playback_requires_user_gesture(webKitSettings, enabled); 1333 } 1334 1335 /** 1336 * Set the #WebKitSettings:minimum-font-size property. 1337 * 1338 * Params: 1339 * fontSize = minimum font size to be set in pixels 1340 */ 1341 public void setMinimumFontSize(uint fontSize) 1342 { 1343 webkit_settings_set_minimum_font_size(webKitSettings, fontSize); 1344 } 1345 1346 /** 1347 * Set the #WebKitSettings:monospace-font-family property. 1348 * 1349 * Params: 1350 * monospaceFontFamily = the new default monospace font family 1351 */ 1352 public void setMonospaceFontFamily(string monospaceFontFamily) 1353 { 1354 webkit_settings_set_monospace_font_family(webKitSettings, Str.toStringz(monospaceFontFamily)); 1355 } 1356 1357 /** 1358 * Set the #WebKitSettings:pictograph-font-family property. 1359 * 1360 * Params: 1361 * pictographFontFamily = the new default pictograph font family 1362 */ 1363 public void setPictographFontFamily(string pictographFontFamily) 1364 { 1365 webkit_settings_set_pictograph_font_family(webKitSettings, Str.toStringz(pictographFontFamily)); 1366 } 1367 1368 /** 1369 * Set the #WebKitSettings:print-backgrounds property. 1370 * 1371 * Params: 1372 * printBackgrounds = Value to be set 1373 */ 1374 public void setPrintBackgrounds(bool printBackgrounds) 1375 { 1376 webkit_settings_set_print_backgrounds(webKitSettings, printBackgrounds); 1377 } 1378 1379 /** 1380 * Set the #WebKitSettings:sans-serif-font-family property. 1381 * 1382 * Params: 1383 * sansSerifFontFamily = the new default sans-serif font family 1384 */ 1385 public void setSansSerifFontFamily(string sansSerifFontFamily) 1386 { 1387 webkit_settings_set_sans_serif_font_family(webKitSettings, Str.toStringz(sansSerifFontFamily)); 1388 } 1389 1390 /** 1391 * Set the #WebKitSettings:serif-font-family property. 1392 * 1393 * Params: 1394 * serifFontFamily = the new default serif font family 1395 */ 1396 public void setSerifFontFamily(string serifFontFamily) 1397 { 1398 webkit_settings_set_serif_font_family(webKitSettings, Str.toStringz(serifFontFamily)); 1399 } 1400 1401 /** 1402 * Set the #WebKitSettings:user-agent property. 1403 * 1404 * Params: 1405 * userAgent = The new custom user agent string or %NULL to use the default user agent 1406 */ 1407 public void setUserAgent(string userAgent) 1408 { 1409 webkit_settings_set_user_agent(webKitSettings, Str.toStringz(userAgent)); 1410 } 1411 1412 /** 1413 * Set the #WebKitSettings:user-agent property by appending the application details to the default user 1414 * agent. If no application name or version is given, the default user agent used will be used. If only 1415 * the version is given, the default engine version is used with the given application name. 1416 * 1417 * Params: 1418 * applicationName = The application name used for the user agent or %NULL to use the default user agent. 1419 * applicationVersion = The application version for the user agent or %NULL to user the default version. 1420 */ 1421 public void setUserAgentWithApplicationDetails(string applicationName, string applicationVersion) 1422 { 1423 webkit_settings_set_user_agent_with_application_details(webKitSettings, Str.toStringz(applicationName), Str.toStringz(applicationVersion)); 1424 } 1425 1426 /** 1427 * Set the #WebKitSettings:zoom-text-only property. 1428 * 1429 * Params: 1430 * zoomTextOnly = Value to be set 1431 */ 1432 public void setZoomTextOnly(bool zoomTextOnly) 1433 { 1434 webkit_settings_set_zoom_text_only(webKitSettings, zoomTextOnly); 1435 } 1436 }