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

namespace GLib {

	using System;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class ContentType {

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

		public static bool CanBeExecutable(string type) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			bool raw_ret = g_content_type_can_be_executable(native_type);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_type);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_g_content_type_equals(IntPtr type1, IntPtr type2);
		static d_g_content_type_equals g_content_type_equals = FuncLoader.LoadFunction<d_g_content_type_equals>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_content_type_equals"));

		public static bool Equals(string type1, string type2) {
			IntPtr native_type1 = GLib.Marshaller.StringToPtrGStrdup (type1);
			IntPtr native_type2 = GLib.Marshaller.StringToPtrGStrdup (type2);
			bool raw_ret = g_content_type_equals(native_type1, native_type2);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_type1);
			GLib.Marshaller.Free (native_type2);
			return ret;
		}

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

		public static string FromMimeType(string mime_type) {
			IntPtr native_mime_type = GLib.Marshaller.StringToPtrGStrdup (mime_type);
			IntPtr raw_ret = g_content_type_from_mime_type(native_mime_type);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			GLib.Marshaller.Free (native_mime_type);
			return ret;
		}

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

		public static string GetDescription(string type) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			IntPtr raw_ret = g_content_type_get_description(native_type);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			GLib.Marshaller.Free (native_type);
			return ret;
		}

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

		public static string TypeGetGenericIconName(string type) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			IntPtr raw_ret = g_content_type_get_generic_icon_name(native_type);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			GLib.Marshaller.Free (native_type);
			return ret;
		}

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

		public static GLib.IIcon GetIcon(string type) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			IntPtr raw_ret = g_content_type_get_icon(native_type);
			GLib.IIcon ret = GLib.IconAdapter.GetObject (raw_ret, false);
			GLib.Marshaller.Free (native_type);
			return ret;
		}

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

		public static string GetMimeType(string type) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			IntPtr raw_ret = g_content_type_get_mime_type(native_type);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			GLib.Marshaller.Free (native_type);
			return ret;
		}

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

		public static GLib.IIcon TypeGetSymbolicIcon(string type) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			IntPtr raw_ret = g_content_type_get_symbolic_icon(native_type);
			GLib.IIcon ret = GLib.IconAdapter.GetObject (raw_ret, false);
			GLib.Marshaller.Free (native_type);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_g_content_type_guess(IntPtr filename, byte[] data, UIntPtr n_data, out bool result_uncertain);
		static d_g_content_type_guess g_content_type_guess = FuncLoader.LoadFunction<d_g_content_type_guess>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_content_type_guess"));

		public static string Guess(string filename, byte[] data, out bool result_uncertain) {
			IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup (filename);
			IntPtr raw_ret = g_content_type_guess(native_filename, data, new UIntPtr ((ulong) (data == null ? 0 : data.Length)), out result_uncertain);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			GLib.Marshaller.Free (native_filename);
			return ret;
		}

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

		public static string GuessForTree(GLib.IFile root) {
			IntPtr raw_ret = g_content_type_guess_for_tree(root == null ? IntPtr.Zero : ((root is GLib.Object) ? (root as GLib.Object).Handle : (root as GLib.FileAdapter).Handle));
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_g_content_type_is_a(IntPtr type, IntPtr supertype);
		static d_g_content_type_is_a g_content_type_is_a = FuncLoader.LoadFunction<d_g_content_type_is_a>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_content_type_is_a"));

		public static bool IsA(string type, string supertype) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			IntPtr native_supertype = GLib.Marshaller.StringToPtrGStrdup (supertype);
			bool raw_ret = g_content_type_is_a(native_type, native_supertype);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_type);
			GLib.Marshaller.Free (native_supertype);
			return ret;
		}

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

		public static bool IsUnknown(string type) {
			IntPtr native_type = GLib.Marshaller.StringToPtrGStrdup (type);
			bool raw_ret = g_content_type_is_unknown(native_type);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_type);
			return ret;
		}

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

		public static string[] Registered { 
			get {
				IntPtr raw_ret = g_content_types_get_registered();
				string[] ret = GLib.Marshaller.ListPtrToArray<string, string> (raw_ret, true, true);
				return ret;
			}
		}

#endregion
	}
}
