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

namespace Gst {

	using System;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class TagSetterAdapter : GLib.GInterfaceAdapter, Gst.ITagSetter {

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

		static GstTagSetterInterface iface;

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

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

		GLib.Object implementor;

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

		public TagSetterAdapter (ITagSetterImplementor 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 TagSetterAdapter (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("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_tag_setter_get_type();

		private static GLib.GType _gtype = new GLib.GType (gst_tag_setter_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 ITagSetter GetObject (IntPtr handle, bool owned)
		{
			GLib.Object obj = GLib.Object.GetObject (handle, owned);
			return GetObject (obj);
		}

		public static ITagSetter GetObject (GLib.Object obj)
		{
			if (obj == null)
				return null;
			else if (obj is ITagSetterImplementor)
				return new TagSetterAdapter (obj as ITagSetterImplementor);
			else if (obj as ITagSetter == null)
				return new TagSetterAdapter (obj.Handle);
			else
				return obj as ITagSetter;
		}

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

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_tag_setter_add_tag_value(IntPtr raw, int mode, IntPtr tag, IntPtr value);

		public void AddTagValue(Gst.TagMergeMode mode, string tag, GLib.Value value) {
			IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
			IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
			gst_tag_setter_add_tag_value(Handle, (int) mode, native_tag, native_value);
			GLib.Marshaller.Free (native_tag);
			Marshal.FreeHGlobal (native_value);
		}

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

		public Gst.TagList TagList { 
			get {
				IntPtr raw_ret = gst_tag_setter_get_tag_list(Handle);
				Gst.TagList ret = raw_ret == IntPtr.Zero ? null : (Gst.TagList) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.TagList), false);
				return ret;
			}
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_tag_setter_get_tag_merge_mode(IntPtr raw);

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_tag_setter_set_tag_merge_mode(IntPtr raw, int mode);

		public Gst.TagMergeMode TagMergeMode { 
			get {
				int raw_ret = gst_tag_setter_get_tag_merge_mode(Handle);
				Gst.TagMergeMode ret = (Gst.TagMergeMode) raw_ret;
				return ret;
			}
			set {
				gst_tag_setter_set_tag_merge_mode(Handle, (int) value);
			}
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_tag_setter_merge_tags(IntPtr raw, IntPtr list, int mode);

		public void MergeTags(Gst.TagList list, Gst.TagMergeMode mode) {
			gst_tag_setter_merge_tags(Handle, list == null ? IntPtr.Zero : list.Handle, (int) mode);
		}

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

		public void ResetTags() {
			gst_tag_setter_reset_tags(Handle);
		}

#endregion
	}
}
