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

namespace Gtk {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;
	using static GLib.AbiStructExtension;

#region Autogenerated code
	public partial class InfoBar : Gtk.Box {

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_info_bar_new();
		static d_gtk_info_bar_new gtk_info_bar_new = FuncLoader.LoadFunction<d_gtk_info_bar_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_new"));

		public InfoBar () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (InfoBar)) {
				CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
				return;
			}
			Raw = gtk_info_bar_new();
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_info_bar_get_message_type(IntPtr raw);
		static d_gtk_info_bar_get_message_type gtk_info_bar_get_message_type = FuncLoader.LoadFunction<d_gtk_info_bar_get_message_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_get_message_type"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_info_bar_set_message_type(IntPtr raw, int message_type);
		static d_gtk_info_bar_set_message_type gtk_info_bar_set_message_type = FuncLoader.LoadFunction<d_gtk_info_bar_set_message_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_set_message_type"));

		[GLib.Property ("message-type")]
		public Gtk.MessageType MessageType {
			get  {
				int raw_ret = gtk_info_bar_get_message_type(Handle);
				Gtk.MessageType ret = (Gtk.MessageType) raw_ret;
				return ret;
			}
			set  {
				gtk_info_bar_set_message_type(Handle, (int) value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_info_bar_get_show_close_button(IntPtr raw);
		static d_gtk_info_bar_get_show_close_button gtk_info_bar_get_show_close_button = FuncLoader.LoadFunction<d_gtk_info_bar_get_show_close_button>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_get_show_close_button"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_info_bar_set_show_close_button(IntPtr raw, bool setting);
		static d_gtk_info_bar_set_show_close_button gtk_info_bar_set_show_close_button = FuncLoader.LoadFunction<d_gtk_info_bar_set_show_close_button>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_set_show_close_button"));

		[GLib.Property ("show-close-button")]
		public bool ShowCloseButton {
			get  {
				bool raw_ret = gtk_info_bar_get_show_close_button(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_info_bar_set_show_close_button(Handle, value);
			}
		}

		[Obsolete]
		public int ContentAreaBorder {
			get {
				var val = (int)StyleGetProperty("content-area-border");
				return val;
			}
		}

		[Obsolete]
		public int ContentAreaSpacing {
			get {
				var val = (int)StyleGetProperty("content-area-spacing");
				return val;
			}
		}

		[Obsolete]
		public int ButtonSpacing {
			get {
				var val = (int)StyleGetProperty("button-spacing");
				return val;
			}
		}

		[Obsolete]
		public int ActionAreaBorder {
			get {
				var val = (int)StyleGetProperty("action-area-border");
				return val;
			}
		}

		[GLib.Signal("response")]
		public event Gtk.RespondHandler Respond {
			add {
				this.AddSignalHandler ("response", value, typeof (Gtk.RespondArgs));
			}
			remove {
				this.RemoveSignalHandler ("response", value);
			}
		}

		[GLib.Signal("close")]
		public event System.EventHandler Close {
			add {
				this.AddSignalHandler ("close", value);
			}
			remove {
				this.RemoveSignalHandler ("close", value);
			}
		}

		static RespondNativeDelegate Respond_cb_delegate;
		static RespondNativeDelegate RespondVMCallback {
			get {
				if (Respond_cb_delegate == null)
					Respond_cb_delegate = new RespondNativeDelegate (Respond_cb);
				return Respond_cb_delegate;
			}
		}

		static void OverrideRespond (GLib.GType gtype)
		{
			OverrideRespond (gtype, RespondVMCallback);
		}

		static void OverrideRespond (GLib.GType gtype, RespondNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("response"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void RespondNativeDelegate (IntPtr inst, int response_id);

		static void Respond_cb (IntPtr inst, int response_id)
		{
			try {
				InfoBar __obj = GLib.Object.GetObject (inst, false) as InfoBar;
				__obj.OnRespond (response_id);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.InfoBar), ConnectionMethod="OverrideRespond")]
		protected virtual void OnRespond (int response_id)
		{
			InternalRespond (response_id);
		}

		private void InternalRespond (int response_id)
		{
			RespondNativeDelegate unmanaged = class_abi.BaseOverride<RespondNativeDelegate>(this.LookupGType(), "response");
			if (unmanaged == null) return;

			unmanaged (this.Handle, response_id);
		}

		static CloseNativeDelegate Close_cb_delegate;
		static CloseNativeDelegate CloseVMCallback {
			get {
				if (Close_cb_delegate == null)
					Close_cb_delegate = new CloseNativeDelegate (Close_cb);
				return Close_cb_delegate;
			}
		}

		static void OverrideClose (GLib.GType gtype)
		{
			OverrideClose (gtype, CloseVMCallback);
		}

		static void OverrideClose (GLib.GType gtype, CloseNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void CloseNativeDelegate (IntPtr inst);

		static void Close_cb (IntPtr inst)
		{
			try {
				InfoBar __obj = GLib.Object.GetObject (inst, false) as InfoBar;
				__obj.OnClose ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.InfoBar), ConnectionMethod="OverrideClose")]
		protected virtual void OnClose ()
		{
			InternalClose ();
		}

		private void InternalClose ()
		{
			CloseNativeDelegate unmanaged = class_abi.BaseOverride<CloseNativeDelegate>(this.LookupGType(), "close");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public unsafe new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("response"
							, Gtk.Box.class_abi.Fields
							, (uint) sizeof( IntPtr ) // response
							, null
							, "close"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("close"
							, -1
							, (uint) sizeof( IntPtr ) // close
							, "response"
							, "_gtk_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved1
							, "close"
							, "_gtk_reserved2"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved2"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved2
							, "_gtk_reserved1"
							, "_gtk_reserved3"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved3"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved3
							, "_gtk_reserved2"
							, "_gtk_reserved4"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved4"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved4
							, "_gtk_reserved3"
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_info_bar_add_action_widget(IntPtr raw, IntPtr child, int response_id);
		static d_gtk_info_bar_add_action_widget gtk_info_bar_add_action_widget = FuncLoader.LoadFunction<d_gtk_info_bar_add_action_widget>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_add_action_widget"));

		public void AddActionWidget(Gtk.Widget child, int response_id) {
			gtk_info_bar_add_action_widget(Handle, child == null ? IntPtr.Zero : child.Handle, response_id);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_info_bar_add_button(IntPtr raw, IntPtr button_text, int response_id);
		static d_gtk_info_bar_add_button gtk_info_bar_add_button = FuncLoader.LoadFunction<d_gtk_info_bar_add_button>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_add_button"));

		public Gtk.Widget AddButton(string button_text, int response_id) {
			IntPtr native_button_text = GLib.Marshaller.StringToPtrGStrdup (button_text);
			IntPtr raw_ret = gtk_info_bar_add_button(Handle, native_button_text, response_id);
			Gtk.Widget ret = GLib.Object.GetObject(raw_ret) as Gtk.Widget;
			GLib.Marshaller.Free (native_button_text);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_info_bar_get_action_area(IntPtr raw);
		static d_gtk_info_bar_get_action_area gtk_info_bar_get_action_area = FuncLoader.LoadFunction<d_gtk_info_bar_get_action_area>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_get_action_area"));

		public Gtk.Widget ActionArea { 
			get {
				IntPtr raw_ret = gtk_info_bar_get_action_area(Handle);
				Gtk.Widget ret = GLib.Object.GetObject(raw_ret) as Gtk.Widget;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_info_bar_get_content_area(IntPtr raw);
		static d_gtk_info_bar_get_content_area gtk_info_bar_get_content_area = FuncLoader.LoadFunction<d_gtk_info_bar_get_content_area>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_get_content_area"));

		public Gtk.Widget ContentArea { 
			get {
				IntPtr raw_ret = gtk_info_bar_get_content_area(Handle);
				Gtk.Widget ret = GLib.Object.GetObject(raw_ret) as Gtk.Widget;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_info_bar_get_type();
		static d_gtk_info_bar_get_type gtk_info_bar_get_type = FuncLoader.LoadFunction<d_gtk_info_bar_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_get_type"));

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_info_bar_response(IntPtr raw, int response_id);
		static d_gtk_info_bar_response gtk_info_bar_response = FuncLoader.LoadFunction<d_gtk_info_bar_response>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_response"));

		public void Response(int response_id) {
			gtk_info_bar_response(Handle, response_id);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_info_bar_set_default_response(IntPtr raw, int response_id);
		static d_gtk_info_bar_set_default_response gtk_info_bar_set_default_response = FuncLoader.LoadFunction<d_gtk_info_bar_set_default_response>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_set_default_response"));

		public int DefaultResponse { 
			set {
				gtk_info_bar_set_default_response(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_info_bar_set_response_sensitive(IntPtr raw, int response_id, bool setting);
		static d_gtk_info_bar_set_response_sensitive gtk_info_bar_set_response_sensitive = FuncLoader.LoadFunction<d_gtk_info_bar_set_response_sensitive>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_info_bar_set_response_sensitive"));

		public void SetResponseSensitive(int response_id, bool setting) {
			gtk_info_bar_set_response_sensitive(Handle, response_id, setting);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public unsafe new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("priv"
							, Gtk.Box.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
