1 module soup.SessionAsync; 2 3 private import glib.ConstructionException; 4 private import glib.Str; 5 private import gobject.ObjectG; 6 private import soup.Session; 7 private import soup.c.functions; 8 public import soup.c.types; 9 10 11 /** 12 * #SoupSessionAsync is an implementation of #SoupSession that uses 13 * non-blocking I/O via the glib main loop for all I/O. 14 * 15 * Deprecated: Use the #SoupSession class (which uses both asynchronous 16 * and synchronous I/O, depending on the API used). See the 17 * <link linkend="libsoup-session-porting">porting guide</link>. 18 */ 19 public class SessionAsync : Session 20 { 21 /** the main Gtk struct */ 22 protected SoupSessionAsync* soupSessionAsync; 23 24 /** Get the main Gtk struct */ 25 public SoupSessionAsync* getSessionAsyncStruct(bool transferOwnership = false) 26 { 27 if (transferOwnership) 28 ownedRef = false; 29 return soupSessionAsync; 30 } 31 32 /** the main Gtk struct as a void* */ 33 protected override void* getStruct() 34 { 35 return cast(void*)soupSessionAsync; 36 } 37 38 /** 39 * Sets our main struct and passes it to the parent class. 40 */ 41 public this (SoupSessionAsync* soupSessionAsync, bool ownedRef = false) 42 { 43 this.soupSessionAsync = soupSessionAsync; 44 super(cast(SoupSession*)soupSessionAsync, ownedRef); 45 } 46 47 48 /** */ 49 public static GType getType() 50 { 51 return soup_session_async_get_type(); 52 } 53 54 /** 55 * Creates an asynchronous #SoupSession with the default options. 56 * 57 * Deprecated: #SoupSessionAsync is deprecated; use a plain 58 * #SoupSession, created with soup_session_new(). See the <link 59 * linkend="libsoup-session-porting">porting guide</link>. 60 * 61 * Returns: the new session. 62 * 63 * Throws: ConstructionException GTK+ fails to create the object. 64 */ 65 public this() 66 { 67 auto __p = soup_session_async_new(); 68 69 if(__p is null) 70 { 71 throw new ConstructionException("null returned by new"); 72 } 73 74 this(cast(SoupSessionAsync*) __p, true); 75 } 76 }