1 module soup.AuthDomainBasic; 2 3 private import glib.ConstructionException; 4 private import glib.Str; 5 private import gobject.ObjectG; 6 private import soup.AuthDomain; 7 private import soup.c.functions; 8 public import soup.c.types; 9 10 11 /** 12 * #SoupAuthDomainBasic handles the server side of HTTP "Basic" (ie, 13 * cleartext password) authentication. 14 */ 15 public class AuthDomainBasic : AuthDomain 16 { 17 /** the main Gtk struct */ 18 protected SoupAuthDomainBasic* soupAuthDomainBasic; 19 20 /** Get the main Gtk struct */ 21 public SoupAuthDomainBasic* getAuthDomainBasicStruct(bool transferOwnership = false) 22 { 23 if (transferOwnership) 24 ownedRef = false; 25 return soupAuthDomainBasic; 26 } 27 28 /** the main Gtk struct as a void* */ 29 protected override void* getStruct() 30 { 31 return cast(void*)soupAuthDomainBasic; 32 } 33 34 /** 35 * Sets our main struct and passes it to the parent class. 36 */ 37 public this (SoupAuthDomainBasic* soupAuthDomainBasic, bool ownedRef = false) 38 { 39 this.soupAuthDomainBasic = soupAuthDomainBasic; 40 super(cast(SoupAuthDomain*)soupAuthDomainBasic, ownedRef); 41 } 42 43 44 /** */ 45 public static GType getType() 46 { 47 return soup_auth_domain_basic_get_type(); 48 } 49 50 /** 51 * Sets the callback that @domain will use to authenticate incoming 52 * requests. For each request containing authorization, @domain will 53 * invoke the callback, and then either accept or reject the request 54 * based on @callback's return value. 55 * 56 * You can also set the auth callback by setting the 57 * %SOUP_AUTH_DOMAIN_BASIC_AUTH_CALLBACK and 58 * %SOUP_AUTH_DOMAIN_BASIC_AUTH_DATA properties, which can also be 59 * used to set the callback at construct time. 60 * 61 * Params: 62 * callback = the callback 63 * userData = data to pass to @auth_callback 64 * dnotify = destroy notifier to free @user_data when @domain 65 * is destroyed 66 */ 67 public void setAuthCallback(SoupAuthDomainBasicAuthCallback callback, void* userData, GDestroyNotify dnotify) 68 { 69 soup_auth_domain_basic_set_auth_callback(cast(SoupAuthDomain*)soupAuthDomainBasic, callback, userData, dnotify); 70 } 71 }