// 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 FileAttributeInfoList : GLib.Opaque {

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_g_file_attribute_info_list_add(IntPtr raw, IntPtr name, int type, int flags);
		static d_g_file_attribute_info_list_add g_file_attribute_info_list_add = FuncLoader.LoadFunction<d_g_file_attribute_info_list_add>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_file_attribute_info_list_add"));

		public void Add(string name, GLib.FileAttributeType type, GLib.FileAttributeInfoFlags flags) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			g_file_attribute_info_list_add(Handle, native_name, (int) type, (int) flags);
			GLib.Marshaller.Free (native_name);
		}

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

		public GLib.FileAttributeInfoList Dup() {
			IntPtr raw_ret = g_file_attribute_info_list_dup(Handle);
			GLib.FileAttributeInfoList ret = raw_ret == IntPtr.Zero ? null : (GLib.FileAttributeInfoList) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.FileAttributeInfoList), false);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_g_file_attribute_info_list_get_type();
		static d_g_file_attribute_info_list_get_type g_file_attribute_info_list_get_type = FuncLoader.LoadFunction<d_g_file_attribute_info_list_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_file_attribute_info_list_get_type"));

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_g_file_attribute_info_list_lookup(IntPtr raw, IntPtr name);
		static d_g_file_attribute_info_list_lookup g_file_attribute_info_list_lookup = FuncLoader.LoadFunction<d_g_file_attribute_info_list_lookup>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_file_attribute_info_list_lookup"));

		public GLib.FileAttributeInfo Lookup(string name) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			IntPtr raw_ret = g_file_attribute_info_list_lookup(Handle, native_name);
			GLib.FileAttributeInfo ret = GLib.FileAttributeInfo.New (raw_ret);
			GLib.Marshaller.Free (native_name);
			return ret;
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_g_file_attribute_info_list_new();
		static d_g_file_attribute_info_list_new g_file_attribute_info_list_new = FuncLoader.LoadFunction<d_g_file_attribute_info_list_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_file_attribute_info_list_new"));

		public FileAttributeInfoList () 
		{
			Raw = g_file_attribute_info_list_new();
		}

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

		protected override void Ref (IntPtr raw)
		{
			if (!Owned) {
				g_file_attribute_info_list_ref (raw);
				Owned = true;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_g_file_attribute_info_list_unref(IntPtr raw);
		static d_g_file_attribute_info_list_unref g_file_attribute_info_list_unref = FuncLoader.LoadFunction<d_g_file_attribute_info_list_unref>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_file_attribute_info_list_unref"));

		protected override void Unref (IntPtr raw)
		{
			if (Owned) {
				g_file_attribute_info_list_unref (raw);
				Owned = false;
			}
		}

		class FinalizerInfo {
			IntPtr handle;
			public uint timeoutHandlerId;

			public FinalizerInfo (IntPtr handle)
			{
				this.handle = handle;
			}

			public bool Handler ()
			{
				g_file_attribute_info_list_unref (handle);
				GLib.Timeout.Remove(timeoutHandlerId);
				return false;
			}
		}

		~FileAttributeInfoList ()
		{
			if (!Owned)
				return;
			FinalizerInfo info = new FinalizerInfo (Handle);
			info.timeoutHandlerId = GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public unsafe GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("infos"
							, 0
							, (uint) sizeof( IntPtr ) // infos
							, null
							, "n_infos"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("n_infos"
							, -1
							, (uint) sizeof( int ) // n_infos
							, "infos"
							, null
							, (long) Marshal.OffsetOf<GFileAttributeInfoList_n_infosAlign>("n_infos")
							, 0
							),
					});

				return _abi_info;
			}
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GFileAttributeInfoList_n_infosAlign
		{
			sbyte f1;
			private int n_infos;
		}


		// End of the ABI representation.

#endregion
	}
}
