1 module webkit2.ITPFirstParty; 2 3 private import glib.DateTime; 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 public class ITPFirstParty 12 { 13 /** the main Gtk struct */ 14 protected WebKitITPFirstParty* webKitITPFirstParty; 15 protected bool ownedRef; 16 17 /** Get the main Gtk struct */ 18 public WebKitITPFirstParty* getITPFirstPartyStruct(bool transferOwnership = false) 19 { 20 if (transferOwnership) 21 ownedRef = false; 22 return webKitITPFirstParty; 23 } 24 25 /** the main Gtk struct as a void* */ 26 protected void* getStruct() 27 { 28 return cast(void*)webKitITPFirstParty; 29 } 30 31 /** 32 * Sets our main struct and passes it to the parent class. 33 */ 34 public this (WebKitITPFirstParty* webKitITPFirstParty, bool ownedRef = false) 35 { 36 this.webKitITPFirstParty = webKitITPFirstParty; 37 this.ownedRef = ownedRef; 38 } 39 40 ~this () 41 { 42 if ( ownedRef ) 43 webkit_itp_first_party_unref(webKitITPFirstParty); 44 } 45 46 47 /** */ 48 public static GType getType() 49 { 50 return webkit_itp_first_party_get_type(); 51 } 52 53 /** 54 * Get the domain name of @itp_first_party 55 * 56 * Returns: the domain name 57 * 58 * Since: 2.30 59 */ 60 public string getDomain() 61 { 62 return Str.toString(webkit_itp_first_party_get_domain(webKitITPFirstParty)); 63 } 64 65 /** 66 * Get the last time a #WebKitITPThirdParty has been seen under @itp_first_party. 67 * Each @WebKitITPFirstParty is created by webkit_itp_third_party_get_first_parties() and 68 * therefore corresponds to exactly one #WebKitITPThirdParty. 69 * 70 * Returns: the last update time as a #GDateTime 71 * 72 * Since: 2.30 73 */ 74 public DateTime getLastUpdateTime() 75 { 76 auto __p = webkit_itp_first_party_get_last_update_time(webKitITPFirstParty); 77 78 if(__p is null) 79 { 80 return null; 81 } 82 83 return new DateTime(cast(GDateTime*) __p); 84 } 85 86 /** 87 * Get whether @itp_first_party has granted website data access to its #WebKitITPThirdParty. 88 * Each @WebKitITPFirstParty is created by webkit_itp_third_party_get_first_parties() and 89 * therefore corresponds to exactly one #WebKitITPThirdParty. 90 * 91 * Returns: %TRUE if website data access has been granted, or %FALSE otherwise 92 * 93 * Since: 2.30 94 */ 95 public bool getWebsiteDataAccessAllowed() 96 { 97 return webkit_itp_first_party_get_website_data_access_allowed(webKitITPFirstParty) != 0; 98 } 99 100 alias doref = ref_; 101 /** 102 * Atomically increments the reference count of @itp_first_party by one. 103 * This function is MT-safe and may be called from any thread. 104 * 105 * Returns: The passed #WebKitITPFirstParty 106 * 107 * Since: 2.30 108 */ 109 public ITPFirstParty ref_() 110 { 111 auto __p = webkit_itp_first_party_ref(webKitITPFirstParty); 112 113 if(__p is null) 114 { 115 return null; 116 } 117 118 return ObjectG.getDObject!(ITPFirstParty)(cast(WebKitITPFirstParty*) __p, true); 119 } 120 121 /** 122 * Atomically decrements the reference count of @itp_first_party by one. 123 * If the reference count drops to 0, all memory allocated by 124 * #WebKitITPFirstParty is released. This function is MT-safe and may be 125 * called from any thread. 126 * 127 * Since: 2.30 128 */ 129 public void unref() 130 { 131 webkit_itp_first_party_unref(webKitITPFirstParty); 132 } 133 }