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

namespace Gst.Tags {

	using System;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class TagXmpWriterAdapter : GLib.GInterfaceAdapter, Gst.Tags.ITagXmpWriter {

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

		static GstTagXmpWriterInterface iface;

		static TagXmpWriterAdapter ()
		{
			GLib.GType.Register (_gtype, typeof (TagXmpWriterAdapter));
		}

		static void Initialize (IntPtr ptr, IntPtr data)
		{
		}

		GLib.Object implementor;

		public TagXmpWriterAdapter ()
		{
			InitHandler = new GLib.GInterfaceInitHandler (Initialize);
		}

		public TagXmpWriterAdapter (ITagXmpWriterImplementor implementor)
		{
			if (implementor == null)
				throw new ArgumentNullException ("implementor");
			else if (!(implementor is GLib.Object))
				throw new ArgumentException ("implementor must be a subclass of GLib.Object");
			this.implementor = implementor as GLib.Object;
		}

		public TagXmpWriterAdapter (IntPtr handle)
		{
			if (!_gtype.IsInstance (handle))
				throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
			implementor = GLib.Object.GetObject (handle);
		}

		[DllImport("libgsttag-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_tag_xmp_writer_get_type();

		private static GLib.GType _gtype = new GLib.GType (gst_tag_xmp_writer_get_type ());

		public static GLib.GType GType {
			get {
				return _gtype;
			}
		}

		public override GLib.GType GInterfaceGType {
			get {
				return _gtype;
			}
		}

		public override IntPtr Handle {
			get {
				return implementor.Handle;
			}
		}

		public IntPtr OwnedHandle {
			get {
				return implementor.OwnedHandle;
			}
		}

		public static ITagXmpWriter GetObject (IntPtr handle, bool owned)
		{
			GLib.Object obj = GLib.Object.GetObject (handle, owned);
			return GetObject (obj);
		}

		public static ITagXmpWriter GetObject (GLib.Object obj)
		{
			if (obj == null)
				return null;
			else if (obj is ITagXmpWriterImplementor)
				return new TagXmpWriterAdapter (obj as ITagXmpWriterImplementor);
			else if (obj as ITagXmpWriter == null)
				return new TagXmpWriterAdapter (obj.Handle);
			else
				return obj as ITagXmpWriter;
		}

		public ITagXmpWriterImplementor Implementor {
			get {
				return implementor as ITagXmpWriterImplementor;
			}
		}

		[DllImport("libgsttag-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_tag_xmp_writer_add_all_schemas(IntPtr raw);

		public void AddAllSchemas() {
			gst_tag_xmp_writer_add_all_schemas(Handle);
		}

		[DllImport("libgsttag-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_tag_xmp_writer_add_schema(IntPtr raw, IntPtr schema);

		public void AddSchema(string schema) {
			IntPtr native_schema = GLib.Marshaller.StringToPtrGStrdup (schema);
			gst_tag_xmp_writer_add_schema(Handle, native_schema);
			GLib.Marshaller.Free (native_schema);
		}

		[DllImport("libgsttag-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_tag_xmp_writer_has_schema(IntPtr raw, IntPtr schema);

		public bool HasSchema(string schema) {
			IntPtr native_schema = GLib.Marshaller.StringToPtrGStrdup (schema);
			bool raw_ret = gst_tag_xmp_writer_has_schema(Handle, native_schema);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_schema);
			return ret;
		}

		[DllImport("libgsttag-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_tag_xmp_writer_remove_all_schemas(IntPtr raw);

		public void RemoveAllSchemas() {
			gst_tag_xmp_writer_remove_all_schemas(Handle);
		}

		[DllImport("libgsttag-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_tag_xmp_writer_remove_schema(IntPtr raw, IntPtr schema);

		public void RemoveSchema(string schema) {
			IntPtr native_schema = GLib.Marshaller.StringToPtrGStrdup (schema);
			gst_tag_xmp_writer_remove_schema(Handle, native_schema);
			GLib.Marshaller.Free (native_schema);
		}

		[DllImport("libgsttag-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_tag_xmp_writer_tag_list_to_xmp_buffer(IntPtr raw, IntPtr taglist, bool read_only);

		public Gst.Buffer TagListToXmpBuffer(Gst.TagList taglist, bool read_only) {
			IntPtr raw_ret = gst_tag_xmp_writer_tag_list_to_xmp_buffer(Handle, taglist == null ? IntPtr.Zero : taglist.Handle, read_only);
			Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
			return ret;
		}

#endregion
	}
}
