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

namespace Poppler {

	using System;
	using System.Collections;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public class LayersIter : GLib.Opaque {

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_layers_iter_copy(IntPtr raw);

		public Poppler.LayersIter Copy() {
			IntPtr raw_ret = poppler_layers_iter_copy(Handle);
			Poppler.LayersIter ret = raw_ret == IntPtr.Zero ? null : (Poppler.LayersIter) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.LayersIter), true);
			return ret;
		}

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_layers_iter_get_title(IntPtr raw);

		public string Title { 
			get {
				IntPtr raw_ret = poppler_layers_iter_get_title(Handle);
				string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
				return ret;
			}
		}

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_layers_iter_get_child(IntPtr raw);

		public Poppler.LayersIter Child { 
			get {
				IntPtr raw_ret = poppler_layers_iter_get_child(Handle);
				Poppler.LayersIter ret = raw_ret == IntPtr.Zero ? null : (Poppler.LayersIter) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.LayersIter), false);
				return ret;
			}
		}

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_layers_iter_get_type();

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

		[DllImport("poppler-glib")]
		static extern bool poppler_layers_iter_next(IntPtr raw);

		public bool Next() {
			bool raw_ret = poppler_layers_iter_next(Handle);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_layers_iter_get_layer(IntPtr raw);

		public Poppler.Layer Layer { 
			get {
				IntPtr raw_ret = poppler_layers_iter_get_layer(Handle);
				Poppler.Layer ret = GLib.Object.GetObject(raw_ret) as Poppler.Layer;
				return ret;
			}
		}

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

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_layers_iter_new(IntPtr document);

		public LayersIter (Poppler.Document document) 
		{
			Raw = poppler_layers_iter_new(document == null ? IntPtr.Zero : document.Handle);
		}

		[DllImport("poppler-glib")]
		static extern void poppler_layers_iter_free(IntPtr raw);

		protected override void Free (IntPtr raw)
		{
			poppler_layers_iter_free (raw);
		}

		class FinalizerInfo {
			IntPtr handle;

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

			public bool Handler ()
			{
				poppler_layers_iter_free (handle);
				return false;
			}
		}

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

#endregion
	}
}
