using GLib;

[CCode (cheader_filename="libgksu.h")]
namespace Gksu {
	/*
	[CCode (cprefix="GksuError")]
	public errordomain Error {
		XAUTH,
		HELPER,
		NOCOMMAND,
		NOPASSWORD,
		FORK,
		EXEC,
		PIPE,
		PIPEREAD,
		WRONGPASS,
		CHILDFAILED,
		NOT_ALLOWED,
		CANCELED,
		WRONGAUTOPASS
	}
	*/
	public class Context {
		public string user { get; set; }
		public string command { get; set; }
		public string description { get; set; }
		public string message { get; set; }
		public string alert { get; set; }
		public bool login_shell { get; set; }
		public bool keep_env { get; set; }
		public bool grab { get; set; }
		public bool debug { get; set; }
		public bool always_ask_password { get; set; }
		//public SnLauncherContext launcher_context { get; set; }

		public Context ();
		[CCode (cname="gksu_ask_password")]
			public static string ask_password () throws GLib.Error;
		[CCode (cname="gksu_ask_password_full")]
			public string ask_password_full (string prompt) throws GLib.Error;
		[CCode (cname="gksu_run")]
			public static bool run (string command_line) throws GLib.Error;
		[CCode (cname="gksu_run_full")]
			public bool run_full (AskPassFunc ask_pass, void *data, PassNotNeededFunc pass_not_needed, void *data2) throws GLib.Error;
		[CCode (cname="gksu_run_fuller")]
			public bool run_fuller (AskPassFunc ask_pass, void *data, PassNotNeededFunc pass_not_needed, void *data2, out int exit_status) throws GLib.Error;
		[CCode (cname="gksu_sudo")]
			public static bool sudo (string command_line) throws GLib.Error;
		[CCode (cname="gksu_su")]
			public static bool su (string command_line) throws GLib.Error;
		[CCode (cname="gksu_sudo_full")]
			public bool sudo_full (AskPassFunc ask_pass, void *data, PassNotNeededFunc pass_not_needed, void *data2) throws GLib.Error;
		[CCode (cname="gksu_sudo_fuller")]
			public bool sudo_fuller (AskPassFunc ask_pass, void *data, PassNotNeededFunc pass_not_needed, void *data2, out int exit_status) throws GLib.Error;
		[CCode (cname="gksu_su_full")]
			public bool su_full (AskPassFunc ask_pass, void *data, PassNotNeededFunc pass_not_needed, void *data2) throws GLib.Error;
		[CCode (cname="gksu_su_fuller")]
			public bool su_fuller (AskPassFunc ask_pass, void *data, PassNotNeededFunc pass_not_needed, void *data2, out int exit_status) throws GLib.Error;

		public delegate string AskPassFunc(string prompt, void *user_data) throws GLib.Error;
		public delegate void PassNotNeededFunc(void *user_data) throws GLib.Error;
	}
}
