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

namespace Gtk {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;
	using static GLib.AbiStructExtension;

#region Autogenerated code
	public partial class PrintJob : GLib.Object {

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_print_job_new(IntPtr title, IntPtr printer, IntPtr settings, IntPtr page_setup);
		static d_gtk_print_job_new gtk_print_job_new = FuncLoader.LoadFunction<d_gtk_print_job_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_new"));

		public PrintJob (string title, Gtk.Printer printer, Gtk.PrintSettings settings, Gtk.PageSetup page_setup) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (PrintJob)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				names.Add ("title");
				vals.Add (new GLib.Value (title));
				if (printer != null) {
					names.Add ("printer");
					vals.Add (new GLib.Value (printer));
				}
				if (settings != null) {
					names.Add ("settings");
					vals.Add (new GLib.Value (settings));
				}
				if (page_setup != null) {
					names.Add ("page_setup");
					vals.Add (new GLib.Value (page_setup));
				}
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			IntPtr native_title = GLib.Marshaller.StringToPtrGStrdup (title);
			Raw = gtk_print_job_new(native_title, printer == null ? IntPtr.Zero : printer.Handle, settings == null ? IntPtr.Zero : settings.Handle, page_setup == null ? IntPtr.Zero : page_setup.Handle);
			GLib.Marshaller.Free (native_title);
		}

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

		[GLib.Property ("title")]
		public string Title {
			get  {
				IntPtr raw_ret = gtk_print_job_get_title(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

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

		[GLib.Property ("printer")]
		public Gtk.Printer Printer {
			get  {
				IntPtr raw_ret = gtk_print_job_get_printer(Handle);
				Gtk.Printer ret = GLib.Object.GetObject(raw_ret) as Gtk.Printer;
				return ret;
			}
		}

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

		[GLib.Property ("settings")]
		public Gtk.PrintSettings Settings {
			get  {
				IntPtr raw_ret = gtk_print_job_get_settings(Handle);
				Gtk.PrintSettings ret = GLib.Object.GetObject(raw_ret) as Gtk.PrintSettings;
				return ret;
			}
		}

		[GLib.Property ("page-setup")]
		public Gtk.PageSetup PageSetup {
			get {
				GLib.Value val = GetProperty ("page-setup");
				Gtk.PageSetup ret = (Gtk.PageSetup) val;
				val.Dispose ();
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_print_job_get_track_print_status(IntPtr raw);
		static d_gtk_print_job_get_track_print_status gtk_print_job_get_track_print_status = FuncLoader.LoadFunction<d_gtk_print_job_get_track_print_status>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_track_print_status"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_track_print_status(IntPtr raw, bool track_status);
		static d_gtk_print_job_set_track_print_status gtk_print_job_set_track_print_status = FuncLoader.LoadFunction<d_gtk_print_job_set_track_print_status>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_track_print_status"));

		[GLib.Property ("track-print-status")]
		public bool TrackPrintStatus {
			get  {
				bool raw_ret = gtk_print_job_get_track_print_status(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_print_job_set_track_print_status(Handle, value);
			}
		}

		[GLib.Signal("status-changed")]
		public event System.EventHandler StatusChanged {
			add {
				this.AddSignalHandler ("status-changed", value);
			}
			remove {
				this.RemoveSignalHandler ("status-changed", value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_print_job_get_collate(IntPtr raw);
		static d_gtk_print_job_get_collate gtk_print_job_get_collate = FuncLoader.LoadFunction<d_gtk_print_job_get_collate>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_collate"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_collate(IntPtr raw, bool collate);
		static d_gtk_print_job_set_collate gtk_print_job_set_collate = FuncLoader.LoadFunction<d_gtk_print_job_set_collate>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_collate"));

		public bool Collate { 
			get {
				bool raw_ret = gtk_print_job_get_collate(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_collate(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate uint d_gtk_print_job_get_n_up(IntPtr raw);
		static d_gtk_print_job_get_n_up gtk_print_job_get_n_up = FuncLoader.LoadFunction<d_gtk_print_job_get_n_up>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_n_up"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_n_up(IntPtr raw, uint n_up);
		static d_gtk_print_job_set_n_up gtk_print_job_set_n_up = FuncLoader.LoadFunction<d_gtk_print_job_set_n_up>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_n_up"));

		public uint NUp { 
			get {
				uint raw_ret = gtk_print_job_get_n_up(Handle);
				uint ret = raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_n_up(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_print_job_get_n_up_layout(IntPtr raw);
		static d_gtk_print_job_get_n_up_layout gtk_print_job_get_n_up_layout = FuncLoader.LoadFunction<d_gtk_print_job_get_n_up_layout>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_n_up_layout"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_n_up_layout(IntPtr raw, int layout);
		static d_gtk_print_job_set_n_up_layout gtk_print_job_set_n_up_layout = FuncLoader.LoadFunction<d_gtk_print_job_set_n_up_layout>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_n_up_layout"));

		public Gtk.NumberUpLayout NUpLayout { 
			get {
				int raw_ret = gtk_print_job_get_n_up_layout(Handle);
				Gtk.NumberUpLayout ret = (Gtk.NumberUpLayout) raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_n_up_layout(Handle, (int) value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_print_job_get_num_copies(IntPtr raw);
		static d_gtk_print_job_get_num_copies gtk_print_job_get_num_copies = FuncLoader.LoadFunction<d_gtk_print_job_get_num_copies>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_num_copies"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_num_copies(IntPtr raw, int num_copies);
		static d_gtk_print_job_set_num_copies gtk_print_job_set_num_copies = FuncLoader.LoadFunction<d_gtk_print_job_set_num_copies>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_num_copies"));

		public int NumCopies { 
			get {
				int raw_ret = gtk_print_job_get_num_copies(Handle);
				int ret = raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_num_copies(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_print_job_get_page_ranges(IntPtr raw, out int n_ranges);
		static d_gtk_print_job_get_page_ranges gtk_print_job_get_page_ranges = FuncLoader.LoadFunction<d_gtk_print_job_get_page_ranges>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_page_ranges"));

		public Gtk.PageRange GetPageRanges(out int n_ranges) {
			IntPtr raw_ret = gtk_print_job_get_page_ranges(Handle, out n_ranges);
			Gtk.PageRange ret = Gtk.PageRange.New (raw_ret);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_print_job_get_page_set(IntPtr raw);
		static d_gtk_print_job_get_page_set gtk_print_job_get_page_set = FuncLoader.LoadFunction<d_gtk_print_job_get_page_set>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_page_set"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_page_set(IntPtr raw, int page_set);
		static d_gtk_print_job_set_page_set gtk_print_job_set_page_set = FuncLoader.LoadFunction<d_gtk_print_job_set_page_set>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_page_set"));

		public Gtk.PageSet PageSet { 
			get {
				int raw_ret = gtk_print_job_get_page_set(Handle);
				Gtk.PageSet ret = (Gtk.PageSet) raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_page_set(Handle, (int) value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_print_job_get_pages(IntPtr raw);
		static d_gtk_print_job_get_pages gtk_print_job_get_pages = FuncLoader.LoadFunction<d_gtk_print_job_get_pages>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_pages"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_pages(IntPtr raw, int pages);
		static d_gtk_print_job_set_pages gtk_print_job_set_pages = FuncLoader.LoadFunction<d_gtk_print_job_set_pages>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_pages"));

		public Gtk.PrintPages Pages { 
			get {
				int raw_ret = gtk_print_job_get_pages(Handle);
				Gtk.PrintPages ret = (Gtk.PrintPages) raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_pages(Handle, (int) value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_print_job_get_reverse(IntPtr raw);
		static d_gtk_print_job_get_reverse gtk_print_job_get_reverse = FuncLoader.LoadFunction<d_gtk_print_job_get_reverse>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_reverse"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_reverse(IntPtr raw, bool reverse);
		static d_gtk_print_job_set_reverse gtk_print_job_set_reverse = FuncLoader.LoadFunction<d_gtk_print_job_set_reverse>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_reverse"));

		public bool Reverse { 
			get {
				bool raw_ret = gtk_print_job_get_reverse(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_reverse(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_print_job_get_rotate(IntPtr raw);
		static d_gtk_print_job_get_rotate gtk_print_job_get_rotate = FuncLoader.LoadFunction<d_gtk_print_job_get_rotate>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_rotate"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_rotate(IntPtr raw, bool rotate);
		static d_gtk_print_job_set_rotate gtk_print_job_set_rotate = FuncLoader.LoadFunction<d_gtk_print_job_set_rotate>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_rotate"));

		public bool Rotate { 
			get {
				bool raw_ret = gtk_print_job_get_rotate(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_rotate(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate double d_gtk_print_job_get_scale(IntPtr raw);
		static d_gtk_print_job_get_scale gtk_print_job_get_scale = FuncLoader.LoadFunction<d_gtk_print_job_get_scale>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_scale"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_scale(IntPtr raw, double scale);
		static d_gtk_print_job_set_scale gtk_print_job_set_scale = FuncLoader.LoadFunction<d_gtk_print_job_set_scale>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_scale"));

		public double Scale { 
			get {
				double raw_ret = gtk_print_job_get_scale(Handle);
				double ret = raw_ret;
				return ret;
			}
			set {
				gtk_print_job_set_scale(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int d_gtk_print_job_get_status(IntPtr raw);
		static d_gtk_print_job_get_status gtk_print_job_get_status = FuncLoader.LoadFunction<d_gtk_print_job_get_status>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_status"));

		public Gtk.PrintStatus Status { 
			get {
				int raw_ret = gtk_print_job_get_status(Handle);
				Gtk.PrintStatus ret = (Gtk.PrintStatus) raw_ret;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_print_job_get_surface(IntPtr raw, out IntPtr error);
		static d_gtk_print_job_get_surface gtk_print_job_get_surface = FuncLoader.LoadFunction<d_gtk_print_job_get_surface>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_surface"));

		public unsafe Cairo.Surface GetSurface() {
			IntPtr error = IntPtr.Zero;
			IntPtr raw_ret = gtk_print_job_get_surface(Handle, out error);
			Cairo.Surface ret = Cairo.Surface.Lookup (raw_ret, true);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_print_job_get_type();
		static d_gtk_print_job_get_type gtk_print_job_get_type = FuncLoader.LoadFunction<d_gtk_print_job_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_get_type"));

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_send(IntPtr raw, GtkSharp.PrintJobCompleteFuncNative cb, IntPtr user_data, GLib.DestroyNotify dnotify);
		static d_gtk_print_job_send gtk_print_job_send = FuncLoader.LoadFunction<d_gtk_print_job_send>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_send"));

		public void Send(Gtk.PrintJobCompleteFunc cb) {
			GtkSharp.PrintJobCompleteFuncWrapper cb_wrapper = new GtkSharp.PrintJobCompleteFuncWrapper (cb);
			IntPtr user_data;
			GLib.DestroyNotify dnotify;
			if (cb == null) {
				user_data = IntPtr.Zero;
				dnotify = null;
			} else {
				user_data = (IntPtr) GCHandle.Alloc (cb_wrapper);
				dnotify = GLib.DestroyHelper.NotifyHandler;
			}
			gtk_print_job_send(Handle, cb_wrapper.NativeDelegate, user_data, dnotify);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_print_job_set_page_ranges(IntPtr raw, IntPtr ranges, int n_ranges);
		static d_gtk_print_job_set_page_ranges gtk_print_job_set_page_ranges = FuncLoader.LoadFunction<d_gtk_print_job_set_page_ranges>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_page_ranges"));

		public void SetPageRanges(Gtk.PageRange ranges, int n_ranges) {
			IntPtr native_ranges = GLib.Marshaller.StructureToPtrAlloc (ranges);
			gtk_print_job_set_page_ranges(Handle, native_ranges, n_ranges);
			Marshal.FreeHGlobal (native_ranges);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_print_job_set_source_fd(IntPtr raw, int fd, out IntPtr error);
		static d_gtk_print_job_set_source_fd gtk_print_job_set_source_fd = FuncLoader.LoadFunction<d_gtk_print_job_set_source_fd>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_source_fd"));

		public unsafe bool SetSourceFd(int fd) {
			IntPtr error = IntPtr.Zero;
			bool raw_ret = gtk_print_job_set_source_fd(Handle, fd, out error);
			bool ret = raw_ret;
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_print_job_set_source_file(IntPtr raw, IntPtr filename, out IntPtr error);
		static d_gtk_print_job_set_source_file gtk_print_job_set_source_file = FuncLoader.LoadFunction<d_gtk_print_job_set_source_file>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_print_job_set_source_file"));

		public unsafe bool SetSourceFile(string filename) {
			IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup (filename);
			IntPtr error = IntPtr.Zero;
			bool raw_ret = gtk_print_job_set_source_file(Handle, native_filename, out error);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_filename);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

#endregion
	}
}
