1 module webkit2.UserContentFilter; 2 3 private import glib.Str; 4 private import gobject.ObjectG; 5 private import webkit2.c.functions; 6 public import webkit2.c.types; 7 8 9 /** */ 10 public class UserContentFilter 11 { 12 /** the main Gtk struct */ 13 protected WebKitUserContentFilter* webKitUserContentFilter; 14 protected bool ownedRef; 15 16 /** Get the main Gtk struct */ 17 public WebKitUserContentFilter* getUserContentFilterStruct(bool transferOwnership = false) 18 { 19 if (transferOwnership) 20 ownedRef = false; 21 return webKitUserContentFilter; 22 } 23 24 /** the main Gtk struct as a void* */ 25 protected void* getStruct() 26 { 27 return cast(void*)webKitUserContentFilter; 28 } 29 30 /** 31 * Sets our main struct and passes it to the parent class. 32 */ 33 public this (WebKitUserContentFilter* webKitUserContentFilter, bool ownedRef = false) 34 { 35 this.webKitUserContentFilter = webKitUserContentFilter; 36 this.ownedRef = ownedRef; 37 } 38 39 ~this () 40 { 41 if ( ownedRef ) 42 webkit_user_content_filter_unref(webKitUserContentFilter); 43 } 44 45 46 /** */ 47 public static GType getType() 48 { 49 return webkit_user_content_filter_get_type(); 50 } 51 52 /** 53 * Obtain the identifier previously used to save the @user_content_filter in the 54 * #WebKitUserContentFilterStore. 55 * 56 * Returns: the identifier for the filter 57 * 58 * Since: 2.24 59 */ 60 public string getIdentifier() 61 { 62 return Str.toString(webkit_user_content_filter_get_identifier(webKitUserContentFilter)); 63 } 64 65 alias doref = ref_; 66 /** 67 * Atomically increments the reference count of @user_content_filter by one. 68 * This function is MT-safe and may be called from any thread. 69 * 70 * Since: 2.24 71 */ 72 public UserContentFilter ref_() 73 { 74 auto __p = webkit_user_content_filter_ref(webKitUserContentFilter); 75 76 if(__p is null) 77 { 78 return null; 79 } 80 81 return ObjectG.getDObject!(UserContentFilter)(cast(WebKitUserContentFilter*) __p, true); 82 } 83 84 /** 85 * Atomically decrements the reference count of @user_content_filter by one. 86 * If the reference count drops to 0, all the memory allocated by the 87 * #WebKitUserContentFilter is released. This function is MT-safe and may 88 * be called from any thread. 89 * 90 * Since: 2.24 91 */ 92 public void unref() 93 { 94 webkit_user_content_filter_unref(webKitUserContentFilter); 95 } 96 }