// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace GLib {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class ProxyAddress : GLib.InetSocketAddress {

		public ProxyAddress (IntPtr raw) : base(raw) {}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_proxy_address_new(IntPtr inetaddr, ushort port, IntPtr protocol, IntPtr dest_hostname, ushort dest_port, IntPtr username, IntPtr password);

		public ProxyAddress (GLib.InetAddress inetaddr, ushort port, string protocol, string dest_hostname, ushort dest_port, string username, string password) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (ProxyAddress)) {
				throw new InvalidOperationException ("Can't override this constructor.");
			}
			IntPtr native_protocol = GLib.Marshaller.StringToPtrGStrdup (protocol);
			IntPtr native_dest_hostname = GLib.Marshaller.StringToPtrGStrdup (dest_hostname);
			IntPtr native_username = GLib.Marshaller.StringToPtrGStrdup (username);
			IntPtr native_password = GLib.Marshaller.StringToPtrGStrdup (password);
			Raw = g_proxy_address_new(inetaddr == null ? IntPtr.Zero : inetaddr.Handle, port, native_protocol, native_dest_hostname, dest_port, native_username, native_password);
			GLib.Marshaller.Free (native_protocol);
			GLib.Marshaller.Free (native_dest_hostname);
			GLib.Marshaller.Free (native_username);
			GLib.Marshaller.Free (native_password);
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_proxy_address_get_protocol(IntPtr raw);

		[GLib.Property ("protocol")]
		public string Protocol {
			get  {
				IntPtr raw_ret = g_proxy_address_get_protocol(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_proxy_address_get_username(IntPtr raw);

		[GLib.Property ("username")]
		public string Username {
			get  {
				IntPtr raw_ret = g_proxy_address_get_username(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_proxy_address_get_password(IntPtr raw);

		[GLib.Property ("password")]
		public string Password {
			get  {
				IntPtr raw_ret = g_proxy_address_get_password(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_proxy_address_get_destination_hostname(IntPtr raw);

		[GLib.Property ("destination-hostname")]
		public string DestinationHostname {
			get  {
				IntPtr raw_ret = g_proxy_address_get_destination_hostname(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern ushort g_proxy_address_get_destination_port(IntPtr raw);

		[GLib.Property ("destination-port")]
		public ushort DestinationPort {
			get  {
				ushort raw_ret = g_proxy_address_get_destination_port(Handle);
				ushort ret = raw_ret;
				return ret;
			}
		}

		[StructLayout (LayoutKind.Sequential)]
		struct GProxyAddressClass {
		}

		static uint class_offset = ((GLib.GType) typeof (GLib.InetSocketAddress)).GetClassSize ();
		static Dictionary<GLib.GType, GProxyAddressClass> class_structs;

		static GProxyAddressClass GetClassStruct (GLib.GType gtype, bool use_cache)
		{
			if (class_structs == null)
				class_structs = new Dictionary<GLib.GType, GProxyAddressClass> ();

			if (use_cache && class_structs.ContainsKey (gtype))
				return class_structs [gtype];
			else {
				IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
				GProxyAddressClass class_struct = (GProxyAddressClass) Marshal.PtrToStructure (class_ptr, typeof (GProxyAddressClass));
				if (use_cache)
					class_structs.Add (gtype, class_struct);
				return class_struct;
			}
		}

		static void OverrideClassStruct (GLib.GType gtype, GProxyAddressClass class_struct)
		{
			IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
			Marshal.StructureToPtr (class_struct, class_ptr, false);
		}

		[DllImport("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr g_proxy_address_get_type();

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = g_proxy_address_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

#endregion
	}
}
