/* httpseverywhere-0.8.vapi generated by valac 0.38.6, do not modify. */

namespace HTTPSEverywhere {
	[CCode (cheader_filename = "httpseverywhere.h")]
	public class Context : GLib.Object {
		public enum RewriteResult {
			OK,
			NO_MATCH,
			NO_RULESET
		}
		public Context ();
		public bool has_https (string url);
		public void ignore_host (string host);
		public void ignore_ruleset (uint id);
		public async void init (GLib.Cancellable? cancellable = null) throws GLib.IOError;
		public string rewrite (string url);
		public HTTPSEverywhere.Context.RewriteResult rewrite_result ();
		public void unignore_host (string host);
		public void unignore_ruleset (uint id);
		public bool initialized { get; private set; }
	}
	[CCode (cheader_filename = "httpseverywhere.h")]
	public class Ruleset : GLib.Object {
		public Ruleset ();
		public void add_exclusion (string exclusion);
		public void add_rule (string from, string to);
		public void add_target (string host);
		public Ruleset.from_json (Json.Node root) throws HTTPSEverywhere.RulesetError;
		public string rewrite (string url);
		public Gee.ArrayList<HTTPSEverywhere.Target> targets { get; }
	}
	[CCode (cheader_filename = "httpseverywhere.h")]
	public class Target : GLib.Object {
		public Target (string host);
		public bool matches (string url);
		public string host { get; set; }
	}
	[CCode (cheader_filename = "httpseverywhere.h")]
	public class Updater : GLib.Object {
		public Updater (HTTPSEverywhere.Context context);
		public async void update (GLib.Cancellable? cancellable = null) throws HTTPSEverywhere.UpdateError, GLib.IOError;
		public HTTPSEverywhere.UpdateState update_state { get; private set; }
	}
	[CCode (cheader_filename = "httpseverywhere.h")]
	public enum UpdateState {
		FINISHED,
		CHECKING_AVAILABILITY,
		DOWNLOADING_XPI,
		DECOMPRESSING_XPI,
		COPYING_RULES
	}
	[CCode (cheader_filename = "httpseverywhere.h")]
	public errordomain ContextError {
		NOT_IMPLEMENTED
	}
	[CCode (cheader_filename = "httpseverywhere.h")]
	public errordomain RulesetError {
		PARSE_ERROR
	}
	[CCode (cheader_filename = "httpseverywhere.h")]
	public errordomain UpdateError {
		IN_PROGRESS,
		NO_UPDATE_AVAILABLE,
		CANT_REACH_SERVER,
		CANT_READ_HTTP_BODY,
		CANT_READ_FROM_ARCHIVE,
		NO_RULESET_FILE,
		WRITE_FAILED
	}
}
