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

namespace WebKit {

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

#region Autogenerated code
	public partial class BackForwardList : GLib.Object {

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

		protected BackForwardList() : base(IntPtr.Zero)
		{
			CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
		}

		[GLib.Signal("changed")]
		public event WebKit.ChangedHandler Changed {
			add {
				this.AddSignalHandler ("changed", value, typeof (WebKit.ChangedArgs));
			}
			remove {
				this.RemoveSignalHandler ("changed", value);
			}
		}

		static ChangedNativeDelegate Changed_cb_delegate;
		static ChangedNativeDelegate ChangedVMCallback {
			get {
				if (Changed_cb_delegate == null)
					Changed_cb_delegate = new ChangedNativeDelegate (Changed_cb);
				return Changed_cb_delegate;
			}
		}

		static void OverrideChanged (GLib.GType gtype)
		{
			OverrideChanged (gtype, ChangedVMCallback);
		}

		static void OverrideChanged (GLib.GType gtype, ChangedNativeDelegate callback)
		{
			OverrideVirtualMethod (gtype, "changed", callback);
		}
		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void ChangedNativeDelegate (IntPtr inst, IntPtr item_added, IntPtr items_removed);

		static void Changed_cb (IntPtr inst, IntPtr item_added, IntPtr items_removed)
		{
			try {
				BackForwardList __obj = GLib.Object.GetObject (inst, false) as BackForwardList;
				__obj.OnChanged (GLib.Object.GetObject(item_added) as WebKit.BackForwardListItem, items_removed);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(WebKit.BackForwardList), ConnectionMethod="OverrideChanged")]
		protected virtual void OnChanged (WebKit.BackForwardListItem item_added, IntPtr items_removed)
		{
			InternalChanged (item_added, items_removed);
		}

		private void InternalChanged (WebKit.BackForwardListItem item_added, IntPtr items_removed)
		{
			GLib.Value ret = GLib.Value.Empty;
			GLib.ValueArray inst_and_params = new GLib.ValueArray (3);
			GLib.Value[] vals = new GLib.Value [3];
			vals [0] = new GLib.Value (this);
			inst_and_params.Append (vals [0]);
			vals [1] = new GLib.Value (item_added);
			inst_and_params.Append (vals [1]);
			vals [2] = new GLib.Value (items_removed);
			inst_and_params.Append (vals [2]);
			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
			foreach (GLib.Value v in vals)
				v.Dispose ();
		}


		// 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("_webkit_reserved0"
							, GLib.Object.class_abi.Fields
							, (uint) sizeof( IntPtr ) // _webkit_reserved0
							, null
							, "_webkit_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_webkit_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _webkit_reserved1
							, "_webkit_reserved0"
							, "_webkit_reserved2"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_webkit_reserved2"
							, -1
							, (uint) sizeof( IntPtr ) // _webkit_reserved2
							, "_webkit_reserved1"
							, "_webkit_reserved3"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_webkit_reserved3"
							, -1
							, (uint) sizeof( IntPtr ) // _webkit_reserved3
							, "_webkit_reserved2"
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_webkit_back_forward_list_get_type();
		static d_webkit_back_forward_list_get_type webkit_back_forward_list_get_type = FuncLoader.LoadFunction<d_webkit_back_forward_list_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_back_forward_list_get_type"));

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

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

		public WebKit.BackForwardListItem BackItem { 
			get {
				IntPtr raw_ret = webkit_back_forward_list_get_back_item(Handle);
				WebKit.BackForwardListItem ret = GLib.Object.GetObject(raw_ret) as WebKit.BackForwardListItem;
				return ret;
			}
		}

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

		public WebKit.BackForwardListItem[] BackList { 
			get {
				IntPtr raw_ret = webkit_back_forward_list_get_back_list(Handle);
				WebKit.BackForwardListItem[] ret = GLib.Marshaller.ListPtrToArray<WebKit.BackForwardListItem, WebKit.BackForwardListItem> (raw_ret, false, true);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_webkit_back_forward_list_get_back_list_with_limit(IntPtr raw, uint limit);
		static d_webkit_back_forward_list_get_back_list_with_limit webkit_back_forward_list_get_back_list_with_limit = FuncLoader.LoadFunction<d_webkit_back_forward_list_get_back_list_with_limit>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_back_forward_list_get_back_list_with_limit"));

		public WebKit.BackForwardListItem[] GetBackListWithLimit(uint limit) {
			IntPtr raw_ret = webkit_back_forward_list_get_back_list_with_limit(Handle, limit);
			WebKit.BackForwardListItem[] ret = GLib.Marshaller.ListPtrToArray<WebKit.BackForwardListItem, WebKit.BackForwardListItem> (raw_ret, false, true);
			return ret;
		}

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

		public WebKit.BackForwardListItem CurrentItem { 
			get {
				IntPtr raw_ret = webkit_back_forward_list_get_current_item(Handle);
				WebKit.BackForwardListItem ret = GLib.Object.GetObject(raw_ret) as WebKit.BackForwardListItem;
				return ret;
			}
		}

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

		public WebKit.BackForwardListItem ForwardItem { 
			get {
				IntPtr raw_ret = webkit_back_forward_list_get_forward_item(Handle);
				WebKit.BackForwardListItem ret = GLib.Object.GetObject(raw_ret) as WebKit.BackForwardListItem;
				return ret;
			}
		}

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

		public WebKit.BackForwardListItem[] ForwardList { 
			get {
				IntPtr raw_ret = webkit_back_forward_list_get_forward_list(Handle);
				WebKit.BackForwardListItem[] ret = GLib.Marshaller.ListPtrToArray<WebKit.BackForwardListItem, WebKit.BackForwardListItem> (raw_ret, false, true);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_webkit_back_forward_list_get_forward_list_with_limit(IntPtr raw, uint limit);
		static d_webkit_back_forward_list_get_forward_list_with_limit webkit_back_forward_list_get_forward_list_with_limit = FuncLoader.LoadFunction<d_webkit_back_forward_list_get_forward_list_with_limit>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_back_forward_list_get_forward_list_with_limit"));

		public WebKit.BackForwardListItem[] GetForwardListWithLimit(uint limit) {
			IntPtr raw_ret = webkit_back_forward_list_get_forward_list_with_limit(Handle, limit);
			WebKit.BackForwardListItem[] ret = GLib.Marshaller.ListPtrToArray<WebKit.BackForwardListItem, WebKit.BackForwardListItem> (raw_ret, false, true);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint d_webkit_back_forward_list_get_length(IntPtr raw);
		static d_webkit_back_forward_list_get_length webkit_back_forward_list_get_length = FuncLoader.LoadFunction<d_webkit_back_forward_list_get_length>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_back_forward_list_get_length"));

		public uint Length { 
			get {
				uint raw_ret = webkit_back_forward_list_get_length(Handle);
				uint ret = raw_ret;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_webkit_back_forward_list_get_nth_item(IntPtr raw, int index);
		static d_webkit_back_forward_list_get_nth_item webkit_back_forward_list_get_nth_item = FuncLoader.LoadFunction<d_webkit_back_forward_list_get_nth_item>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_back_forward_list_get_nth_item"));

		public WebKit.BackForwardListItem GetNthItem(int index) {
			IntPtr raw_ret = webkit_back_forward_list_get_nth_item(Handle, index);
			WebKit.BackForwardListItem ret = GLib.Object.GetObject(raw_ret) as WebKit.BackForwardListItem;
			return ret;
		}


		static BackForwardList ()
		{
			GtkSharp.WebkitGtkSharp.ObjectManager.Initialize ();
		}

		// 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"
							, GLib.Object.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
