1 module webkit2.WebsitePolicies; 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 * WebKitWebsitePolicies allows you to configure per-page policies, 12 * currently only autoplay policies are supported. 13 * 14 * Since: 2.30 15 */ 16 public class WebsitePolicies : ObjectG 17 { 18 /** the main Gtk struct */ 19 protected WebKitWebsitePolicies* webKitWebsitePolicies; 20 21 /** Get the main Gtk struct */ 22 public WebKitWebsitePolicies* getWebsitePoliciesStruct(bool transferOwnership = false) 23 { 24 if (transferOwnership) 25 ownedRef = false; 26 return webKitWebsitePolicies; 27 } 28 29 /** the main Gtk struct as a void* */ 30 protected override void* getStruct() 31 { 32 return cast(void*)webKitWebsitePolicies; 33 } 34 35 /** 36 * Sets our main struct and passes it to the parent class. 37 */ 38 public this (WebKitWebsitePolicies* webKitWebsitePolicies, bool ownedRef = false) 39 { 40 this.webKitWebsitePolicies = webKitWebsitePolicies; 41 super(cast(GObject*)webKitWebsitePolicies, ownedRef); 42 } 43 44 45 /** */ 46 public static GType getType() 47 { 48 return webkit_website_policies_get_type(); 49 } 50 51 /** 52 * Create a new #WebKitWebsitePolicies 53 * 54 * Returns: the newly created #WebKitWebsitePolicies 55 * 56 * Since: 2.30 57 * 58 * Throws: ConstructionException GTK+ fails to create the object. 59 */ 60 public this() 61 { 62 auto __p = webkit_website_policies_new(); 63 64 if(__p is null) 65 { 66 throw new ConstructionException("null returned by new"); 67 } 68 69 this(cast(WebKitWebsitePolicies*) __p, true); 70 } 71 72 /** 73 * Get the #WebKitWebsitePolicies:autoplay property. 74 * 75 * Returns: #WebKitAutoplayPolicy 76 * 77 * Since: 2.30 78 */ 79 public WebKitAutoplayPolicy getAutoplayPolicy() 80 { 81 return webkit_website_policies_get_autoplay_policy(webKitWebsitePolicies); 82 } 83 }