/++
	A web view wrapper. Uses CEF on Linux and WebView2 on Windows.

	Microsoft WebView2 is fairly stable and is unlikely to break, but CEF
	is not remotely stable and likely to break every release. You'll have
	to get the same version as me to use this unless you want to generate
	your own bindings (procedure found in the file comments). Details below.


	I currently built against the version listed below and it uses UTF-16 strings.

	July 2024-present: 126.2.10+g61241e4+chromium-126.0.6478.127

	November 2023: cef_binary_119.3.1+gf768881+chromium-119.0.6045.124_linux64_minimal.tar.bz2

	November 2022: cef_binary_107.1.9+g1f0a21a+chromium-107.0.5304.110_linux64_minimal.tar.bz2

	November 2021: 95.7.17+g4208276+chromium-95.0.4638.69

	Note my ceftranslate.d for instructions to start the update process.

	Then to install the cef put in the Resources in the Release directory (*.pak and *.dat
	out of Resources, failure to do this will cause an abort on ICU file descriptor things)
	and copy the locales to /opt/cef/Resources/Locales

	You can download compatible builds from https://cef-builds.spotifycdn.com/index.html
	just make sure to put in the version filter and check "all builds" to match it.

	You do NOT actually need the cef to build the application, but it must be
	on the user's machine to run it. It looks in /opt/cef/ on Linux.

	Work in progress. DO NOT USE YET as I am prolly gonna break everything too.

	On Windows, you need to distribute the WebView2Loader.dll with your exe. That
	is found in the web view 2 sdk. Furthermore, users will have to install the runtime.

	Please note; the Microsoft terms and conditions say they may be able to collect
	information about your users if you use this on Windows.
	see: https://developer.microsoft.com/en-us/microsoft-edge/webview2/


+/
module arsd.webview;

enum WebviewEngine {
	none,
	cef,
	wv2,
	webkit_gtk
}
// see activeEngine which is an enum you can static if on


// I might recover this gtk thing but i don't like gtk
// dmdi webview -version=linux_gtk -version=Demo

// the setup link for Microsoft:
// https://go.microsoft.com/fwlink/p/?LinkId=2124703


version(Windows) {
import arsd.simpledisplay;
import arsd.com;
import core.atomic;

//import std.stdio;

private template InvokerArgFor(T, Context) {
	alias invoker = typeof(&T.init.Invoke);
	static if(is(invoker fntype == delegate)) {
		static if(is(fntype Params == __parameters))
			alias InvokerArgFor = HRESULT function(Params, Context);
		else
			static assert(0);
	}
}

T callback(T, Context)(InvokerArgFor!(T, Context) dg, Context ctx) {
	return new class(dg, ctx) T {
		extern(Windows):

		static if(is(typeof(T.init.Invoke) R == return))
		static if(is(typeof(T.init.Invoke) P == __parameters))
  		override R Invoke(P _args_) {
			return dgMember(_args_, ctxMember);
		}

		InvokerArgFor!(T, Context) dgMember;
		Context ctxMember;

		this(typeof(dgMember) dg_, Context ctx_) {
			this.dgMember = dg_;
			this.ctxMember = ctx_;
			AddRef();
		}

		override HRESULT QueryInterface(const (IID)*riid, LPVOID *ppv) {
			if (IID_IUnknown == *riid) {
				*ppv = cast(void*) cast(IUnknown) this;
			}
			else if (T.iid == *riid) {
				*ppv = cast(void*) cast(T) this;
			}
			else {
				*ppv = null;
				return E_NOINTERFACE;
			}

			AddRef();
			return NOERROR;
		}

		shared LONG count = 0;
		ULONG AddRef() {
			auto cnt = atomicOp!"+="(count, 1);
			if(cnt == 1) {
				import core.memory;
				GC.addRoot(cast(void*) this);
			}
			return cnt;
		}
		ULONG Release() {
			auto cnt = atomicOp!"-="(count, 1);
			if(cnt == 0) {
				import core.memory;
				GC.removeRoot(cast(void*) this);
			}
			return cnt;
		}
	};
}

enum activeEngine = WebviewEngine.wv2;

struct RC(T) {
	private T object;
	this(T t, bool addRef = true) {
		object = t;
		if(addRef && object)
			object.AddRef();
	}
	this(this) {
		if(object is null) return;
		object.AddRef();
	}
	~this() {
		if(object is null) return;
		object.Release();
		object = null;
	}

	RC!I queryInterface(I)() {
		I i;
		auto err = object.QueryInterface(&I.iid, cast(void**) &i);
		if(err != S_OK)
			return RC!I(null, false);
		else
			return RC!I(i, false); // QueryInterface already calls AddRef
	}

	bool opCast(T:bool)() nothrow {
		return object !is null;
	}

	void opAssign(T obj) {
		obj.AddRef();
		if(object)
			object.Release();
		this.object = obj;
	}

	T raw() { return object; }

	T returnable() {
		if(object is null) return null;
		return object;
	}

	T passable() {
		if(object is null) return null;
		object.AddRef();
		return object;
	}

	static foreach(memberName; __traits(allMembers /*derivedMembers*/, T)) {
		mixin ForwardMethod!(memberName);
	}
}

/+
// does NOT add ref, use after you queryInterface
RC!T makeRcd(T)(T t) {
	return RC!T(t, false);
}
+/

extern(Windows)
alias StringMethod = int delegate(wchar**);

string toGC(scope StringMethod dg) {
	wchar* t;
	auto res = dg(&t);
	if(res != S_OK)
		throw new ComException(res);

	auto ot = t;

	string s;

	while(*t) {
		import std.utf;
		char[4] buffer;
		wchar item = *t;
		t++;
		if(item >= 0xD800 && item <= 0xDFFF) {
			wchar second = *t;
			t++;
			wchar low, high;
			if(item >= 0xD800 && item <= 0xDBFF) {
				high = item;
				low = second;
			} else {
				high = second;
				low = item;
			}

			if(
				high >= 0xD800 && high <= 0xDBFF
				&&
				low >= 0xDC00 && low <= 0xDCFF
			 ) {
				dchar d = (high - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000;

				s ~= buffer[0 .. encode(buffer, d)];
			} else {
				// we could probably throw something tbh
			}
		} else {
			s ~= buffer[0 .. encode(buffer, item)];
		}
	}

	auto ret = s;

	CoTaskMemFree(ot);

	return ret;
}

class ComException : Exception {
	HRESULT errorCode;
	this(HRESULT errorCode) {
		import std.format;
		super(format("HRESULT: 0x%08x", errorCode));
		// FIXME: call FormatMessage
	}
}

mixin template ForwardMethod(string methodName) {
	static if(methodName.length > 4 && methodName[0 .. 4] == "put_") {
		static if(is(typeof(__traits(getMember, T, memberName)) Params == function))
			private alias Type = Params[0];
		mixin(q{ @property void } ~ memberName[4 .. $] ~ q{(Type v) {
			auto errorCode = __traits(getMember, object, memberName)(v);
			if(errorCode)
				throw new ComException(errorCode);
		}
		});
	} else
	static if(methodName.length > 4 && methodName[0 .. 4] == "get_") {
		static if(is(typeof(__traits(getMember, T, memberName)) Params == function))
			private alias Type = typeof(*(Params[0].init));
		mixin(q{ @property Type } ~ memberName[4 .. $] ~ q{() {
			Type response;
			auto errorCode = __traits(getMember, object, memberName)(&response);
			if(errorCode)
				throw new ComException(errorCode);
			return response;
		}
		});
	} else
	static if(methodName.length > 4 && methodName[0 .. 4] == "add_") {
		static if(is(typeof(__traits(getMember, T, memberName)) Params == function))
			alias Handler = Params[0];
		mixin(q{ EventRegistrationToken } ~ memberName ~ q{ (Context)(InvokerArgFor!(Handler, Context) handler, Context ctx) {
			EventRegistrationToken token;
			__traits(getMember, object, memberName)(callback!(Handler, Context)(handler, ctx), &token);
			return token;
		}});
	} else
	static if(methodName.length > 7 && methodName[0 .. 4] == "remove_") {
		mixin(q{ void } ~ memberName ~ q{ (EventRegistrationToken token) {
			__traits(getMember, object, memberName)(token);
		}});
	} else {
		// I could do the return value things by looking for these comments:
		// /+[out]+/ but be warned it is possible or a thing to have multiple out params (only one such function in here though i think)
		// /+[out, retval]+/
		// a find/replace could make them a UDA or something.

		static if(is(typeof(__traits(getMember, T, memberName)) Params == function))
		static if(is(typeof(__traits(getMember, T, memberName)) Return == return))

		mixin(q{ Return } ~ memberName ~ q{ (Params p) {
			// FIXME: check the return value and throw
			return __traits(getMember, object, memberName)(p);
		}
		});

	}
}

struct Wv2App {
	static bool active = false;

	static HRESULT code;
	static bool initialized = false;
	static RC!ICoreWebView2Environment webview_env;

	@disable this(this);

	static void delegate(RC!ICoreWebView2Environment)[] pending;
	this(void delegate(RC!ICoreWebView2Environment) withEnvironment) {
		if(withEnvironment)
			pending ~= withEnvironment;

		import core.sys.windows.com;
		CoInitializeEx(null, COINIT_APARTMENTTHREADED);

		active = true;

		auto lib = LoadLibraryW("WebView2Loader.dll"w.ptr);
		typeof(&CreateCoreWebView2EnvironmentWithOptions) func;

		if(lib is null)
			throw new Exception("WebView2Loader.dll unable to load. The developer should bundle this with the application exe. It is found with the WebView2 SDK from nuget.");
		func = cast(typeof(func)) GetProcAddress(lib, CreateCoreWebView2EnvironmentWithOptions.mangleof);
		if(func is null)
			throw new Exception("CreateCoreWebView2EnvironmentWithOptions failed from WebView2Loader...");

		auto result = func(null, null, null,
			callback!(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler, Wv2App*)(
				function(error, env, this_) {
					this_.initialized = true;
					this_.code = error;

					if(error)
						return error;

					this_.webview_env = env;

					auto len = pending.length;
					foreach(item; this_.pending) {
						item(this_.webview_env);
					}

					this_.pending = this_.pending[len .. $];

					return S_OK;
				}
			, &this)
		);

		if(result != S_OK) {
			if(MessageBox(null, "The WebView2 runtime is not installed. Would you like to install it now? This will open a browser to download a file. After it installs, you can try running this program again.", "Missing file", MB_YESNO) == IDYES) {
				import std.process;
				browse("https://go.microsoft.com/fwlink/p/?LinkId=2124703");
			}
			throw new ComException(result);
		}
	}

	@disable this();

	~this() {
		active = false;
	}

	static void useEnvironment(void delegate(RC!ICoreWebView2Environment) withEnvironment) {
		assert(active);
		assert(withEnvironment !is null);
		if(initialized) {
			if(code)
				throw new ComException(code);
			withEnvironment(webview_env);
		} else
			pending ~= withEnvironment;
	}
}
}



/+
interface WebView {
	void refresh();
	void back();
	void forward();
	void stop();

	void navigate(string url);

	// the url and line are for error reporting purposes
	void executeJavascript(string code, string url = null, int line = 0);

	void showDevTools();

	// these are get/set properties that you can subscribe to with some system

	mixin Observable!(string, "title");
	mixin Observable!(string, "url");
	mixin Observable!(string, "status");
	mixin Observable!(int, "loadingProgress");
}
+/


version(linux) {
version(linux_gtk) {} else
	version=cef;
}


version(cef) {
import arsd.simpledisplay;

//pragma(lib, "cef");

class BrowserProcessHandler : CEF!cef_browser_process_handler_t {
	this(void delegate(string dir, string[] args) onAlreadyRunningAppRelaunch) {
		this.onAlreadyRunningAppRelaunch = onAlreadyRunningAppRelaunch;
	}

	private void delegate(string dir, string[] args) onAlreadyRunningAppRelaunch;

	override void on_context_initialized() { }

	override void on_before_child_process_launch(RC!cef_command_line_t) { }
	override void on_schedule_message_pump_work(long delayMs) { }
	override cef_client_t* get_default_client() { return null; }
	override void on_register_custom_preferences(cef_preferences_type_t, cef_preference_registrar_t*) {}

	override int on_already_running_app_relaunch(RC!(cef_command_line_t) command_line, const(cef_string_utf16_t)* current_directory) nothrow {
		if(onAlreadyRunningAppRelaunch) {

			string[] argList;

			if(command_line.has_arguments()) {
				cef_string_list_t thing = libcef.string_list_alloc();

				command_line.get_arguments(thing);

				auto count = libcef.string_list_size(thing);
				foreach(i; 0 .. count) {
					cef_string_utf16_t v;

					libcef.string_list_value(thing, i, &v);

					argList ~= toGC(&v);
				}
				libcef.string_list_free(thing);
			}

			try {
				onAlreadyRunningAppRelaunch(
					toGC(current_directory),
					argList
				);
			} catch(Exception e) {

			}

			return 1;
		} else {
			return 0;
		}
	}
	override cef_request_context_handler_t* get_default_request_context_handler() nothrow {
		return null;
	}
}


int cefProcessHelper() {
	import core.runtime;
	import core.stdc.stdlib;

	cef_main_args_t main_args;
	version(linux) {
		main_args.argc = Runtime.cArgs.argc;
		main_args.argv = Runtime.cArgs.argv;
	} else version(Windows) {
		main_args.instance = GetModuleHandle(null);
	}

	if(libcef.loadDynamicLibrary()) {
		int code = libcef.execute_process(&main_args, null, null);
		if(code >= 0)
			exit(code);
		return code;
	}
	return -1;
}

shared static this() {
	cefProcessHelper();
}

public struct CefApp {
	static bool active() {
		return count > 0;
	}

	private __gshared int count = 0;

	@disable this(this);
	@disable new();
	this(void delegate(cef_settings_t* settings) setSettings, void delegate(string dir, string[] args) onAlreadyRunningAppRelaunch) {

		if(!libcef.loadDynamicLibrary())
			throw new Exception("failed to load cef dll");

		count++;

		import core.runtime;
		import core.stdc.stdlib;

		cef_main_args_t main_args;
		version(linux) {
			main_args.argc = Runtime.cArgs.argc;
			main_args.argv = Runtime.cArgs.argv;
		} else version(Windows) {
			main_args.instance = GetModuleHandle(null);
		}

		cef_settings_t settings;
		settings.size = cef_settings_t.sizeof;
		//settings.log_severity = cef_log_severity_t.LOGSEVERITY_DISABLE; // Show only warnings/errors
		settings.log_severity = cef_log_severity_t.LOGSEVERITY_INFO; // Show only warnings/errors
		settings.multi_threaded_message_loop = 1;
		settings.no_sandbox = 1;

		version(linux)
		settings.locales_dir_path = cef_string_t("/opt/cef/Resources/locales");

		if(setSettings !is null)
			setSettings(&settings);


		auto app = new class(onAlreadyRunningAppRelaunch) CEF!cef_app_t {
			BrowserProcessHandler bph;
			this(void delegate(string dir, string[] args) onAlreadyRunningAppRelaunch) {
				bph = new BrowserProcessHandler(onAlreadyRunningAppRelaunch);
			}
			override void on_before_command_line_processing(const(cef_string_t)*, RC!cef_command_line_t) {}

			override cef_resource_bundle_handler_t* get_resource_bundle_handler() {
				return null;
			}
			override cef_browser_process_handler_t* get_browser_process_handler() {
				return bph.returnable;
			}
			override cef_render_process_handler_t* get_render_process_handler() {
				return null;
			}
			override void on_register_custom_schemes(cef_scheme_registrar_t*) {

			}
		};

		if(!libcef.initialize(&main_args, &settings, app.passable, null)) {
			throw new Exception("cef_initialize failed");
		}
	}

	~this() {
		count--;
		// this call hangs and idk why.
		// FIXME
		//libcef.shutdown();
	}
}


version(Demo)
void main() {
	auto app = CefApp(null);

	auto window = new SimpleWindow(640, 480, "D Browser", Resizability.allowResizing);
	flushGui;

	cef_window_info_t window_info;
	/*
	window_info.x = 100;
	window_info.y = 100;
	window_info.width = 300;
	window_info.height = 300;
	*/
	//window_info.parent_window = window.nativeWindowHandle;

	cef_string_t cef_url = cef_string_t("http://dpldocs.info/");//"http://youtube.com/"w);

	//string url = "http://arsdnet.net/";
	//cef_string_utf8_to_utf16(url.ptr, url.length, &cef_url);

	cef_browser_settings_t browser_settings;
	browser_settings.size = cef_browser_settings_t.sizeof;

	auto client = new MyCefClient();

	auto got = libcef.browser_host_create_browser(&window_info, client.passable, &cef_url, &browser_settings, null, null); // or _sync

	window.eventLoop(0);
}


/++
	This gives access to the CEF functions. If you get a linker error for using an undefined function,
	it is probably because you did NOT go through this when dynamically loading.

	(...similarly, if you get a segfault, it is probably because you DID go through this when static binding.)
+/
struct libcef {
	static __gshared:

	bool isLoaded;
	bool loadAttempted;
	void* libHandle;

	/// Make sure you call this only from one thread, probably at process startup. It caches internally and returns true if the load was successful.
	bool loadDynamicLibrary() {
		if(loadAttempted)
			return isLoaded;

		loadAttempted = true;

		version(linux) {
			import core.sys.posix.dlfcn;
			libHandle = dlopen("libcef.so", RTLD_NOW);

			static void* loadsym(const char* name) {
				return dlsym(libHandle, name);
			}
		} else version(Windows) {
			import core.sys.windows.windows;
			libHandle = LoadLibrary("libcef.dll");

			static void* loadsym(const char* name) {
				return GetProcAddress(libHandle, name);
			}
		}

		//import std.stdio;
		if(libHandle is null) {
			// import std.stdio; writeln("libhandle null");
			import core.stdc.stdio; printf("%s\n", dlerror());
			// import core.stdc.errno; writeln(errno);
			return false;
		}
		foreach(memberName; __traits(allMembers, libcef)[4 .. $]) { // cutting off everything until the actual static foreach below; this trims off isLoaded to loadDynamicLibrary
			alias mem = __traits(getMember, libcef, memberName);
			mem = cast(typeof(mem)) loadsym("cef_" ~ memberName);
			if(mem is null) {
				 // import std.stdio; writeln(memberName); throw new Exception("cef_" ~ memberName ~ " failed to load");
				return false;
			}
		}

		import core.stdc.string;
		if(strcmp(libcef.api_hash(1), CEF_API_HASH_UNIVERSAL) != 0)
			throw new Exception("libcef versions not matching bindings");

		isLoaded = true;
		return true;
	}

	static foreach(memberName; __traits(allMembers, arsd.webview))
	static if(is(typeof(__traits(getMember, arsd.webview, memberName)) == function))
	static if(memberName.length > 4 && memberName[0 .. 4] == "cef_") {
		mixin(q{ typeof(&__traits(getMember, arsd.webview, memberName)) } ~ memberName[4 .. $] ~ ";"); // = &" ~ memberName ~ ";");
	}
}

}

version(linux_gtk)
version(Demo)
void main() {
	auto wv = new WebView(true, null);
	wv.navigate("http://dpldocs.info/");
	wv.setTitle("omg a D webview");
	wv.setSize(500, 500, true);
	wv.eval("console.log('just testing');");
	wv.run();
}

version(linux_gtk)
enum activeEngine = WebviewEngine.webkit_gtk;

/++

+/
version(linux_gtk)
class WebView : browser_engine {

	/++
		Creates a new webview instance. If dbg is non-zero - developer tools will
		be enabled (if the platform supports them). Window parameter can be a
		pointer to the native window handle. If it's non-null - then child WebView
		is embedded into the given parent window. Otherwise a new window is created.
		Depending on the platform, a GtkWindow, NSWindow or HWND pointer can be
		passed here.
	+/
	this(bool dbg, void* window) {
		super(&on_message, dbg, window);
	}

	extern(C)
	static void on_message(const char*) {}

	/// Destroys a webview and closes the native window.
	void destroy() {

	}

	/// Runs the main loop until it's terminated. After this function exits - you
	/// must destroy the webview.
	override void run() { super.run(); }

	/// Stops the main loop. It is safe to call this function from another other
	/// background thread.
	override void terminate() { super.terminate(); }

	/+
	/// Posts a function to be executed on the main thread. You normally do not need
	/// to call this function, unless you want to tweak the native window.
	void dispatch(void function(WebView w, void *arg) fn, void *arg) {}
	+/

	/// Returns a native window handle pointer. When using GTK backend the pointer
	/// is GtkWindow pointer, when using Cocoa backend the pointer is NSWindow
	/// pointer, when using Win32 backend the pointer is HWND pointer.
	void* getWindow() { return m_window; }

	/// Updates the title of the native window. Must be called from the UI thread.
	override void setTitle(const char *title) { super.setTitle(title); }

	/// Navigates webview to the given URL. URL may be a data URI.
	override void navigate(const char *url) { super.navigate(url); }

	/// Injects JavaScript code at the initialization of the new page. Every time
	/// the webview will open a the new page - this initialization code will be
	/// executed. It is guaranteed that code is executed before window.onload.
	override void init(const char *js) { super.init(js); }

	/// Evaluates arbitrary JavaScript code. Evaluation happens asynchronously, also
	/// the result of the expression is ignored. Use RPC bindings if you want to
	/// receive notifications about the results of the evaluation.
	override void eval(const char *js) { super.eval(js); }

	/// Binds a native C callback so that it will appear under the given name as a
	/// global JavaScript function. Internally it uses webview_init(). Callback
	/// receives a request string and a user-provided argument pointer. Request
	/// string is a JSON array of all the arguments passed to the JavaScript
	/// function.
	void bind(const char *name, void function(const char *, void *) fn, void *arg) {}

	/// Allows to return a value from the native binding. Original request pointer
	/// must be provided to help internal RPC engine match requests with responses.
	/// If status is zero - result is expected to be a valid JSON result value.
	/// If status is not zero - result is an error JSON object.
	void webview_return(const char *req, int status, const char *result) {}

  /*
  void on_message(const char *msg) {
    auto seq = json_parse(msg, "seq", 0);
    auto name = json_parse(msg, "name", 0);
    auto args = json_parse(msg, "args", 0);
    auto fn = bindings[name];
    if (fn == null) {
      return;
    }
    std::async(std::launch::async, [=]() {
      auto result = (*fn)(args);
      dispatch([=]() {
        eval(("var b = window['" + name + "'];b['callbacks'][" + seq + "](" +
              result + ");b['callbacks'][" + seq +
              "] = undefined;b['errors'][" + seq + "] = undefined;")
                 .c_str());
      });
    });
  }
  std::map<std::string, binding_t *> bindings;

  alias binding_t = std::function<std::string(std::string)>;

  void bind(const char *name, binding_t f) {
    auto js = "(function() { var name = '" + std::string(name) + "';" + R"(
      window[name] = function() {
        var me = window[name];
        var errors = me['errors'];
        var callbacks = me['callbacks'];
        if (!callbacks) {
          callbacks = {};
          me['callbacks'] = callbacks;
        }
        if (!errors) {
          errors = {};
          me['errors'] = errors;
        }
        var seq = (me['lastSeq'] || 0) + 1;
        me['lastSeq'] = seq;
        var promise = new Promise(function(resolve, reject) {
          callbacks[seq] = resolve;
          errors[seq] = reject;
        });
        window.external.invoke(JSON.stringify({
          name: name,
          seq:seq,
          args: Array.prototype.slice.call(arguments),
        }));
        return promise;
      }
    })())";
    init(js.c_str());
    bindings[name] = new binding_t(f);
  }

*/
}

private extern(C) {
	alias dispatch_fn_t = void function();
	alias msg_cb_t = void function(const char *msg);
}

version(linux_gtk) {


/* Original https://github.com/zserge/webview notice below:
 * MIT License
 *
 * Copyright (c) 2017 Serge Zaitsev
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/*
	Port to D by Adam D. Ruppe, November 30, 2019
*/


	pragma(lib, "gtk-3");
	pragma(lib, "glib-2.0");
	pragma(lib, "gobject-2.0");
	pragma(lib, "webkit2gtk-4.0");
	pragma(lib, "javascriptcoregtk-4.0");

	private extern(C) {
		import core.stdc.config;
		alias GtkWidget = void;
		enum GtkWindowType {
			GTK_WINDOW_TOPLEVEL = 0
		}
		bool gtk_init_check(int*, char***);
		GtkWidget* gtk_window_new(GtkWindowType);
		c_ulong g_signal_connect_data(void*, const char*, void* /* function pointer!!! */, void*, void*, int);
		GtkWidget* webkit_web_view_new();
		alias WebKitUserContentManager = void;
		WebKitUserContentManager* webkit_web_view_get_user_content_manager(GtkWidget*);

		void gtk_container_add(GtkWidget*, GtkWidget*);
		void gtk_widget_grab_focus(GtkWidget*);
		void gtk_widget_show_all(GtkWidget*);
		void gtk_main();
		void gtk_main_quit();
		void webkit_web_view_load_uri(GtkWidget*, const char*);
		alias WebKitSettings = void;
		WebKitSettings* webkit_web_view_get_settings(GtkWidget*);
		void webkit_settings_set_enable_write_console_messages_to_stdout(WebKitSettings*, bool);
		void webkit_settings_set_enable_developer_extras(WebKitSettings*, bool);
		void webkit_user_content_manager_register_script_message_handler(WebKitUserContentManager*, const char*);
		alias JSCValue = void;
		alias WebKitJavascriptResult = void;
		JSCValue* webkit_javascript_result_get_js_value(WebKitJavascriptResult*);
		char* jsc_value_to_string(JSCValue*);
		void g_free(void*);
		void webkit_web_view_run_javascript(GtkWidget*, const char*, void*, void*, void*);
		alias WebKitUserScript = void;
		void webkit_user_content_manager_add_script(WebKitUserContentManager*, WebKitUserScript*);
		WebKitUserScript* webkit_user_script_new(const char*, WebKitUserContentInjectedFrames, WebKitUserScriptInjectionTime, const char*, const char*);
		enum WebKitUserContentInjectedFrames {
			WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES,
			WEBKIT_USER_CONTENT_INJECT_TOP_FRAME
		}
		enum WebKitUserScriptInjectionTime {
			WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START,
			WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END
		}
		void gtk_window_set_title(GtkWidget*, const char*);

		void gtk_window_set_resizable(GtkWidget*, bool);
		void gtk_window_set_default_size(GtkWidget*, int, int);
		void gtk_widget_set_size_request(GtkWidget*, int, int);
	}

	private class browser_engine {

		static extern(C)
		void ondestroy (GtkWidget *w, void* arg) {
			(cast(browser_engine) arg).terminate();
		}

		static extern(C)
		void smr(WebKitUserContentManager* m, WebKitJavascriptResult* r, void* arg) {
			auto w = cast(browser_engine) arg;
			JSCValue *value = webkit_javascript_result_get_js_value(r);
			auto s = jsc_value_to_string(value);
			w.m_cb(s);
			g_free(s);
		}

		this(msg_cb_t cb, bool dbg, void* window) {
			m_cb = cb;

			gtk_init_check(null, null);
			m_window = cast(GtkWidget*) window;
			if (m_window == null)
				m_window = gtk_window_new(GtkWindowType.GTK_WINDOW_TOPLEVEL);

			g_signal_connect_data(m_window, "destroy", &ondestroy, cast(void*) this, null, 0);

			m_webview = webkit_web_view_new();
			WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webview);

			g_signal_connect_data(manager, "script-message-received::external", &smr, cast(void*) this, null, 0);
			webkit_user_content_manager_register_script_message_handler(manager, "external");
			init("window.external={invoke:function(s){window.webkit.messageHandlers.external.postMessage(s);}}");

			gtk_container_add(m_window, m_webview);
			gtk_widget_grab_focus(m_webview);

			if (dbg) {
				WebKitSettings *settings = webkit_web_view_get_settings(m_webview);
				webkit_settings_set_enable_write_console_messages_to_stdout(settings, true);
				webkit_settings_set_enable_developer_extras(settings, true);
			}

			gtk_widget_show_all(m_window);
		}
		void run() { gtk_main(); }
		void terminate() { gtk_main_quit(); }

		void navigate(const char *url) {
			webkit_web_view_load_uri(m_webview, url);
		}

		void setTitle(const char* title) {
			gtk_window_set_title(m_window, title);
		}

		/+
			void dispatch(std::function<void()> f) {
				g_idle_add_full(G_PRIORITY_HIGH_IDLE, (GSourceFunc)([](void *f) -> int {
							(*static_cast<dispatch_fn_t *>(f))();
							return G_SOURCE_REMOVE;
							}),
						new std::function<void()>(f),
						[](void *f) { delete static_cast<dispatch_fn_t *>(f); });
			}
		+/

		void setSize(int width, int height, bool resizable) {
			gtk_window_set_resizable(m_window, resizable);
			if (resizable) {
				gtk_window_set_default_size(m_window, width, height);
			}
			gtk_widget_set_size_request(m_window, width, height);
		}

		void init(const char *js) {
			WebKitUserContentManager *manager = webkit_web_view_get_user_content_manager(m_webview);
			webkit_user_content_manager_add_script(
				manager, webkit_user_script_new(
					js, WebKitUserContentInjectedFrames.WEBKIT_USER_CONTENT_INJECT_TOP_FRAME,
					WebKitUserScriptInjectionTime.WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START, null, null));
			}

		void eval(const char *js) {
			webkit_web_view_run_javascript(m_webview, js, null, null, null);
		}

		protected:
		GtkWidget* m_window;
		GtkWidget* m_webview;
		msg_cb_t m_cb;
	}
} else version(WEBVIEW_COCOA) {
/+

//
// ====================================================================
//
// This implementation uses Cocoa WKWebView backend on macOS. It is
// written using ObjC runtime and uses WKWebView class as a browser runtime.
// You should pass "-framework Webkit" flag to the compiler.
//
// ====================================================================
//

#define OBJC_OLD_DISPATCH_PROTOTYPES 1
#include <CoreGraphics/CoreGraphics.h>
#include <objc/objc-runtime.h>

#define NSBackingStoreBuffered 2

#define NSWindowStyleMaskResizable 8
#define NSWindowStyleMaskMiniaturizable 4
#define NSWindowStyleMaskTitled 1
#define NSWindowStyleMaskClosable 2

#define NSApplicationActivationPolicyRegular 0

#define WKUserScriptInjectionTimeAtDocumentStart 0

id operator"" _cls(const char *s, std::size_t sz) {
  return (id)objc_getClass(s);
}
SEL operator"" _sel(const char *s, std::size_t sz) {
  return sel_registerName(s);
}
id operator"" _str(const char *s, std::size_t sz) {
  return objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, s);
}

class browser_engine {
public:
  browser_engine(msg_cb_t cb, bool dbg, void *window) : m_cb(cb) {
    // Application
    id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel);
    objc_msgSend(app, "setActivationPolicy:"_sel,
                 NSApplicationActivationPolicyRegular);

    // Delegate
    auto cls = objc_allocateClassPair((Class) "NSObject"_cls, "AppDelegate", 0);
    class_addProtocol(cls, objc_getProtocol("NSApplicationDelegate"));
    class_addProtocol(cls, objc_getProtocol("WKScriptMessageHandler"));
    class_addMethod(
        cls, "applicationShouldTerminateAfterLastWindowClosed:"_sel,
        (IMP)(+[](id self, SEL cmd, id notification) -> BOOL { return 1; }),
        "c@:@");
    class_addMethod(
        cls, "userContentController:didReceiveScriptMessage:"_sel,
        (IMP)(+[](id self, SEL cmd, id notification, id msg) {
          auto w = (browser_engine *)objc_getAssociatedObject(self, "webview");
          w->m_cb((const char *)objc_msgSend(objc_msgSend(msg, "body"_sel),
                                             "UTF8String"_sel));
        }),
        "v@:@@");
    objc_registerClassPair(cls);

    auto delegate = objc_msgSend((id)cls, "new"_sel);
    objc_setAssociatedObject(delegate, "webview", (id)this,
                             OBJC_ASSOCIATION_ASSIGN);
    objc_msgSend(app, sel_registerName("setDelegate:"), delegate);

    // Main window
    if (window is null) {
      m_window = objc_msgSend("NSWindow"_cls, "alloc"_sel);
      m_window = objc_msgSend(
          m_window, "initWithContentRect:styleMask:backing:defer:"_sel,
          CGRectMake(0, 0, 0, 0), 0, NSBackingStoreBuffered, 0);
      setSize(480, 320, true);
    } else {
      m_window = (id)window;
    }

    // Webview
    auto config = objc_msgSend("WKWebViewConfiguration"_cls, "new"_sel);
    m_manager = objc_msgSend(config, "userContentController"_sel);
    m_webview = objc_msgSend("WKWebView"_cls, "alloc"_sel);
    objc_msgSend(m_webview, "initWithFrame:configuration:"_sel,
                 CGRectMake(0, 0, 0, 0), config);
    objc_msgSend(m_manager, "addScriptMessageHandler:name:"_sel, delegate,
                 "external"_str);
    init(R"script(
                      window.external = {
                        invoke: function(s) {
                          window.webkit.messageHandlers.external.postMessage(s);
                        },
                      };
                     )script");
    if (dbg) {
      objc_msgSend(objc_msgSend(config, "preferences"_sel),
                   "setValue:forKey:"_sel, 1, "developerExtrasEnabled"_str);
    }
    objc_msgSend(m_window, "setContentView:"_sel, m_webview);
    objc_msgSend(m_window, "makeKeyAndOrderFront:"_sel, null);
  }
  ~browser_engine() { close(); }
  void terminate() { close(); objc_msgSend("NSApp"_cls, "terminate:"_sel, null); }
  void run() {
    id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel);
    dispatch([&]() { objc_msgSend(app, "activateIgnoringOtherApps:"_sel, 1); });
    objc_msgSend(app, "run"_sel);
  }
  void dispatch(std::function<void()> f) {
    dispatch_async_f(dispatch_get_main_queue(), new dispatch_fn_t(f),
                     (dispatch_function_t)([](void *arg) {
                       auto f = static_cast<dispatch_fn_t *>(arg);
                       (*f)();
                       delete f;
                     }));
  }
  void setTitle(const char *title) {
    objc_msgSend(
        m_window, "setTitle:"_sel,
        objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, title));
  }
  void setSize(int width, int height, bool resizable) {
    auto style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
                 NSWindowStyleMaskMiniaturizable;
    if (resizable) {
      style = style | NSWindowStyleMaskResizable;
    }
    objc_msgSend(m_window, "setStyleMask:"_sel, style);
    objc_msgSend(m_window, "setFrame:display:animate:"_sel,
                 CGRectMake(0, 0, width, height), 1, 0);
  }
  void navigate(const char *url) {
    auto nsurl = objc_msgSend(
        "NSURL"_cls, "URLWithString:"_sel,
        objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, url));
    objc_msgSend(
        m_webview, "loadRequest:"_sel,
        objc_msgSend("NSURLRequest"_cls, "requestWithURL:"_sel, nsurl));
  }
  void init(const char *js) {
    objc_msgSend(
        m_manager, "addUserScript:"_sel,
        objc_msgSend(
            objc_msgSend("WKUserScript"_cls, "alloc"_sel),
            "initWithSource:injectionTime:forMainFrameOnly:"_sel,
            objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js),
            WKUserScriptInjectionTimeAtDocumentStart, 1));
  }
  void eval(const char *js) {
    objc_msgSend(m_webview, "evaluateJavaScript:completionHandler:"_sel,
                 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js),
                 null);
  }

protected:
  void close() { objc_msgSend(m_window, "close"_sel); }
  id m_window;
  id m_webview;
  id m_manager;
  msg_cb_t m_cb;
};

+/

}

version(cef)  {

/++
	This creates a base class for a thing to help you implement the function pointers.

	class MyApp : CEF!cef_app_t {

	}
+/
abstract class CEF(Base) {
	private struct Inner {
		Base c;
		CEF d_object;
	}
	private Inner inner;

	this() nothrow {
		if(!__ctfe) construct();
	}

	// ONLY call this if you did a ctfe construction
	void construct() nothrow {
		assert(inner.c.base.size == 0);

		import core.memory;
		GC.addRoot(cast(void*) this);
		inner.c.base.size = Inner.sizeof;
		inner.c.base.add_ref = &c_add_ref;
		inner.c.base.release = &c_release;
		inner.c.base.has_one_ref = &c_has_one_ref;
		inner.c.base.has_at_least_one_ref = &c_has_at_least_one_ref;
		inner.d_object = this;

		static foreach(memberName; __traits(allMembers, Base)) {
			static if(is(typeof(__traits(getMember, Base, memberName)) == return)) {
				__traits(getMember, inner.c, memberName) = mixin("&c_" ~ memberName);
			}
		}
	}

	private static nothrow @nogc extern(System) {
		void c_add_ref(cef_base_ref_counted_t* self) {
			return ((cast(Inner*) self).d_object).add_ref();
		}
		int c_release(cef_base_ref_counted_t* self) {
			return ((cast(Inner*) self).d_object).release();
		}
		int c_has_one_ref(cef_base_ref_counted_t* self) {
			return ((cast(Inner*) self).d_object).has_one_ref();
		}
		int c_has_at_least_one_ref(cef_base_ref_counted_t* self) {
			return ((cast(Inner*) self).d_object).has_at_least_one_ref();
		}
	}

	private shared(int) refcount = 1;
	final void add_ref() {
		import core.atomic;
		atomicOp!"+="(refcount, 1);
	}
	final int release() {
		import core.atomic;
		auto v = atomicOp!"-="(refcount, 1);
		if(v == 0) {
			import core.memory;
			GC.removeRoot(cast(void*) this);
			return 1;
		}
		return 0;
	}
	final int has_one_ref() {
		return (cast() refcount) == 1;
	}
	final int has_at_least_one_ref() {
		return (cast() refcount) >= 1;
	}

	/// Call this to pass to CEF. It will add ref for you.
	final Base* passable() {
		assert(inner.c.base.size);
		add_ref();
		return returnable();
	}

	final Base* returnable() {
		assert(inner.c.base.size);
		return &inner.c;
	}

	static foreach(memberName; __traits(allMembers, Base)) {
		static if(is(typeof(__traits(getMember, Base, memberName)) == return)) {
			mixin AbstractMethod!(memberName);
		} else {
			mixin(q{final ref @property } ~ memberName ~ q{() { return __traits(getMember, inner.c, memberName); }});
		}
	}
}

// you implement this in D...
private mixin template AbstractMethod(string name) {
	alias ptr = typeof(__traits(getMember, Base, name));
	static if(is(ptr Return == return))
	static if(is(typeof(*ptr) Params == function))
	{
		mixin(q{abstract nothrow Return } ~ name ~ q{(CefToD!(Params[1 .. $]) p);});
		// mixin(q{abstract nothrow Return } ~ name ~ q{(Params[1 .. $] p);});

		mixin(q{
		private static nothrow extern(System)
		Return c_}~name~q{(Params p) {
			Base* self = p[0]; // a bit of a type check here...
			auto dobj = (cast(Inner*) self).d_object; // ...before this cast.

			//return __traits(getMember, dobj, name)(p[1 .. $]);
			mixin(() {
				string code = "return __traits(getMember, dobj, name)(";

				static foreach(idx; 1 .. p.length) {
					if(idx > 1)
						code ~= ", ";
					code ~= "cefToD(p[" ~ idx.stringof ~ "])";
				}
				code ~= ");";
				return code;
			}());
		}
		});
	}
	else static assert(0, name ~ " params");
	else static assert(0, name ~ " return");
}

// you call this from D...
private mixin template ForwardMethod(string name) {
	alias ptr = typeof(__traits(getMember, Base, name));
	static if(is(ptr Return == return))
	static if(is(typeof(*ptr) Params == function))
	{
		mixin(q{nothrow auto } ~ name ~ q{(Params[1 .. $] p) {
			Base* self = inner; // a bit of a type check here...
			static if(is(Return == void))
				return __traits(getMember, inner, name)(self, p);
			else
				return cefToD(__traits(getMember, inner, name)(self, p));
		}});
	}
	else static assert(0, name ~ " params");
	else static assert(0, name ~ " return");
}


private alias AliasSeq(T...) = T;

private template CefToD(T...) {
	static if(T.length == 0) {
		alias CefToD = T;
	} else static if(T.length == 1) {
		static if(is(typeof(T[0].base) == cef_base_ref_counted_t)) {
			alias CefToD = RC!(typeof(*T[0]));
			/+
			static if(is(T[0] == I*, I)) {
				alias CefToD = CEF!(I);
			} else static assert(0, T[0]);
			+/
		} else
			alias CefToD = T[0];
	} else {
		alias CefToD = AliasSeq!(CefToD!(T[0]), CefToD!(T[1..$]));

	}
}

enum activeEngine = WebviewEngine.cef;

struct RC(Base) {
	private Base* inner;

	this(Base* t) nothrow {
		inner = t;
		// assuming the refcount is already set here
	}
	this(this) nothrow {
		if(inner is null) return;
		inner.base.add_ref(&inner.base);
	}
	~this() nothrow {
		if(inner is null) return;
		inner.base.release(&inner.base);
		inner = null;
		//sdpyPrintDebugString("omg release");
	}
	bool opCast(T:bool)() nothrow {
		return inner !is null;
	}

	Base* getRawPointer() nothrow {
		return inner;
	}

	Base* passable() nothrow {
		if(inner is null)
			return inner;

		inner.base.add_ref(&inner.base);
		return inner;
	}

	static foreach(memberName; __traits(allMembers, Base)) {
		static if(is(typeof(__traits(getMember, Base, memberName)) == return)) {
			mixin ForwardMethod!(memberName);
		} else {
			mixin(q{final ref @property } ~ memberName ~ q{() { return __traits(getMember, inner, memberName); }});
		}
	}
}

auto cefToD(T)(T t) {
	static if(is(typeof(T.base) == cef_base_ref_counted_t)) {
		return RC!(typeof(*T))(t);
	} else {
		return t;
	}
}


string toGC(const cef_string_utf16_t str) nothrow {
	if(str.str is null)
		return null;

	string s;
	s.reserve(str.length);

	try
	foreach(char ch; str.str[0 .. str.length])
		s ~= ch;
	catch(Exception e) {}
	return s;
}

string toGC(const cef_string_utf16_t* str) nothrow {
	if(str is null)
		return null;
	return toGC(*str);
}

string toGCAndFree(const cef_string_userfree_t str) nothrow {
	if(str is null)
		return null;

	string s = toGC(str);
	libcef.string_userfree_utf16_free(str);
	//str = null;
	return s;
}

// bindings follow, first some hand-written ones for Linux, then some machine translated things. More comments about the machine translation when it comes.

version(linux)
struct cef_main_args_t {
	int argc;
	char** argv;
}
version(Windows)
struct cef_main_args_t {
	HINSTANCE instance;
}

// 0 - CEF_VERSION_MAJOR
// 1 - CEF_VERSION_MINOR
// 2 - CEF_VERSION_PATCH
// 3 - CEF_COMMIT_NUMBER
// 4 - CHROME_VERSION_MAJOR
// 5 - CHROME_VERSION_MINOR
// 6 - CHROME_VERSION_BUILD
// 7 - CHROME_VERSION_PATCH

extern(C) nothrow
int cef_string_utf8_to_utf16(const char* src, size_t src_len, cef_string_utf16_t* output);

struct cef_string_utf8_t {
  char* str;
  size_t length;
  void* dtor;// void (*dtor)(char* str);
}

struct cef_basetime_t {
	long val;
}


struct cef_string_utf16_t {
  char16* str;
  size_t length;
  void* dtor; // voiod (*dtor)(char16* str);

  this(wstring s) nothrow {
	this.str = cast(char16*) s.ptr;
	this.length = s.length;
  }

  this(string s) nothrow {
	libcef.string_utf8_to_utf16(s.ptr, s.length, &this);
  }
}

alias cef_string_t = cef_string_utf16_t;
alias cef_window_handle_t = NativeWindowHandle;
version(Windows)
	alias cef_cursor_handle_t = HCURSOR;
else
	alias cef_cursor_handle_t = XID;

struct cef_time_t {
  int year;          // Four or five digit year "2007" (1601 to 30827 on
                     //   Windows, 1970 to 2038 on 32-bit POSIX)
  int month;         // 1-based month (values 1 = January, etc.)
  int day_of_week;   // 0-based day of week (0 = Sunday, etc.)
  int day_of_month;  // 1-based day of month (1-31)
  int hour;          // Hour within the current day (0-23)
  int minute;        // Minute within the current hour (0-59)
  int second;        // Second within the current minute (0-59 plus leap
                     //   seconds which may take it up to 60).
  int millisecond;   // Milliseconds within the current second (0-999)
}

version(linux)
struct cef_window_info_t {
  cef_string_t window_name;

  uint x;
  uint y;
  uint width;
  uint height;

  cef_window_handle_t parent_window;

  int windowless_rendering_enabled;

  int shared_texture_enabled;

  int external_begin_frame_enabled;

  cef_window_handle_t window;
}

version(Windows)
struct cef_window_info_t {
	DWORD ex_style;
	cef_string_t window_name;
	DWORD style;
	cef_rect_t bounds;
	cef_window_handle_t parent_window;
	HMENU menu;
	int windowless_rendering_enabled;
	int shared_texture_enabled;
	int external_begin_frame_enabled;
	cef_window_handle_t window;
}



import core.stdc.config;
alias int16 = short;
alias uint16 = ushort;
alias int32 = int;
alias uint32 = uint;
alias char16 = wchar;
alias int64 = long;
alias uint64 = ulong;

// these are supposed to just be opaque pointers but i want some type safety. this same abi wise.......... RIGHT?
struct cef_string_list_t { void* r; }
struct cef_string_multimap_t { void* r; }
struct cef_string_map_t { void* r; }


extern(C) nothrow {
	cef_string_list_t cef_string_list_alloc();
	size_t cef_string_list_size(cef_string_list_t list);
	int cef_string_list_value(cef_string_list_t list, size_t index, cef_string_t* value);
	void cef_string_list_append(cef_string_list_t list, const cef_string_t* value);
	void cef_string_list_clear(cef_string_list_t list);
	void cef_string_list_free(cef_string_list_t list);
	cef_string_list_t cef_string_list_copy(cef_string_list_t list);
}


version(linux) {
	import core.sys.posix.sys.types;
	alias pid_t cef_platform_thread_id_t;
	alias OS_EVENT = XEvent;
} else {
	import core.sys.windows.windows;
	alias HANDLE cef_platform_thread_id_t;
	alias OS_EVENT = void;
}

nothrow @nogc extern(C) void cef_string_userfree_utf16_free(const cef_string_userfree_utf16_t str);
struct cef_string_userfree_utf16_t { cef_string_utf16_t* it; alias it this; }
alias cef_string_userfree_t = cef_string_userfree_utf16_t;

// **************

// cef/include/capi$ for i in *.h; do dstep -I../.. $i; done
// also dstep include/cef_version.h
// update the CEF_VERSION and the CEF_API_HASH_UNIVERSAL out of cef_version.h and cef_api_hash.h
// then concatenate the bodies of them and delete the translated macros and `struct .*;` stuff
// then I added nothrow to all function pointers with a vim macro (`/function (<ENTER>e%a nothrow<ESC>` then just hold in @ to do the @@ repeat macro command until it was done
// then select all and global replace s/_cef/cef/g
// then delete the pointless aliases find with `/alias \(.*\) = \1;` and delete with 2dd. macros can do the job or just simple global replace to nothing. blank lines don't matter.

// and make sure version(linux) void cef_register_widevine_cdm ( if it is there.

// and extern (C) is wrong on the callbacks, they should all be extern(System)
// `/function (<ENTER>Oextern(System)<ESC>`


version=embedded_cef_bindings;

// everything inside these brackets are the bindings you can replace if update needed

version(embedded_cef_bindings) {
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the make_version_header.py tool.
//

extern (C):

enum CEF_VERSION = "126.2.10+g61241e4+chromium-126.0.6478.127";
enum CEF_VERSION_MAJOR = 126;
enum CEF_VERSION_MINOR = 2;
enum CEF_VERSION_PATCH = 10;
enum CEF_COMMIT_NUMBER = 3011;
enum CEF_COMMIT_HASH = "61241e448276eee53d2b20ca045f5b5ae53a937a";
enum COPYRIGHT_YEAR = 2024;

enum CHROME_VERSION_MAJOR = 126;
enum CHROME_VERSION_MINOR = 0;
enum CHROME_VERSION_BUILD = 6478;
enum CHROME_VERSION_PATCH = 127;



// Returns CEF version information for the libcef library. The |entry|
// parameter describes which version component will be returned:
// 0 - CEF_VERSION_MAJOR
// 1 - CEF_VERSION_MINOR
// 2 - CEF_VERSION_PATCH
// 3 - CEF_COMMIT_NUMBER
// 4 - CHROME_VERSION_MAJOR
// 5 - CHROME_VERSION_MINOR
// 6 - CHROME_VERSION_BUILD
// 7 - CHROME_VERSION_PATCH
///
int cef_version_info (int entry);

// APSTUDIO_HIDDEN_SYMBOLS

// CEF_INCLUDE_CEF_VERSION_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the make_api_hash_header.py tool.
//

extern (C):

// The API hash is created by analyzing CEF header files for C API type
// definitions. The hash value will change when header files are modified in a
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
enum CEF_API_HASH_UNIVERSAL = "ed1dfa5ff8a041241f8fb72eb7454811f358f0d3";

enum CEF_API_HASH_PLATFORM = "09d3e280ed38f7a082b794c56ff71c52f86f0ea8";

///
// Returns CEF API hashes for the libcef library. The returned string is owned
// by the library and should not be freed. The |entry| parameter describes which
// hash value will be returned:
// 0 - CEF_API_HASH_PLATFORM
// 1 - CEF_API_HASH_UNIVERSAL
// 2 - CEF_COMMIT_HASH (from cef_version.h)
///
const(char)* cef_api_hash (int entry);

// CEF_INCLUDE_API_HASH_H_
// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

extern (C):

///
/// Structure representing a point.
///
struct cef_point_t
{
    int x;
    int y;
}



///
/// Structure representing a rectangle.
///
struct cef_rect_t
{
    int x;
    int y;
    int width;
    int height;
}



///
/// Structure representing a size.
///
struct cef_size_t
{
    int width;
    int height;
}



///
/// Structure representing insets.
///
struct cef_insets_t
{
    int top;
    int left;
    int bottom;
    int right;
}



// CEF_INCLUDE_INTERNAL_CEF_TYPES_GEOMETRY_H_
// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

extern (C):

///
/// Supported content setting types. Some types are platform-specific or only
/// supported with the Chrome runtime. Should be kept in sync with Chromium's
/// ContentSettingsType type.
///
enum cef_content_setting_types_t
{
    // This setting governs whether cookies are enabled by the user in the
    /// provided context. However, it may be overridden by other settings. This
    /// enum should NOT be read directly to determine whether cookies are enabled;
    /// the client should instead rely on the CookieSettings API.
    CEF_CONTENT_SETTING_TYPE_COOKIES = 0,
    CEF_CONTENT_SETTING_TYPE_IMAGES = 1,
    CEF_CONTENT_SETTING_TYPE_JAVASCRIPT = 2,

    /// This setting governs both popups and unwanted redirects like tab-unders
    /// and framebusting.
    CEF_CONTENT_SETTING_TYPE_POPUPS = 3,

    CEF_CONTENT_SETTING_TYPE_GEOLOCATION = 4,
    CEF_CONTENT_SETTING_TYPE_NOTIFICATIONS = 5,
    CEF_CONTENT_SETTING_TYPE_AUTO_SELECT_CERTIFICATE = 6,
    CEF_CONTENT_SETTING_TYPE_MIXEDSCRIPT = 7,
    CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_MIC = 8,
    CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_CAMERA = 9,
    CEF_CONTENT_SETTING_TYPE_PROTOCOL_HANDLERS = 10,
    CEF_CONTENT_SETTING_TYPE_DEPRECATED_PPAPI_BROKER = 11,
    CEF_CONTENT_SETTING_TYPE_AUTOMATIC_DOWNLOADS = 12,

    /// Advanced device-specific functions on MIDI devices. MIDI-SysEx
    /// communications can be used for changing the MIDI device's persistent state
    /// such as firmware.
    CEF_CONTENT_SETTING_TYPE_MIDI_SYSEX = 13,

    CEF_CONTENT_SETTING_TYPE_SSL_CERT_DECISIONS = 14,
    CEF_CONTENT_SETTING_TYPE_PROTECTED_MEDIA_IDENTIFIER = 15,
    CEF_CONTENT_SETTING_TYPE_APP_BANNER = 16,
    CEF_CONTENT_SETTING_TYPE_SITE_ENGAGEMENT = 17,
    CEF_CONTENT_SETTING_TYPE_DURABLE_STORAGE = 18,
    CEF_CONTENT_SETTING_TYPE_USB_CHOOSER_DATA = 19,
    CEF_CONTENT_SETTING_TYPE_BLUETOOTH_GUARD = 20,
    CEF_CONTENT_SETTING_TYPE_BACKGROUND_SYNC = 21,
    CEF_CONTENT_SETTING_TYPE_AUTOPLAY = 22,
    CEF_CONTENT_SETTING_TYPE_IMPORTANT_SITE_INFO = 23,
    CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOBLOCKER_DATA = 24,
    CEF_CONTENT_SETTING_TYPE_ADS = 25,

    /// Website setting which stores metadata for the subresource filter to aid in
    /// decisions for whether or not to show the UI.
    CEF_CONTENT_SETTING_TYPE_ADS_DATA = 26,

    /// MIDI stands for Musical Instrument Digital Interface. It is a standard
    /// that allows electronic musical instruments, computers, and other devices
    /// to communicate with each other.
    CEF_CONTENT_SETTING_TYPE_MIDI = 27,

    /// This content setting type is for caching password protection service's
    /// verdicts of each origin.
    CEF_CONTENT_SETTING_TYPE_PASSWORD_PROTECTION = 28,

    /// Website setting which stores engagement data for media related to a
    /// specific origin.
    CEF_CONTENT_SETTING_TYPE_MEDIA_ENGAGEMENT = 29,

    /// Content setting which stores whether or not the site can play audible
    /// sound. This will not block playback but instead the user will not hear it.
    CEF_CONTENT_SETTING_TYPE_SOUND = 30,

    /// Website setting which stores the list of client hints that the origin
    /// requested the browser to remember. The browser is expected to send all
    /// client hints in the HTTP request headers for every resource requested
    /// from that origin.
    CEF_CONTENT_SETTING_TYPE_CLIENT_HINTS = 31,

    /// Generic Sensor API covering ambient-light-sensor, accelerometer, gyroscope
    /// and magnetometer are all mapped to a single content_settings_type.
    /// Setting for the Generic Sensor API covering ambient-light-sensor,
    /// accelerometer, gyroscope and magnetometer. These are all mapped to a
    /// single ContentSettingsType.
    CEF_CONTENT_SETTING_TYPE_SENSORS = 32,

    /// Content setting which stores whether or not the user has granted the site
    /// permission to respond to accessibility events, which can be used to
    /// provide a custom accessibility experience. Requires explicit user consent
    /// because some users may not want sites to know they're using assistive
    /// technology.
    CEF_CONTENT_SETTING_TYPE_ACCESSIBILITY_EVENTS = 33,

    /// Used to store whether to allow a website to install a payment handler.
    CEF_CONTENT_SETTING_TYPE_PAYMENT_HANDLER = 34,

    /// Content setting which stores whether to allow sites to ask for permission
    /// to access USB devices. If this is allowed specific device permissions are
    /// stored under USB_CHOOSER_DATA.
    CEF_CONTENT_SETTING_TYPE_USB_GUARD = 35,

    /// Nothing is stored in this setting at present. Please refer to
    /// BackgroundFetchPermissionContext for details on how this permission
    /// is ascertained.
    CEF_CONTENT_SETTING_TYPE_BACKGROUND_FETCH = 36,

    /// Website setting which stores the amount of times the user has dismissed
    /// intent picker UI without explicitly choosing an option.
    CEF_CONTENT_SETTING_TYPE_INTENT_PICKER_DISPLAY = 37,

    /// Used to store whether to allow a website to detect user active/idle state.
    CEF_CONTENT_SETTING_TYPE_IDLE_DETECTION = 38,

    /// Content settings for access to serial ports. The "guard" content setting
    /// stores whether to allow sites to ask for permission to access a port. The
    /// permissions granted to access particular ports are stored in the "chooser
    /// data" website setting.
    CEF_CONTENT_SETTING_TYPE_SERIAL_GUARD = 39,
    CEF_CONTENT_SETTING_TYPE_SERIAL_CHOOSER_DATA = 40,

    /// Nothing is stored in this setting at present. Please refer to
    /// PeriodicBackgroundSyncPermissionContext for details on how this permission
    /// is ascertained.
    /// This content setting is not registered because it does not require access
    /// to any existing providers.
    CEF_CONTENT_SETTING_TYPE_PERIODIC_BACKGROUND_SYNC = 41,

    /// Content setting which stores whether to allow sites to ask for permission
    /// to do Bluetooth scanning.
    CEF_CONTENT_SETTING_TYPE_BLUETOOTH_SCANNING = 42,

    /// Content settings for access to HID devices. The "guard" content setting
    /// stores whether to allow sites to ask for permission to access a device.
    /// The permissions granted to access particular devices are stored in the
    /// "chooser data" website setting.
    CEF_CONTENT_SETTING_TYPE_HID_GUARD = 43,
    CEF_CONTENT_SETTING_TYPE_HID_CHOOSER_DATA = 44,

    /// Wake Lock API, which has two lock types: screen and system locks.
    /// Currently, screen locks do not need any additional permission, and system
    /// locks are always denied while the right UI is worked out.
    CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SCREEN = 45,
    CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SYSTEM = 46,

    /// Legacy SameSite cookie behavior. This disables SameSite=Lax-by-default,
    /// SameSite=None requires Secure, and Schemeful Same-Site, forcing the
    /// legacy behavior wherein 1) cookies that don't specify SameSite are treated
    /// as SameSite=None, 2) SameSite=None cookies are not required to be Secure,
    /// and 3) schemeful same-site is not active.
    ///
    /// This will also be used to revert to legacy behavior when future changes
    /// in cookie handling are introduced.
    CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_ACCESS = 47,

    /// Content settings which stores whether to allow sites to ask for permission
    /// to save changes to an original file selected by the user through the
    /// File System Access API.
    CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_WRITE_GUARD = 48,

    /// Used to store whether to allow a website to exchange data with NFC
    /// devices.
    CEF_CONTENT_SETTING_TYPE_NFC = 49,

    /// Website setting to store permissions granted to access particular
    /// Bluetooth devices.
    CEF_CONTENT_SETTING_TYPE_BLUETOOTH_CHOOSER_DATA = 50,

    /// Full access to the system clipboard (sanitized read without user gesture,
    /// and unsanitized read and write with user gesture).
    CEF_CONTENT_SETTING_TYPE_CLIPBOARD_READ_WRITE = 51,

    /// This is special-cased in the permissions layer to always allow, and as
    /// such doesn't have associated prefs data.
    CEF_CONTENT_SETTING_TYPE_CLIPBOARD_SANITIZED_WRITE = 52,

    /// This content setting type is for caching safe browsing real time url
    /// check's verdicts of each origin.
    CEF_CONTENT_SETTING_TYPE_SAFE_BROWSING_URL_CHECK_DATA = 53,

    /// Used to store whether a site is allowed to request AR or VR sessions with
    /// the WebXr Device API.
    CEF_CONTENT_SETTING_TYPE_VR = 54,
    CEF_CONTENT_SETTING_TYPE_AR = 55,

    /// Content setting which stores whether to allow site to open and read files
    /// and directories selected through the File System Access API.
    CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_READ_GUARD = 56,

    /// Access to first party storage in a third-party context. Exceptions are
    /// scoped to the combination of requesting/top-level origin, and are managed
    /// through the Storage Access API. For the time being, this content setting
    /// exists in parallel to third-party cookie rules stored in COOKIES.
    CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS = 57,

    /// Content setting which stores whether to allow a site to control camera
    /// movements. It does not give access to camera.
    CEF_CONTENT_SETTING_TYPE_CAMERA_PAN_TILT_ZOOM = 58,

    /// Content setting for Screen Enumeration and Screen Detail functionality.
    /// Permits access to detailed multi-screen information, like size and
    /// position. Permits placing fullscreen and windowed content on specific
    /// screens. See also: https://w3c.github.io/window-placement
    CEF_CONTENT_SETTING_TYPE_WINDOW_MANAGEMENT = 59,

    /// Stores whether to allow insecure websites to make private network
    /// requests.
    /// See also: https://wicg.github.io/cors-rfc1918
    /// Set through enterprise policies only.
    CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK = 60,

    /// Content setting which stores whether or not a site can access low-level
    /// locally installed font data using the Local Fonts Access API.
    CEF_CONTENT_SETTING_TYPE_LOCAL_FONTS = 61,

    /// Stores per-origin state for permission auto-revocation (for all permission
    /// types).
    CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOREVOCATION_DATA = 62,

    /// Stores per-origin state of the most recently selected directory for the
    /// use by the File System Access API.
    CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY = 63,

    /// Controls access to the getDisplayMedia API.
    CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE = 64,

    /// Website setting to store permissions metadata granted to paths on the
    /// local file system via the File System Access API.
    /// |FILE_SYSTEM_WRITE_GUARD| is the corresponding "guard" setting. The stored
    /// data represents valid permission only if
    /// |FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION| is enabled via user opt-in.
    /// Otherwise, they represent "recently granted but revoked permission", which
    /// are used to restore the permission.
    CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_CHOOSER_DATA = 65,

    /// Stores a grant that allows a relying party to send a request for identity
    /// information to specified identity providers, potentially through any
    /// anti-tracking measures that would otherwise prevent it. This setting is
    /// associated with the relying party's origin.
    CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_SHARING = 66,

    /// Whether to use the v8 optimized JIT for running JavaScript on the page.
    CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_JIT = 67,

    /// Content setting which stores user decisions to allow loading a site over
    /// HTTP. Entries are added by hostname when a user bypasses the HTTPS-First
    /// Mode interstitial warning when a site does not support HTTPS. Allowed
    /// hosts are exact hostname matches -- subdomains of a host on the allowlist
    /// must be separately allowlisted.
    CEF_CONTENT_SETTING_TYPE_HTTP_ALLOWED = 68,

    /// Stores metadata related to form fill, such as e.g. whether user data was
    /// autofilled on a specific website.
    CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA = 69,

    /// Setting to indicate that there is an active federated sign-in session
    /// between a specified relying party and a specified identity provider for
    /// a specified account. When this is present it allows access to session
    /// management capabilities between the sites. This setting is associated
    /// with the relying party's origin.
    // Obsolete on Nov 2023.
    CEF_CONTENT_SETTING_TYPE_DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION = 70,

    /// Setting to indicate whether Chrome should automatically apply darkening to
    /// web content.
    CEF_CONTENT_SETTING_TYPE_AUTO_DARK_WEB_CONTENT = 71,

    /// Setting to indicate whether Chrome should request the desktop view of a
    /// site instead of the mobile one.
    CEF_CONTENT_SETTING_TYPE_REQUEST_DESKTOP_SITE = 72,

    /// Setting to indicate whether browser should allow signing into a website
    /// via the browser FedCM API.
    CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_API = 73,

    /// Stores notification interactions per origin for the past 90 days.
    /// Interactions per origin are pre-aggregated over seven-day windows: A
    /// notification interaction or display is assigned to the last Monday
    /// midnight in local time.
    CEF_CONTENT_SETTING_TYPE_NOTIFICATION_INTERACTIONS = 74,

    /// Website setting which stores the last reduced accept language negotiated
    /// for a given origin, to be used on future visits to the origin.
    CEF_CONTENT_SETTING_TYPE_REDUCED_ACCEPT_LANGUAGE = 75,

    /// Website setting which is used for NotificationPermissionReviewService to
    /// store origin blocklist from review notification permissions feature.
    CEF_CONTENT_SETTING_TYPE_NOTIFICATION_PERMISSION_REVIEW = 76,

    /// Website setting to store permissions granted to access particular devices
    /// in private network.
    CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_GUARD = 77,
    CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_CHOOSER_DATA = 78,

    /// Website setting which stores whether the browser has observed the user
    /// signing into an identity-provider based on observing the IdP-SignIn-Status
    /// HTTP header.
    CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS = 79,

    /// Website setting which is used for UnusedSitePermissionsService to
    /// store revoked permissions of unused sites from unused site permissions
    /// feature.
    CEF_CONTENT_SETTING_TYPE_REVOKED_UNUSED_SITE_PERMISSIONS = 80,

    /// Similar to STORAGE_ACCESS, but applicable at the page-level rather than
    /// being specific to a frame.
    CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_STORAGE_ACCESS = 81,

    /// Setting to indicate whether user has opted in to allowing auto re-authn
    /// via the FedCM API.
    CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION = 82,

    /// Website setting which stores whether the user has explicitly registered
    /// a website as an identity-provider.
    CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION = 83,

    /// Content setting which is used to indicate whether anti-abuse functionality
    /// should be enabled.
    CEF_CONTENT_SETTING_TYPE_ANTI_ABUSE = 84,

    /// Content setting used to indicate whether third-party storage partitioning
    /// should be enabled.
    CEF_CONTENT_SETTING_TYPE_THIRD_PARTY_STORAGE_PARTITIONING = 85,

    /// Used to indicate whether HTTPS-First Mode is enabled on the hostname.
    CEF_CONTENT_SETTING_TYPE_HTTPS_ENFORCED = 86,

    /// Setting for enabling the `getAllScreensMedia` API. Spec link:
    /// https://github.com/screen-share/capture-all-screens
    CEF_CONTENT_SETTING_TYPE_ALL_SCREEN_CAPTURE = 87,

    /// Stores per origin metadata for cookie controls.
    CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA = 88,

    /// Content Setting for temporary 3PC accesses granted by user behavior
    /// heuristics.
    CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS = 89,

    /// Content Setting for 3PC accesses granted by metadata delivered via the
    /// component updater service. This type will only be used when
    /// `net::features::kTpcdMetadataGrants` is enabled.
    CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS = 90,

    /// Content Setting for 3PC accesses granted via 3PC deprecation trial.
    CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL = 91,

    /// Content Setting for 3PC accesses granted via top-level 3PC deprecation
    /// trial. Similar to TPCD_TRIAL, but applicable at the page-level for the
    /// lifetime of the page that served the token, rather than being specific to
    /// a requesting-origin/top-level-site combination and persistent.
    CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL = 92,

    /// Content Setting for a first-party origin trial that allows websites to
    /// enable third-party cookie deprecation.
    /// ALLOW (default): no effect (e.g. third-party cookies allowed, if not
    ///                  blocked otherwise).
    /// BLOCK: third-party cookies blocked, but 3PCD mitigations enabled.
    CEF_CONTENT_SETTING_TOP_LEVEL_TPCD_ORIGIN_TRIAL = 93,

    /// Content setting used to indicate whether entering picture-in-picture
    /// automatically should be enabled.
    CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE = 94,

    /// Whether user has opted into keeping file/directory permissions persistent
    /// between visits for a given origin. When enabled, permission metadata
    /// stored under |FILE_SYSTEM_ACCESS_CHOOSER_DATA| can auto-grant incoming
    /// permission request.
    CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION = 95,

    /// Whether the FSA Persistent Permissions restore prompt is eligible to be
    /// shown to the user, for a given origin.
    CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION = 96,

    /// Whether an application capturing another tab, may scroll and zoom
    /// the captured tab.
    CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL = 97,

    /// Content setting for access to smart card readers.
    /// The "guard" content setting stores whether to allow sites to access the
    /// Smart Card API.
    CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD = 98,
    CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA = 99,

    /// Content settings for access to printers for the Web Printing API.
    CEF_CONTENT_SETTING_TYPE_WEB_PRINTING = 100,

    /// Content setting used to indicate whether entering HTML Fullscreen
    /// automatically (i.e. without transient activation) should be enabled.
    CEF_CONTENT_SETTING_TYPE_AUTOMATIC_FULLSCREEN = 101,

    /// Content settings used to indicate that a web app is allowed to prompt the
    /// user for the installation of sub apps.
    CEF_CONTENT_SETTING_TYPE_SUB_APP_INSTALLATION_PROMPTS = 102,

    /// Whether an application can enumerate audio output device.
    CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION = 103,

    /// Content settings for access to the Direct Sockets API.
    CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS = 104,

    /// Keyboard Lock API allows a site to capture keyboard inputs that would
    /// otherwise be handled by the OS or the browser.
    CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK = 105,

    /// Pointer Lock API allows a site to hide the cursor and have exclusive
    /// access to mouse inputs.
    CEF_CONTENT_SETTING_TYPE_POINTER_LOCK = 106,

    /// Website setting which is used for UnusedSitePermissionsService to store
    /// auto-revoked notification permissions from abusive sites.
    REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS = 107,

    /// Content setting that controls tracking protection status per site.
    /// BLOCK: Protections enabled. This is the default state.
    /// ALLOW: Protections disabled.
    TRACKING_PROTECTION = 108
}

alias CEF_CONTENT_SETTING_TYPE_COOKIES = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_COOKIES;
alias CEF_CONTENT_SETTING_TYPE_IMAGES = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_IMAGES;
alias CEF_CONTENT_SETTING_TYPE_JAVASCRIPT = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_JAVASCRIPT;
alias CEF_CONTENT_SETTING_TYPE_POPUPS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_POPUPS;
alias CEF_CONTENT_SETTING_TYPE_GEOLOCATION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_GEOLOCATION;
alias CEF_CONTENT_SETTING_TYPE_NOTIFICATIONS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_NOTIFICATIONS;
alias CEF_CONTENT_SETTING_TYPE_AUTO_SELECT_CERTIFICATE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_AUTO_SELECT_CERTIFICATE;
alias CEF_CONTENT_SETTING_TYPE_MIXEDSCRIPT = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_MIXEDSCRIPT;
alias CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_MIC = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_MIC;
alias CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_CAMERA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_CAMERA;
alias CEF_CONTENT_SETTING_TYPE_PROTOCOL_HANDLERS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PROTOCOL_HANDLERS;
alias CEF_CONTENT_SETTING_TYPE_DEPRECATED_PPAPI_BROKER = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_DEPRECATED_PPAPI_BROKER;
alias CEF_CONTENT_SETTING_TYPE_AUTOMATIC_DOWNLOADS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_AUTOMATIC_DOWNLOADS;
alias CEF_CONTENT_SETTING_TYPE_MIDI_SYSEX = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_MIDI_SYSEX;
alias CEF_CONTENT_SETTING_TYPE_SSL_CERT_DECISIONS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SSL_CERT_DECISIONS;
alias CEF_CONTENT_SETTING_TYPE_PROTECTED_MEDIA_IDENTIFIER = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PROTECTED_MEDIA_IDENTIFIER;
alias CEF_CONTENT_SETTING_TYPE_APP_BANNER = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_APP_BANNER;
alias CEF_CONTENT_SETTING_TYPE_SITE_ENGAGEMENT = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SITE_ENGAGEMENT;
alias CEF_CONTENT_SETTING_TYPE_DURABLE_STORAGE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_DURABLE_STORAGE;
alias CEF_CONTENT_SETTING_TYPE_USB_CHOOSER_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_USB_CHOOSER_DATA;
alias CEF_CONTENT_SETTING_TYPE_BLUETOOTH_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_BLUETOOTH_GUARD;
alias CEF_CONTENT_SETTING_TYPE_BACKGROUND_SYNC = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_BACKGROUND_SYNC;
alias CEF_CONTENT_SETTING_TYPE_AUTOPLAY = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_AUTOPLAY;
alias CEF_CONTENT_SETTING_TYPE_IMPORTANT_SITE_INFO = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_IMPORTANT_SITE_INFO;
alias CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOBLOCKER_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOBLOCKER_DATA;
alias CEF_CONTENT_SETTING_TYPE_ADS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_ADS;
alias CEF_CONTENT_SETTING_TYPE_ADS_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_ADS_DATA;
alias CEF_CONTENT_SETTING_TYPE_MIDI = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_MIDI;
alias CEF_CONTENT_SETTING_TYPE_PASSWORD_PROTECTION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PASSWORD_PROTECTION;
alias CEF_CONTENT_SETTING_TYPE_MEDIA_ENGAGEMENT = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_MEDIA_ENGAGEMENT;
alias CEF_CONTENT_SETTING_TYPE_SOUND = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SOUND;
alias CEF_CONTENT_SETTING_TYPE_CLIENT_HINTS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_CLIENT_HINTS;
alias CEF_CONTENT_SETTING_TYPE_SENSORS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SENSORS;
alias CEF_CONTENT_SETTING_TYPE_ACCESSIBILITY_EVENTS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_ACCESSIBILITY_EVENTS;
alias CEF_CONTENT_SETTING_TYPE_PAYMENT_HANDLER = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PAYMENT_HANDLER;
alias CEF_CONTENT_SETTING_TYPE_USB_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_USB_GUARD;
alias CEF_CONTENT_SETTING_TYPE_BACKGROUND_FETCH = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_BACKGROUND_FETCH;
alias CEF_CONTENT_SETTING_TYPE_INTENT_PICKER_DISPLAY = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_INTENT_PICKER_DISPLAY;
alias CEF_CONTENT_SETTING_TYPE_IDLE_DETECTION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_IDLE_DETECTION;
alias CEF_CONTENT_SETTING_TYPE_SERIAL_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SERIAL_GUARD;
alias CEF_CONTENT_SETTING_TYPE_SERIAL_CHOOSER_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SERIAL_CHOOSER_DATA;
alias CEF_CONTENT_SETTING_TYPE_PERIODIC_BACKGROUND_SYNC = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PERIODIC_BACKGROUND_SYNC;
alias CEF_CONTENT_SETTING_TYPE_BLUETOOTH_SCANNING = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_BLUETOOTH_SCANNING;
alias CEF_CONTENT_SETTING_TYPE_HID_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_HID_GUARD;
alias CEF_CONTENT_SETTING_TYPE_HID_CHOOSER_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_HID_CHOOSER_DATA;
alias CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SCREEN = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SCREEN;
alias CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SYSTEM = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SYSTEM;
alias CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_ACCESS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_ACCESS;
alias CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_WRITE_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_WRITE_GUARD;
alias CEF_CONTENT_SETTING_TYPE_NFC = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_NFC;
alias CEF_CONTENT_SETTING_TYPE_BLUETOOTH_CHOOSER_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_BLUETOOTH_CHOOSER_DATA;
alias CEF_CONTENT_SETTING_TYPE_CLIPBOARD_READ_WRITE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_CLIPBOARD_READ_WRITE;
alias CEF_CONTENT_SETTING_TYPE_CLIPBOARD_SANITIZED_WRITE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_CLIPBOARD_SANITIZED_WRITE;
alias CEF_CONTENT_SETTING_TYPE_SAFE_BROWSING_URL_CHECK_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SAFE_BROWSING_URL_CHECK_DATA;
alias CEF_CONTENT_SETTING_TYPE_VR = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_VR;
alias CEF_CONTENT_SETTING_TYPE_AR = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_AR;
alias CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_READ_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_READ_GUARD;
alias CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS;
alias CEF_CONTENT_SETTING_TYPE_CAMERA_PAN_TILT_ZOOM = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_CAMERA_PAN_TILT_ZOOM;
alias CEF_CONTENT_SETTING_TYPE_WINDOW_MANAGEMENT = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_WINDOW_MANAGEMENT;
alias CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_INSECURE_PRIVATE_NETWORK;
alias CEF_CONTENT_SETTING_TYPE_LOCAL_FONTS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_LOCAL_FONTS;
alias CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOREVOCATION_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOREVOCATION_DATA;
alias CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY;
alias CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE;
alias CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_CHOOSER_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_CHOOSER_DATA;
alias CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_SHARING = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_SHARING;
alias CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_JIT = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_JIT;
alias CEF_CONTENT_SETTING_TYPE_HTTP_ALLOWED = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_HTTP_ALLOWED;
alias CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA;
alias CEF_CONTENT_SETTING_TYPE_DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_DEPRECATED_FEDERATED_IDENTITY_ACTIVE_SESSION;
alias CEF_CONTENT_SETTING_TYPE_AUTO_DARK_WEB_CONTENT = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_AUTO_DARK_WEB_CONTENT;
alias CEF_CONTENT_SETTING_TYPE_REQUEST_DESKTOP_SITE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_REQUEST_DESKTOP_SITE;
alias CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_API = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_API;
alias CEF_CONTENT_SETTING_TYPE_NOTIFICATION_INTERACTIONS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_NOTIFICATION_INTERACTIONS;
alias CEF_CONTENT_SETTING_TYPE_REDUCED_ACCEPT_LANGUAGE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_REDUCED_ACCEPT_LANGUAGE;
alias CEF_CONTENT_SETTING_TYPE_NOTIFICATION_PERMISSION_REVIEW = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_NOTIFICATION_PERMISSION_REVIEW;
alias CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_GUARD;
alias CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_CHOOSER_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_CHOOSER_DATA;
alias CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS;
alias CEF_CONTENT_SETTING_TYPE_REVOKED_UNUSED_SITE_PERMISSIONS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_REVOKED_UNUSED_SITE_PERMISSIONS;
alias CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_STORAGE_ACCESS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_STORAGE_ACCESS;
alias CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION;
alias CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION;
alias CEF_CONTENT_SETTING_TYPE_ANTI_ABUSE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_ANTI_ABUSE;
alias CEF_CONTENT_SETTING_TYPE_THIRD_PARTY_STORAGE_PARTITIONING = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_THIRD_PARTY_STORAGE_PARTITIONING;
alias CEF_CONTENT_SETTING_TYPE_HTTPS_ENFORCED = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_HTTPS_ENFORCED;
alias CEF_CONTENT_SETTING_TYPE_ALL_SCREEN_CAPTURE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_ALL_SCREEN_CAPTURE;
alias CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA;
alias CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS;
alias CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS;
alias CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL;
alias CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL;
alias CEF_CONTENT_SETTING_TOP_LEVEL_TPCD_ORIGIN_TRIAL = cef_content_setting_types_t.CEF_CONTENT_SETTING_TOP_LEVEL_TPCD_ORIGIN_TRIAL;
alias CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE;
alias CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION;
alias CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION;
alias CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL;
alias CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD;
alias CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA;
alias CEF_CONTENT_SETTING_TYPE_WEB_PRINTING = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_WEB_PRINTING;
alias CEF_CONTENT_SETTING_TYPE_AUTOMATIC_FULLSCREEN = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_AUTOMATIC_FULLSCREEN;
alias CEF_CONTENT_SETTING_TYPE_SUB_APP_INSTALLATION_PROMPTS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SUB_APP_INSTALLATION_PROMPTS;
alias CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION;
alias CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS;
alias CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK;
alias CEF_CONTENT_SETTING_TYPE_POINTER_LOCK = cef_content_setting_types_t.CEF_CONTENT_SETTING_TYPE_POINTER_LOCK;
alias REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS = cef_content_setting_types_t.REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS;
alias TRACKING_PROTECTION = cef_content_setting_types_t.TRACKING_PROTECTION;

///
/// Supported content setting values. Should be kept in sync with Chromium's
/// ContentSetting type.
///
enum cef_content_setting_values_t
{
    CEF_CONTENT_SETTING_VALUE_DEFAULT = 0,
    CEF_CONTENT_SETTING_VALUE_ALLOW = 1,
    CEF_CONTENT_SETTING_VALUE_BLOCK = 2,
    CEF_CONTENT_SETTING_VALUE_ASK = 3,
    CEF_CONTENT_SETTING_VALUE_SESSION_ONLY = 4,
    CEF_CONTENT_SETTING_VALUE_DETECT_IMPORTANT_CONTENT = 5,

    CEF_CONTENT_SETTING_VALUE_NUM_VALUES = 6
}

alias CEF_CONTENT_SETTING_VALUE_DEFAULT = cef_content_setting_values_t.CEF_CONTENT_SETTING_VALUE_DEFAULT;
alias CEF_CONTENT_SETTING_VALUE_ALLOW = cef_content_setting_values_t.CEF_CONTENT_SETTING_VALUE_ALLOW;
alias CEF_CONTENT_SETTING_VALUE_BLOCK = cef_content_setting_values_t.CEF_CONTENT_SETTING_VALUE_BLOCK;
alias CEF_CONTENT_SETTING_VALUE_ASK = cef_content_setting_values_t.CEF_CONTENT_SETTING_VALUE_ASK;
alias CEF_CONTENT_SETTING_VALUE_SESSION_ONLY = cef_content_setting_values_t.CEF_CONTENT_SETTING_VALUE_SESSION_ONLY;
alias CEF_CONTENT_SETTING_VALUE_DETECT_IMPORTANT_CONTENT = cef_content_setting_values_t.CEF_CONTENT_SETTING_VALUE_DETECT_IMPORTANT_CONTENT;
alias CEF_CONTENT_SETTING_VALUE_NUM_VALUES = cef_content_setting_values_t.CEF_CONTENT_SETTING_VALUE_NUM_VALUES;

// CEF_INCLUDE_INTERNAL_CEF_TYPES_CONTENT_SETTINGS_H_
// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import core.stdc.config;
import core.stdc.limits;

extern (C):

// Bring in platform-specific definitions.

// 32-bit ARGB color value, not premultiplied. The color components are always
// in a known order. Equivalent to the SkColor type.
alias cef_color_t = uint;

// Return the alpha byte from a cef_color_t value.


// Return the red byte from a cef_color_t value.


// Return the green byte from a cef_color_t value.


// Return the blue byte from a cef_color_t value.


// Return an cef_color_t value with the specified byte component values.


// Return an int64_t value with the specified low and high int32_t component
// values.


// Return the low int32_t value from an int64_t value.


// Return the high int32_t value from an int64_t value.


///
/// Log severity levels.
///
enum cef_log_severity_t
{
    ///
    /// Default logging (currently INFO logging).
    ///
    LOGSEVERITY_DEFAULT = 0,

    ///
    /// Verbose logging.
    ///
    LOGSEVERITY_VERBOSE = 1,

    ///
    /// DEBUG logging.
    ///
    LOGSEVERITY_DEBUG = LOGSEVERITY_VERBOSE,

    ///
    /// INFO logging.
    ///
    LOGSEVERITY_INFO = 2,

    ///
    /// WARNING logging.
    ///
    LOGSEVERITY_WARNING = 3,

    ///
    /// ERROR logging.
    ///
    LOGSEVERITY_ERROR = 4,

    ///
    /// FATAL logging.
    ///
    LOGSEVERITY_FATAL = 5,

    ///
    /// Disable logging to file for all messages, and to stderr for messages with
    /// severity less than FATAL.
    ///
    LOGSEVERITY_DISABLE = 99
}

alias LOGSEVERITY_DEFAULT = cef_log_severity_t.LOGSEVERITY_DEFAULT;
alias LOGSEVERITY_VERBOSE = cef_log_severity_t.LOGSEVERITY_VERBOSE;
alias LOGSEVERITY_DEBUG = cef_log_severity_t.LOGSEVERITY_DEBUG;
alias LOGSEVERITY_INFO = cef_log_severity_t.LOGSEVERITY_INFO;
alias LOGSEVERITY_WARNING = cef_log_severity_t.LOGSEVERITY_WARNING;
alias LOGSEVERITY_ERROR = cef_log_severity_t.LOGSEVERITY_ERROR;
alias LOGSEVERITY_FATAL = cef_log_severity_t.LOGSEVERITY_FATAL;
alias LOGSEVERITY_DISABLE = cef_log_severity_t.LOGSEVERITY_DISABLE;

///
/// Log items prepended to each log line.
///
enum cef_log_items_t
{
    ///
    /// Prepend the default list of items.
    ///
    LOG_ITEMS_DEFAULT = 0,

    ///
    /// Prepend no items.
    ///
    LOG_ITEMS_NONE = 1,

    ///
    /// Prepend the process ID.
    ///
    LOG_ITEMS_FLAG_PROCESS_ID = 1 << 1,

    ///
    /// Prepend the thread ID.
    ///
    LOG_ITEMS_FLAG_THREAD_ID = 1 << 2,

    ///
    /// Prepend the timestamp.
    ///
    LOG_ITEMS_FLAG_TIME_STAMP = 1 << 3,

    ///
    /// Prepend the tickcount.
    ///
    LOG_ITEMS_FLAG_TICK_COUNT = 1 << 4
}

alias LOG_ITEMS_DEFAULT = cef_log_items_t.LOG_ITEMS_DEFAULT;
alias LOG_ITEMS_NONE = cef_log_items_t.LOG_ITEMS_NONE;
alias LOG_ITEMS_FLAG_PROCESS_ID = cef_log_items_t.LOG_ITEMS_FLAG_PROCESS_ID;
alias LOG_ITEMS_FLAG_THREAD_ID = cef_log_items_t.LOG_ITEMS_FLAG_THREAD_ID;
alias LOG_ITEMS_FLAG_TIME_STAMP = cef_log_items_t.LOG_ITEMS_FLAG_TIME_STAMP;
alias LOG_ITEMS_FLAG_TICK_COUNT = cef_log_items_t.LOG_ITEMS_FLAG_TICK_COUNT;

///
/// Represents the state of a setting.
///
enum cef_state_t
{
    ///
    /// Use the default state for the setting.
    ///
    STATE_DEFAULT = 0,

    ///
    /// Enable or allow the setting.
    ///
    STATE_ENABLED = 1,

    ///
    /// Disable or disallow the setting.
    ///
    STATE_DISABLED = 2
}

alias STATE_DEFAULT = cef_state_t.STATE_DEFAULT;
alias STATE_ENABLED = cef_state_t.STATE_ENABLED;
alias STATE_DISABLED = cef_state_t.STATE_DISABLED;

///
/// Initialization settings. Specify NULL or 0 to get the recommended default
/// values. Many of these and other settings can also configured using command-
/// line switches.
///
struct cef_settings_t
{
    ///
    /// Size of this structure.
    ///
    alias size_t = c_ulong;
    size_t size;

    ///
    /// Set to true (1) to disable the sandbox for sub-processes. See
    /// cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also
    /// configurable using the "no-sandbox" command-line switch.
    ///
    int no_sandbox;

    ///
    /// The path to a separate executable that will be launched for sub-processes.
    /// If this value is empty on Windows or Linux then the main process
    /// executable will be used. If this value is empty on macOS then a helper
    /// executable must exist at "Contents/Frameworks/<app>
    /// Helper.app/Contents/MacOS/<app> Helper" in the top-level app bundle. See
    /// the comments on CefExecuteProcess() for details. If this value is
    /// non-empty then it must be an absolute path. Also configurable using the
    /// "browser-subprocess-path" command-line switch.
    ///
    alias cef_string_t = cef_string_utf16_t;
    cef_string_t browser_subprocess_path;

    ///
    /// The path to the CEF framework directory on macOS. If this value is empty
    /// then the framework must exist at "Contents/Frameworks/Chromium Embedded
    /// Framework.framework" in the top-level app bundle. If this value is
    /// non-empty then it must be an absolute path. Also configurable using the
    /// "framework-dir-path" command-line switch.
    ///
    cef_string_t framework_dir_path;

    ///
    /// The path to the main bundle on macOS. If this value is empty then it
    /// defaults to the top-level app bundle. If this value is non-empty then it
    /// must be an absolute path. Also configurable using the "main-bundle-path"
    /// command-line switch.
    ///
    cef_string_t main_bundle_path;

    ///
    /// Set to true (1) to enable use of the Chrome runtime in CEF. This feature
    /// is considered experimental and is not recommended for most users at this
    /// time. See issue #2969 for details.
    ///
    int chrome_runtime;

    ///
    /// Set to true (1) to have the browser process message loop run in a separate
    /// thread. If false (0) then the CefDoMessageLoopWork() function must be
    /// called from your application message loop. This option is only supported
    /// on Windows and Linux.
    ///
    int multi_threaded_message_loop;

    ///
    /// Set to true (1) to control browser process main (UI) thread message pump
    /// scheduling via the CefBrowserProcessHandler::OnScheduleMessagePumpWork()
    /// callback. This option is recommended for use in combination with the
    /// CefDoMessageLoopWork() function in cases where the CEF message loop must
    /// be integrated into an existing application message loop (see additional
    /// comments and warnings on CefDoMessageLoopWork). Enabling this option is
    /// not recommended for most users; leave this option disabled and use either
    /// the CefRunMessageLoop() function or multi_threaded_message_loop if
    /// possible.
    ///
    int external_message_pump;

    ///
    /// Set to true (1) to enable windowless (off-screen) rendering support. Do
    /// not enable this value if the application does not use windowless rendering
    /// as it may reduce rendering performance on some systems.
    ///
    int windowless_rendering_enabled;

    ///
    /// Set to true (1) to disable configuration of browser process features using
    /// standard CEF and Chromium command-line arguments. Configuration can still
    /// be specified using CEF data structures or via the
    /// CefApp::OnBeforeCommandLineProcessing() method.
    ///
    int command_line_args_disabled;

    ///
    /// The directory where data for the global browser cache will be stored on
    /// disk. If this value is non-empty then it must be an absolute path that is
    /// either equal to or a child directory of CefSettings.root_cache_path. If
    /// this value is empty then browsers will be created in "incognito mode"
    /// where in-memory caches are used for storage and no profile-specific data
    /// is persisted to disk (installation-specific data will still be persisted
    /// in root_cache_path). HTML5 databases such as localStorage will only
    /// persist across sessions if a cache path is specified. Can be overridden
    /// for individual CefRequestContext instances via the
    /// CefRequestContextSettings.cache_path value. When using the Chrome runtime
    /// any child directory value will be ignored and the "default" profile (also
    /// a child directory) will be used instead.
    ///
    cef_string_t cache_path;

    ///
    /// The root directory for installation-specific data and the parent directory
    /// for profile-specific data. All CefSettings.cache_path and
    /// CefRequestContextSettings.cache_path values must have this parent
    /// directory in common. If this value is empty and CefSettings.cache_path is
    /// non-empty then it will default to the CefSettings.cache_path value. Any
    /// non-empty value must be an absolute path. If both values are empty then
    /// the default platform-specific directory will be used
    /// ("~/.config/cef_user_data" directory on Linux, "~/Library/Application
    /// Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data"
    /// directory under the user profile directory on Windows). Use of the default
    /// directory is not recommended in production applications (see below).
    ///
    /// Multiple application instances writing to the same root_cache_path
    /// directory could result in data corruption. A process singleton lock based
    /// on the root_cache_path value is therefore used to protect against this.
    /// This singleton behavior applies to all CEF-based applications using
    /// version 120 or newer. You should customize root_cache_path for your
    /// application and implement CefBrowserProcessHandler::
    /// OnAlreadyRunningAppRelaunch, which will then be called on any app relaunch
    /// with the same root_cache_path value.
    ///
    /// Failure to set the root_cache_path value correctly may result in startup
    /// crashes or other unexpected behaviors (for example, the sandbox blocking
    /// read/write access to certain files).
    ///
    cef_string_t root_cache_path;

    ///
    /// To persist session cookies (cookies without an expiry date or validity
    /// interval) by default when using the global cookie manager set this value
    /// to true (1). Session cookies are generally intended to be transient and
    /// most Web browsers do not persist them. A |cache_path| value must also be
    /// specified to enable this feature. Also configurable using the
    /// "persist-session-cookies" command-line switch. Can be overridden for
    /// individual CefRequestContext instances via the
    /// CefRequestContextSettings.persist_session_cookies value.
    ///
    int persist_session_cookies;

    ///
    /// To persist user preferences as a JSON file in the cache path directory set
    /// this value to true (1). A |cache_path| value must also be specified
    /// to enable this feature. Also configurable using the
    /// "persist-user-preferences" command-line switch. Can be overridden for
    /// individual CefRequestContext instances via the
    /// CefRequestContextSettings.persist_user_preferences value.
    ///
    int persist_user_preferences;

    ///
    /// Value that will be returned as the User-Agent HTTP header. If empty the
    /// default User-Agent string will be used. Also configurable using the
    /// "user-agent" command-line switch.
    ///
    cef_string_t user_agent;

    ///
    /// Value that will be inserted as the product portion of the default
    /// User-Agent string. If empty the Chromium product version will be used. If
    /// |userAgent| is specified this value will be ignored. Also configurable
    /// using the "user-agent-product" command-line switch.
    ///
    cef_string_t user_agent_product;

    ///
    /// The locale string that will be passed to WebKit. If empty the default
    /// locale of "en-US" will be used. This value is ignored on Linux where
    /// locale is determined using environment variable parsing with the
    /// precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also
    /// configurable using the "lang" command-line switch.
    ///
    cef_string_t locale;

    ///
    /// The directory and file name to use for the debug log. If empty a default
    /// log file name and location will be used. On Windows and Linux a
    /// "debug.log" file will be written in the main executable directory. On
    /// MacOS a "~/Library/Logs/[app name]_debug.log" file will be written where
    /// [app name] is the name of the main app executable. Also configurable using
    /// the "log-file" command-line switch.
    ///
    cef_string_t log_file;

    ///
    /// The log severity. Only messages of this severity level or higher will be
    /// logged. When set to DISABLE no messages will be written to the log file,
    /// but FATAL messages will still be output to stderr. Also configurable using
    /// the "log-severity" command-line switch with a value of "verbose", "info",
    /// "warning", "error", "fatal" or "disable".
    ///
    cef_log_severity_t log_severity;

    ///
    /// The log items prepended to each log line. If not set the default log items
    /// will be used. Also configurable using the "log-items" command-line switch
    /// with a value of "none" for no log items, or a comma-delimited list of
    /// values "pid", "tid", "timestamp" or "tickcount" for custom log items.
    ///
    cef_log_items_t log_items;

    ///
    /// Custom flags that will be used when initializing the V8 JavaScript engine.
    /// The consequences of using custom flags may not be well tested. Also
    /// configurable using the "js-flags" command-line switch.
    ///
    cef_string_t javascript_flags;

    ///
    /// The fully qualified path for the resources directory. If this value is
    /// empty the *.pak files must be located in the module directory on
    /// Windows/Linux or the app bundle Resources directory on MacOS. If this
    /// value is non-empty then it must be an absolute path. Also configurable
    /// using the "resources-dir-path" command-line switch.
    ///
    cef_string_t resources_dir_path;

    ///
    /// The fully qualified path for the locales directory. If this value is empty
    /// the locales directory must be located in the module directory. If this
    /// value is non-empty then it must be an absolute path. This value is ignored
    /// on MacOS where pack files are always loaded from the app bundle Resources
    /// directory. Also configurable using the "locales-dir-path" command-line
    /// switch.
    ///
    cef_string_t locales_dir_path;

    ///
    /// Set to true (1) to disable loading of pack files for resources and
    /// locales. A resource bundle handler must be provided for the browser and
    /// render processes via CefApp::GetResourceBundleHandler() if loading of pack
    /// files is disabled. Also configurable using the "disable-pack-loading"
    /// command- line switch.
    ///
    int pack_loading_disabled;

    ///
    /// Set to a value between 1024 and 65535 to enable remote debugging on the
    /// specified port. Also configurable using the "remote-debugging-port"
    /// command-line switch. Specifying 0 via the command-line switch will result
    /// in the selection of an ephemeral port and the port number will be printed
    /// as part of the WebSocket endpoint URL to stderr. If a cache directory path
    /// is provided the port will also be written to the
    /// <cache-dir>/DevToolsActivePort file. Remote debugging can be accessed by
    /// loading the chrome://inspect page in Google Chrome. Port numbers 9222 and
    /// 9229 are discoverable by default. Other port numbers may need to be
    /// configured via "Discover network targets" on the Devices tab.
    ///
    int remote_debugging_port;

    ///
    /// The number of stack trace frames to capture for uncaught exceptions.
    /// Specify a positive value to enable the
    /// CefRenderProcessHandler::OnUncaughtException() callback. Specify 0
    /// (default value) and OnUncaughtException() will not be called. Also
    /// configurable using the "uncaught-exception-stack-size" command-line
    /// switch.
    ///
    int uncaught_exception_stack_size;

    ///
    /// Background color used for the browser before a document is loaded and when
    /// no document color is specified. The alpha component must be either fully
    /// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully
    /// opaque then the RGB components will be used as the background color. If
    /// the alpha component is fully transparent for a windowed browser then the
    /// default value of opaque white be used. If the alpha component is fully
    /// transparent for a windowless (off-screen) browser then transparent
    /// painting will be enabled.
    ///
    cef_color_t background_color;

    ///
    /// Comma delimited ordered list of language codes without any whitespace that
    /// will be used in the "Accept-Language" HTTP request header and
    /// "navigator.language" JS attribute. Can be overridden for individual
    /// CefRequestContext instances via the
    /// CefRequestContextSettings.accept_language_list value.
    ///
    cef_string_t accept_language_list;

    ///
    /// Comma delimited list of schemes supported by the associated
    /// CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0)
    /// the default schemes ("http", "https", "ws" and "wss") will also be
    /// supported. Not specifying a |cookieable_schemes_list| value and setting
    /// |cookieable_schemes_exclude_defaults| to true (1) will disable all loading
    /// and saving of cookies. These settings will only impact the global
    /// CefRequestContext. Individual CefRequestContext instances can be
    /// configured via the CefRequestContextSettings.cookieable_schemes_list and
    /// CefRequestContextSettings.cookieable_schemes_exclude_defaults values.
    ///
    cef_string_t cookieable_schemes_list;
    int cookieable_schemes_exclude_defaults;

    ///
    /// Specify an ID to enable Chrome policy management via Platform and OS-user
    /// policies. On Windows, this is a registry key like
    /// "SOFTWARE\\Policies\\Google\\Chrome". On MacOS, this is a bundle ID like
    /// "com.google.Chrome". On Linux, this is an absolute directory path like
    /// "/etc/opt/chrome/policies". Only supported with the Chrome runtime. See
    /// https://support.google.com/chrome/a/answer/9037717 for details.
    ///
    /// Chrome Browser Cloud Management integration, when enabled via the
    /// "enable-chrome-browser-cloud-management" command-line flag, will also use
    /// the specified ID. See https://support.google.com/chrome/a/answer/9116814
    /// for details.
    ///
    cef_string_t chrome_policy_id;

    ///
    /// Specify an ID for an ICON resource that can be loaded from the main
    /// executable and used when creating default Chrome windows such as DevTools
    /// and Task Manager. If unspecified the default Chromium ICON (IDR_MAINFRAME
    /// [101]) will be loaded from libcef.dll. Only supported with the Chrome
    /// runtime on Windows.
    ///
    int chrome_app_icon_id;
}



///
/// Request context initialization settings. Specify NULL or 0 to get the
/// recommended default values.
///
struct cef_request_context_settings_t
{
    ///
    /// Size of this structure.
    ///
    size_t size;

    ///
    /// The directory where cache data for this request context will be stored on
    /// disk. If this value is non-empty then it must be an absolute path that is
    /// either equal to or a child directory of CefSettings.root_cache_path. If
    /// this value is empty then browsers will be created in "incognito mode"
    /// where in-memory caches are used for storage and no profile-specific data
    /// is persisted to disk (installation-specific data will still be persisted
    /// in root_cache_path). HTML5 databases such as localStorage will only
    /// persist across sessions if a cache path is specified. To share the global
    /// browser cache and related configuration set this value to match the
    /// CefSettings.cache_path value.
    ///
    cef_string_t cache_path;

    ///
    /// To persist session cookies (cookies without an expiry date or validity
    /// interval) by default when using the global cookie manager set this value
    /// to true (1). Session cookies are generally intended to be transient and
    /// most Web browsers do not persist them. Can be set globally using the
    /// CefSettings.persist_session_cookies value. This value will be ignored if
    /// |cache_path| is empty or if it matches the CefSettings.cache_path value.
    ///
    int persist_session_cookies;

    ///
    /// To persist user preferences as a JSON file in the cache path directory set
    /// this value to true (1). Can be set globally using the
    /// CefSettings.persist_user_preferences value. This value will be ignored if
    /// |cache_path| is empty or if it matches the CefSettings.cache_path value.
    ///
    int persist_user_preferences;

    ///
    /// Comma delimited ordered list of language codes without any whitespace that
    /// will be used in the "Accept-Language" HTTP request header and
    /// "navigator.language" JS attribute. Can be set globally using the
    /// CefSettings.accept_language_list value. If all values are empty then
    /// "en-US,en" will be used. This value will be ignored if |cache_path|
    /// matches the CefSettings.cache_path value.
    ///
    cef_string_t accept_language_list;

    ///
    /// Comma delimited list of schemes supported by the associated
    /// CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0)
    /// the default schemes ("http", "https", "ws" and "wss") will also be
    /// supported. Not specifying a |cookieable_schemes_list| value and setting
    /// |cookieable_schemes_exclude_defaults| to true (1) will disable all loading
    /// and saving of cookies. These values will be ignored if |cache_path|
    /// matches the CefSettings.cache_path value.
    ///
    cef_string_t cookieable_schemes_list;
    int cookieable_schemes_exclude_defaults;
}



///
/// Browser initialization settings. Specify NULL or 0 to get the recommended
/// default values. The consequences of using custom values may not be well
/// tested. Many of these and other settings can also configured using command-
/// line switches.
///
struct cef_browser_settings_t
{
    ///
    /// Size of this structure.
    ///
    size_t size;

    ///
    /// The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint
    /// will be called for a windowless browser. The actual fps may be lower if
    /// the browser cannot generate frames at the requested rate. The minimum
    /// value is 1 and the maximum value is 60 (default 30). This value can also
    /// be changed dynamically via CefBrowserHost::SetWindowlessFrameRate.
    ///
    int windowless_frame_rate;

    /// BEGIN values that map to WebPreferences settings.

    ///
    /// Font settings.
    ///
    cef_string_t standard_font_family;
    cef_string_t fixed_font_family;
    cef_string_t serif_font_family;
    cef_string_t sans_serif_font_family;
    cef_string_t cursive_font_family;
    cef_string_t fantasy_font_family;
    int default_font_size;
    int default_fixed_font_size;
    int minimum_font_size;
    int minimum_logical_font_size;

    ///
    /// Default encoding for Web content. If empty "ISO-8859-1" will be used. Also
    /// configurable using the "default-encoding" command-line switch.
    ///
    cef_string_t default_encoding;

    ///
    /// Controls the loading of fonts from remote sources. Also configurable using
    /// the "disable-remote-fonts" command-line switch.
    ///
    cef_state_t remote_fonts;

    ///
    /// Controls whether JavaScript can be executed. Also configurable using the
    /// "disable-javascript" command-line switch.
    ///
    cef_state_t javascript;

    ///
    /// Controls whether JavaScript can be used to close windows that were not
    /// opened via JavaScript. JavaScript can still be used to close windows that
    /// were opened via JavaScript or that have no back/forward history. Also
    /// configurable using the "disable-javascript-close-windows" command-line
    /// switch.
    ///
    cef_state_t javascript_close_windows;

    ///
    /// Controls whether JavaScript can access the clipboard. Also configurable
    /// using the "disable-javascript-access-clipboard" command-line switch.
    ///
    cef_state_t javascript_access_clipboard;

    ///
    /// Controls whether DOM pasting is supported in the editor via
    /// execCommand("paste"). The |javascript_access_clipboard| setting must also
    /// be enabled. Also configurable using the "disable-javascript-dom-paste"
    /// command-line switch.
    ///
    cef_state_t javascript_dom_paste;

    ///
    /// Controls whether image URLs will be loaded from the network. A cached
    /// image will still be rendered if requested. Also configurable using the
    /// "disable-image-loading" command-line switch.
    ///
    cef_state_t image_loading;

    ///
    /// Controls whether standalone images will be shrunk to fit the page. Also
    /// configurable using the "image-shrink-standalone-to-fit" command-line
    /// switch.
    ///
    cef_state_t image_shrink_standalone_to_fit;

    ///
    /// Controls whether text areas can be resized. Also configurable using the
    /// "disable-text-area-resize" command-line switch.
    ///
    cef_state_t text_area_resize;

    ///
    /// Controls whether the tab key can advance focus to links. Also configurable
    /// using the "disable-tab-to-links" command-line switch.
    ///
    cef_state_t tab_to_links;

    ///
    /// Controls whether local storage can be used. Also configurable using the
    /// "disable-local-storage" command-line switch.
    ///
    cef_state_t local_storage;

    ///
    /// Controls whether databases can be used. Also configurable using the
    /// "disable-databases" command-line switch.
    ///
    cef_state_t databases;

    ///
    /// Controls whether WebGL can be used. Note that WebGL requires hardware
    /// support and may not work on all systems even when enabled. Also
    /// configurable using the "disable-webgl" command-line switch.
    ///
    cef_state_t webgl;

    /// END values that map to WebPreferences settings.

    ///
    /// Background color used for the browser before a document is loaded and when
    /// no document color is specified. The alpha component must be either fully
    /// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully
    /// opaque then the RGB components will be used as the background color. If
    /// the alpha component is fully transparent for a windowed browser then the
    /// CefSettings.background_color value will be used. If the alpha component is
    /// fully transparent for a windowless (off-screen) browser then transparent
    /// painting will be enabled.
    ///
    cef_color_t background_color;

    ///
    /// Controls whether the Chrome status bubble will be used. Only supported
    /// with the Chrome runtime. For details about the status bubble see
    /// https://www.chromium.org/user-experience/status-bubble/
    ///
    cef_state_t chrome_status_bubble;

    ///
    /// Controls whether the Chrome zoom bubble will be shown when zooming. Only
    /// supported with the Chrome runtime.
    ///
    cef_state_t chrome_zoom_bubble;
}



///
/// Return value types.
///
enum cef_return_value_t
{
    ///
    /// Cancel immediately.
    ///
    RV_CANCEL = 0,

    ///
    /// Continue immediately.
    ///
    RV_CONTINUE = 1,

    ///
    /// Continue asynchronously (usually via a callback).
    ///
    RV_CONTINUE_ASYNC = 2
}

alias RV_CANCEL = cef_return_value_t.RV_CANCEL;
alias RV_CONTINUE = cef_return_value_t.RV_CONTINUE;
alias RV_CONTINUE_ASYNC = cef_return_value_t.RV_CONTINUE_ASYNC;

///
/// URL component parts.
///
struct cef_urlparts_t
{
    ///
    /// The complete URL specification.
    ///
    cef_string_t spec;

    ///
    /// Scheme component not including the colon (e.g., "http").
    ///
    cef_string_t scheme;

    ///
    /// User name component.
    ///
    cef_string_t username;

    ///
    /// Password component.
    ///
    cef_string_t password;

    ///
    /// Host component. This may be a hostname, an IPv4 address or an IPv6 literal
    /// surrounded by square brackets (e.g., "[2001:db8::1]").
    ///
    cef_string_t host;

    ///
    /// Port number component.
    ///
    cef_string_t port;

    ///
    /// Origin contains just the scheme, host, and port from a URL. Equivalent to
    /// clearing any username and password, replacing the path with a slash, and
    /// clearing everything after that. This value will be empty for non-standard
    /// URLs.
    ///
    cef_string_t origin;

    ///
    /// Path component including the first slash following the host.
    ///
    cef_string_t path;

    ///
    /// Query string component (i.e., everything following the '?').
    ///
    cef_string_t query;

    ///
    /// Fragment (hash) identifier component (i.e., the string following the '#').
    ///
    cef_string_t fragment;
}



///
/// Cookie priority values.
///
enum cef_cookie_priority_t
{
    CEF_COOKIE_PRIORITY_LOW = -1,
    CEF_COOKIE_PRIORITY_MEDIUM = 0,
    CEF_COOKIE_PRIORITY_HIGH = 1
}

alias CEF_COOKIE_PRIORITY_LOW = cef_cookie_priority_t.CEF_COOKIE_PRIORITY_LOW;
alias CEF_COOKIE_PRIORITY_MEDIUM = cef_cookie_priority_t.CEF_COOKIE_PRIORITY_MEDIUM;
alias CEF_COOKIE_PRIORITY_HIGH = cef_cookie_priority_t.CEF_COOKIE_PRIORITY_HIGH;

///
/// Cookie same site values.
///
enum cef_cookie_same_site_t
{
    CEF_COOKIE_SAME_SITE_UNSPECIFIED = 0,
    CEF_COOKIE_SAME_SITE_NO_RESTRICTION = 1,
    CEF_COOKIE_SAME_SITE_LAX_MODE = 2,
    CEF_COOKIE_SAME_SITE_STRICT_MODE = 3
}

alias CEF_COOKIE_SAME_SITE_UNSPECIFIED = cef_cookie_same_site_t.CEF_COOKIE_SAME_SITE_UNSPECIFIED;
alias CEF_COOKIE_SAME_SITE_NO_RESTRICTION = cef_cookie_same_site_t.CEF_COOKIE_SAME_SITE_NO_RESTRICTION;
alias CEF_COOKIE_SAME_SITE_LAX_MODE = cef_cookie_same_site_t.CEF_COOKIE_SAME_SITE_LAX_MODE;
alias CEF_COOKIE_SAME_SITE_STRICT_MODE = cef_cookie_same_site_t.CEF_COOKIE_SAME_SITE_STRICT_MODE;

///
/// Cookie information.
///
struct cef_cookie_t
{
    ///
    /// The cookie name.
    ///
    cef_string_t name;

    ///
    /// The cookie value.
    ///
    cef_string_t value;

    ///
    /// If |domain| is empty a host cookie will be created instead of a domain
    /// cookie. Domain cookies are stored with a leading "." and are visible to
    /// sub-domains whereas host cookies are not.
    ///
    cef_string_t domain;

    ///
    /// If |path| is non-empty only URLs at or below the path will get the cookie
    /// value.
    ///
    cef_string_t path;

    ///
    /// If |secure| is true the cookie will only be sent for HTTPS requests.
    ///
    int secure;

    ///
    /// If |httponly| is true the cookie will only be sent for HTTP requests.
    ///
    int httponly;

    ///
    /// The cookie creation date. This is automatically populated by the system on
    /// cookie creation.
    ///

    cef_basetime_t creation;

    ///
    /// The cookie last access date. This is automatically populated by the system
    /// on access.
    ///
    cef_basetime_t last_access;

    ///
    /// The cookie expiration date is only valid if |has_expires| is true.
    ///
    int has_expires;
    cef_basetime_t expires;

    ///
    /// Same site.
    ///
    cef_cookie_same_site_t same_site;

    ///
    /// Priority.
    ///
    cef_cookie_priority_t priority;
}



///
/// Process termination status values.
///
enum cef_termination_status_t
{
    ///
    /// Non-zero exit status.
    ///
    TS_ABNORMAL_TERMINATION = 0,

    ///
    /// SIGKILL or task manager kill.
    ///
    TS_PROCESS_WAS_KILLED = 1,

    ///
    /// Segmentation fault.
    ///
    TS_PROCESS_CRASHED = 2,

    ///
    /// Out of memory. Some platforms may use TS_PROCESS_CRASHED instead.
    ///
    TS_PROCESS_OOM = 3,

    ///
    /// Child process never launched.
    ///
    TS_LAUNCH_FAILED = 4,

    ///
    /// On Windows, the OS terminated the process due to code integrity failure.
    ///
    TS_INTEGRITY_FAILURE = 5
}

alias TS_ABNORMAL_TERMINATION = cef_termination_status_t.TS_ABNORMAL_TERMINATION;
alias TS_PROCESS_WAS_KILLED = cef_termination_status_t.TS_PROCESS_WAS_KILLED;
alias TS_PROCESS_CRASHED = cef_termination_status_t.TS_PROCESS_CRASHED;
alias TS_PROCESS_OOM = cef_termination_status_t.TS_PROCESS_OOM;
alias TS_LAUNCH_FAILED = cef_termination_status_t.TS_LAUNCH_FAILED;
alias TS_INTEGRITY_FAILURE = cef_termination_status_t.TS_INTEGRITY_FAILURE;

///
/// Path key values.
///
enum cef_path_key_t
{
    ///
    /// Current directory.
    ///
    PK_DIR_CURRENT = 0,

    ///
    /// Directory containing PK_FILE_EXE.
    ///
    PK_DIR_EXE = 1,

    ///
    /// Directory containing PK_FILE_MODULE.
    ///
    PK_DIR_MODULE = 2,

    ///
    /// Temporary directory.
    ///
    PK_DIR_TEMP = 3,

    ///
    /// Path and filename of the current executable.
    ///
    PK_FILE_EXE = 4,

    ///
    /// Path and filename of the module containing the CEF code (usually the
    /// libcef module).
    ///
    PK_FILE_MODULE = 5,

    ///
    /// "Local Settings\Application Data" directory under the user profile
    /// directory on Windows.
    ///
    PK_LOCAL_APP_DATA = 6,

    ///
    /// "Application Data" directory under the user profile directory on Windows
    /// and "~/Library/Application Support" directory on MacOS.
    ///
    PK_USER_DATA = 7,

    ///
    /// Directory containing application resources. Can be configured via
    /// CefSettings.resources_dir_path.
    ///
    PK_DIR_RESOURCES = 8
}

alias PK_DIR_CURRENT = cef_path_key_t.PK_DIR_CURRENT;
alias PK_DIR_EXE = cef_path_key_t.PK_DIR_EXE;
alias PK_DIR_MODULE = cef_path_key_t.PK_DIR_MODULE;
alias PK_DIR_TEMP = cef_path_key_t.PK_DIR_TEMP;
alias PK_FILE_EXE = cef_path_key_t.PK_FILE_EXE;
alias PK_FILE_MODULE = cef_path_key_t.PK_FILE_MODULE;
alias PK_LOCAL_APP_DATA = cef_path_key_t.PK_LOCAL_APP_DATA;
alias PK_USER_DATA = cef_path_key_t.PK_USER_DATA;
alias PK_DIR_RESOURCES = cef_path_key_t.PK_DIR_RESOURCES;

///
/// Storage types.
///
enum cef_storage_type_t
{
    ST_LOCALSTORAGE = 0,
    ST_SESSIONSTORAGE = 1
}

alias ST_LOCALSTORAGE = cef_storage_type_t.ST_LOCALSTORAGE;
alias ST_SESSIONSTORAGE = cef_storage_type_t.ST_SESSIONSTORAGE;

///
/// Supported error code values. For the complete list of error values see
/// "include/base/internal/cef_net_error_list.h".
///
enum cef_errorcode_t
{
    // No error.
    ERR_NONE = 0,
    ERR_IO_PENDING = -1,
    ERR_FAILED = -2,
    ERR_ABORTED = -3,
    ERR_INVALID_ARGUMENT = -4,
    ERR_INVALID_HANDLE = -5,
    ERR_FILE_NOT_FOUND = -6,
    ERR_TIMED_OUT = -7,
    ERR_FILE_TOO_BIG = -8,
    ERR_UNEXPECTED = -9,
    ERR_ACCESS_DENIED = -10,
    ERR_NOT_IMPLEMENTED = -11,
    ERR_INSUFFICIENT_RESOURCES = -12,
    ERR_OUT_OF_MEMORY = -13,
    ERR_UPLOAD_FILE_CHANGED = -14,
    ERR_SOCKET_NOT_CONNECTED = -15,
    ERR_FILE_EXISTS = -16,
    ERR_FILE_PATH_TOO_LONG = -17,
    ERR_FILE_NO_SPACE = -18,
    ERR_FILE_VIRUS_INFECTED = -19,
    ERR_BLOCKED_BY_CLIENT = -20,
    ERR_NETWORK_CHANGED = -21,
    ERR_BLOCKED_BY_ADMINISTRATOR = -22,
    ERR_SOCKET_IS_CONNECTED = -23,
    ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED = -25,
    ERR_CONTEXT_SHUT_DOWN = -26,
    ERR_BLOCKED_BY_RESPONSE = -27,
    ERR_CLEARTEXT_NOT_PERMITTED = -29,
    ERR_BLOCKED_BY_CSP = -30,
    ERR_H2_OR_QUIC_REQUIRED = -31,
    ERR_BLOCKED_BY_ORB = -32,
    ERR_NETWORK_ACCESS_REVOKED = -33,
    ERR_CONNECTION_CLOSED = -100,
    ERR_CONNECTION_RESET = -101,
    ERR_CONNECTION_REFUSED = -102,
    ERR_CONNECTION_ABORTED = -103,
    ERR_CONNECTION_FAILED = -104,
    ERR_NAME_NOT_RESOLVED = -105,
    ERR_INTERNET_DISCONNECTED = -106,
    ERR_SSL_PROTOCOL_ERROR = -107,
    ERR_ADDRESS_INVALID = -108,
    ERR_ADDRESS_UNREACHABLE = -109,
    ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110,
    ERR_TUNNEL_CONNECTION_FAILED = -111,
    ERR_NO_SSL_VERSIONS_ENABLED = -112,
    ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113,
    ERR_SSL_RENEGOTIATION_REQUESTED = -114,
    ERR_PROXY_AUTH_UNSUPPORTED = -115,
    ERR_BAD_SSL_CLIENT_AUTH_CERT = -117,
    ERR_CONNECTION_TIMED_OUT = -118,
    ERR_HOST_RESOLVER_QUEUE_TOO_LARGE = -119,
    ERR_SOCKS_CONNECTION_FAILED = -120,
    ERR_SOCKS_CONNECTION_HOST_UNREACHABLE = -121,
    ERR_ALPN_NEGOTIATION_FAILED = -122,
    ERR_SSL_NO_RENEGOTIATION = -123,
    ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES = -124,
    ERR_SSL_DECOMPRESSION_FAILURE_ALERT = -125,
    ERR_SSL_BAD_RECORD_MAC_ALERT = -126,
    ERR_PROXY_AUTH_REQUESTED = -127,
    ERR_PROXY_CONNECTION_FAILED = -130,
    ERR_MANDATORY_PROXY_CONFIGURATION_FAILED = -131,
    ERR_PRECONNECT_MAX_SOCKET_LIMIT = -133,
    ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED = -134,
    ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY = -135,
    ERR_PROXY_CERTIFICATE_INVALID = -136,
    ERR_NAME_RESOLUTION_FAILED = -137,
    ERR_NETWORK_ACCESS_DENIED = -138,
    ERR_TEMPORARILY_THROTTLED = -139,
    ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT = -140,
    ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED = -141,
    ERR_MSG_TOO_BIG = -142,
    ERR_WS_PROTOCOL_ERROR = -145,
    ERR_ADDRESS_IN_USE = -147,
    ERR_SSL_HANDSHAKE_NOT_COMPLETED = -148,
    ERR_SSL_BAD_PEER_PUBLIC_KEY = -149,
    ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN = -150,
    ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED = -151,
    ERR_SSL_DECRYPT_ERROR_ALERT = -153,
    ERR_WS_THROTTLE_QUEUE_TOO_LARGE = -154,
    ERR_SSL_SERVER_CERT_CHANGED = -156,
    ERR_SSL_UNRECOGNIZED_NAME_ALERT = -159,
    ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR = -160,
    ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR = -161,
    ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE = -162,
    ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE = -163,
    ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT = -164,
    ERR_ICANN_NAME_COLLISION = -166,
    ERR_SSL_SERVER_CERT_BAD_FORMAT = -167,
    ERR_CT_STH_PARSING_FAILED = -168,
    ERR_CT_STH_INCOMPLETE = -169,
    ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH = -170,
    ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED = -171,
    ERR_SSL_OBSOLETE_CIPHER = -172,
    ERR_WS_UPGRADE = -173,
    ERR_READ_IF_READY_NOT_IMPLEMENTED = -174,
    ERR_NO_BUFFER_SPACE = -176,
    ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS = -177,
    ERR_EARLY_DATA_REJECTED = -178,
    ERR_WRONG_VERSION_ON_EARLY_DATA = -179,
    ERR_TLS13_DOWNGRADE_DETECTED = -180,
    ERR_SSL_KEY_USAGE_INCOMPATIBLE = -181,
    ERR_INVALID_ECH_CONFIG_LIST = -182,
    ERR_ECH_NOT_NEGOTIATED = -183,
    ERR_ECH_FALLBACK_CERTIFICATE_INVALID = -184,
    ERR_CERT_COMMON_NAME_INVALID = -200,
    ERR_CERT_DATE_INVALID = -201,
    ERR_CERT_AUTHORITY_INVALID = -202,
    ERR_CERT_CONTAINS_ERRORS = -203,
    ERR_CERT_NO_REVOCATION_MECHANISM = -204,
    ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205,
    ERR_CERT_REVOKED = -206,
    ERR_CERT_INVALID = -207,
    ERR_CERT_WEAK_SIGNATURE_ALGORITHM = -208,
    ERR_CERT_NON_UNIQUE_NAME = -210,
    ERR_CERT_WEAK_KEY = -211,
    ERR_CERT_NAME_CONSTRAINT_VIOLATION = -212,
    ERR_CERT_VALIDITY_TOO_LONG = -213,
    ERR_CERTIFICATE_TRANSPARENCY_REQUIRED = -214,
    ERR_CERT_SYMANTEC_LEGACY = -215,
    ERR_CERT_KNOWN_INTERCEPTION_BLOCKED = -217,
    ERR_CERT_END = -219,
    ERR_INVALID_URL = -300,
    ERR_DISALLOWED_URL_SCHEME = -301,
    ERR_UNKNOWN_URL_SCHEME = -302,
    ERR_INVALID_REDIRECT = -303,
    ERR_TOO_MANY_REDIRECTS = -310,
    ERR_UNSAFE_REDIRECT = -311,
    ERR_UNSAFE_PORT = -312,
    ERR_INVALID_RESPONSE = -320,
    ERR_INVALID_CHUNKED_ENCODING = -321,
    ERR_METHOD_NOT_SUPPORTED = -322,
    ERR_UNEXPECTED_PROXY_AUTH = -323,
    ERR_EMPTY_RESPONSE = -324,
    ERR_RESPONSE_HEADERS_TOO_BIG = -325,
    ERR_PAC_SCRIPT_FAILED = -327,
    ERR_REQUEST_RANGE_NOT_SATISFIABLE = -328,
    ERR_MALFORMED_IDENTITY = -329,
    ERR_CONTENT_DECODING_FAILED = -330,
    ERR_NETWORK_IO_SUSPENDED = -331,
    ERR_SYN_REPLY_NOT_RECEIVED = -332,
    ERR_ENCODING_CONVERSION_FAILED = -333,
    ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT = -334,
    ERR_NO_SUPPORTED_PROXIES = -336,
    ERR_HTTP2_PROTOCOL_ERROR = -337,
    ERR_INVALID_AUTH_CREDENTIALS = -338,
    ERR_UNSUPPORTED_AUTH_SCHEME = -339,
    ERR_ENCODING_DETECTION_FAILED = -340,
    ERR_MISSING_AUTH_CREDENTIALS = -341,
    ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS = -342,
    ERR_MISCONFIGURED_AUTH_ENVIRONMENT = -343,
    ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS = -344,
    ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN = -345,
    ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH = -346,
    ERR_INCOMPLETE_HTTP2_HEADERS = -347,
    ERR_PAC_NOT_IN_DHCP = -348,
    ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION = -349,
    ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION = -350,
    ERR_HTTP2_SERVER_REFUSED_STREAM = -351,
    ERR_HTTP2_PING_FAILED = -352,
    ERR_CONTENT_LENGTH_MISMATCH = -354,
    ERR_INCOMPLETE_CHUNKED_ENCODING = -355,
    ERR_QUIC_PROTOCOL_ERROR = -356,
    ERR_RESPONSE_HEADERS_TRUNCATED = -357,
    ERR_QUIC_HANDSHAKE_FAILED = -358,
    ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY = -360,
    ERR_HTTP2_FLOW_CONTROL_ERROR = -361,
    ERR_HTTP2_FRAME_SIZE_ERROR = -362,
    ERR_HTTP2_COMPRESSION_ERROR = -363,
    ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION = -364,
    ERR_HTTP_1_1_REQUIRED = -365,
    ERR_PROXY_HTTP_1_1_REQUIRED = -366,
    ERR_PAC_SCRIPT_TERMINATED = -367,
    ERR_INVALID_HTTP_RESPONSE = -370,
    ERR_CONTENT_DECODING_INIT_FAILED = -371,
    ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED = -372,
    ERR_TOO_MANY_RETRIES = -375,
    ERR_HTTP2_STREAM_CLOSED = -376,
    ERR_HTTP_RESPONSE_CODE_FAILURE = -379,
    ERR_QUIC_CERT_ROOT_NOT_KNOWN = -380,
    ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED = -381,
    ERR_TOO_MANY_ACCEPT_CH_RESTARTS = -382,
    ERR_INCONSISTENT_IP_ADDRESS_SPACE = -383,
    ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_POLICY = -384,
    ERR_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_CHECKS = -385,
    ERR_ZSTD_WINDOW_SIZE_TOO_BIG = -386,
    ERR_DICTIONARY_LOAD_FAILED = -387,
    ERR_UNEXPECTED_CONTENT_DICTIONARY_HEADER = -388,
    ERR_CACHE_MISS = -400,
    ERR_CACHE_READ_FAILURE = -401,
    ERR_CACHE_WRITE_FAILURE = -402,
    ERR_CACHE_OPERATION_NOT_SUPPORTED = -403,
    ERR_CACHE_OPEN_FAILURE = -404,
    ERR_CACHE_CREATE_FAILURE = -405,
    ERR_CACHE_RACE = -406,
    ERR_CACHE_CHECKSUM_READ_FAILURE = -407,
    ERR_CACHE_CHECKSUM_MISMATCH = -408,
    ERR_CACHE_LOCK_TIMEOUT = -409,
    ERR_CACHE_AUTH_FAILURE_AFTER_READ = -410,
    ERR_CACHE_ENTRY_NOT_SUITABLE = -411,
    ERR_CACHE_DOOM_FAILURE = -412,
    ERR_CACHE_OPEN_OR_CREATE_FAILURE = -413,
    ERR_INSECURE_RESPONSE = -501,
    ERR_NO_PRIVATE_KEY_FOR_CERT = -502,
    ERR_ADD_USER_CERT_FAILED = -503,
    ERR_INVALID_SIGNED_EXCHANGE = -504,
    ERR_INVALID_WEB_BUNDLE = -505,
    ERR_TRUST_TOKEN_OPERATION_FAILED = -506,

    ///
    /// Supported certificate status code values. See net\cert\cert_status_flags.h
    /// for more information. CERT_STATUS_NONE is new in CEF because we use an
    /// enum while cert_status_flags.h uses a typedef and static const variables.
    ///
    ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST = -507,

    // 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP).

    // 1 << 9 was used for CERT_STATUS_NOT_IN_DNS

    // 1 << 12 was used for CERT_STATUS_WEAK_DH_KEY
    ERR_PKCS12_IMPORT_BAD_PASSWORD = -701,

    // Bits 16 to 31 are for non-error statuses.
    ERR_PKCS12_IMPORT_FAILED = -702,

    // Bit 18 was CERT_STATUS_IS_DNSSEC
    ERR_IMPORT_CA_CERT_NOT_CA = -703,

    ///
    /// Process result codes. This is not a comprehensive list, as result codes
    /// might also include platform-specific crash values (Posix signal or Windows
    ERR_IMPORT_CERT_ALREADY_EXISTS = -704,
    /// hardware exception), or internal-only implementation values.
    ERR_IMPORT_CA_CERT_FAILED = -705,
    ///

    // The following values should be kept in sync with Chromium's
    ERR_IMPORT_SERVER_CERT_FAILED = -706,
    // content::ResultCode type.

    /// Process was killed by user or system.
    ERR_PKCS12_IMPORT_INVALID_MAC = -707,

    /// Process hung.
    ERR_PKCS12_IMPORT_INVALID_FILE = -708,

    /// A bad message caused the process termination.

    /// The GPU process exited because initialization failed.
    ERR_PKCS12_IMPORT_UNSUPPORTED = -709,
    ERR_KEY_GENERATION_FAILED = -710,

    // The following values should be kept in sync with Chromium's
    // chrome::ResultCode type. Unused chrome values are excluded.
    ERR_PRIVATE_KEY_EXPORT_FAILED = -712,

    /// A critical chrome file is missing.
    ERR_SELF_SIGNED_CERT_GENERATION_FAILED = -713,

    /// Command line parameter is not supported.
    ERR_CERT_DATABASE_CHANGED = -714,

    /// The profile was in use on another host.

    /// Failed to pack an extension via the command line.
    ERR_CERT_VERIFIER_CHANGED = -716,

    /// The browser process exited early by passing the command line to another
    ERR_DNS_MALFORMED_RESPONSE = -800,
    /// running browser.
    ERR_DNS_SERVER_REQUIRES_TCP = -801,

    /// A browser process was sandboxed. This should never happen.

    /// Cloud policy enrollment failed or was given up by user.

    /// The GPU process was terminated due to context lost.

    /// An early startup command was executed and the browser must exit.

    /// The browser process exited because system resources are exhausted. The
    ERR_DNS_SERVER_FAILED = -802,
    /// system state can't be recovered and will be unstable.
    ERR_DNS_TIMED_OUT = -803,

    // The following values should be kept in sync with Chromium's
    // sandbox::TerminationCodes type.
    ERR_DNS_CACHE_MISS = -804,

    /// Windows sandbox could not set the integrity level.
    ERR_DNS_SEARCH_EMPTY = -805,

    /// Windows sandbox could not lower the token.
    ERR_DNS_SORT_ERROR = -806,

    /// Windows sandbox failed to flush registry handles.
    ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED = -808,

    /// Windows sandbox failed to forbid HCKU caching.

    /// Windows sandbox failed to close pending handles.

    /// Windows sandbox could not set the mitigation policy.
    ERR_DNS_NAME_HTTPS_ONLY = -809,

    /// Windows sandbox exceeded the job memory limit.
    ERR_DNS_REQUEST_CANCELLED = -810,

    /// Windows sandbox failed to warmup.
    ERR_DNS_NO_MATCHING_SUPPORTED_ALPN = -811,

    ///
    /// The manner in which a link click should be opened. These constants match
    /// their equivalents in Chromium's window_open_disposition.h and should not be
    /// renumbered.
    ///
    ERR_DNS_SECURE_PROBE_RECORD_INVALID = -814
}

alias ERR_NONE = cef_errorcode_t.ERR_NONE;
alias ERR_IO_PENDING = cef_errorcode_t.ERR_IO_PENDING;
alias ERR_FAILED = cef_errorcode_t.ERR_FAILED;
alias ERR_ABORTED = cef_errorcode_t.ERR_ABORTED;
alias ERR_INVALID_ARGUMENT = cef_errorcode_t.ERR_INVALID_ARGUMENT;
alias ERR_INVALID_HANDLE = cef_errorcode_t.ERR_INVALID_HANDLE;
alias ERR_FILE_NOT_FOUND = cef_errorcode_t.ERR_FILE_NOT_FOUND;
alias ERR_TIMED_OUT = cef_errorcode_t.ERR_TIMED_OUT;
alias ERR_FILE_TOO_BIG = cef_errorcode_t.ERR_FILE_TOO_BIG;
alias ERR_UNEXPECTED = cef_errorcode_t.ERR_UNEXPECTED;
alias ERR_ACCESS_DENIED = cef_errorcode_t.ERR_ACCESS_DENIED;
alias ERR_NOT_IMPLEMENTED = cef_errorcode_t.ERR_NOT_IMPLEMENTED;
alias ERR_INSUFFICIENT_RESOURCES = cef_errorcode_t.ERR_INSUFFICIENT_RESOURCES;
alias ERR_OUT_OF_MEMORY = cef_errorcode_t.ERR_OUT_OF_MEMORY;
alias ERR_UPLOAD_FILE_CHANGED = cef_errorcode_t.ERR_UPLOAD_FILE_CHANGED;
alias ERR_SOCKET_NOT_CONNECTED = cef_errorcode_t.ERR_SOCKET_NOT_CONNECTED;
alias ERR_FILE_EXISTS = cef_errorcode_t.ERR_FILE_EXISTS;
alias ERR_FILE_PATH_TOO_LONG = cef_errorcode_t.ERR_FILE_PATH_TOO_LONG;
alias ERR_FILE_NO_SPACE = cef_errorcode_t.ERR_FILE_NO_SPACE;
alias ERR_FILE_VIRUS_INFECTED = cef_errorcode_t.ERR_FILE_VIRUS_INFECTED;
alias ERR_BLOCKED_BY_CLIENT = cef_errorcode_t.ERR_BLOCKED_BY_CLIENT;
alias ERR_NETWORK_CHANGED = cef_errorcode_t.ERR_NETWORK_CHANGED;
alias ERR_BLOCKED_BY_ADMINISTRATOR = cef_errorcode_t.ERR_BLOCKED_BY_ADMINISTRATOR;
alias ERR_SOCKET_IS_CONNECTED = cef_errorcode_t.ERR_SOCKET_IS_CONNECTED;
alias ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED = cef_errorcode_t.ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED;
alias ERR_CONTEXT_SHUT_DOWN = cef_errorcode_t.ERR_CONTEXT_SHUT_DOWN;
alias ERR_BLOCKED_BY_RESPONSE = cef_errorcode_t.ERR_BLOCKED_BY_RESPONSE;
alias ERR_CLEARTEXT_NOT_PERMITTED = cef_errorcode_t.ERR_CLEARTEXT_NOT_PERMITTED;
alias ERR_BLOCKED_BY_CSP = cef_errorcode_t.ERR_BLOCKED_BY_CSP;
alias ERR_H2_OR_QUIC_REQUIRED = cef_errorcode_t.ERR_H2_OR_QUIC_REQUIRED;
alias ERR_BLOCKED_BY_ORB = cef_errorcode_t.ERR_BLOCKED_BY_ORB;
alias ERR_NETWORK_ACCESS_REVOKED = cef_errorcode_t.ERR_NETWORK_ACCESS_REVOKED;
alias ERR_CONNECTION_CLOSED = cef_errorcode_t.ERR_CONNECTION_CLOSED;
alias ERR_CONNECTION_RESET = cef_errorcode_t.ERR_CONNECTION_RESET;
alias ERR_CONNECTION_REFUSED = cef_errorcode_t.ERR_CONNECTION_REFUSED;
alias ERR_CONNECTION_ABORTED = cef_errorcode_t.ERR_CONNECTION_ABORTED;
alias ERR_CONNECTION_FAILED = cef_errorcode_t.ERR_CONNECTION_FAILED;
alias ERR_NAME_NOT_RESOLVED = cef_errorcode_t.ERR_NAME_NOT_RESOLVED;
alias ERR_INTERNET_DISCONNECTED = cef_errorcode_t.ERR_INTERNET_DISCONNECTED;
alias ERR_SSL_PROTOCOL_ERROR = cef_errorcode_t.ERR_SSL_PROTOCOL_ERROR;
alias ERR_ADDRESS_INVALID = cef_errorcode_t.ERR_ADDRESS_INVALID;
alias ERR_ADDRESS_UNREACHABLE = cef_errorcode_t.ERR_ADDRESS_UNREACHABLE;
alias ERR_SSL_CLIENT_AUTH_CERT_NEEDED = cef_errorcode_t.ERR_SSL_CLIENT_AUTH_CERT_NEEDED;
alias ERR_TUNNEL_CONNECTION_FAILED = cef_errorcode_t.ERR_TUNNEL_CONNECTION_FAILED;
alias ERR_NO_SSL_VERSIONS_ENABLED = cef_errorcode_t.ERR_NO_SSL_VERSIONS_ENABLED;
alias ERR_SSL_VERSION_OR_CIPHER_MISMATCH = cef_errorcode_t.ERR_SSL_VERSION_OR_CIPHER_MISMATCH;
alias ERR_SSL_RENEGOTIATION_REQUESTED = cef_errorcode_t.ERR_SSL_RENEGOTIATION_REQUESTED;
alias ERR_PROXY_AUTH_UNSUPPORTED = cef_errorcode_t.ERR_PROXY_AUTH_UNSUPPORTED;
alias ERR_BAD_SSL_CLIENT_AUTH_CERT = cef_errorcode_t.ERR_BAD_SSL_CLIENT_AUTH_CERT;
alias ERR_CONNECTION_TIMED_OUT = cef_errorcode_t.ERR_CONNECTION_TIMED_OUT;
alias ERR_HOST_RESOLVER_QUEUE_TOO_LARGE = cef_errorcode_t.ERR_HOST_RESOLVER_QUEUE_TOO_LARGE;
alias ERR_SOCKS_CONNECTION_FAILED = cef_errorcode_t.ERR_SOCKS_CONNECTION_FAILED;
alias ERR_SOCKS_CONNECTION_HOST_UNREACHABLE = cef_errorcode_t.ERR_SOCKS_CONNECTION_HOST_UNREACHABLE;
alias ERR_ALPN_NEGOTIATION_FAILED = cef_errorcode_t.ERR_ALPN_NEGOTIATION_FAILED;
alias ERR_SSL_NO_RENEGOTIATION = cef_errorcode_t.ERR_SSL_NO_RENEGOTIATION;
alias ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES = cef_errorcode_t.ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES;
alias ERR_SSL_DECOMPRESSION_FAILURE_ALERT = cef_errorcode_t.ERR_SSL_DECOMPRESSION_FAILURE_ALERT;
alias ERR_SSL_BAD_RECORD_MAC_ALERT = cef_errorcode_t.ERR_SSL_BAD_RECORD_MAC_ALERT;
alias ERR_PROXY_AUTH_REQUESTED = cef_errorcode_t.ERR_PROXY_AUTH_REQUESTED;
alias ERR_PROXY_CONNECTION_FAILED = cef_errorcode_t.ERR_PROXY_CONNECTION_FAILED;
alias ERR_MANDATORY_PROXY_CONFIGURATION_FAILED = cef_errorcode_t.ERR_MANDATORY_PROXY_CONFIGURATION_FAILED;
alias ERR_PRECONNECT_MAX_SOCKET_LIMIT = cef_errorcode_t.ERR_PRECONNECT_MAX_SOCKET_LIMIT;
alias ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED = cef_errorcode_t.ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED;
alias ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY = cef_errorcode_t.ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY;
alias ERR_PROXY_CERTIFICATE_INVALID = cef_errorcode_t.ERR_PROXY_CERTIFICATE_INVALID;
alias ERR_NAME_RESOLUTION_FAILED = cef_errorcode_t.ERR_NAME_RESOLUTION_FAILED;
alias ERR_NETWORK_ACCESS_DENIED = cef_errorcode_t.ERR_NETWORK_ACCESS_DENIED;
alias ERR_TEMPORARILY_THROTTLED = cef_errorcode_t.ERR_TEMPORARILY_THROTTLED;
alias ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT = cef_errorcode_t.ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT;
alias ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED = cef_errorcode_t.ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED;
alias ERR_MSG_TOO_BIG = cef_errorcode_t.ERR_MSG_TOO_BIG;
alias ERR_WS_PROTOCOL_ERROR = cef_errorcode_t.ERR_WS_PROTOCOL_ERROR;
alias ERR_ADDRESS_IN_USE = cef_errorcode_t.ERR_ADDRESS_IN_USE;
alias ERR_SSL_HANDSHAKE_NOT_COMPLETED = cef_errorcode_t.ERR_SSL_HANDSHAKE_NOT_COMPLETED;
alias ERR_SSL_BAD_PEER_PUBLIC_KEY = cef_errorcode_t.ERR_SSL_BAD_PEER_PUBLIC_KEY;
alias ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN = cef_errorcode_t.ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN;
alias ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED = cef_errorcode_t.ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED;
alias ERR_SSL_DECRYPT_ERROR_ALERT = cef_errorcode_t.ERR_SSL_DECRYPT_ERROR_ALERT;
alias ERR_WS_THROTTLE_QUEUE_TOO_LARGE = cef_errorcode_t.ERR_WS_THROTTLE_QUEUE_TOO_LARGE;
alias ERR_SSL_SERVER_CERT_CHANGED = cef_errorcode_t.ERR_SSL_SERVER_CERT_CHANGED;
alias ERR_SSL_UNRECOGNIZED_NAME_ALERT = cef_errorcode_t.ERR_SSL_UNRECOGNIZED_NAME_ALERT;
alias ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR = cef_errorcode_t.ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR;
alias ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR = cef_errorcode_t.ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR;
alias ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE = cef_errorcode_t.ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE;
alias ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE = cef_errorcode_t.ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE;
alias ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT = cef_errorcode_t.ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT;
alias ERR_ICANN_NAME_COLLISION = cef_errorcode_t.ERR_ICANN_NAME_COLLISION;
alias ERR_SSL_SERVER_CERT_BAD_FORMAT = cef_errorcode_t.ERR_SSL_SERVER_CERT_BAD_FORMAT;
alias ERR_CT_STH_PARSING_FAILED = cef_errorcode_t.ERR_CT_STH_PARSING_FAILED;
alias ERR_CT_STH_INCOMPLETE = cef_errorcode_t.ERR_CT_STH_INCOMPLETE;
alias ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH = cef_errorcode_t.ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH;
alias ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED = cef_errorcode_t.ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED;
alias ERR_SSL_OBSOLETE_CIPHER = cef_errorcode_t.ERR_SSL_OBSOLETE_CIPHER;
alias ERR_WS_UPGRADE = cef_errorcode_t.ERR_WS_UPGRADE;
alias ERR_READ_IF_READY_NOT_IMPLEMENTED = cef_errorcode_t.ERR_READ_IF_READY_NOT_IMPLEMENTED;
alias ERR_NO_BUFFER_SPACE = cef_errorcode_t.ERR_NO_BUFFER_SPACE;
alias ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS = cef_errorcode_t.ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS;
alias ERR_EARLY_DATA_REJECTED = cef_errorcode_t.ERR_EARLY_DATA_REJECTED;
alias ERR_WRONG_VERSION_ON_EARLY_DATA = cef_errorcode_t.ERR_WRONG_VERSION_ON_EARLY_DATA;
alias ERR_TLS13_DOWNGRADE_DETECTED = cef_errorcode_t.ERR_TLS13_DOWNGRADE_DETECTED;
alias ERR_SSL_KEY_USAGE_INCOMPATIBLE = cef_errorcode_t.ERR_SSL_KEY_USAGE_INCOMPATIBLE;
alias ERR_INVALID_ECH_CONFIG_LIST = cef_errorcode_t.ERR_INVALID_ECH_CONFIG_LIST;
alias ERR_ECH_NOT_NEGOTIATED = cef_errorcode_t.ERR_ECH_NOT_NEGOTIATED;
alias ERR_ECH_FALLBACK_CERTIFICATE_INVALID = cef_errorcode_t.ERR_ECH_FALLBACK_CERTIFICATE_INVALID;
alias ERR_CERT_COMMON_NAME_INVALID = cef_errorcode_t.ERR_CERT_COMMON_NAME_INVALID;
alias ERR_CERT_DATE_INVALID = cef_errorcode_t.ERR_CERT_DATE_INVALID;
alias ERR_CERT_AUTHORITY_INVALID = cef_errorcode_t.ERR_CERT_AUTHORITY_INVALID;
alias ERR_CERT_CONTAINS_ERRORS = cef_errorcode_t.ERR_CERT_CONTAINS_ERRORS;
alias ERR_CERT_NO_REVOCATION_MECHANISM = cef_errorcode_t.ERR_CERT_NO_REVOCATION_MECHANISM;
alias ERR_CERT_UNABLE_TO_CHECK_REVOCATION = cef_errorcode_t.ERR_CERT_UNABLE_TO_CHECK_REVOCATION;
alias ERR_CERT_REVOKED = cef_errorcode_t.ERR_CERT_REVOKED;
alias ERR_CERT_INVALID = cef_errorcode_t.ERR_CERT_INVALID;
alias ERR_CERT_WEAK_SIGNATURE_ALGORITHM = cef_errorcode_t.ERR_CERT_WEAK_SIGNATURE_ALGORITHM;
alias ERR_CERT_NON_UNIQUE_NAME = cef_errorcode_t.ERR_CERT_NON_UNIQUE_NAME;
alias ERR_CERT_WEAK_KEY = cef_errorcode_t.ERR_CERT_WEAK_KEY;
alias ERR_CERT_NAME_CONSTRAINT_VIOLATION = cef_errorcode_t.ERR_CERT_NAME_CONSTRAINT_VIOLATION;
alias ERR_CERT_VALIDITY_TOO_LONG = cef_errorcode_t.ERR_CERT_VALIDITY_TOO_LONG;
alias ERR_CERTIFICATE_TRANSPARENCY_REQUIRED = cef_errorcode_t.ERR_CERTIFICATE_TRANSPARENCY_REQUIRED;
alias ERR_CERT_SYMANTEC_LEGACY = cef_errorcode_t.ERR_CERT_SYMANTEC_LEGACY;
alias ERR_CERT_KNOWN_INTERCEPTION_BLOCKED = cef_errorcode_t.ERR_CERT_KNOWN_INTERCEPTION_BLOCKED;
alias ERR_CERT_END = cef_errorcode_t.ERR_CERT_END;
alias ERR_INVALID_URL = cef_errorcode_t.ERR_INVALID_URL;
alias ERR_DISALLOWED_URL_SCHEME = cef_errorcode_t.ERR_DISALLOWED_URL_SCHEME;
alias ERR_UNKNOWN_URL_SCHEME = cef_errorcode_t.ERR_UNKNOWN_URL_SCHEME;
alias ERR_INVALID_REDIRECT = cef_errorcode_t.ERR_INVALID_REDIRECT;
alias ERR_TOO_MANY_REDIRECTS = cef_errorcode_t.ERR_TOO_MANY_REDIRECTS;
alias ERR_UNSAFE_REDIRECT = cef_errorcode_t.ERR_UNSAFE_REDIRECT;
alias ERR_UNSAFE_PORT = cef_errorcode_t.ERR_UNSAFE_PORT;
alias ERR_INVALID_RESPONSE = cef_errorcode_t.ERR_INVALID_RESPONSE;
alias ERR_INVALID_CHUNKED_ENCODING = cef_errorcode_t.ERR_INVALID_CHUNKED_ENCODING;
alias ERR_METHOD_NOT_SUPPORTED = cef_errorcode_t.ERR_METHOD_NOT_SUPPORTED;
alias ERR_UNEXPECTED_PROXY_AUTH = cef_errorcode_t.ERR_UNEXPECTED_PROXY_AUTH;
alias ERR_EMPTY_RESPONSE = cef_errorcode_t.ERR_EMPTY_RESPONSE;
alias ERR_RESPONSE_HEADERS_TOO_BIG = cef_errorcode_t.ERR_RESPONSE_HEADERS_TOO_BIG;
alias ERR_PAC_SCRIPT_FAILED = cef_errorcode_t.ERR_PAC_SCRIPT_FAILED;
alias ERR_REQUEST_RANGE_NOT_SATISFIABLE = cef_errorcode_t.ERR_REQUEST_RANGE_NOT_SATISFIABLE;
alias ERR_MALFORMED_IDENTITY = cef_errorcode_t.ERR_MALFORMED_IDENTITY;
alias ERR_CONTENT_DECODING_FAILED = cef_errorcode_t.ERR_CONTENT_DECODING_FAILED;
alias ERR_NETWORK_IO_SUSPENDED = cef_errorcode_t.ERR_NETWORK_IO_SUSPENDED;
alias ERR_SYN_REPLY_NOT_RECEIVED = cef_errorcode_t.ERR_SYN_REPLY_NOT_RECEIVED;
alias ERR_ENCODING_CONVERSION_FAILED = cef_errorcode_t.ERR_ENCODING_CONVERSION_FAILED;
alias ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT = cef_errorcode_t.ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT;
alias ERR_NO_SUPPORTED_PROXIES = cef_errorcode_t.ERR_NO_SUPPORTED_PROXIES;
alias ERR_HTTP2_PROTOCOL_ERROR = cef_errorcode_t.ERR_HTTP2_PROTOCOL_ERROR;
alias ERR_INVALID_AUTH_CREDENTIALS = cef_errorcode_t.ERR_INVALID_AUTH_CREDENTIALS;
alias ERR_UNSUPPORTED_AUTH_SCHEME = cef_errorcode_t.ERR_UNSUPPORTED_AUTH_SCHEME;
alias ERR_ENCODING_DETECTION_FAILED = cef_errorcode_t.ERR_ENCODING_DETECTION_FAILED;
alias ERR_MISSING_AUTH_CREDENTIALS = cef_errorcode_t.ERR_MISSING_AUTH_CREDENTIALS;
alias ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS = cef_errorcode_t.ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS;
alias ERR_MISCONFIGURED_AUTH_ENVIRONMENT = cef_errorcode_t.ERR_MISCONFIGURED_AUTH_ENVIRONMENT;
alias ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS = cef_errorcode_t.ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS;
alias ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN = cef_errorcode_t.ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN;
alias ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH = cef_errorcode_t.ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH;
alias ERR_INCOMPLETE_HTTP2_HEADERS = cef_errorcode_t.ERR_INCOMPLETE_HTTP2_HEADERS;
alias ERR_PAC_NOT_IN_DHCP = cef_errorcode_t.ERR_PAC_NOT_IN_DHCP;
alias ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION = cef_errorcode_t.ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION;
alias ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION = cef_errorcode_t.ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION;
alias ERR_HTTP2_SERVER_REFUSED_STREAM = cef_errorcode_t.ERR_HTTP2_SERVER_REFUSED_STREAM;
alias ERR_HTTP2_PING_FAILED = cef_errorcode_t.ERR_HTTP2_PING_FAILED;
alias ERR_CONTENT_LENGTH_MISMATCH = cef_errorcode_t.ERR_CONTENT_LENGTH_MISMATCH;
alias ERR_INCOMPLETE_CHUNKED_ENCODING = cef_errorcode_t.ERR_INCOMPLETE_CHUNKED_ENCODING;
alias ERR_QUIC_PROTOCOL_ERROR = cef_errorcode_t.ERR_QUIC_PROTOCOL_ERROR;
alias ERR_RESPONSE_HEADERS_TRUNCATED = cef_errorcode_t.ERR_RESPONSE_HEADERS_TRUNCATED;
alias ERR_QUIC_HANDSHAKE_FAILED = cef_errorcode_t.ERR_QUIC_HANDSHAKE_FAILED;
alias ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY = cef_errorcode_t.ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY;
alias ERR_HTTP2_FLOW_CONTROL_ERROR = cef_errorcode_t.ERR_HTTP2_FLOW_CONTROL_ERROR;
alias ERR_HTTP2_FRAME_SIZE_ERROR = cef_errorcode_t.ERR_HTTP2_FRAME_SIZE_ERROR;
alias ERR_HTTP2_COMPRESSION_ERROR = cef_errorcode_t.ERR_HTTP2_COMPRESSION_ERROR;
alias ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION = cef_errorcode_t.ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION;
alias ERR_HTTP_1_1_REQUIRED = cef_errorcode_t.ERR_HTTP_1_1_REQUIRED;
alias ERR_PROXY_HTTP_1_1_REQUIRED = cef_errorcode_t.ERR_PROXY_HTTP_1_1_REQUIRED;
alias ERR_PAC_SCRIPT_TERMINATED = cef_errorcode_t.ERR_PAC_SCRIPT_TERMINATED;
alias ERR_INVALID_HTTP_RESPONSE = cef_errorcode_t.ERR_INVALID_HTTP_RESPONSE;
alias ERR_CONTENT_DECODING_INIT_FAILED = cef_errorcode_t.ERR_CONTENT_DECODING_INIT_FAILED;
alias ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED = cef_errorcode_t.ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED;
alias ERR_TOO_MANY_RETRIES = cef_errorcode_t.ERR_TOO_MANY_RETRIES;
alias ERR_HTTP2_STREAM_CLOSED = cef_errorcode_t.ERR_HTTP2_STREAM_CLOSED;
alias ERR_HTTP_RESPONSE_CODE_FAILURE = cef_errorcode_t.ERR_HTTP_RESPONSE_CODE_FAILURE;
alias ERR_QUIC_CERT_ROOT_NOT_KNOWN = cef_errorcode_t.ERR_QUIC_CERT_ROOT_NOT_KNOWN;
alias ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED = cef_errorcode_t.ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED;
alias ERR_TOO_MANY_ACCEPT_CH_RESTARTS = cef_errorcode_t.ERR_TOO_MANY_ACCEPT_CH_RESTARTS;
alias ERR_INCONSISTENT_IP_ADDRESS_SPACE = cef_errorcode_t.ERR_INCONSISTENT_IP_ADDRESS_SPACE;
alias ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_POLICY = cef_errorcode_t.ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_POLICY;
alias ERR_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_CHECKS = cef_errorcode_t.ERR_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_CHECKS;
alias ERR_ZSTD_WINDOW_SIZE_TOO_BIG = cef_errorcode_t.ERR_ZSTD_WINDOW_SIZE_TOO_BIG;
alias ERR_DICTIONARY_LOAD_FAILED = cef_errorcode_t.ERR_DICTIONARY_LOAD_FAILED;
alias ERR_UNEXPECTED_CONTENT_DICTIONARY_HEADER = cef_errorcode_t.ERR_UNEXPECTED_CONTENT_DICTIONARY_HEADER;
alias ERR_CACHE_MISS = cef_errorcode_t.ERR_CACHE_MISS;
alias ERR_CACHE_READ_FAILURE = cef_errorcode_t.ERR_CACHE_READ_FAILURE;
alias ERR_CACHE_WRITE_FAILURE = cef_errorcode_t.ERR_CACHE_WRITE_FAILURE;
alias ERR_CACHE_OPERATION_NOT_SUPPORTED = cef_errorcode_t.ERR_CACHE_OPERATION_NOT_SUPPORTED;
alias ERR_CACHE_OPEN_FAILURE = cef_errorcode_t.ERR_CACHE_OPEN_FAILURE;
alias ERR_CACHE_CREATE_FAILURE = cef_errorcode_t.ERR_CACHE_CREATE_FAILURE;
alias ERR_CACHE_RACE = cef_errorcode_t.ERR_CACHE_RACE;
alias ERR_CACHE_CHECKSUM_READ_FAILURE = cef_errorcode_t.ERR_CACHE_CHECKSUM_READ_FAILURE;
alias ERR_CACHE_CHECKSUM_MISMATCH = cef_errorcode_t.ERR_CACHE_CHECKSUM_MISMATCH;
alias ERR_CACHE_LOCK_TIMEOUT = cef_errorcode_t.ERR_CACHE_LOCK_TIMEOUT;
alias ERR_CACHE_AUTH_FAILURE_AFTER_READ = cef_errorcode_t.ERR_CACHE_AUTH_FAILURE_AFTER_READ;
alias ERR_CACHE_ENTRY_NOT_SUITABLE = cef_errorcode_t.ERR_CACHE_ENTRY_NOT_SUITABLE;
alias ERR_CACHE_DOOM_FAILURE = cef_errorcode_t.ERR_CACHE_DOOM_FAILURE;
alias ERR_CACHE_OPEN_OR_CREATE_FAILURE = cef_errorcode_t.ERR_CACHE_OPEN_OR_CREATE_FAILURE;
alias ERR_INSECURE_RESPONSE = cef_errorcode_t.ERR_INSECURE_RESPONSE;
alias ERR_NO_PRIVATE_KEY_FOR_CERT = cef_errorcode_t.ERR_NO_PRIVATE_KEY_FOR_CERT;
alias ERR_ADD_USER_CERT_FAILED = cef_errorcode_t.ERR_ADD_USER_CERT_FAILED;
alias ERR_INVALID_SIGNED_EXCHANGE = cef_errorcode_t.ERR_INVALID_SIGNED_EXCHANGE;
alias ERR_INVALID_WEB_BUNDLE = cef_errorcode_t.ERR_INVALID_WEB_BUNDLE;
alias ERR_TRUST_TOKEN_OPERATION_FAILED = cef_errorcode_t.ERR_TRUST_TOKEN_OPERATION_FAILED;
alias ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST = cef_errorcode_t.ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST;
alias ERR_PKCS12_IMPORT_BAD_PASSWORD = cef_errorcode_t.ERR_PKCS12_IMPORT_BAD_PASSWORD;
alias ERR_PKCS12_IMPORT_FAILED = cef_errorcode_t.ERR_PKCS12_IMPORT_FAILED;
alias ERR_IMPORT_CA_CERT_NOT_CA = cef_errorcode_t.ERR_IMPORT_CA_CERT_NOT_CA;
alias ERR_IMPORT_CERT_ALREADY_EXISTS = cef_errorcode_t.ERR_IMPORT_CERT_ALREADY_EXISTS;
alias ERR_IMPORT_CA_CERT_FAILED = cef_errorcode_t.ERR_IMPORT_CA_CERT_FAILED;
alias ERR_IMPORT_SERVER_CERT_FAILED = cef_errorcode_t.ERR_IMPORT_SERVER_CERT_FAILED;
alias ERR_PKCS12_IMPORT_INVALID_MAC = cef_errorcode_t.ERR_PKCS12_IMPORT_INVALID_MAC;
alias ERR_PKCS12_IMPORT_INVALID_FILE = cef_errorcode_t.ERR_PKCS12_IMPORT_INVALID_FILE;
alias ERR_PKCS12_IMPORT_UNSUPPORTED = cef_errorcode_t.ERR_PKCS12_IMPORT_UNSUPPORTED;
alias ERR_KEY_GENERATION_FAILED = cef_errorcode_t.ERR_KEY_GENERATION_FAILED;
alias ERR_PRIVATE_KEY_EXPORT_FAILED = cef_errorcode_t.ERR_PRIVATE_KEY_EXPORT_FAILED;
alias ERR_SELF_SIGNED_CERT_GENERATION_FAILED = cef_errorcode_t.ERR_SELF_SIGNED_CERT_GENERATION_FAILED;
alias ERR_CERT_DATABASE_CHANGED = cef_errorcode_t.ERR_CERT_DATABASE_CHANGED;
alias ERR_CERT_VERIFIER_CHANGED = cef_errorcode_t.ERR_CERT_VERIFIER_CHANGED;
alias ERR_DNS_MALFORMED_RESPONSE = cef_errorcode_t.ERR_DNS_MALFORMED_RESPONSE;
alias ERR_DNS_SERVER_REQUIRES_TCP = cef_errorcode_t.ERR_DNS_SERVER_REQUIRES_TCP;
alias ERR_DNS_SERVER_FAILED = cef_errorcode_t.ERR_DNS_SERVER_FAILED;
alias ERR_DNS_TIMED_OUT = cef_errorcode_t.ERR_DNS_TIMED_OUT;
alias ERR_DNS_CACHE_MISS = cef_errorcode_t.ERR_DNS_CACHE_MISS;
alias ERR_DNS_SEARCH_EMPTY = cef_errorcode_t.ERR_DNS_SEARCH_EMPTY;
alias ERR_DNS_SORT_ERROR = cef_errorcode_t.ERR_DNS_SORT_ERROR;
alias ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED = cef_errorcode_t.ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED;
alias ERR_DNS_NAME_HTTPS_ONLY = cef_errorcode_t.ERR_DNS_NAME_HTTPS_ONLY;
alias ERR_DNS_REQUEST_CANCELLED = cef_errorcode_t.ERR_DNS_REQUEST_CANCELLED;
alias ERR_DNS_NO_MATCHING_SUPPORTED_ALPN = cef_errorcode_t.ERR_DNS_NO_MATCHING_SUPPORTED_ALPN;
alias ERR_DNS_SECURE_PROBE_RECORD_INVALID = cef_errorcode_t.ERR_DNS_SECURE_PROBE_RECORD_INVALID;

enum cef_cert_status_t
{
    CERT_STATUS_NONE = 0,
    CERT_STATUS_COMMON_NAME_INVALID = 1 << 0,
    CERT_STATUS_DATE_INVALID = 1 << 1,
    CERT_STATUS_AUTHORITY_INVALID = 1 << 2,
    CERT_STATUS_NO_REVOCATION_MECHANISM = 1 << 4,
    CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = 1 << 5,
    CERT_STATUS_REVOKED = 1 << 6,
    CERT_STATUS_INVALID = 1 << 7,
    CERT_STATUS_WEAK_SIGNATURE_ALGORITHM = 1 << 8,
    CERT_STATUS_NON_UNIQUE_NAME = 1 << 10,
    CERT_STATUS_WEAK_KEY = 1 << 11,
    CERT_STATUS_PINNED_KEY_MISSING = 1 << 13,
    CERT_STATUS_NAME_CONSTRAINT_VIOLATION = 1 << 14,
    CERT_STATUS_VALIDITY_TOO_LONG = 1 << 15,
    CERT_STATUS_IS_EV = 1 << 16,
    CERT_STATUS_REV_CHECKING_ENABLED = 1 << 17,
    CERT_STATUS_SHA1_SIGNATURE_PRESENT = 1 << 19,
    CERT_STATUS_CT_COMPLIANCE_FAILED = 1 << 20
}

alias CERT_STATUS_NONE = cef_cert_status_t.CERT_STATUS_NONE;
alias CERT_STATUS_COMMON_NAME_INVALID = cef_cert_status_t.CERT_STATUS_COMMON_NAME_INVALID;
alias CERT_STATUS_DATE_INVALID = cef_cert_status_t.CERT_STATUS_DATE_INVALID;
alias CERT_STATUS_AUTHORITY_INVALID = cef_cert_status_t.CERT_STATUS_AUTHORITY_INVALID;
alias CERT_STATUS_NO_REVOCATION_MECHANISM = cef_cert_status_t.CERT_STATUS_NO_REVOCATION_MECHANISM;
alias CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = cef_cert_status_t.CERT_STATUS_UNABLE_TO_CHECK_REVOCATION;
alias CERT_STATUS_REVOKED = cef_cert_status_t.CERT_STATUS_REVOKED;
alias CERT_STATUS_INVALID = cef_cert_status_t.CERT_STATUS_INVALID;
alias CERT_STATUS_WEAK_SIGNATURE_ALGORITHM = cef_cert_status_t.CERT_STATUS_WEAK_SIGNATURE_ALGORITHM;
alias CERT_STATUS_NON_UNIQUE_NAME = cef_cert_status_t.CERT_STATUS_NON_UNIQUE_NAME;
alias CERT_STATUS_WEAK_KEY = cef_cert_status_t.CERT_STATUS_WEAK_KEY;
alias CERT_STATUS_PINNED_KEY_MISSING = cef_cert_status_t.CERT_STATUS_PINNED_KEY_MISSING;
alias CERT_STATUS_NAME_CONSTRAINT_VIOLATION = cef_cert_status_t.CERT_STATUS_NAME_CONSTRAINT_VIOLATION;
alias CERT_STATUS_VALIDITY_TOO_LONG = cef_cert_status_t.CERT_STATUS_VALIDITY_TOO_LONG;
alias CERT_STATUS_IS_EV = cef_cert_status_t.CERT_STATUS_IS_EV;
alias CERT_STATUS_REV_CHECKING_ENABLED = cef_cert_status_t.CERT_STATUS_REV_CHECKING_ENABLED;
alias CERT_STATUS_SHA1_SIGNATURE_PRESENT = cef_cert_status_t.CERT_STATUS_SHA1_SIGNATURE_PRESENT;
alias CERT_STATUS_CT_COMPLIANCE_FAILED = cef_cert_status_t.CERT_STATUS_CT_COMPLIANCE_FAILED;

enum cef_resultcode_t
{
    CEF_RESULT_CODE_NORMAL_EXIT = 0,
    CEF_RESULT_CODE_KILLED = 1,
    CEF_RESULT_CODE_HUNG = 2,
    CEF_RESULT_CODE_KILLED_BAD_MESSAGE = 3,
    CEF_RESULT_CODE_GPU_DEAD_ON_ARRIVAL = 4,
    CEF_RESULT_CODE_CHROME_FIRST = 5,
    CEF_RESULT_CODE_MISSING_DATA = 7,
    CEF_RESULT_CODE_UNSUPPORTED_PARAM = 13,
    CEF_RESULT_CODE_PROFILE_IN_USE = 21,
    CEF_RESULT_CODE_PACK_EXTENSION_ERROR = 22,
    CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED = 24,
    CEF_RESULT_CODE_INVALID_SANDBOX_STATE = 31,
    CEF_RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED = 32,
    CEF_RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST = 34,
    CEF_RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS = 36,
    CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED = 37,
    CEF_RESULT_CODE_CHROME_LAST = 39,
    CEF_RESULT_CODE_SANDBOX_FATAL_FIRST = 7006,
    CEF_RESULT_CODE_SANDBOX_FATAL_INTEGRITY = CEF_RESULT_CODE_SANDBOX_FATAL_FIRST,
    CEF_RESULT_CODE_SANDBOX_FATAL_DROPTOKEN = 7007,
    CEF_RESULT_CODE_SANDBOX_FATAL_FLUSHANDLES = 7008,
    CEF_RESULT_CODE_SANDBOX_FATAL_CACHEDISABLE = 7009,
    CEF_RESULT_CODE_SANDBOX_FATAL_CLOSEHANDLES = 7010,
    CEF_RESULT_CODE_SANDBOX_FATAL_MITIGATION = 7011,
    CEF_RESULT_CODE_SANDBOX_FATAL_MEMORY_EXCEEDED = 7012,
    CEF_RESULT_CODE_SANDBOX_FATAL_WARMUP = 7013,
    CEF_RESULT_CODE_SANDBOX_FATAL_LAST = 7014
}

alias CEF_RESULT_CODE_NORMAL_EXIT = cef_resultcode_t.CEF_RESULT_CODE_NORMAL_EXIT;
alias CEF_RESULT_CODE_KILLED = cef_resultcode_t.CEF_RESULT_CODE_KILLED;
alias CEF_RESULT_CODE_HUNG = cef_resultcode_t.CEF_RESULT_CODE_HUNG;
alias CEF_RESULT_CODE_KILLED_BAD_MESSAGE = cef_resultcode_t.CEF_RESULT_CODE_KILLED_BAD_MESSAGE;
alias CEF_RESULT_CODE_GPU_DEAD_ON_ARRIVAL = cef_resultcode_t.CEF_RESULT_CODE_GPU_DEAD_ON_ARRIVAL;
alias CEF_RESULT_CODE_CHROME_FIRST = cef_resultcode_t.CEF_RESULT_CODE_CHROME_FIRST;
alias CEF_RESULT_CODE_MISSING_DATA = cef_resultcode_t.CEF_RESULT_CODE_MISSING_DATA;
alias CEF_RESULT_CODE_UNSUPPORTED_PARAM = cef_resultcode_t.CEF_RESULT_CODE_UNSUPPORTED_PARAM;
alias CEF_RESULT_CODE_PROFILE_IN_USE = cef_resultcode_t.CEF_RESULT_CODE_PROFILE_IN_USE;
alias CEF_RESULT_CODE_PACK_EXTENSION_ERROR = cef_resultcode_t.CEF_RESULT_CODE_PACK_EXTENSION_ERROR;
alias CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED = cef_resultcode_t.CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED;
alias CEF_RESULT_CODE_INVALID_SANDBOX_STATE = cef_resultcode_t.CEF_RESULT_CODE_INVALID_SANDBOX_STATE;
alias CEF_RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED = cef_resultcode_t.CEF_RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED;
alias CEF_RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST = cef_resultcode_t.CEF_RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST;
alias CEF_RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS = cef_resultcode_t.CEF_RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS;
alias CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED = cef_resultcode_t.CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED;
alias CEF_RESULT_CODE_CHROME_LAST = cef_resultcode_t.CEF_RESULT_CODE_CHROME_LAST;
alias CEF_RESULT_CODE_SANDBOX_FATAL_FIRST = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_FIRST;
alias CEF_RESULT_CODE_SANDBOX_FATAL_INTEGRITY = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_INTEGRITY;
alias CEF_RESULT_CODE_SANDBOX_FATAL_DROPTOKEN = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_DROPTOKEN;
alias CEF_RESULT_CODE_SANDBOX_FATAL_FLUSHANDLES = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_FLUSHANDLES;
alias CEF_RESULT_CODE_SANDBOX_FATAL_CACHEDISABLE = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_CACHEDISABLE;
alias CEF_RESULT_CODE_SANDBOX_FATAL_CLOSEHANDLES = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_CLOSEHANDLES;
alias CEF_RESULT_CODE_SANDBOX_FATAL_MITIGATION = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_MITIGATION;
alias CEF_RESULT_CODE_SANDBOX_FATAL_MEMORY_EXCEEDED = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_MEMORY_EXCEEDED;
alias CEF_RESULT_CODE_SANDBOX_FATAL_WARMUP = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_WARMUP;
alias CEF_RESULT_CODE_SANDBOX_FATAL_LAST = cef_resultcode_t.CEF_RESULT_CODE_SANDBOX_FATAL_LAST;

enum cef_window_open_disposition_t
{
    CEF_WOD_UNKNOWN = 0,

    ///
    /// Current tab. This is the default in most cases.
    ///
    CEF_WOD_CURRENT_TAB = 1,

    ///
    /// Indicates that only one tab with the url should exist in the same window.
    ///
    CEF_WOD_SINGLETON_TAB = 2,

    ///
    /// Shift key + Middle mouse button or meta/ctrl key while clicking.
    ///
    CEF_WOD_NEW_FOREGROUND_TAB = 3,

    ///
    /// Middle mouse button or meta/ctrl key while clicking.
    ///
    CEF_WOD_NEW_BACKGROUND_TAB = 4,

    ///
    /// New popup window.
    ///
    CEF_WOD_NEW_POPUP = 5,

    ///
    /// Shift key while clicking.
    ///
    CEF_WOD_NEW_WINDOW = 6,

    ///
    /// Alt key while clicking.
    ///
    CEF_WOD_SAVE_TO_DISK = 7,

    ///
    /// New off-the-record (incognito) window.
    ///
    CEF_WOD_OFF_THE_RECORD = 8,

    ///
    /// Special case error condition from the renderer.
    ///
    CEF_WOD_IGNORE_ACTION = 9,

    ///
    /// Activates an existing tab containing the url, rather than navigating.
    /// This is similar to SINGLETON_TAB, but searches across all windows from
    /// the current profile and anonymity (instead of just the current one);
    /// closes the current tab on switching if the current tab was the NTP with
    /// no session history; and behaves like CURRENT_TAB instead of
    /// NEW_FOREGROUND_TAB when no existing tab is found.
    ///
    CEF_WOD_SWITCH_TO_TAB = 10,

    ///
    /// Creates a new document picture-in-picture window showing a child WebView.
    ///
    CEF_WOD_NEW_PICTURE_IN_PICTURE = 11,

    CEF_WOD_MAX_VALUE = CEF_WOD_NEW_PICTURE_IN_PICTURE
}

alias CEF_WOD_UNKNOWN = cef_window_open_disposition_t.CEF_WOD_UNKNOWN;
alias CEF_WOD_CURRENT_TAB = cef_window_open_disposition_t.CEF_WOD_CURRENT_TAB;
alias CEF_WOD_SINGLETON_TAB = cef_window_open_disposition_t.CEF_WOD_SINGLETON_TAB;
alias CEF_WOD_NEW_FOREGROUND_TAB = cef_window_open_disposition_t.CEF_WOD_NEW_FOREGROUND_TAB;
alias CEF_WOD_NEW_BACKGROUND_TAB = cef_window_open_disposition_t.CEF_WOD_NEW_BACKGROUND_TAB;
alias CEF_WOD_NEW_POPUP = cef_window_open_disposition_t.CEF_WOD_NEW_POPUP;
alias CEF_WOD_NEW_WINDOW = cef_window_open_disposition_t.CEF_WOD_NEW_WINDOW;
alias CEF_WOD_SAVE_TO_DISK = cef_window_open_disposition_t.CEF_WOD_SAVE_TO_DISK;
alias CEF_WOD_OFF_THE_RECORD = cef_window_open_disposition_t.CEF_WOD_OFF_THE_RECORD;
alias CEF_WOD_IGNORE_ACTION = cef_window_open_disposition_t.CEF_WOD_IGNORE_ACTION;
alias CEF_WOD_SWITCH_TO_TAB = cef_window_open_disposition_t.CEF_WOD_SWITCH_TO_TAB;
alias CEF_WOD_NEW_PICTURE_IN_PICTURE = cef_window_open_disposition_t.CEF_WOD_NEW_PICTURE_IN_PICTURE;
alias CEF_WOD_MAX_VALUE = cef_window_open_disposition_t.CEF_WOD_MAX_VALUE;

///
/// "Verb" of a drag-and-drop operation as negotiated between the source and
/// destination. These constants match their equivalents in WebCore's
/// DragActions.h and should not be renumbered.
///
enum cef_drag_operations_mask_t
{
    DRAG_OPERATION_NONE = 0,
    DRAG_OPERATION_COPY = 1,
    DRAG_OPERATION_LINK = 2,
    DRAG_OPERATION_GENERIC = 4,
    DRAG_OPERATION_PRIVATE = 8,
    DRAG_OPERATION_MOVE = 16,
    DRAG_OPERATION_DELETE = 32,
    DRAG_OPERATION_EVERY = UINT_MAX
}

alias DRAG_OPERATION_NONE = cef_drag_operations_mask_t.DRAG_OPERATION_NONE;
alias DRAG_OPERATION_COPY = cef_drag_operations_mask_t.DRAG_OPERATION_COPY;
alias DRAG_OPERATION_LINK = cef_drag_operations_mask_t.DRAG_OPERATION_LINK;
alias DRAG_OPERATION_GENERIC = cef_drag_operations_mask_t.DRAG_OPERATION_GENERIC;
alias DRAG_OPERATION_PRIVATE = cef_drag_operations_mask_t.DRAG_OPERATION_PRIVATE;
alias DRAG_OPERATION_MOVE = cef_drag_operations_mask_t.DRAG_OPERATION_MOVE;
alias DRAG_OPERATION_DELETE = cef_drag_operations_mask_t.DRAG_OPERATION_DELETE;
alias DRAG_OPERATION_EVERY = cef_drag_operations_mask_t.DRAG_OPERATION_EVERY;

///
/// Input mode of a virtual keyboard. These constants match their equivalents
/// in Chromium's text_input_mode.h and should not be renumbered.
/// See https://html.spec.whatwg.org/#input-modalities:-the-inputmode-attribute
///
enum cef_text_input_mode_t
{
    CEF_TEXT_INPUT_MODE_DEFAULT = 0,
    CEF_TEXT_INPUT_MODE_NONE = 1,
    CEF_TEXT_INPUT_MODE_TEXT = 2,
    CEF_TEXT_INPUT_MODE_TEL = 3,
    CEF_TEXT_INPUT_MODE_URL = 4,
    CEF_TEXT_INPUT_MODE_EMAIL = 5,
    CEF_TEXT_INPUT_MODE_NUMERIC = 6,
    CEF_TEXT_INPUT_MODE_DECIMAL = 7,
    CEF_TEXT_INPUT_MODE_SEARCH = 8,

    CEF_TEXT_INPUT_MODE_MAX = CEF_TEXT_INPUT_MODE_SEARCH
}

alias CEF_TEXT_INPUT_MODE_DEFAULT = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_DEFAULT;
alias CEF_TEXT_INPUT_MODE_NONE = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_NONE;
alias CEF_TEXT_INPUT_MODE_TEXT = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_TEXT;
alias CEF_TEXT_INPUT_MODE_TEL = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_TEL;
alias CEF_TEXT_INPUT_MODE_URL = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_URL;
alias CEF_TEXT_INPUT_MODE_EMAIL = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_EMAIL;
alias CEF_TEXT_INPUT_MODE_NUMERIC = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_NUMERIC;
alias CEF_TEXT_INPUT_MODE_DECIMAL = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_DECIMAL;
alias CEF_TEXT_INPUT_MODE_SEARCH = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_SEARCH;
alias CEF_TEXT_INPUT_MODE_MAX = cef_text_input_mode_t.CEF_TEXT_INPUT_MODE_MAX;

///
/// V8 property attribute values.
///
enum cef_v8_propertyattribute_t
{
    ///
    /// Writeable, Enumerable, Configurable
    ///
    V8_PROPERTY_ATTRIBUTE_NONE = 0,

    ///
    /// Not writeable
    ///
    V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0,

    ///
    /// Not enumerable
    ///
    V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1,

    ///
    /// Not configurable
    ///
    V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2
}

alias V8_PROPERTY_ATTRIBUTE_NONE = cef_v8_propertyattribute_t.V8_PROPERTY_ATTRIBUTE_NONE;
alias V8_PROPERTY_ATTRIBUTE_READONLY = cef_v8_propertyattribute_t.V8_PROPERTY_ATTRIBUTE_READONLY;
alias V8_PROPERTY_ATTRIBUTE_DONTENUM = cef_v8_propertyattribute_t.V8_PROPERTY_ATTRIBUTE_DONTENUM;
alias V8_PROPERTY_ATTRIBUTE_DONTDELETE = cef_v8_propertyattribute_t.V8_PROPERTY_ATTRIBUTE_DONTDELETE;

///
/// Post data elements may represent either bytes or files.
///
enum cef_postdataelement_type_t
{
    PDE_TYPE_EMPTY = 0,
    PDE_TYPE_BYTES = 1,
    PDE_TYPE_FILE = 2
}

alias PDE_TYPE_EMPTY = cef_postdataelement_type_t.PDE_TYPE_EMPTY;
alias PDE_TYPE_BYTES = cef_postdataelement_type_t.PDE_TYPE_BYTES;
alias PDE_TYPE_FILE = cef_postdataelement_type_t.PDE_TYPE_FILE;

///
/// Resource type for a request. These constants match their equivalents in
/// Chromium's ResourceType and should not be renumbered.
///
enum cef_resource_type_t
{
    ///
    /// Top level page.
    ///
    RT_MAIN_FRAME = 0,

    ///
    /// Frame or iframe.
    ///
    RT_SUB_FRAME = 1,

    ///
    /// CSS stylesheet.
    ///
    RT_STYLESHEET = 2,

    ///
    /// External script.
    ///
    RT_SCRIPT = 3,

    ///
    /// Image (jpg/gif/png/etc).
    ///
    RT_IMAGE = 4,

    ///
    /// Font.
    ///
    RT_FONT_RESOURCE = 5,

    ///
    /// Some other subresource. This is the default type if the actual type is
    /// unknown.
    ///
    RT_SUB_RESOURCE = 6,

    ///
    /// Object (or embed) tag for a plugin, or a resource that a plugin requested.
    ///
    RT_OBJECT = 7,

    ///
    /// Media resource.
    ///
    RT_MEDIA = 8,

    ///
    /// Main resource of a dedicated worker.
    ///
    RT_WORKER = 9,

    ///
    /// Main resource of a shared worker.
    ///
    RT_SHARED_WORKER = 10,

    ///
    /// Explicitly requested prefetch.
    ///
    RT_PREFETCH = 11,

    ///
    /// Favicon.
    ///
    RT_FAVICON = 12,

    ///
    /// XMLHttpRequest.
    ///
    RT_XHR = 13,

    ///
    /// A request for a "<ping>".
    ///
    RT_PING = 14,

    ///
    /// Main resource of a service worker.
    ///
    RT_SERVICE_WORKER = 15,

    ///
    /// A report of Content Security Policy violations.
    ///
    RT_CSP_REPORT = 16,

    ///
    /// A resource that a plugin requested.
    ///
    RT_PLUGIN_RESOURCE = 17,

    ///
    /// A main-frame service worker navigation preload request.
    ///
    RT_NAVIGATION_PRELOAD_MAIN_FRAME = 19,

    ///
    /// A sub-frame service worker navigation preload request.
    ///
    RT_NAVIGATION_PRELOAD_SUB_FRAME = 20
}

alias RT_MAIN_FRAME = cef_resource_type_t.RT_MAIN_FRAME;
alias RT_SUB_FRAME = cef_resource_type_t.RT_SUB_FRAME;
alias RT_STYLESHEET = cef_resource_type_t.RT_STYLESHEET;
alias RT_SCRIPT = cef_resource_type_t.RT_SCRIPT;
alias RT_IMAGE = cef_resource_type_t.RT_IMAGE;
alias RT_FONT_RESOURCE = cef_resource_type_t.RT_FONT_RESOURCE;
alias RT_SUB_RESOURCE = cef_resource_type_t.RT_SUB_RESOURCE;
alias RT_OBJECT = cef_resource_type_t.RT_OBJECT;
alias RT_MEDIA = cef_resource_type_t.RT_MEDIA;
alias RT_WORKER = cef_resource_type_t.RT_WORKER;
alias RT_SHARED_WORKER = cef_resource_type_t.RT_SHARED_WORKER;
alias RT_PREFETCH = cef_resource_type_t.RT_PREFETCH;
alias RT_FAVICON = cef_resource_type_t.RT_FAVICON;
alias RT_XHR = cef_resource_type_t.RT_XHR;
alias RT_PING = cef_resource_type_t.RT_PING;
alias RT_SERVICE_WORKER = cef_resource_type_t.RT_SERVICE_WORKER;
alias RT_CSP_REPORT = cef_resource_type_t.RT_CSP_REPORT;
alias RT_PLUGIN_RESOURCE = cef_resource_type_t.RT_PLUGIN_RESOURCE;
alias RT_NAVIGATION_PRELOAD_MAIN_FRAME = cef_resource_type_t.RT_NAVIGATION_PRELOAD_MAIN_FRAME;
alias RT_NAVIGATION_PRELOAD_SUB_FRAME = cef_resource_type_t.RT_NAVIGATION_PRELOAD_SUB_FRAME;

///
/// Transition type for a request. Made up of one source value and 0 or more
/// qualifiers.
///
enum cef_transition_type_t
{
    ///
    /// Source is a link click or the JavaScript window.open function. This is
    /// also the default value for requests like sub-resource loads that are not
    /// navigations.
    ///
    TT_LINK = 0,

    ///
    /// Source is some other "explicit" navigation. This is the default value for
    /// navigations where the actual type is unknown. See also
    /// TT_DIRECT_LOAD_FLAG.
    ///
    TT_EXPLICIT = 1,

    ///
    /// User got to this page through a suggestion in the UI (for example, via the
    /// destinations page). Chrome runtime only.
    ///
    TT_AUTO_BOOKMARK = 2,

    ///
    /// Source is a subframe navigation. This is any content that is automatically
    /// loaded in a non-toplevel frame. For example, if a page consists of several
    /// frames containing ads, those ad URLs will have this transition type.
    /// The user may not even realize the content in these pages is a separate
    /// frame, so may not care about the URL.
    ///
    TT_AUTO_SUBFRAME = 3,

    ///
    /// Source is a subframe navigation explicitly requested by the user that will
    /// generate new navigation entries in the back/forward list. These are
    /// probably more important than frames that were automatically loaded in
    /// the background because the user probably cares about the fact that this
    /// link was loaded.
    ///
    TT_MANUAL_SUBFRAME = 4,

    ///
    /// User got to this page by typing in the URL bar and selecting an entry
    /// that did not look like a URL.  For example, a match might have the URL
    /// of a Google search result page, but appear like "Search Google for ...".
    /// These are not quite the same as EXPLICIT navigations because the user
    /// didn't type or see the destination URL. Chrome runtime only.
    /// See also TT_KEYWORD.
    ///
    TT_GENERATED = 5,

    ///
    /// This is a toplevel navigation. This is any content that is automatically
    /// loaded in a toplevel frame.  For example, opening a tab to show the ASH
    /// screen saver, opening the devtools window, opening the NTP after the safe
    /// browsing warning, opening web-based dialog boxes are examples of
    /// AUTO_TOPLEVEL navigations. Chrome runtime only.
    ///
    TT_AUTO_TOPLEVEL = 6,

    ///
    /// Source is a form submission by the user. NOTE: In some situations
    /// submitting a form does not result in this transition type. This can happen
    /// if the form uses a script to submit the contents.
    ///
    TT_FORM_SUBMIT = 7,

    ///
    /// Source is a "reload" of the page via the Reload function or by re-visiting
    /// the same URL. NOTE: This is distinct from the concept of whether a
    /// particular load uses "reload semantics" (i.e. bypasses cached data).
    ///
    TT_RELOAD = 8,

    ///
    /// The url was generated from a replaceable keyword other than the default
    /// search provider. If the user types a keyword (which also applies to
    /// tab-to-search) in the omnibox this qualifier is applied to the transition
    /// type of the generated url. TemplateURLModel then may generate an
    /// additional visit with a transition type of TT_KEYWORD_GENERATED against
    /// the url 'http://' + keyword. For example, if you do a tab-to-search
    /// against wikipedia the generated url has a transition qualifer of
    /// TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org'
    /// with a transition type of TT_KEYWORD_GENERATED. Chrome runtime only.
    ///
    TT_KEYWORD = 9,

    ///
    /// Corresponds to a visit generated for a keyword. See description of
    /// TT_KEYWORD for more details. Chrome runtime only.
    ///
    TT_KEYWORD_GENERATED = 10,

    ///
    /// General mask defining the bits used for the source values.
    ///
    TT_SOURCE_MASK = 0xFF,

    /// Qualifiers.
    /// Any of the core values above can be augmented by one or more qualifiers.
    /// These qualifiers further define the transition.

    ///
    /// Attempted to visit a URL but was blocked.
    ///
    TT_BLOCKED_FLAG = 0x00800000,

    ///
    /// Used the Forward or Back function to navigate among browsing history.
    /// Will be ORed to the transition type for the original load.
    ///
    TT_FORWARD_BACK_FLAG = 0x01000000,

    ///
    /// Loaded a URL directly via CreateBrowser, LoadURL or LoadRequest.
    ///
    TT_DIRECT_LOAD_FLAG = 0x02000000,

    ///
    /// User is navigating to the home page. Chrome runtime only.
    ///
    TT_HOME_PAGE_FLAG = 0x04000000,

    ///
    /// The transition originated from an external application; the exact
    /// definition of this is embedder dependent. Chrome runtime and
    /// extension system only.
    ///
    TT_FROM_API_FLAG = 0x08000000,

    ///
    /// The beginning of a navigation chain.
    ///
    TT_CHAIN_START_FLAG = 0x10000000,

    ///
    /// The last transition in a redirect chain.
    ///
    TT_CHAIN_END_FLAG = 0x20000000,

    ///
    /// Redirects caused by JavaScript or a meta refresh tag on the page.
    ///
    TT_CLIENT_REDIRECT_FLAG = 0x40000000,

    ///
    /// Redirects sent from the server by HTTP headers.
    ///
    TT_SERVER_REDIRECT_FLAG = 0x80000000,

    ///
    /// Used to test whether a transition involves a redirect.
    ///
    TT_IS_REDIRECT_MASK = 0xC0000000,

    ///
    /// General mask defining the bits used for the qualifiers.
    ///
    TT_QUALIFIER_MASK = 0xFFFFFF00
}

alias TT_LINK = cef_transition_type_t.TT_LINK;
alias TT_EXPLICIT = cef_transition_type_t.TT_EXPLICIT;
alias TT_AUTO_BOOKMARK = cef_transition_type_t.TT_AUTO_BOOKMARK;
alias TT_AUTO_SUBFRAME = cef_transition_type_t.TT_AUTO_SUBFRAME;
alias TT_MANUAL_SUBFRAME = cef_transition_type_t.TT_MANUAL_SUBFRAME;
alias TT_GENERATED = cef_transition_type_t.TT_GENERATED;
alias TT_AUTO_TOPLEVEL = cef_transition_type_t.TT_AUTO_TOPLEVEL;
alias TT_FORM_SUBMIT = cef_transition_type_t.TT_FORM_SUBMIT;
alias TT_RELOAD = cef_transition_type_t.TT_RELOAD;
alias TT_KEYWORD = cef_transition_type_t.TT_KEYWORD;
alias TT_KEYWORD_GENERATED = cef_transition_type_t.TT_KEYWORD_GENERATED;
alias TT_SOURCE_MASK = cef_transition_type_t.TT_SOURCE_MASK;
alias TT_BLOCKED_FLAG = cef_transition_type_t.TT_BLOCKED_FLAG;
alias TT_FORWARD_BACK_FLAG = cef_transition_type_t.TT_FORWARD_BACK_FLAG;
alias TT_DIRECT_LOAD_FLAG = cef_transition_type_t.TT_DIRECT_LOAD_FLAG;
alias TT_HOME_PAGE_FLAG = cef_transition_type_t.TT_HOME_PAGE_FLAG;
alias TT_FROM_API_FLAG = cef_transition_type_t.TT_FROM_API_FLAG;
alias TT_CHAIN_START_FLAG = cef_transition_type_t.TT_CHAIN_START_FLAG;
alias TT_CHAIN_END_FLAG = cef_transition_type_t.TT_CHAIN_END_FLAG;
alias TT_CLIENT_REDIRECT_FLAG = cef_transition_type_t.TT_CLIENT_REDIRECT_FLAG;
alias TT_SERVER_REDIRECT_FLAG = cef_transition_type_t.TT_SERVER_REDIRECT_FLAG;
alias TT_IS_REDIRECT_MASK = cef_transition_type_t.TT_IS_REDIRECT_MASK;
alias TT_QUALIFIER_MASK = cef_transition_type_t.TT_QUALIFIER_MASK;

///
/// Flags used to customize the behavior of CefURLRequest.
///
enum cef_urlrequest_flags_t
{
    ///
    /// Default behavior.
    ///
    UR_FLAG_NONE = 0,

    ///
    /// If set the cache will be skipped when handling the request. Setting this
    /// value is equivalent to specifying the "Cache-Control: no-cache" request
    /// header. Setting this value in combination with UR_FLAG_ONLY_FROM_CACHE
    /// will cause the request to fail.
    ///
    UR_FLAG_SKIP_CACHE = 1 << 0,

    ///
    /// If set the request will fail if it cannot be served from the cache (or
    /// some equivalent local store). Setting this value is equivalent to
    /// specifying the "Cache-Control: only-if-cached" request header. Setting
    /// this value in combination with UR_FLAG_SKIP_CACHE or UR_FLAG_DISABLE_CACHE
    /// will cause the request to fail.
    ///
    UR_FLAG_ONLY_FROM_CACHE = 1 << 1,

    ///
    /// If set the cache will not be used at all. Setting this value is equivalent
    /// to specifying the "Cache-Control: no-store" request header. Setting this
    /// value in combination with UR_FLAG_ONLY_FROM_CACHE will cause the request
    /// to fail.
    ///
    UR_FLAG_DISABLE_CACHE = 1 << 2,

    ///
    /// If set user name, password, and cookies may be sent with the request, and
    /// cookies may be saved from the response.
    ///
    UR_FLAG_ALLOW_STORED_CREDENTIALS = 1 << 3,

    ///
    /// If set upload progress events will be generated when a request has a body.
    ///
    UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 4,

    ///
    /// If set the CefURLRequestClient::OnDownloadData method will not be called.
    ///
    UR_FLAG_NO_DOWNLOAD_DATA = 1 << 5,

    ///
    /// If set 5XX redirect errors will be propagated to the observer instead of
    /// automatically re-tried. This currently only applies for requests
    /// originated in the browser process.
    ///
    UR_FLAG_NO_RETRY_ON_5XX = 1 << 6,

    ///
    /// If set 3XX responses will cause the fetch to halt immediately rather than
    /// continue through the redirect.
    ///
    UR_FLAG_STOP_ON_REDIRECT = 1 << 7
}

alias UR_FLAG_NONE = cef_urlrequest_flags_t.UR_FLAG_NONE;
alias UR_FLAG_SKIP_CACHE = cef_urlrequest_flags_t.UR_FLAG_SKIP_CACHE;
alias UR_FLAG_ONLY_FROM_CACHE = cef_urlrequest_flags_t.UR_FLAG_ONLY_FROM_CACHE;
alias UR_FLAG_DISABLE_CACHE = cef_urlrequest_flags_t.UR_FLAG_DISABLE_CACHE;
alias UR_FLAG_ALLOW_STORED_CREDENTIALS = cef_urlrequest_flags_t.UR_FLAG_ALLOW_STORED_CREDENTIALS;
alias UR_FLAG_REPORT_UPLOAD_PROGRESS = cef_urlrequest_flags_t.UR_FLAG_REPORT_UPLOAD_PROGRESS;
alias UR_FLAG_NO_DOWNLOAD_DATA = cef_urlrequest_flags_t.UR_FLAG_NO_DOWNLOAD_DATA;
alias UR_FLAG_NO_RETRY_ON_5XX = cef_urlrequest_flags_t.UR_FLAG_NO_RETRY_ON_5XX;
alias UR_FLAG_STOP_ON_REDIRECT = cef_urlrequest_flags_t.UR_FLAG_STOP_ON_REDIRECT;

///
/// Flags that represent CefURLRequest status.
///
enum cef_urlrequest_status_t
{
    ///
    /// Unknown status.
    ///
    UR_UNKNOWN = 0,

    ///
    /// Request succeeded.
    ///
    UR_SUCCESS = 1,

    ///
    /// An IO request is pending, and the caller will be informed when it is
    /// completed.
    ///
    UR_IO_PENDING = 2,

    ///
    /// Request was canceled programatically.
    ///
    UR_CANCELED = 3,

    ///
    /// Request failed for some reason.
    ///
    UR_FAILED = 4
}

alias UR_UNKNOWN = cef_urlrequest_status_t.UR_UNKNOWN;
alias UR_SUCCESS = cef_urlrequest_status_t.UR_SUCCESS;
alias UR_IO_PENDING = cef_urlrequest_status_t.UR_IO_PENDING;
alias UR_CANCELED = cef_urlrequest_status_t.UR_CANCELED;
alias UR_FAILED = cef_urlrequest_status_t.UR_FAILED;

/// Structure representing a draggable region.
///
struct cef_draggable_region_t
{
    ///
    /// Bounds of the region.
    ///

    cef_rect_t bounds;

    ///
    /// True (1) this this region is draggable and false (0) otherwise.
    ///
    int draggable;
}



///
/// Existing process IDs.
///
enum cef_process_id_t
{
    ///
    /// Browser process.
    ///
    PID_BROWSER = 0,
    ///
    /// Renderer process.
    ///
    PID_RENDERER = 1
}

alias PID_BROWSER = cef_process_id_t.PID_BROWSER;
alias PID_RENDERER = cef_process_id_t.PID_RENDERER;

///
/// Existing thread IDs.
///
enum cef_thread_id_t
{
    // BROWSER PROCESS THREADS -- Only available in the browser process.

    ///
    /// The main thread in the browser. This will be the same as the main
    /// application thread if CefInitialize() is called with a
    /// CefSettings.multi_threaded_message_loop value of false. Do not perform
    /// blocking tasks on this thread. All tasks posted after
    /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
    /// are guaranteed to run. This thread will outlive all other CEF threads.
    ///
    TID_UI = 0,

    ///
    /// Used for blocking tasks like file system access where the user won't
    /// notice if the task takes an arbitrarily long time to complete. All tasks
    /// posted after CefBrowserProcessHandler::OnContextInitialized() and before
    /// CefShutdown() are guaranteed to run.
    ///
    TID_FILE_BACKGROUND = 1,

    ///
    /// Used for blocking tasks like file system access that affect UI or
    /// responsiveness of future user interactions. Do not use if an immediate
    /// response to a user interaction is expected. All tasks posted after
    /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
    /// are guaranteed to run.
    /// Examples:
    /// - Updating the UI to reflect progress on a long task.
    /// - Loading data that might be shown in the UI after a future user
    ///   interaction.
    ///
    TID_FILE_USER_VISIBLE = 2,

    ///
    /// Used for blocking tasks like file system access that affect UI
    /// immediately after a user interaction. All tasks posted after
    /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
    /// are guaranteed to run.
    /// Example: Generating data shown in the UI immediately after a click.
    ///
    TID_FILE_USER_BLOCKING = 3,

    ///
    /// Used to launch and terminate browser processes.
    ///
    TID_PROCESS_LAUNCHER = 4,

    ///
    /// Used to process IPC and network messages. Do not perform blocking tasks on
    /// this thread. All tasks posted after
    /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
    /// are guaranteed to run.
    ///
    TID_IO = 5,

    // RENDER PROCESS THREADS -- Only available in the render process.

    ///
    /// The main thread in the renderer. Used for all WebKit and V8 interaction.
    /// Tasks may be posted to this thread after
    /// CefRenderProcessHandler::OnWebKitInitialized but are not guaranteed to
    /// run before sub-process termination (sub-processes may be killed at any
    /// time without warning).
    ///
    TID_RENDERER = 6
}

alias TID_UI = cef_thread_id_t.TID_UI;
alias TID_FILE_BACKGROUND = cef_thread_id_t.TID_FILE_BACKGROUND;
alias TID_FILE_USER_VISIBLE = cef_thread_id_t.TID_FILE_USER_VISIBLE;
alias TID_FILE_USER_BLOCKING = cef_thread_id_t.TID_FILE_USER_BLOCKING;
alias TID_PROCESS_LAUNCHER = cef_thread_id_t.TID_PROCESS_LAUNCHER;
alias TID_IO = cef_thread_id_t.TID_IO;
alias TID_RENDERER = cef_thread_id_t.TID_RENDERER;

///
/// Thread priority values listed in increasing order of importance.
///
enum cef_thread_priority_t
{
    ///
    /// Suitable for threads that shouldn't disrupt high priority work.
    ///
    TP_BACKGROUND = 0,

    ///
    /// Default priority level.
    ///
    TP_NORMAL = 1,

    ///
    /// Suitable for threads which generate data for the display (at ~60Hz).
    ///
    TP_DISPLAY = 2,

    ///
    /// Suitable for low-latency, glitch-resistant audio.
    ///
    TP_REALTIME_AUDIO = 3
}

alias TP_BACKGROUND = cef_thread_priority_t.TP_BACKGROUND;
alias TP_NORMAL = cef_thread_priority_t.TP_NORMAL;
alias TP_DISPLAY = cef_thread_priority_t.TP_DISPLAY;
alias TP_REALTIME_AUDIO = cef_thread_priority_t.TP_REALTIME_AUDIO;

///
/// Message loop types. Indicates the set of asynchronous events that a message
/// loop can process.
///
enum cef_message_loop_type_t
{
    ///
    /// Supports tasks and timers.
    ///
    ML_TYPE_DEFAULT = 0,

    ///
    /// Supports tasks, timers and native UI events (e.g. Windows messages).
    ///
    ML_TYPE_UI = 1,

    ///
    /// Supports tasks, timers and asynchronous IO events.
    ///
    ML_TYPE_IO = 2
}

alias ML_TYPE_DEFAULT = cef_message_loop_type_t.ML_TYPE_DEFAULT;
alias ML_TYPE_UI = cef_message_loop_type_t.ML_TYPE_UI;
alias ML_TYPE_IO = cef_message_loop_type_t.ML_TYPE_IO;

///
/// Windows COM initialization mode. Specifies how COM will be initialized for a
/// new thread.
///
enum cef_com_init_mode_t
{
    ///
    /// No COM initialization.
    ///
    COM_INIT_MODE_NONE = 0,

    ///
    /// Initialize COM using single-threaded apartments.
    ///
    COM_INIT_MODE_STA = 1,

    ///
    /// Initialize COM using multi-threaded apartments.
    ///
    COM_INIT_MODE_MTA = 2
}

alias COM_INIT_MODE_NONE = cef_com_init_mode_t.COM_INIT_MODE_NONE;
alias COM_INIT_MODE_STA = cef_com_init_mode_t.COM_INIT_MODE_STA;
alias COM_INIT_MODE_MTA = cef_com_init_mode_t.COM_INIT_MODE_MTA;

///
/// Supported value types.
///
enum cef_value_type_t
{
    VTYPE_INVALID = 0,
    VTYPE_NULL = 1,
    VTYPE_BOOL = 2,
    VTYPE_INT = 3,
    VTYPE_DOUBLE = 4,
    VTYPE_STRING = 5,
    VTYPE_BINARY = 6,
    VTYPE_DICTIONARY = 7,
    VTYPE_LIST = 8
}

alias VTYPE_INVALID = cef_value_type_t.VTYPE_INVALID;
alias VTYPE_NULL = cef_value_type_t.VTYPE_NULL;
alias VTYPE_BOOL = cef_value_type_t.VTYPE_BOOL;
alias VTYPE_INT = cef_value_type_t.VTYPE_INT;
alias VTYPE_DOUBLE = cef_value_type_t.VTYPE_DOUBLE;
alias VTYPE_STRING = cef_value_type_t.VTYPE_STRING;
alias VTYPE_BINARY = cef_value_type_t.VTYPE_BINARY;
alias VTYPE_DICTIONARY = cef_value_type_t.VTYPE_DICTIONARY;
alias VTYPE_LIST = cef_value_type_t.VTYPE_LIST;

///
/// Supported JavaScript dialog types.
///
enum cef_jsdialog_type_t
{
    JSDIALOGTYPE_ALERT = 0,
    JSDIALOGTYPE_CONFIRM = 1,
    JSDIALOGTYPE_PROMPT = 2
}

alias JSDIALOGTYPE_ALERT = cef_jsdialog_type_t.JSDIALOGTYPE_ALERT;
alias JSDIALOGTYPE_CONFIRM = cef_jsdialog_type_t.JSDIALOGTYPE_CONFIRM;
alias JSDIALOGTYPE_PROMPT = cef_jsdialog_type_t.JSDIALOGTYPE_PROMPT;

///
/// Screen information used when window rendering is disabled. This structure is
/// passed as a parameter to CefRenderHandler::GetScreenInfo and should be
/// filled in by the client.
///
struct cef_screen_info_t
{
    ///
    /// Device scale factor. Specifies the ratio between physical and logical
    /// pixels.
    ///
    float device_scale_factor;

    ///
    /// The screen depth in bits per pixel.
    ///
    int depth;

    ///
    /// The bits per color component. This assumes that the colors are balanced
    /// equally.
    ///
    int depth_per_component;

    ///
    /// This can be true for black and white printers.
    ///
    int is_monochrome;

    ///
    /// This is set from the rcMonitor member of MONITORINFOEX, to whit:
    ///   "A RECT structure that specifies the display monitor rectangle,
    ///   expressed in virtual-screen coordinates. Note that if the monitor
    ///   is not the primary display monitor, some of the rectangle's
    ///   coordinates may be negative values."
    //
    /// The |rect| and |available_rect| properties are used to determine the
    /// available surface for rendering popup views.
    ///
    cef_rect_t rect;

    ///
    /// This is set from the rcWork member of MONITORINFOEX, to whit:
    ///   "A RECT structure that specifies the work area rectangle of the
    ///   display monitor that can be used by applications, expressed in
    ///   virtual-screen coordinates. Windows uses this rectangle to
    ///   maximize an application on the monitor. The rest of the area in
    ///   rcMonitor contains system windows such as the task bar and side
    ///   bars. Note that if the monitor is not the primary display monitor,
    ///   some of the rectangle's coordinates may be negative values".
    //
    /// The |rect| and |available_rect| properties are used to determine the
    /// available surface for rendering popup views.
    ///
    cef_rect_t available_rect;
}



///
/// Supported menu IDs. Non-English translations can be provided for the
/// IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString().
///
enum cef_menu_id_t
{
    // Navigation.
    MENU_ID_BACK = 100,
    MENU_ID_FORWARD = 101,
    MENU_ID_RELOAD = 102,
    MENU_ID_RELOAD_NOCACHE = 103,
    MENU_ID_STOPLOAD = 104,

    // Editing.
    MENU_ID_UNDO = 110,
    MENU_ID_REDO = 111,
    MENU_ID_CUT = 112,
    MENU_ID_COPY = 113,
    MENU_ID_PASTE = 114,
    MENU_ID_DELETE = 115,
    MENU_ID_SELECT_ALL = 116,

    // Miscellaneous.
    MENU_ID_FIND = 130,
    MENU_ID_PRINT = 131,
    MENU_ID_VIEW_SOURCE = 132,

    // Spell checking word correction suggestions.
    MENU_ID_SPELLCHECK_SUGGESTION_0 = 200,
    MENU_ID_SPELLCHECK_SUGGESTION_1 = 201,
    MENU_ID_SPELLCHECK_SUGGESTION_2 = 202,
    MENU_ID_SPELLCHECK_SUGGESTION_3 = 203,
    MENU_ID_SPELLCHECK_SUGGESTION_4 = 204,
    MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204,
    MENU_ID_NO_SPELLING_SUGGESTIONS = 205,
    MENU_ID_ADD_TO_DICTIONARY = 206,

    // Custom menu items originating from the renderer process.
    MENU_ID_CUSTOM_FIRST = 220,
    MENU_ID_CUSTOM_LAST = 250,

    // All user-defined menu IDs should come between MENU_ID_USER_FIRST and
    // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges
    // defined in the tools/gritsettings/resource_ids file.
    MENU_ID_USER_FIRST = 26500,
    MENU_ID_USER_LAST = 28500
}

alias MENU_ID_BACK = cef_menu_id_t.MENU_ID_BACK;
alias MENU_ID_FORWARD = cef_menu_id_t.MENU_ID_FORWARD;
alias MENU_ID_RELOAD = cef_menu_id_t.MENU_ID_RELOAD;
alias MENU_ID_RELOAD_NOCACHE = cef_menu_id_t.MENU_ID_RELOAD_NOCACHE;
alias MENU_ID_STOPLOAD = cef_menu_id_t.MENU_ID_STOPLOAD;
alias MENU_ID_UNDO = cef_menu_id_t.MENU_ID_UNDO;
alias MENU_ID_REDO = cef_menu_id_t.MENU_ID_REDO;
alias MENU_ID_CUT = cef_menu_id_t.MENU_ID_CUT;
alias MENU_ID_COPY = cef_menu_id_t.MENU_ID_COPY;
alias MENU_ID_PASTE = cef_menu_id_t.MENU_ID_PASTE;
alias MENU_ID_DELETE = cef_menu_id_t.MENU_ID_DELETE;
alias MENU_ID_SELECT_ALL = cef_menu_id_t.MENU_ID_SELECT_ALL;
alias MENU_ID_FIND = cef_menu_id_t.MENU_ID_FIND;
alias MENU_ID_PRINT = cef_menu_id_t.MENU_ID_PRINT;
alias MENU_ID_VIEW_SOURCE = cef_menu_id_t.MENU_ID_VIEW_SOURCE;
alias MENU_ID_SPELLCHECK_SUGGESTION_0 = cef_menu_id_t.MENU_ID_SPELLCHECK_SUGGESTION_0;
alias MENU_ID_SPELLCHECK_SUGGESTION_1 = cef_menu_id_t.MENU_ID_SPELLCHECK_SUGGESTION_1;
alias MENU_ID_SPELLCHECK_SUGGESTION_2 = cef_menu_id_t.MENU_ID_SPELLCHECK_SUGGESTION_2;
alias MENU_ID_SPELLCHECK_SUGGESTION_3 = cef_menu_id_t.MENU_ID_SPELLCHECK_SUGGESTION_3;
alias MENU_ID_SPELLCHECK_SUGGESTION_4 = cef_menu_id_t.MENU_ID_SPELLCHECK_SUGGESTION_4;
alias MENU_ID_SPELLCHECK_SUGGESTION_LAST = cef_menu_id_t.MENU_ID_SPELLCHECK_SUGGESTION_LAST;
alias MENU_ID_NO_SPELLING_SUGGESTIONS = cef_menu_id_t.MENU_ID_NO_SPELLING_SUGGESTIONS;
alias MENU_ID_ADD_TO_DICTIONARY = cef_menu_id_t.MENU_ID_ADD_TO_DICTIONARY;
alias MENU_ID_CUSTOM_FIRST = cef_menu_id_t.MENU_ID_CUSTOM_FIRST;
alias MENU_ID_CUSTOM_LAST = cef_menu_id_t.MENU_ID_CUSTOM_LAST;
alias MENU_ID_USER_FIRST = cef_menu_id_t.MENU_ID_USER_FIRST;
alias MENU_ID_USER_LAST = cef_menu_id_t.MENU_ID_USER_LAST;

///
/// Mouse button types.
///
enum cef_mouse_button_type_t
{
    MBT_LEFT = 0,
    MBT_MIDDLE = 1,
    MBT_RIGHT = 2
}

alias MBT_LEFT = cef_mouse_button_type_t.MBT_LEFT;
alias MBT_MIDDLE = cef_mouse_button_type_t.MBT_MIDDLE;
alias MBT_RIGHT = cef_mouse_button_type_t.MBT_RIGHT;

///
/// Structure representing mouse event information.
///
struct cef_mouse_event_t
{
    ///
    /// X coordinate relative to the left side of the view.
    ///
    int x;

    ///
    /// Y coordinate relative to the top side of the view.
    ///
    int y;

    ///
    /// Bit flags describing any pressed modifier keys. See
    /// cef_event_flags_t for values.
    ///
    uint modifiers;
}



///
/// Touch points states types.
///
enum cef_touch_event_type_t
{
    CEF_TET_RELEASED = 0,
    CEF_TET_PRESSED = 1,
    CEF_TET_MOVED = 2,
    CEF_TET_CANCELLED = 3
}

alias CEF_TET_RELEASED = cef_touch_event_type_t.CEF_TET_RELEASED;
alias CEF_TET_PRESSED = cef_touch_event_type_t.CEF_TET_PRESSED;
alias CEF_TET_MOVED = cef_touch_event_type_t.CEF_TET_MOVED;
alias CEF_TET_CANCELLED = cef_touch_event_type_t.CEF_TET_CANCELLED;

///
/// The device type that caused the event.
///
enum cef_pointer_type_t
{
    CEF_POINTER_TYPE_TOUCH = 0,
    CEF_POINTER_TYPE_MOUSE = 1,
    CEF_POINTER_TYPE_PEN = 2,
    CEF_POINTER_TYPE_ERASER = 3,
    CEF_POINTER_TYPE_UNKNOWN = 4
}

alias CEF_POINTER_TYPE_TOUCH = cef_pointer_type_t.CEF_POINTER_TYPE_TOUCH;
alias CEF_POINTER_TYPE_MOUSE = cef_pointer_type_t.CEF_POINTER_TYPE_MOUSE;
alias CEF_POINTER_TYPE_PEN = cef_pointer_type_t.CEF_POINTER_TYPE_PEN;
alias CEF_POINTER_TYPE_ERASER = cef_pointer_type_t.CEF_POINTER_TYPE_ERASER;
alias CEF_POINTER_TYPE_UNKNOWN = cef_pointer_type_t.CEF_POINTER_TYPE_UNKNOWN;

///
/// Structure representing touch event information.
///
struct cef_touch_event_t
{
    ///
    /// Id of a touch point. Must be unique per touch, can be any number except
    /// -1. Note that a maximum of 16 concurrent touches will be tracked; touches
    /// beyond that will be ignored.
    ///
    int id;

    ///
    /// X coordinate relative to the left side of the view.
    ///
    float x;

    ///
    /// Y coordinate relative to the top side of the view.
    ///
    float y;

    ///
    /// X radius in pixels. Set to 0 if not applicable.
    ///
    float radius_x;

    ///
    /// Y radius in pixels. Set to 0 if not applicable.
    ///
    float radius_y;

    ///
    /// Rotation angle in radians. Set to 0 if not applicable.
    ///
    float rotation_angle;

    ///
    /// The normalized pressure of the pointer input in the range of [0,1].
    /// Set to 0 if not applicable.
    ///
    float pressure;

    ///
    /// The state of the touch point. Touches begin with one CEF_TET_PRESSED event
    /// followed by zero or more CEF_TET_MOVED events and finally one
    /// CEF_TET_RELEASED or CEF_TET_CANCELLED event. Events not respecting this
    /// order will be ignored.
    ///
    cef_touch_event_type_t type;

    ///
    /// Bit flags describing any pressed modifier keys. See
    /// cef_event_flags_t for values.
    ///
    uint modifiers;

    ///
    /// The device type that caused the event.
    ///
    cef_pointer_type_t pointer_type;
}



///
/// Paint element types.
///
enum cef_paint_element_type_t
{
    PET_VIEW = 0,
    PET_POPUP = 1
}

alias PET_VIEW = cef_paint_element_type_t.PET_VIEW;
alias PET_POPUP = cef_paint_element_type_t.PET_POPUP;

///
/// Supported event bit flags.
///
enum cef_event_flags_t
{
    EVENTFLAG_NONE = 0,
    EVENTFLAG_CAPS_LOCK_ON = 1 << 0,
    EVENTFLAG_SHIFT_DOWN = 1 << 1,
    EVENTFLAG_CONTROL_DOWN = 1 << 2,
    EVENTFLAG_ALT_DOWN = 1 << 3,
    EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4,
    EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5,
    EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6,
    /// Mac OS-X command key.
    EVENTFLAG_COMMAND_DOWN = 1 << 7,
    EVENTFLAG_NUM_LOCK_ON = 1 << 8,
    EVENTFLAG_IS_KEY_PAD = 1 << 9,
    EVENTFLAG_IS_LEFT = 1 << 10,
    EVENTFLAG_IS_RIGHT = 1 << 11,
    EVENTFLAG_ALTGR_DOWN = 1 << 12,
    EVENTFLAG_IS_REPEAT = 1 << 13
}

alias EVENTFLAG_NONE = cef_event_flags_t.EVENTFLAG_NONE;
alias EVENTFLAG_CAPS_LOCK_ON = cef_event_flags_t.EVENTFLAG_CAPS_LOCK_ON;
alias EVENTFLAG_SHIFT_DOWN = cef_event_flags_t.EVENTFLAG_SHIFT_DOWN;
alias EVENTFLAG_CONTROL_DOWN = cef_event_flags_t.EVENTFLAG_CONTROL_DOWN;
alias EVENTFLAG_ALT_DOWN = cef_event_flags_t.EVENTFLAG_ALT_DOWN;
alias EVENTFLAG_LEFT_MOUSE_BUTTON = cef_event_flags_t.EVENTFLAG_LEFT_MOUSE_BUTTON;
alias EVENTFLAG_MIDDLE_MOUSE_BUTTON = cef_event_flags_t.EVENTFLAG_MIDDLE_MOUSE_BUTTON;
alias EVENTFLAG_RIGHT_MOUSE_BUTTON = cef_event_flags_t.EVENTFLAG_RIGHT_MOUSE_BUTTON;
alias EVENTFLAG_COMMAND_DOWN = cef_event_flags_t.EVENTFLAG_COMMAND_DOWN;
alias EVENTFLAG_NUM_LOCK_ON = cef_event_flags_t.EVENTFLAG_NUM_LOCK_ON;
alias EVENTFLAG_IS_KEY_PAD = cef_event_flags_t.EVENTFLAG_IS_KEY_PAD;
alias EVENTFLAG_IS_LEFT = cef_event_flags_t.EVENTFLAG_IS_LEFT;
alias EVENTFLAG_IS_RIGHT = cef_event_flags_t.EVENTFLAG_IS_RIGHT;
alias EVENTFLAG_ALTGR_DOWN = cef_event_flags_t.EVENTFLAG_ALTGR_DOWN;
alias EVENTFLAG_IS_REPEAT = cef_event_flags_t.EVENTFLAG_IS_REPEAT;

///
/// Supported menu item types.
///
enum cef_menu_item_type_t
{
    MENUITEMTYPE_NONE = 0,
    MENUITEMTYPE_COMMAND = 1,
    MENUITEMTYPE_CHECK = 2,
    MENUITEMTYPE_RADIO = 3,
    MENUITEMTYPE_SEPARATOR = 4,
    MENUITEMTYPE_SUBMENU = 5
}

alias MENUITEMTYPE_NONE = cef_menu_item_type_t.MENUITEMTYPE_NONE;
alias MENUITEMTYPE_COMMAND = cef_menu_item_type_t.MENUITEMTYPE_COMMAND;
alias MENUITEMTYPE_CHECK = cef_menu_item_type_t.MENUITEMTYPE_CHECK;
alias MENUITEMTYPE_RADIO = cef_menu_item_type_t.MENUITEMTYPE_RADIO;
alias MENUITEMTYPE_SEPARATOR = cef_menu_item_type_t.MENUITEMTYPE_SEPARATOR;
alias MENUITEMTYPE_SUBMENU = cef_menu_item_type_t.MENUITEMTYPE_SUBMENU;

///
/// Supported context menu type flags.
///
enum cef_context_menu_type_flags_t
{
    ///
    /// No node is selected.
    ///
    CM_TYPEFLAG_NONE = 0,
    ///
    /// The top page is selected.
    ///
    CM_TYPEFLAG_PAGE = 1 << 0,
    ///
    /// A subframe page is selected.
    ///
    CM_TYPEFLAG_FRAME = 1 << 1,
    ///
    /// A link is selected.
    ///
    CM_TYPEFLAG_LINK = 1 << 2,
    ///
    /// A media node is selected.
    ///
    CM_TYPEFLAG_MEDIA = 1 << 3,
    ///
    /// There is a textual or mixed selection that is selected.
    ///
    CM_TYPEFLAG_SELECTION = 1 << 4,
    ///
    /// An editable element is selected.
    ///
    CM_TYPEFLAG_EDITABLE = 1 << 5
}

alias CM_TYPEFLAG_NONE = cef_context_menu_type_flags_t.CM_TYPEFLAG_NONE;
alias CM_TYPEFLAG_PAGE = cef_context_menu_type_flags_t.CM_TYPEFLAG_PAGE;
alias CM_TYPEFLAG_FRAME = cef_context_menu_type_flags_t.CM_TYPEFLAG_FRAME;
alias CM_TYPEFLAG_LINK = cef_context_menu_type_flags_t.CM_TYPEFLAG_LINK;
alias CM_TYPEFLAG_MEDIA = cef_context_menu_type_flags_t.CM_TYPEFLAG_MEDIA;
alias CM_TYPEFLAG_SELECTION = cef_context_menu_type_flags_t.CM_TYPEFLAG_SELECTION;
alias CM_TYPEFLAG_EDITABLE = cef_context_menu_type_flags_t.CM_TYPEFLAG_EDITABLE;

///
/// Supported context menu media types. These constants match their equivalents
/// in Chromium's ContextMenuDataMediaType and should not be renumbered.
///
enum cef_context_menu_media_type_t
{
    ///
    /// No special node is in context.
    ///
    CM_MEDIATYPE_NONE = 0,
    ///
    /// An image node is selected.
    ///
    CM_MEDIATYPE_IMAGE = 1,
    ///
    /// A video node is selected.
    ///
    CM_MEDIATYPE_VIDEO = 2,
    ///
    /// An audio node is selected.
    ///
    CM_MEDIATYPE_AUDIO = 3,
    ///
    /// An canvas node is selected.
    ///
    CM_MEDIATYPE_CANVAS = 4,
    ///
    /// A file node is selected.
    ///
    CM_MEDIATYPE_FILE = 5,
    ///
    /// A plugin node is selected.
    ///
    CM_MEDIATYPE_PLUGIN = 6
}

alias CM_MEDIATYPE_NONE = cef_context_menu_media_type_t.CM_MEDIATYPE_NONE;
alias CM_MEDIATYPE_IMAGE = cef_context_menu_media_type_t.CM_MEDIATYPE_IMAGE;
alias CM_MEDIATYPE_VIDEO = cef_context_menu_media_type_t.CM_MEDIATYPE_VIDEO;
alias CM_MEDIATYPE_AUDIO = cef_context_menu_media_type_t.CM_MEDIATYPE_AUDIO;
alias CM_MEDIATYPE_CANVAS = cef_context_menu_media_type_t.CM_MEDIATYPE_CANVAS;
alias CM_MEDIATYPE_FILE = cef_context_menu_media_type_t.CM_MEDIATYPE_FILE;
alias CM_MEDIATYPE_PLUGIN = cef_context_menu_media_type_t.CM_MEDIATYPE_PLUGIN;

///
/// Supported context menu media state bit flags. These constants match their
/// equivalents in Chromium's ContextMenuData::MediaFlags and should not be
/// renumbered.
///
enum cef_context_menu_media_state_flags_t
{
    CM_MEDIAFLAG_NONE = 0,
    CM_MEDIAFLAG_IN_ERROR = 1 << 0,
    CM_MEDIAFLAG_PAUSED = 1 << 1,
    CM_MEDIAFLAG_MUTED = 1 << 2,
    CM_MEDIAFLAG_LOOP = 1 << 3,
    CM_MEDIAFLAG_CAN_SAVE = 1 << 4,
    CM_MEDIAFLAG_HAS_AUDIO = 1 << 5,
    CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = 1 << 6,
    CM_MEDIAFLAG_CONTROLS = 1 << 7,
    CM_MEDIAFLAG_CAN_PRINT = 1 << 8,
    CM_MEDIAFLAG_CAN_ROTATE = 1 << 9,
    CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10,
    CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11,
    CM_MEDIAFLAG_CAN_LOOP = 1 << 12
}

alias CM_MEDIAFLAG_NONE = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_NONE;
alias CM_MEDIAFLAG_IN_ERROR = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_IN_ERROR;
alias CM_MEDIAFLAG_PAUSED = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_PAUSED;
alias CM_MEDIAFLAG_MUTED = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_MUTED;
alias CM_MEDIAFLAG_LOOP = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_LOOP;
alias CM_MEDIAFLAG_CAN_SAVE = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_CAN_SAVE;
alias CM_MEDIAFLAG_HAS_AUDIO = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_HAS_AUDIO;
alias CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS;
alias CM_MEDIAFLAG_CONTROLS = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_CONTROLS;
alias CM_MEDIAFLAG_CAN_PRINT = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_CAN_PRINT;
alias CM_MEDIAFLAG_CAN_ROTATE = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_CAN_ROTATE;
alias CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE;
alias CM_MEDIAFLAG_PICTURE_IN_PICTURE = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_PICTURE_IN_PICTURE;
alias CM_MEDIAFLAG_CAN_LOOP = cef_context_menu_media_state_flags_t.CM_MEDIAFLAG_CAN_LOOP;

///
/// Supported context menu edit state bit flags. These constants match their
/// equivalents in Chromium's ContextMenuDataEditFlags and should not be
/// renumbered.
///
enum cef_context_menu_edit_state_flags_t
{
    CM_EDITFLAG_NONE = 0,
    CM_EDITFLAG_CAN_UNDO = 1 << 0,
    CM_EDITFLAG_CAN_REDO = 1 << 1,
    CM_EDITFLAG_CAN_CUT = 1 << 2,
    CM_EDITFLAG_CAN_COPY = 1 << 3,
    CM_EDITFLAG_CAN_PASTE = 1 << 4,
    CM_EDITFLAG_CAN_DELETE = 1 << 5,
    CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6,
    CM_EDITFLAG_CAN_TRANSLATE = 1 << 7,
    CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8
}

alias CM_EDITFLAG_NONE = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_NONE;
alias CM_EDITFLAG_CAN_UNDO = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_UNDO;
alias CM_EDITFLAG_CAN_REDO = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_REDO;
alias CM_EDITFLAG_CAN_CUT = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_CUT;
alias CM_EDITFLAG_CAN_COPY = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_COPY;
alias CM_EDITFLAG_CAN_PASTE = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_PASTE;
alias CM_EDITFLAG_CAN_DELETE = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_DELETE;
alias CM_EDITFLAG_CAN_SELECT_ALL = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_SELECT_ALL;
alias CM_EDITFLAG_CAN_TRANSLATE = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_TRANSLATE;
alias CM_EDITFLAG_CAN_EDIT_RICHLY = cef_context_menu_edit_state_flags_t.CM_EDITFLAG_CAN_EDIT_RICHLY;

///
/// Supported quick menu state bit flags.
///
enum cef_quick_menu_edit_state_flags_t
{
    QM_EDITFLAG_NONE = 0,
    QM_EDITFLAG_CAN_ELLIPSIS = 1 << 0,
    QM_EDITFLAG_CAN_CUT = 1 << 1,
    QM_EDITFLAG_CAN_COPY = 1 << 2,
    QM_EDITFLAG_CAN_PASTE = 1 << 3
}

alias QM_EDITFLAG_NONE = cef_quick_menu_edit_state_flags_t.QM_EDITFLAG_NONE;
alias QM_EDITFLAG_CAN_ELLIPSIS = cef_quick_menu_edit_state_flags_t.QM_EDITFLAG_CAN_ELLIPSIS;
alias QM_EDITFLAG_CAN_CUT = cef_quick_menu_edit_state_flags_t.QM_EDITFLAG_CAN_CUT;
alias QM_EDITFLAG_CAN_COPY = cef_quick_menu_edit_state_flags_t.QM_EDITFLAG_CAN_COPY;
alias QM_EDITFLAG_CAN_PASTE = cef_quick_menu_edit_state_flags_t.QM_EDITFLAG_CAN_PASTE;

///
/// Key event types.
///
enum cef_key_event_type_t
{
    ///
    /// Notification that a key transitioned from "up" to "down".
    ///
    KEYEVENT_RAWKEYDOWN = 0,

    ///
    /// Notification that a key was pressed. This does not necessarily correspond
    /// to a character depending on the key and language. Use KEYEVENT_CHAR for
    /// character input.
    ///
    KEYEVENT_KEYDOWN = 1,

    ///
    /// Notification that a key was released.
    ///
    KEYEVENT_KEYUP = 2,

    ///
    /// Notification that a character was typed. Use this for text input. Key
    /// down events may generate 0, 1, or more than one character event depending
    /// on the key, locale, and operating system.
    ///
    KEYEVENT_CHAR = 3
}

alias KEYEVENT_RAWKEYDOWN = cef_key_event_type_t.KEYEVENT_RAWKEYDOWN;
alias KEYEVENT_KEYDOWN = cef_key_event_type_t.KEYEVENT_KEYDOWN;
alias KEYEVENT_KEYUP = cef_key_event_type_t.KEYEVENT_KEYUP;
alias KEYEVENT_CHAR = cef_key_event_type_t.KEYEVENT_CHAR;

///
/// Structure representing keyboard event information.
///
struct cef_key_event_t
{
    ///
    /// The type of keyboard event.
    ///
    cef_key_event_type_t type;

    ///
    /// Bit flags describing any pressed modifier keys. See
    /// cef_event_flags_t for values.
    ///
    uint modifiers;

    ///
    /// The Windows key code for the key event. This value is used by the DOM
    /// specification. Sometimes it comes directly from the event (i.e. on
    /// Windows) and sometimes it's determined using a mapping function. See
    /// WebCore/platform/chromium/KeyboardCodes.h for the list of values.
    ///
    int windows_key_code;

    ///
    /// The actual key code genenerated by the platform.
    ///
    int native_key_code;

    ///
    /// Indicates whether the event is considered a "system key" event (see
    /// http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details).
    /// This value will always be false on non-Windows platforms.
    ///
    int is_system_key;

    ///
    /// The character generated by the keystroke.
    ///
    alias char16_t = ushort;
    char16_t character;

    ///
    /// Same as |character| but unmodified by any concurrently-held modifiers
    /// (except shift). This is useful for working out shortcut keys.
    ///
    char16_t unmodified_character;

    ///
    /// True if the focus is currently on an editable field on the page. This is
    /// useful for determining if standard key events should be intercepted.
    ///
    int focus_on_editable_field;
}



///
/// Focus sources.
///
enum cef_focus_source_t
{
    ///
    /// The source is explicit navigation via the API (LoadURL(), etc).
    ///
    FOCUS_SOURCE_NAVIGATION = 0,
    ///
    /// The source is a system-generated focus event.
    ///
    FOCUS_SOURCE_SYSTEM = 1
}

alias FOCUS_SOURCE_NAVIGATION = cef_focus_source_t.FOCUS_SOURCE_NAVIGATION;
alias FOCUS_SOURCE_SYSTEM = cef_focus_source_t.FOCUS_SOURCE_SYSTEM;

///
/// Navigation types.
///
enum cef_navigation_type_t
{
    NAVIGATION_LINK_CLICKED = 0,
    NAVIGATION_FORM_SUBMITTED = 1,
    NAVIGATION_BACK_FORWARD = 2,
    NAVIGATION_RELOAD = 3,
    NAVIGATION_FORM_RESUBMITTED = 4,
    NAVIGATION_OTHER = 5
}

alias NAVIGATION_LINK_CLICKED = cef_navigation_type_t.NAVIGATION_LINK_CLICKED;
alias NAVIGATION_FORM_SUBMITTED = cef_navigation_type_t.NAVIGATION_FORM_SUBMITTED;
alias NAVIGATION_BACK_FORWARD = cef_navigation_type_t.NAVIGATION_BACK_FORWARD;
alias NAVIGATION_RELOAD = cef_navigation_type_t.NAVIGATION_RELOAD;
alias NAVIGATION_FORM_RESUBMITTED = cef_navigation_type_t.NAVIGATION_FORM_RESUBMITTED;
alias NAVIGATION_OTHER = cef_navigation_type_t.NAVIGATION_OTHER;

///
/// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and
/// UTF16 (LE and BE) by default. All other types must be translated to UTF8
/// before being passed to the parser. If a BOM is detected and the correct
/// decoder is available then that decoder will be used automatically.
///
enum cef_xml_encoding_type_t
{
    XML_ENCODING_NONE = 0,
    XML_ENCODING_UTF8 = 1,
    XML_ENCODING_UTF16LE = 2,
    XML_ENCODING_UTF16BE = 3,
    XML_ENCODING_ASCII = 4
}

alias XML_ENCODING_NONE = cef_xml_encoding_type_t.XML_ENCODING_NONE;
alias XML_ENCODING_UTF8 = cef_xml_encoding_type_t.XML_ENCODING_UTF8;
alias XML_ENCODING_UTF16LE = cef_xml_encoding_type_t.XML_ENCODING_UTF16LE;
alias XML_ENCODING_UTF16BE = cef_xml_encoding_type_t.XML_ENCODING_UTF16BE;
alias XML_ENCODING_ASCII = cef_xml_encoding_type_t.XML_ENCODING_ASCII;

///
/// XML node types.
///
enum cef_xml_node_type_t
{
    XML_NODE_UNSUPPORTED = 0,
    XML_NODE_PROCESSING_INSTRUCTION = 1,
    XML_NODE_DOCUMENT_TYPE = 2,
    XML_NODE_ELEMENT_START = 3,
    XML_NODE_ELEMENT_END = 4,
    XML_NODE_ATTRIBUTE = 5,
    XML_NODE_TEXT = 6,
    XML_NODE_CDATA = 7,
    XML_NODE_ENTITY_REFERENCE = 8,
    XML_NODE_WHITESPACE = 9,
    XML_NODE_COMMENT = 10
}

alias XML_NODE_UNSUPPORTED = cef_xml_node_type_t.XML_NODE_UNSUPPORTED;
alias XML_NODE_PROCESSING_INSTRUCTION = cef_xml_node_type_t.XML_NODE_PROCESSING_INSTRUCTION;
alias XML_NODE_DOCUMENT_TYPE = cef_xml_node_type_t.XML_NODE_DOCUMENT_TYPE;
alias XML_NODE_ELEMENT_START = cef_xml_node_type_t.XML_NODE_ELEMENT_START;
alias XML_NODE_ELEMENT_END = cef_xml_node_type_t.XML_NODE_ELEMENT_END;
alias XML_NODE_ATTRIBUTE = cef_xml_node_type_t.XML_NODE_ATTRIBUTE;
alias XML_NODE_TEXT = cef_xml_node_type_t.XML_NODE_TEXT;
alias XML_NODE_CDATA = cef_xml_node_type_t.XML_NODE_CDATA;
alias XML_NODE_ENTITY_REFERENCE = cef_xml_node_type_t.XML_NODE_ENTITY_REFERENCE;
alias XML_NODE_WHITESPACE = cef_xml_node_type_t.XML_NODE_WHITESPACE;
alias XML_NODE_COMMENT = cef_xml_node_type_t.XML_NODE_COMMENT;

///
/// Popup window features.
///
struct cef_popup_features_t
{
    int x;
    int xSet;
    int y;
    int ySet;
    int width;
    int widthSet;
    int height;
    int heightSet;

    /// True (1) if browser interface elements should be hidden.
    int isPopup;
}



///
/// DOM document types.
///
enum cef_dom_document_type_t
{
    DOM_DOCUMENT_TYPE_UNKNOWN = 0,
    DOM_DOCUMENT_TYPE_HTML = 1,
    DOM_DOCUMENT_TYPE_XHTML = 2,
    DOM_DOCUMENT_TYPE_PLUGIN = 3
}

alias DOM_DOCUMENT_TYPE_UNKNOWN = cef_dom_document_type_t.DOM_DOCUMENT_TYPE_UNKNOWN;
alias DOM_DOCUMENT_TYPE_HTML = cef_dom_document_type_t.DOM_DOCUMENT_TYPE_HTML;
alias DOM_DOCUMENT_TYPE_XHTML = cef_dom_document_type_t.DOM_DOCUMENT_TYPE_XHTML;
alias DOM_DOCUMENT_TYPE_PLUGIN = cef_dom_document_type_t.DOM_DOCUMENT_TYPE_PLUGIN;

///
/// DOM event category flags.
///
enum cef_dom_event_category_t
{
    DOM_EVENT_CATEGORY_UNKNOWN = 0x0,
    DOM_EVENT_CATEGORY_UI = 0x1,
    DOM_EVENT_CATEGORY_MOUSE = 0x2,
    DOM_EVENT_CATEGORY_MUTATION = 0x4,
    DOM_EVENT_CATEGORY_KEYBOARD = 0x8,
    DOM_EVENT_CATEGORY_TEXT = 0x10,
    DOM_EVENT_CATEGORY_COMPOSITION = 0x20,
    DOM_EVENT_CATEGORY_DRAG = 0x40,
    DOM_EVENT_CATEGORY_CLIPBOARD = 0x80,
    DOM_EVENT_CATEGORY_MESSAGE = 0x100,
    DOM_EVENT_CATEGORY_WHEEL = 0x200,
    DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400,
    DOM_EVENT_CATEGORY_OVERFLOW = 0x800,
    DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000,
    DOM_EVENT_CATEGORY_POPSTATE = 0x2000,
    DOM_EVENT_CATEGORY_PROGRESS = 0x4000,
    DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000
}

alias DOM_EVENT_CATEGORY_UNKNOWN = cef_dom_event_category_t.DOM_EVENT_CATEGORY_UNKNOWN;
alias DOM_EVENT_CATEGORY_UI = cef_dom_event_category_t.DOM_EVENT_CATEGORY_UI;
alias DOM_EVENT_CATEGORY_MOUSE = cef_dom_event_category_t.DOM_EVENT_CATEGORY_MOUSE;
alias DOM_EVENT_CATEGORY_MUTATION = cef_dom_event_category_t.DOM_EVENT_CATEGORY_MUTATION;
alias DOM_EVENT_CATEGORY_KEYBOARD = cef_dom_event_category_t.DOM_EVENT_CATEGORY_KEYBOARD;
alias DOM_EVENT_CATEGORY_TEXT = cef_dom_event_category_t.DOM_EVENT_CATEGORY_TEXT;
alias DOM_EVENT_CATEGORY_COMPOSITION = cef_dom_event_category_t.DOM_EVENT_CATEGORY_COMPOSITION;
alias DOM_EVENT_CATEGORY_DRAG = cef_dom_event_category_t.DOM_EVENT_CATEGORY_DRAG;
alias DOM_EVENT_CATEGORY_CLIPBOARD = cef_dom_event_category_t.DOM_EVENT_CATEGORY_CLIPBOARD;
alias DOM_EVENT_CATEGORY_MESSAGE = cef_dom_event_category_t.DOM_EVENT_CATEGORY_MESSAGE;
alias DOM_EVENT_CATEGORY_WHEEL = cef_dom_event_category_t.DOM_EVENT_CATEGORY_WHEEL;
alias DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = cef_dom_event_category_t.DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED;
alias DOM_EVENT_CATEGORY_OVERFLOW = cef_dom_event_category_t.DOM_EVENT_CATEGORY_OVERFLOW;
alias DOM_EVENT_CATEGORY_PAGE_TRANSITION = cef_dom_event_category_t.DOM_EVENT_CATEGORY_PAGE_TRANSITION;
alias DOM_EVENT_CATEGORY_POPSTATE = cef_dom_event_category_t.DOM_EVENT_CATEGORY_POPSTATE;
alias DOM_EVENT_CATEGORY_PROGRESS = cef_dom_event_category_t.DOM_EVENT_CATEGORY_PROGRESS;
alias DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = cef_dom_event_category_t.DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS;

///
/// DOM event processing phases.
///
enum cef_dom_event_phase_t
{
    DOM_EVENT_PHASE_UNKNOWN = 0,
    DOM_EVENT_PHASE_CAPTURING = 1,
    DOM_EVENT_PHASE_AT_TARGET = 2,
    DOM_EVENT_PHASE_BUBBLING = 3
}

alias DOM_EVENT_PHASE_UNKNOWN = cef_dom_event_phase_t.DOM_EVENT_PHASE_UNKNOWN;
alias DOM_EVENT_PHASE_CAPTURING = cef_dom_event_phase_t.DOM_EVENT_PHASE_CAPTURING;
alias DOM_EVENT_PHASE_AT_TARGET = cef_dom_event_phase_t.DOM_EVENT_PHASE_AT_TARGET;
alias DOM_EVENT_PHASE_BUBBLING = cef_dom_event_phase_t.DOM_EVENT_PHASE_BUBBLING;

///
/// DOM node types.
///
enum cef_dom_node_type_t
{
    DOM_NODE_TYPE_UNSUPPORTED = 0,
    DOM_NODE_TYPE_ELEMENT = 1,
    DOM_NODE_TYPE_ATTRIBUTE = 2,
    DOM_NODE_TYPE_TEXT = 3,
    DOM_NODE_TYPE_CDATA_SECTION = 4,
    DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS = 5,
    DOM_NODE_TYPE_COMMENT = 6,
    DOM_NODE_TYPE_DOCUMENT = 7,
    DOM_NODE_TYPE_DOCUMENT_TYPE = 8,
    DOM_NODE_TYPE_DOCUMENT_FRAGMENT = 9
}

alias DOM_NODE_TYPE_UNSUPPORTED = cef_dom_node_type_t.DOM_NODE_TYPE_UNSUPPORTED;
alias DOM_NODE_TYPE_ELEMENT = cef_dom_node_type_t.DOM_NODE_TYPE_ELEMENT;
alias DOM_NODE_TYPE_ATTRIBUTE = cef_dom_node_type_t.DOM_NODE_TYPE_ATTRIBUTE;
alias DOM_NODE_TYPE_TEXT = cef_dom_node_type_t.DOM_NODE_TYPE_TEXT;
alias DOM_NODE_TYPE_CDATA_SECTION = cef_dom_node_type_t.DOM_NODE_TYPE_CDATA_SECTION;
alias DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS = cef_dom_node_type_t.DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS;
alias DOM_NODE_TYPE_COMMENT = cef_dom_node_type_t.DOM_NODE_TYPE_COMMENT;
alias DOM_NODE_TYPE_DOCUMENT = cef_dom_node_type_t.DOM_NODE_TYPE_DOCUMENT;
alias DOM_NODE_TYPE_DOCUMENT_TYPE = cef_dom_node_type_t.DOM_NODE_TYPE_DOCUMENT_TYPE;
alias DOM_NODE_TYPE_DOCUMENT_FRAGMENT = cef_dom_node_type_t.DOM_NODE_TYPE_DOCUMENT_FRAGMENT;

///
/// DOM form control types. Should be kept in sync with Chromium's
/// blink::mojom::FormControlType type.
///
enum cef_dom_form_control_type_t
{
    DOM_FORM_CONTROL_TYPE_UNSUPPORTED = 0,
    DOM_FORM_CONTROL_TYPE_BUTTON_BUTTON = 1,
    DOM_FORM_CONTROL_TYPE_BUTTON_SUBMIT = 2,
    DOM_FORM_CONTROL_TYPE_BUTTON_RESET = 3,
    DOM_FORM_CONTROL_TYPE_BUTTON_SELECT_LIST = 4,
    DOM_FORM_CONTROL_TYPE_BUTTON_POPOVER = 5,
    DOM_FORM_CONTROL_TYPE_FIELDSET = 6,
    DOM_FORM_CONTROL_TYPE_INPUT_BUTTON = 7,
    DOM_FORM_CONTROL_TYPE_INPUT_CHECKBOX = 8,
    DOM_FORM_CONTROL_TYPE_INPUT_COLOR = 9,
    DOM_FORM_CONTROL_TYPE_INPUT_DATE = 10,
    DOM_FORM_CONTROL_TYPE_INPUT_DATETIME_LOCAL = 11,
    DOM_FORM_CONTROL_TYPE_INPUT_EMAIL = 12,
    DOM_FORM_CONTROL_TYPE_INPUT_FILE = 13,
    DOM_FORM_CONTROL_TYPE_INPUT_HIDDEN = 14,
    DOM_FORM_CONTROL_TYPE_INPUT_IMAGE = 15,
    DOM_FORM_CONTROL_TYPE_INPUT_MONTH = 16,
    DOM_FORM_CONTROL_TYPE_INPUT_NUMBER = 17,
    DOM_FORM_CONTROL_TYPE_INPUT_PASSWORD = 18,
    DOM_FORM_CONTROL_TYPE_INPUT_RADIO = 19,
    DOM_FORM_CONTROL_TYPE_INPUT_RANGE = 20,
    DOM_FORM_CONTROL_TYPE_INPUT_RESET = 21,
    DOM_FORM_CONTROL_TYPE_INPUT_SEARCH = 22,
    DOM_FORM_CONTROL_TYPE_INPUT_SUBMIT = 23,
    DOM_FORM_CONTROL_TYPE_INPUT_TELEPHONE = 24,
    DOM_FORM_CONTROL_TYPE_INPUT_TEXT = 25,
    DOM_FORM_CONTROL_TYPE_INPUT_TIME = 26,
    DOM_FORM_CONTROL_TYPE_INPUT_URL = 27,
    DOM_FORM_CONTROL_TYPE_INPUT_WEEK = 28,
    DOM_FORM_CONTROL_TYPE_OUTPUT = 29,
    DOM_FORM_CONTROL_TYPE_SELECT_ONE = 30,
    DOM_FORM_CONTROL_TYPE_SELECT_MULTIPLE = 31,
    DOM_FORM_CONTROL_TYPE_SELECT_LIST = 32,
    DOM_FORM_CONTROL_TYPE_TEXT_AREA = 33
}

alias DOM_FORM_CONTROL_TYPE_UNSUPPORTED = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_UNSUPPORTED;
alias DOM_FORM_CONTROL_TYPE_BUTTON_BUTTON = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_BUTTON_BUTTON;
alias DOM_FORM_CONTROL_TYPE_BUTTON_SUBMIT = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_BUTTON_SUBMIT;
alias DOM_FORM_CONTROL_TYPE_BUTTON_RESET = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_BUTTON_RESET;
alias DOM_FORM_CONTROL_TYPE_BUTTON_SELECT_LIST = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_BUTTON_SELECT_LIST;
alias DOM_FORM_CONTROL_TYPE_BUTTON_POPOVER = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_BUTTON_POPOVER;
alias DOM_FORM_CONTROL_TYPE_FIELDSET = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_FIELDSET;
alias DOM_FORM_CONTROL_TYPE_INPUT_BUTTON = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_BUTTON;
alias DOM_FORM_CONTROL_TYPE_INPUT_CHECKBOX = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_CHECKBOX;
alias DOM_FORM_CONTROL_TYPE_INPUT_COLOR = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_COLOR;
alias DOM_FORM_CONTROL_TYPE_INPUT_DATE = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_DATE;
alias DOM_FORM_CONTROL_TYPE_INPUT_DATETIME_LOCAL = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_DATETIME_LOCAL;
alias DOM_FORM_CONTROL_TYPE_INPUT_EMAIL = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_EMAIL;
alias DOM_FORM_CONTROL_TYPE_INPUT_FILE = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_FILE;
alias DOM_FORM_CONTROL_TYPE_INPUT_HIDDEN = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_HIDDEN;
alias DOM_FORM_CONTROL_TYPE_INPUT_IMAGE = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_IMAGE;
alias DOM_FORM_CONTROL_TYPE_INPUT_MONTH = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_MONTH;
alias DOM_FORM_CONTROL_TYPE_INPUT_NUMBER = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_NUMBER;
alias DOM_FORM_CONTROL_TYPE_INPUT_PASSWORD = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_PASSWORD;
alias DOM_FORM_CONTROL_TYPE_INPUT_RADIO = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_RADIO;
alias DOM_FORM_CONTROL_TYPE_INPUT_RANGE = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_RANGE;
alias DOM_FORM_CONTROL_TYPE_INPUT_RESET = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_RESET;
alias DOM_FORM_CONTROL_TYPE_INPUT_SEARCH = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_SEARCH;
alias DOM_FORM_CONTROL_TYPE_INPUT_SUBMIT = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_SUBMIT;
alias DOM_FORM_CONTROL_TYPE_INPUT_TELEPHONE = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_TELEPHONE;
alias DOM_FORM_CONTROL_TYPE_INPUT_TEXT = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_TEXT;
alias DOM_FORM_CONTROL_TYPE_INPUT_TIME = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_TIME;
alias DOM_FORM_CONTROL_TYPE_INPUT_URL = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_URL;
alias DOM_FORM_CONTROL_TYPE_INPUT_WEEK = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_INPUT_WEEK;
alias DOM_FORM_CONTROL_TYPE_OUTPUT = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_OUTPUT;
alias DOM_FORM_CONTROL_TYPE_SELECT_ONE = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_SELECT_ONE;
alias DOM_FORM_CONTROL_TYPE_SELECT_MULTIPLE = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_SELECT_MULTIPLE;
alias DOM_FORM_CONTROL_TYPE_SELECT_LIST = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_SELECT_LIST;
alias DOM_FORM_CONTROL_TYPE_TEXT_AREA = cef_dom_form_control_type_t.DOM_FORM_CONTROL_TYPE_TEXT_AREA;

///
/// Supported file dialog modes.
///
enum cef_file_dialog_mode_t
{
    ///
    /// Requires that the file exists before allowing the user to pick it.
    ///
    FILE_DIALOG_OPEN = 0,

    ///
    /// Like Open, but allows picking multiple files to open.
    ///
    FILE_DIALOG_OPEN_MULTIPLE = 1,

    ///
    /// Like Open, but selects a folder to open.
    ///
    FILE_DIALOG_OPEN_FOLDER = 2,

    ///
    /// Allows picking a nonexistent file, and prompts to overwrite if the file
    /// already exists.
    ///
    FILE_DIALOG_SAVE = 3
}

alias FILE_DIALOG_OPEN = cef_file_dialog_mode_t.FILE_DIALOG_OPEN;
alias FILE_DIALOG_OPEN_MULTIPLE = cef_file_dialog_mode_t.FILE_DIALOG_OPEN_MULTIPLE;
alias FILE_DIALOG_OPEN_FOLDER = cef_file_dialog_mode_t.FILE_DIALOG_OPEN_FOLDER;
alias FILE_DIALOG_SAVE = cef_file_dialog_mode_t.FILE_DIALOG_SAVE;

///
/// Print job color mode values.
///
enum cef_color_model_t
{
    COLOR_MODEL_UNKNOWN = 0,
    COLOR_MODEL_GRAY = 1,
    COLOR_MODEL_COLOR = 2,
    COLOR_MODEL_CMYK = 3,
    COLOR_MODEL_CMY = 4,
    COLOR_MODEL_KCMY = 5,
    COLOR_MODEL_CMY_K = 6, // CMY_K represents CMY+K.
    COLOR_MODEL_BLACK = 7,
    COLOR_MODEL_GRAYSCALE = 8,
    COLOR_MODEL_RGB = 9,
    COLOR_MODEL_RGB16 = 10,
    COLOR_MODEL_RGBA = 11,
    COLOR_MODEL_COLORMODE_COLOR = 12, // Used in samsung printer ppds.
    COLOR_MODEL_COLORMODE_MONOCHROME = 13, // Used in samsung printer ppds.
    COLOR_MODEL_HP_COLOR_COLOR = 14, // Used in HP color printer ppds.
    COLOR_MODEL_HP_COLOR_BLACK = 15, // Used in HP color printer ppds.
    COLOR_MODEL_PRINTOUTMODE_NORMAL = 16, // Used in foomatic ppds.
    COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY = 17, // Used in foomatic ppds.
    COLOR_MODEL_PROCESSCOLORMODEL_CMYK = 18, // Used in canon printer ppds.
    COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE = 19, // Used in canon printer ppds.
    COLOR_MODEL_PROCESSCOLORMODEL_RGB = 20 // Used in canon printer ppds
}

alias COLOR_MODEL_UNKNOWN = cef_color_model_t.COLOR_MODEL_UNKNOWN;
alias COLOR_MODEL_GRAY = cef_color_model_t.COLOR_MODEL_GRAY;
alias COLOR_MODEL_COLOR = cef_color_model_t.COLOR_MODEL_COLOR;
alias COLOR_MODEL_CMYK = cef_color_model_t.COLOR_MODEL_CMYK;
alias COLOR_MODEL_CMY = cef_color_model_t.COLOR_MODEL_CMY;
alias COLOR_MODEL_KCMY = cef_color_model_t.COLOR_MODEL_KCMY;
alias COLOR_MODEL_CMY_K = cef_color_model_t.COLOR_MODEL_CMY_K;
alias COLOR_MODEL_BLACK = cef_color_model_t.COLOR_MODEL_BLACK;
alias COLOR_MODEL_GRAYSCALE = cef_color_model_t.COLOR_MODEL_GRAYSCALE;
alias COLOR_MODEL_RGB = cef_color_model_t.COLOR_MODEL_RGB;
alias COLOR_MODEL_RGB16 = cef_color_model_t.COLOR_MODEL_RGB16;
alias COLOR_MODEL_RGBA = cef_color_model_t.COLOR_MODEL_RGBA;
alias COLOR_MODEL_COLORMODE_COLOR = cef_color_model_t.COLOR_MODEL_COLORMODE_COLOR;
alias COLOR_MODEL_COLORMODE_MONOCHROME = cef_color_model_t.COLOR_MODEL_COLORMODE_MONOCHROME;
alias COLOR_MODEL_HP_COLOR_COLOR = cef_color_model_t.COLOR_MODEL_HP_COLOR_COLOR;
alias COLOR_MODEL_HP_COLOR_BLACK = cef_color_model_t.COLOR_MODEL_HP_COLOR_BLACK;
alias COLOR_MODEL_PRINTOUTMODE_NORMAL = cef_color_model_t.COLOR_MODEL_PRINTOUTMODE_NORMAL;
alias COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY = cef_color_model_t.COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY;
alias COLOR_MODEL_PROCESSCOLORMODEL_CMYK = cef_color_model_t.COLOR_MODEL_PROCESSCOLORMODEL_CMYK;
alias COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE = cef_color_model_t.COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE;
alias COLOR_MODEL_PROCESSCOLORMODEL_RGB = cef_color_model_t.COLOR_MODEL_PROCESSCOLORMODEL_RGB;

///
/// Print job duplex mode values.
///
enum cef_duplex_mode_t
{
    DUPLEX_MODE_UNKNOWN = -1,
    DUPLEX_MODE_SIMPLEX = 0,
    DUPLEX_MODE_LONG_EDGE = 1,
    DUPLEX_MODE_SHORT_EDGE = 2
}

alias DUPLEX_MODE_UNKNOWN = cef_duplex_mode_t.DUPLEX_MODE_UNKNOWN;
alias DUPLEX_MODE_SIMPLEX = cef_duplex_mode_t.DUPLEX_MODE_SIMPLEX;
alias DUPLEX_MODE_LONG_EDGE = cef_duplex_mode_t.DUPLEX_MODE_LONG_EDGE;
alias DUPLEX_MODE_SHORT_EDGE = cef_duplex_mode_t.DUPLEX_MODE_SHORT_EDGE;

///
/// Cursor type values.
///
enum cef_cursor_type_t
{
    CT_POINTER = 0,
    CT_CROSS = 1,
    CT_HAND = 2,
    CT_IBEAM = 3,
    CT_WAIT = 4,
    CT_HELP = 5,
    CT_EASTRESIZE = 6,
    CT_NORTHRESIZE = 7,
    CT_NORTHEASTRESIZE = 8,
    CT_NORTHWESTRESIZE = 9,
    CT_SOUTHRESIZE = 10,
    CT_SOUTHEASTRESIZE = 11,
    CT_SOUTHWESTRESIZE = 12,
    CT_WESTRESIZE = 13,
    CT_NORTHSOUTHRESIZE = 14,
    CT_EASTWESTRESIZE = 15,
    CT_NORTHEASTSOUTHWESTRESIZE = 16,
    CT_NORTHWESTSOUTHEASTRESIZE = 17,
    CT_COLUMNRESIZE = 18,
    CT_ROWRESIZE = 19,
    CT_MIDDLEPANNING = 20,
    CT_EASTPANNING = 21,
    CT_NORTHPANNING = 22,
    CT_NORTHEASTPANNING = 23,
    CT_NORTHWESTPANNING = 24,
    CT_SOUTHPANNING = 25,
    CT_SOUTHEASTPANNING = 26,
    CT_SOUTHWESTPANNING = 27,
    CT_WESTPANNING = 28,
    CT_MOVE = 29,
    CT_VERTICALTEXT = 30,
    CT_CELL = 31,
    CT_CONTEXTMENU = 32,
    CT_ALIAS = 33,
    CT_PROGRESS = 34,
    CT_NODROP = 35,
    CT_COPY = 36,
    CT_NONE = 37,
    CT_NOTALLOWED = 38,
    CT_ZOOMIN = 39,
    CT_ZOOMOUT = 40,
    CT_GRAB = 41,
    CT_GRABBING = 42,
    CT_MIDDLE_PANNING_VERTICAL = 43,
    CT_MIDDLE_PANNING_HORIZONTAL = 44,
    CT_CUSTOM = 45,
    CT_DND_NONE = 46,
    CT_DND_MOVE = 47,
    CT_DND_COPY = 48,
    CT_DND_LINK = 49
}

alias CT_POINTER = cef_cursor_type_t.CT_POINTER;
alias CT_CROSS = cef_cursor_type_t.CT_CROSS;
alias CT_HAND = cef_cursor_type_t.CT_HAND;
alias CT_IBEAM = cef_cursor_type_t.CT_IBEAM;
alias CT_WAIT = cef_cursor_type_t.CT_WAIT;
alias CT_HELP = cef_cursor_type_t.CT_HELP;
alias CT_EASTRESIZE = cef_cursor_type_t.CT_EASTRESIZE;
alias CT_NORTHRESIZE = cef_cursor_type_t.CT_NORTHRESIZE;
alias CT_NORTHEASTRESIZE = cef_cursor_type_t.CT_NORTHEASTRESIZE;
alias CT_NORTHWESTRESIZE = cef_cursor_type_t.CT_NORTHWESTRESIZE;
alias CT_SOUTHRESIZE = cef_cursor_type_t.CT_SOUTHRESIZE;
alias CT_SOUTHEASTRESIZE = cef_cursor_type_t.CT_SOUTHEASTRESIZE;
alias CT_SOUTHWESTRESIZE = cef_cursor_type_t.CT_SOUTHWESTRESIZE;
alias CT_WESTRESIZE = cef_cursor_type_t.CT_WESTRESIZE;
alias CT_NORTHSOUTHRESIZE = cef_cursor_type_t.CT_NORTHSOUTHRESIZE;
alias CT_EASTWESTRESIZE = cef_cursor_type_t.CT_EASTWESTRESIZE;
alias CT_NORTHEASTSOUTHWESTRESIZE = cef_cursor_type_t.CT_NORTHEASTSOUTHWESTRESIZE;
alias CT_NORTHWESTSOUTHEASTRESIZE = cef_cursor_type_t.CT_NORTHWESTSOUTHEASTRESIZE;
alias CT_COLUMNRESIZE = cef_cursor_type_t.CT_COLUMNRESIZE;
alias CT_ROWRESIZE = cef_cursor_type_t.CT_ROWRESIZE;
alias CT_MIDDLEPANNING = cef_cursor_type_t.CT_MIDDLEPANNING;
alias CT_EASTPANNING = cef_cursor_type_t.CT_EASTPANNING;
alias CT_NORTHPANNING = cef_cursor_type_t.CT_NORTHPANNING;
alias CT_NORTHEASTPANNING = cef_cursor_type_t.CT_NORTHEASTPANNING;
alias CT_NORTHWESTPANNING = cef_cursor_type_t.CT_NORTHWESTPANNING;
alias CT_SOUTHPANNING = cef_cursor_type_t.CT_SOUTHPANNING;
alias CT_SOUTHEASTPANNING = cef_cursor_type_t.CT_SOUTHEASTPANNING;
alias CT_SOUTHWESTPANNING = cef_cursor_type_t.CT_SOUTHWESTPANNING;
alias CT_WESTPANNING = cef_cursor_type_t.CT_WESTPANNING;
alias CT_MOVE = cef_cursor_type_t.CT_MOVE;
alias CT_VERTICALTEXT = cef_cursor_type_t.CT_VERTICALTEXT;
alias CT_CELL = cef_cursor_type_t.CT_CELL;
alias CT_CONTEXTMENU = cef_cursor_type_t.CT_CONTEXTMENU;
alias CT_ALIAS = cef_cursor_type_t.CT_ALIAS;
alias CT_PROGRESS = cef_cursor_type_t.CT_PROGRESS;
alias CT_NODROP = cef_cursor_type_t.CT_NODROP;
alias CT_COPY = cef_cursor_type_t.CT_COPY;
alias CT_NONE = cef_cursor_type_t.CT_NONE;
alias CT_NOTALLOWED = cef_cursor_type_t.CT_NOTALLOWED;
alias CT_ZOOMIN = cef_cursor_type_t.CT_ZOOMIN;
alias CT_ZOOMOUT = cef_cursor_type_t.CT_ZOOMOUT;
alias CT_GRAB = cef_cursor_type_t.CT_GRAB;
alias CT_GRABBING = cef_cursor_type_t.CT_GRABBING;
alias CT_MIDDLE_PANNING_VERTICAL = cef_cursor_type_t.CT_MIDDLE_PANNING_VERTICAL;
alias CT_MIDDLE_PANNING_HORIZONTAL = cef_cursor_type_t.CT_MIDDLE_PANNING_HORIZONTAL;
alias CT_CUSTOM = cef_cursor_type_t.CT_CUSTOM;
alias CT_DND_NONE = cef_cursor_type_t.CT_DND_NONE;
alias CT_DND_MOVE = cef_cursor_type_t.CT_DND_MOVE;
alias CT_DND_COPY = cef_cursor_type_t.CT_DND_COPY;
alias CT_DND_LINK = cef_cursor_type_t.CT_DND_LINK;

///
/// Structure representing cursor information. |buffer| will be
/// |size.width|*|size.height|*4 bytes in size and represents a BGRA image with
/// an upper-left origin.
///
struct cef_cursor_info_t
{

    cef_point_t hotspot;
    float image_scale_factor;
    void* buffer;

    cef_size_t size;
}



///
/// URI unescape rules passed to CefURIDecode().
///
enum cef_uri_unescape_rule_t
{
    ///
    /// Don't unescape anything at all.
    ///
    UU_NONE = 0,

    ///
    /// Don't unescape anything special, but all normal unescaping will happen.
    /// This is a placeholder and can't be combined with other flags (since it's
    /// just the absence of them). All other unescape rules imply "normal" in
    /// addition to their special meaning. Things like escaped letters, digits,
    /// and most symbols will get unescaped with this mode.
    ///
    UU_NORMAL = 1 << 0,

    ///
    /// Convert %20 to spaces. In some places where we're showing URLs, we may
    /// want this. In places where the URL may be copied and pasted out, then
    /// you wouldn't want this since it might not be interpreted in one piece
    /// by other applications.
    ///
    UU_SPACES = 1 << 1,

    ///
    /// Unescapes '/' and '\\'. If these characters were unescaped, the resulting
    /// URL won't be the same as the source one. Moreover, they are dangerous to
    /// unescape in strings that will be used as file paths or names. This value
    /// should only be used when slashes don't have special meaning, like data
    /// URLs.
    ///
    UU_PATH_SEPARATORS = 1 << 2,

    ///
    /// Unescapes various characters that will change the meaning of URLs,
    /// including '%', '+', '&', '#'. Does not unescape path separators.
    /// If these characters were unescaped, the resulting URL won't be the same
    /// as the source one. This flag is used when generating final output like
    /// filenames for URLs where we won't be interpreting as a URL and want to do
    /// as much unescaping as possible.
    ///
    UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = 1 << 3,

    ///
    /// URL queries use "+" for space. This flag controls that replacement.
    ///
    UU_REPLACE_PLUS_WITH_SPACE = 1 << 4
}

alias UU_NONE = cef_uri_unescape_rule_t.UU_NONE;
alias UU_NORMAL = cef_uri_unescape_rule_t.UU_NORMAL;
alias UU_SPACES = cef_uri_unescape_rule_t.UU_SPACES;
alias UU_PATH_SEPARATORS = cef_uri_unescape_rule_t.UU_PATH_SEPARATORS;
alias UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = cef_uri_unescape_rule_t.UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS;
alias UU_REPLACE_PLUS_WITH_SPACE = cef_uri_unescape_rule_t.UU_REPLACE_PLUS_WITH_SPACE;

///
/// Options that can be passed to CefParseJSON.
///
enum cef_json_parser_options_t
{
    ///
    /// Parses the input strictly according to RFC 4627. See comments in
    /// Chromium's base/json/json_reader.h file for known limitations/
    /// deviations from the RFC.
    ///
    JSON_PARSER_RFC = 0,

    ///
    /// Allows commas to exist after the last element in structures.
    ///
    JSON_PARSER_ALLOW_TRAILING_COMMAS = 1 << 0
}

alias JSON_PARSER_RFC = cef_json_parser_options_t.JSON_PARSER_RFC;
alias JSON_PARSER_ALLOW_TRAILING_COMMAS = cef_json_parser_options_t.JSON_PARSER_ALLOW_TRAILING_COMMAS;

///
/// Options that can be passed to CefWriteJSON.
///
enum cef_json_writer_options_t
{
    ///
    /// Default behavior.
    ///
    JSON_WRITER_DEFAULT = 0,

    ///
    /// This option instructs the writer that if a Binary value is encountered,
    /// the value (and key if within a dictionary) will be omitted from the
    /// output, and success will be returned. Otherwise, if a binary value is
    /// encountered, failure will be returned.
    ///
    JSON_WRITER_OMIT_BINARY_VALUES = 1 << 0,

    ///
    /// This option instructs the writer to write doubles that have no fractional
    /// part as a normal integer (i.e., without using exponential notation
    /// or appending a '.0') as long as the value is within the range of a
    /// 64-bit int.
    ///
    JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = 1 << 1,

    ///
    /// Return a slightly nicer formatted json string (pads with whitespace to
    /// help with readability).
    ///
    JSON_WRITER_PRETTY_PRINT = 1 << 2
}

alias JSON_WRITER_DEFAULT = cef_json_writer_options_t.JSON_WRITER_DEFAULT;
alias JSON_WRITER_OMIT_BINARY_VALUES = cef_json_writer_options_t.JSON_WRITER_OMIT_BINARY_VALUES;
alias JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = cef_json_writer_options_t.JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION;
alias JSON_WRITER_PRETTY_PRINT = cef_json_writer_options_t.JSON_WRITER_PRETTY_PRINT;

///
/// Margin type for PDF printing.
///
enum cef_pdf_print_margin_type_t
{
    ///
    /// Default margins of 1cm (~0.4 inches).
    ///
    PDF_PRINT_MARGIN_DEFAULT = 0,

    ///
    /// No margins.
    ///
    PDF_PRINT_MARGIN_NONE = 1,

    ///
    /// Custom margins using the |margin_*| values from cef_pdf_print_settings_t.
    ///
    PDF_PRINT_MARGIN_CUSTOM = 2
}

alias PDF_PRINT_MARGIN_DEFAULT = cef_pdf_print_margin_type_t.PDF_PRINT_MARGIN_DEFAULT;
alias PDF_PRINT_MARGIN_NONE = cef_pdf_print_margin_type_t.PDF_PRINT_MARGIN_NONE;
alias PDF_PRINT_MARGIN_CUSTOM = cef_pdf_print_margin_type_t.PDF_PRINT_MARGIN_CUSTOM;

///
/// Structure representing PDF print settings. These values match the parameters
/// supported by the DevTools Page.printToPDF function. See
/// https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF
///
struct cef_pdf_print_settings_t
{
    ///
    /// Set to true (1) for landscape mode or false (0) for portrait mode.
    ///
    int landscape;

    ///
    /// Set to true (1) to print background graphics.
    ///
    int print_background;

    ///
    /// The percentage to scale the PDF by before printing (e.g. .5 is 50%).
    /// If this value is less than or equal to zero the default value of 1.0
    /// will be used.
    ///
    double scale;

    ///
    /// Output paper size in inches. If either of these values is less than or
    /// equal to zero then the default paper size (letter, 8.5 x 11 inches) will
    /// be used.
    ///
    double paper_width;
    double paper_height;

    ///
    /// Set to true (1) to prefer page size as defined by css. Defaults to false
    /// (0), in which case the content will be scaled to fit the paper size.
    ///
    int prefer_css_page_size;

    ///
    /// Margin type.
    ///
    cef_pdf_print_margin_type_t margin_type;

    ///
    /// Margins in inches. Only used if |margin_type| is set to
    /// PDF_PRINT_MARGIN_CUSTOM.
    ///
    double margin_top;
    double margin_right;
    double margin_bottom;
    double margin_left;

    ///
    /// Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are printed
    /// in the document order, not in the order specified, and no more than once.
    /// Defaults to empty string, which implies the entire document is printed.
    /// The page numbers are quietly capped to actual page count of the document,
    /// and ranges beyond the end of the document are ignored. If this results in
    /// no pages to print, an error is reported. It is an error to specify a range
    /// with start greater than end.
    ///
    cef_string_t page_ranges;

    ///
    /// Set to true (1) to display the header and/or footer. Modify
    /// |header_template| and/or |footer_template| to customize the display.
    ///
    int display_header_footer;

    ///
    /// HTML template for the print header. Only displayed if
    /// |display_header_footer| is true (1). Should be valid HTML markup with
    /// the following classes used to inject printing values into them:
    ///
    /// - date: formatted print date
    /// - title: document title
    /// - url: document location
    /// - pageNumber: current page number
    /// - totalPages: total pages in the document
    ///
    /// For example, "<span class=title></span>" would generate a span containing
    /// the title.
    ///
    cef_string_t header_template;

    ///
    /// HTML template for the print footer. Only displayed if
    /// |display_header_footer| is true (1). Uses the same format as
    /// |header_template|.
    ///
    cef_string_t footer_template;

    ///
    /// Set to true (1) to generate tagged (accessible) PDF.
    ///
    int generate_tagged_pdf;

    ///
    /// Set to true (1) to generate a document outline.
    ///
    int generate_document_outline;
}



///
/// Supported UI scale factors for the platform. SCALE_FACTOR_NONE is used for
/// density independent resources such as string, html/js files or an image that
/// can be used for any scale factors (such as wallpapers).
///
enum cef_scale_factor_t
{
    SCALE_FACTOR_NONE = 0,
    SCALE_FACTOR_100P = 1,
    SCALE_FACTOR_125P = 2,
    SCALE_FACTOR_133P = 3,
    SCALE_FACTOR_140P = 4,
    SCALE_FACTOR_150P = 5,
    SCALE_FACTOR_180P = 6,
    SCALE_FACTOR_200P = 7,
    SCALE_FACTOR_250P = 8,
    SCALE_FACTOR_300P = 9
}

alias SCALE_FACTOR_NONE = cef_scale_factor_t.SCALE_FACTOR_NONE;
alias SCALE_FACTOR_100P = cef_scale_factor_t.SCALE_FACTOR_100P;
alias SCALE_FACTOR_125P = cef_scale_factor_t.SCALE_FACTOR_125P;
alias SCALE_FACTOR_133P = cef_scale_factor_t.SCALE_FACTOR_133P;
alias SCALE_FACTOR_140P = cef_scale_factor_t.SCALE_FACTOR_140P;
alias SCALE_FACTOR_150P = cef_scale_factor_t.SCALE_FACTOR_150P;
alias SCALE_FACTOR_180P = cef_scale_factor_t.SCALE_FACTOR_180P;
alias SCALE_FACTOR_200P = cef_scale_factor_t.SCALE_FACTOR_200P;
alias SCALE_FACTOR_250P = cef_scale_factor_t.SCALE_FACTOR_250P;
alias SCALE_FACTOR_300P = cef_scale_factor_t.SCALE_FACTOR_300P;

///
/// Policy for how the Referrer HTTP header value will be sent during
/// navigation. If the `--no-referrers` command-line flag is specified then the
/// policy value will be ignored and the Referrer value will never be sent. Must
/// be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium.
///
enum cef_referrer_policy_t
{
    ///
    /// Clear the referrer header if the header value is HTTPS but the request
    /// destination is HTTP. This is the default behavior.
    ///
    REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE = 0,
    REFERRER_POLICY_DEFAULT = REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,

    ///
    /// A slight variant on CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
    /// If the request destination is HTTP, an HTTPS referrer will be cleared. If
    /// the request's destination is cross-origin with the referrer (but does not
    /// downgrade), the referrer's granularity will be stripped down to an origin
    /// rather than a full URL. Same-origin requests will send the full referrer.
    ///
    REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN = 1,

    ///
    /// Strip the referrer down to an origin when the origin of the referrer is
    /// different from the destination's origin.
    ///
    REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN = 2,

    ///
    /// Never change the referrer.
    ///
    REFERRER_POLICY_NEVER_CLEAR_REFERRER = 3,

    ///
    /// Strip the referrer down to the origin regardless of the redirect location.
    ///
    REFERRER_POLICY_ORIGIN = 4,

    ///
    /// Clear the referrer when the request's referrer is cross-origin with the
    /// request's destination.
    ///
    REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN = 5,

    ///
    /// Strip the referrer down to the origin, but clear it entirely if the
    /// referrer value is HTTPS and the destination is HTTP.
    ///
    REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE = 6,

    ///
    /// Always clear the referrer regardless of the request destination.
    ///
    REFERRER_POLICY_NO_REFERRER = 7,

    /// Always the last value in this enumeration.
    REFERRER_POLICY_LAST_VALUE = REFERRER_POLICY_NO_REFERRER
}

alias REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE = cef_referrer_policy_t.REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
alias REFERRER_POLICY_DEFAULT = cef_referrer_policy_t.REFERRER_POLICY_DEFAULT;
alias REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN = cef_referrer_policy_t.REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN;
alias REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN = cef_referrer_policy_t.REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN;
alias REFERRER_POLICY_NEVER_CLEAR_REFERRER = cef_referrer_policy_t.REFERRER_POLICY_NEVER_CLEAR_REFERRER;
alias REFERRER_POLICY_ORIGIN = cef_referrer_policy_t.REFERRER_POLICY_ORIGIN;
alias REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN = cef_referrer_policy_t.REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN;
alias REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE = cef_referrer_policy_t.REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
alias REFERRER_POLICY_NO_REFERRER = cef_referrer_policy_t.REFERRER_POLICY_NO_REFERRER;
alias REFERRER_POLICY_LAST_VALUE = cef_referrer_policy_t.REFERRER_POLICY_LAST_VALUE;

///
/// Return values for CefResponseFilter::Filter().
///
enum cef_response_filter_status_t
{
    ///
    /// Some or all of the pre-filter data was read successfully but more data is
    /// needed in order to continue filtering (filtered output is pending).
    ///
    RESPONSE_FILTER_NEED_MORE_DATA = 0,

    ///
    /// Some or all of the pre-filter data was read successfully and all available
    /// filtered output has been written.
    ///
    RESPONSE_FILTER_DONE = 1,

    ///
    /// An error occurred during filtering.
    ///
    RESPONSE_FILTER_ERROR = 2
}

alias RESPONSE_FILTER_NEED_MORE_DATA = cef_response_filter_status_t.RESPONSE_FILTER_NEED_MORE_DATA;
alias RESPONSE_FILTER_DONE = cef_response_filter_status_t.RESPONSE_FILTER_DONE;
alias RESPONSE_FILTER_ERROR = cef_response_filter_status_t.RESPONSE_FILTER_ERROR;

///
/// Describes how to interpret the alpha component of a pixel.
///
enum cef_alpha_type_t
{
    ///
    /// No transparency. The alpha component is ignored.
    ///
    CEF_ALPHA_TYPE_OPAQUE = 0,

    ///
    /// Transparency with pre-multiplied alpha component.
    ///
    CEF_ALPHA_TYPE_PREMULTIPLIED = 1,

    ///
    /// Transparency with post-multiplied alpha component.
    ///
    CEF_ALPHA_TYPE_POSTMULTIPLIED = 2
}

alias CEF_ALPHA_TYPE_OPAQUE = cef_alpha_type_t.CEF_ALPHA_TYPE_OPAQUE;
alias CEF_ALPHA_TYPE_PREMULTIPLIED = cef_alpha_type_t.CEF_ALPHA_TYPE_PREMULTIPLIED;
alias CEF_ALPHA_TYPE_POSTMULTIPLIED = cef_alpha_type_t.CEF_ALPHA_TYPE_POSTMULTIPLIED;

///
/// Text style types. Should be kepy in sync with gfx::TextStyle.
///
enum cef_text_style_t
{
    CEF_TEXT_STYLE_BOLD = 0,
    CEF_TEXT_STYLE_ITALIC = 1,
    CEF_TEXT_STYLE_STRIKE = 2,
    CEF_TEXT_STYLE_DIAGONAL_STRIKE = 3,
    CEF_TEXT_STYLE_UNDERLINE = 4
}

alias CEF_TEXT_STYLE_BOLD = cef_text_style_t.CEF_TEXT_STYLE_BOLD;
alias CEF_TEXT_STYLE_ITALIC = cef_text_style_t.CEF_TEXT_STYLE_ITALIC;
alias CEF_TEXT_STYLE_STRIKE = cef_text_style_t.CEF_TEXT_STYLE_STRIKE;
alias CEF_TEXT_STYLE_DIAGONAL_STRIKE = cef_text_style_t.CEF_TEXT_STYLE_DIAGONAL_STRIKE;
alias CEF_TEXT_STYLE_UNDERLINE = cef_text_style_t.CEF_TEXT_STYLE_UNDERLINE;

///
/// Specifies where along the axis the CefBoxLayout child views should be laid
/// out. Should be kept in sync with Chromium's views::LayoutAlignment type.
///
enum cef_axis_alignment_t
{
    /// Child views will be left/top-aligned.
    CEF_AXIS_ALIGNMENT_START = 0,

    /// Child views will be center-aligned.
    CEF_AXIS_ALIGNMENT_CENTER = 1,

    /// Child views will be right/bottom-aligned.
    CEF_AXIS_ALIGNMENT_END = 2,

    /// Child views will be stretched to fit.
    CEF_AXIS_ALIGNMENT_STRETCH = 3
}

alias CEF_AXIS_ALIGNMENT_START = cef_axis_alignment_t.CEF_AXIS_ALIGNMENT_START;
alias CEF_AXIS_ALIGNMENT_CENTER = cef_axis_alignment_t.CEF_AXIS_ALIGNMENT_CENTER;
alias CEF_AXIS_ALIGNMENT_END = cef_axis_alignment_t.CEF_AXIS_ALIGNMENT_END;
alias CEF_AXIS_ALIGNMENT_STRETCH = cef_axis_alignment_t.CEF_AXIS_ALIGNMENT_STRETCH;

///
/// Settings used when initializing a CefBoxLayout.
///
struct cef_box_layout_settings_t
{
    ///
    /// If true (1) the layout will be horizontal, otherwise the layout will be
    /// vertical.
    ///
    int horizontal;

    ///
    /// Adds additional horizontal space between the child view area and the host
    /// view border.
    ///
    int inside_border_horizontal_spacing;

    ///
    /// Adds additional vertical space between the child view area and the host
    /// view border.
    ///
    int inside_border_vertical_spacing;

    ///
    /// Adds additional space around the child view area.
    ///

    cef_insets_t inside_border_insets;

    ///
    /// Adds additional space between child views.
    ///
    int between_child_spacing;

    ///
    /// Specifies where along the main axis the child views should be laid out.
    ///
    cef_axis_alignment_t main_axis_alignment;

    ///
    /// Specifies where along the cross axis the child views should be laid out.
    ///
    cef_axis_alignment_t cross_axis_alignment;

    ///
    /// Minimum cross axis size.
    ///
    int minimum_cross_axis_size;

    ///
    /// Default flex for views when none is specified via CefBoxLayout methods.
    /// Using the preferred size as the basis, free space along the main axis is
    /// distributed to views in the ratio of their flex weights. Similarly, if the
    /// views will overflow the parent, space is subtracted in these ratios. A
    /// flex of 0 means this view is not resized. Flex values must not be
    /// negative.
    ///
    int default_flex;
}



///
/// Specifies the button display state.
///
enum cef_button_state_t
{
    CEF_BUTTON_STATE_NORMAL = 0,
    CEF_BUTTON_STATE_HOVERED = 1,
    CEF_BUTTON_STATE_PRESSED = 2,
    CEF_BUTTON_STATE_DISABLED = 3
}

alias CEF_BUTTON_STATE_NORMAL = cef_button_state_t.CEF_BUTTON_STATE_NORMAL;
alias CEF_BUTTON_STATE_HOVERED = cef_button_state_t.CEF_BUTTON_STATE_HOVERED;
alias CEF_BUTTON_STATE_PRESSED = cef_button_state_t.CEF_BUTTON_STATE_PRESSED;
alias CEF_BUTTON_STATE_DISABLED = cef_button_state_t.CEF_BUTTON_STATE_DISABLED;

///
/// Specifies the horizontal text alignment mode.
///
enum cef_horizontal_alignment_t
{
    ///
    /// Align the text's left edge with that of its display area.
    ///
    CEF_HORIZONTAL_ALIGNMENT_LEFT = 0,

    ///
    /// Align the text's center with that of its display area.
    ///
    CEF_HORIZONTAL_ALIGNMENT_CENTER = 1,

    ///
    /// Align the text's right edge with that of its display area.
    ///
    CEF_HORIZONTAL_ALIGNMENT_RIGHT = 2
}

alias CEF_HORIZONTAL_ALIGNMENT_LEFT = cef_horizontal_alignment_t.CEF_HORIZONTAL_ALIGNMENT_LEFT;
alias CEF_HORIZONTAL_ALIGNMENT_CENTER = cef_horizontal_alignment_t.CEF_HORIZONTAL_ALIGNMENT_CENTER;
alias CEF_HORIZONTAL_ALIGNMENT_RIGHT = cef_horizontal_alignment_t.CEF_HORIZONTAL_ALIGNMENT_RIGHT;

///
/// Specifies how a menu will be anchored for non-RTL languages. The opposite
/// position will be used for RTL languages.
///
enum cef_menu_anchor_position_t
{
    CEF_MENU_ANCHOR_TOPLEFT = 0,
    CEF_MENU_ANCHOR_TOPRIGHT = 1,
    CEF_MENU_ANCHOR_BOTTOMCENTER = 2
}

alias CEF_MENU_ANCHOR_TOPLEFT = cef_menu_anchor_position_t.CEF_MENU_ANCHOR_TOPLEFT;
alias CEF_MENU_ANCHOR_TOPRIGHT = cef_menu_anchor_position_t.CEF_MENU_ANCHOR_TOPRIGHT;
alias CEF_MENU_ANCHOR_BOTTOMCENTER = cef_menu_anchor_position_t.CEF_MENU_ANCHOR_BOTTOMCENTER;

///
/// Supported color types for menu items.
///
enum cef_menu_color_type_t
{
    CEF_MENU_COLOR_TEXT = 0,
    CEF_MENU_COLOR_TEXT_HOVERED = 1,
    CEF_MENU_COLOR_TEXT_ACCELERATOR = 2,
    CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED = 3,
    CEF_MENU_COLOR_BACKGROUND = 4,
    CEF_MENU_COLOR_BACKGROUND_HOVERED = 5,
    CEF_MENU_COLOR_COUNT = 6
}

alias CEF_MENU_COLOR_TEXT = cef_menu_color_type_t.CEF_MENU_COLOR_TEXT;
alias CEF_MENU_COLOR_TEXT_HOVERED = cef_menu_color_type_t.CEF_MENU_COLOR_TEXT_HOVERED;
alias CEF_MENU_COLOR_TEXT_ACCELERATOR = cef_menu_color_type_t.CEF_MENU_COLOR_TEXT_ACCELERATOR;
alias CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED = cef_menu_color_type_t.CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED;
alias CEF_MENU_COLOR_BACKGROUND = cef_menu_color_type_t.CEF_MENU_COLOR_BACKGROUND;
alias CEF_MENU_COLOR_BACKGROUND_HOVERED = cef_menu_color_type_t.CEF_MENU_COLOR_BACKGROUND_HOVERED;
alias CEF_MENU_COLOR_COUNT = cef_menu_color_type_t.CEF_MENU_COLOR_COUNT;

/// Supported SSL version values. See net/ssl/ssl_connection_status_flags.h
/// for more information.
enum cef_ssl_version_t
{
    SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version.
    SSL_CONNECTION_VERSION_SSL2 = 1,
    SSL_CONNECTION_VERSION_SSL3 = 2,
    SSL_CONNECTION_VERSION_TLS1 = 3,
    SSL_CONNECTION_VERSION_TLS1_1 = 4,
    SSL_CONNECTION_VERSION_TLS1_2 = 5,
    SSL_CONNECTION_VERSION_TLS1_3 = 6,
    SSL_CONNECTION_VERSION_QUIC = 7
}

alias SSL_CONNECTION_VERSION_UNKNOWN = cef_ssl_version_t.SSL_CONNECTION_VERSION_UNKNOWN;
alias SSL_CONNECTION_VERSION_SSL2 = cef_ssl_version_t.SSL_CONNECTION_VERSION_SSL2;
alias SSL_CONNECTION_VERSION_SSL3 = cef_ssl_version_t.SSL_CONNECTION_VERSION_SSL3;
alias SSL_CONNECTION_VERSION_TLS1 = cef_ssl_version_t.SSL_CONNECTION_VERSION_TLS1;
alias SSL_CONNECTION_VERSION_TLS1_1 = cef_ssl_version_t.SSL_CONNECTION_VERSION_TLS1_1;
alias SSL_CONNECTION_VERSION_TLS1_2 = cef_ssl_version_t.SSL_CONNECTION_VERSION_TLS1_2;
alias SSL_CONNECTION_VERSION_TLS1_3 = cef_ssl_version_t.SSL_CONNECTION_VERSION_TLS1_3;
alias SSL_CONNECTION_VERSION_QUIC = cef_ssl_version_t.SSL_CONNECTION_VERSION_QUIC;

/// Supported SSL content status flags. See content/public/common/ssl_status.h
/// for more information.
enum cef_ssl_content_status_t
{
    SSL_CONTENT_NORMAL_CONTENT = 0,
    SSL_CONTENT_DISPLAYED_INSECURE_CONTENT = 1 << 0,
    SSL_CONTENT_RAN_INSECURE_CONTENT = 1 << 1
}

alias SSL_CONTENT_NORMAL_CONTENT = cef_ssl_content_status_t.SSL_CONTENT_NORMAL_CONTENT;
alias SSL_CONTENT_DISPLAYED_INSECURE_CONTENT = cef_ssl_content_status_t.SSL_CONTENT_DISPLAYED_INSECURE_CONTENT;
alias SSL_CONTENT_RAN_INSECURE_CONTENT = cef_ssl_content_status_t.SSL_CONTENT_RAN_INSECURE_CONTENT;

//
/// Configuration options for registering a custom scheme.
/// These values are used when calling AddCustomScheme.
//
enum cef_scheme_options_t
{
    CEF_SCHEME_OPTION_NONE = 0,

    ///
    /// If CEF_SCHEME_OPTION_STANDARD is set the scheme will be treated as a
    /// standard scheme. Standard schemes are subject to URL canonicalization and
    /// parsing rules as defined in the Common Internet Scheme Syntax RFC 1738
    /// Section 3.1 available at http://www.ietf.org/rfc/rfc1738.txt
    //
    /// In particular, the syntax for standard scheme URLs must be of the form:
    /// <pre>
    ///  [scheme]://[username]:[password]@[host]:[port]/[url-path]
    /// </pre> Standard scheme URLs must have a host component that is a fully
    /// qualified domain name as defined in Section 3.5 of RFC 1034 [13] and
    /// Section 2.1 of RFC 1123. These URLs will be canonicalized to
    /// "scheme://host/path" in the simplest case and
    /// "scheme://username:password@host:port/path" in the most explicit case. For
    /// example, "scheme:host/path" and "scheme:///host/path" will both be
    /// canonicalized to "scheme://host/path". The origin of a standard scheme URL
    /// is the combination of scheme, host and port (i.e., "scheme://host:port" in
    /// the most explicit case).
    //
    /// For non-standard scheme URLs only the "scheme:" component is parsed and
    /// canonicalized. The remainder of the URL will be passed to the handler as-
    /// is. For example, "scheme:///some%20text" will remain the same.
    /// Non-standard scheme URLs cannot be used as a target for form submission.
    ///
    CEF_SCHEME_OPTION_STANDARD = 1 << 0,

    ///
    /// If CEF_SCHEME_OPTION_LOCAL is set the scheme will be treated with the same
    /// security rules as those applied to "file" URLs. Normal pages cannot link
    /// to or access local URLs. Also, by default, local URLs can only perform
    /// XMLHttpRequest calls to the same URL (origin + path) that originated the
    /// request. To allow XMLHttpRequest calls from a local URL to other URLs with
    /// the same origin set the CefSettings.file_access_from_file_urls_allowed
    /// value to true (1). To allow XMLHttpRequest calls from a local URL to all
    /// origins set the CefSettings.universal_access_from_file_urls_allowed value
    /// to true (1).
    ///
    CEF_SCHEME_OPTION_LOCAL = 1 << 1,

    ///
    /// If CEF_SCHEME_OPTION_DISPLAY_ISOLATED is set the scheme can only be
    /// displayed from other content hosted with the same scheme. For example,
    /// pages in other origins cannot create iframes or hyperlinks to URLs with
    /// the scheme. For schemes that must be accessible from other schemes don't
    /// set this, set CEF_SCHEME_OPTION_CORS_ENABLED, and use CORS
    /// "Access-Control-Allow-Origin" headers to further restrict access.
    ///
    CEF_SCHEME_OPTION_DISPLAY_ISOLATED = 1 << 2,

    ///
    /// If CEF_SCHEME_OPTION_SECURE is set the scheme will be treated with the
    /// same security rules as those applied to "https" URLs. For example, loading
    /// this scheme from other secure schemes will not trigger mixed content
    /// warnings.
    ///
    CEF_SCHEME_OPTION_SECURE = 1 << 3,

    ///
    /// If CEF_SCHEME_OPTION_CORS_ENABLED is set the scheme can be sent CORS
    /// requests. This value should be set in most cases where
    /// CEF_SCHEME_OPTION_STANDARD is set.
    ///
    CEF_SCHEME_OPTION_CORS_ENABLED = 1 << 4,

    ///
    /// If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content-
    /// Security-Policy (CSP) checks. This value should not be set in most cases
    /// where CEF_SCHEME_OPTION_STANDARD is set.
    ///
    CEF_SCHEME_OPTION_CSP_BYPASSING = 1 << 5,

    ///
    /// If CEF_SCHEME_OPTION_FETCH_ENABLED is set the scheme can perform Fetch API
    /// requests.
    ///
    CEF_SCHEME_OPTION_FETCH_ENABLED = 1 << 6
}

alias CEF_SCHEME_OPTION_NONE = cef_scheme_options_t.CEF_SCHEME_OPTION_NONE;
alias CEF_SCHEME_OPTION_STANDARD = cef_scheme_options_t.CEF_SCHEME_OPTION_STANDARD;
alias CEF_SCHEME_OPTION_LOCAL = cef_scheme_options_t.CEF_SCHEME_OPTION_LOCAL;
alias CEF_SCHEME_OPTION_DISPLAY_ISOLATED = cef_scheme_options_t.CEF_SCHEME_OPTION_DISPLAY_ISOLATED;
alias CEF_SCHEME_OPTION_SECURE = cef_scheme_options_t.CEF_SCHEME_OPTION_SECURE;
alias CEF_SCHEME_OPTION_CORS_ENABLED = cef_scheme_options_t.CEF_SCHEME_OPTION_CORS_ENABLED;
alias CEF_SCHEME_OPTION_CSP_BYPASSING = cef_scheme_options_t.CEF_SCHEME_OPTION_CSP_BYPASSING;
alias CEF_SCHEME_OPTION_FETCH_ENABLED = cef_scheme_options_t.CEF_SCHEME_OPTION_FETCH_ENABLED;

///
/// Structure representing a range.
///
struct cef_range_t
{
    uint from;
    uint to;
}



///
/// Composition underline style.
///
enum cef_composition_underline_style_t
{
    CEF_CUS_SOLID = 0,
    CEF_CUS_DOT = 1,
    CEF_CUS_DASH = 2,
    CEF_CUS_NONE = 3
}

alias CEF_CUS_SOLID = cef_composition_underline_style_t.CEF_CUS_SOLID;
alias CEF_CUS_DOT = cef_composition_underline_style_t.CEF_CUS_DOT;
alias CEF_CUS_DASH = cef_composition_underline_style_t.CEF_CUS_DASH;
alias CEF_CUS_NONE = cef_composition_underline_style_t.CEF_CUS_NONE;

///
/// Structure representing IME composition underline information. This is a thin
/// wrapper around Blink's WebCompositionUnderline class and should be kept in
/// sync with that.
///
struct cef_composition_underline_t
{
    ///
    /// Underline character range.
    ///
    cef_range_t range;

    ///
    /// Text color.
    ///
    cef_color_t color;

    ///
    /// Background color.
    ///
    cef_color_t background_color;

    ///
    /// Set to true (1) for thick underline.
    ///
    int thick;

    ///
    /// Style.
    ///
    cef_composition_underline_style_t style;
}



///
/// Enumerates the various representations of the ordering of audio channels.
/// Must be kept synchronized with media::ChannelLayout from Chromium.
/// See media\base\channel_layout.h
///
enum cef_channel_layout_t
{
    CEF_CHANNEL_LAYOUT_NONE = 0,
    CEF_CHANNEL_LAYOUT_UNSUPPORTED = 1,

    /// Front C
    CEF_CHANNEL_LAYOUT_MONO = 2,

    /// Front L, Front R
    CEF_CHANNEL_LAYOUT_STEREO = 3,

    /// Front L, Front R, Back C
    CEF_CHANNEL_LAYOUT_2_1 = 4,

    /// Front L, Front R, Front C
    CEF_CHANNEL_LAYOUT_SURROUND = 5,

    /// Front L, Front R, Front C, Back C
    CEF_CHANNEL_LAYOUT_4_0 = 6,

    /// Front L, Front R, Side L, Side R
    CEF_CHANNEL_LAYOUT_2_2 = 7,

    /// Front L, Front R, Back L, Back R
    CEF_CHANNEL_LAYOUT_QUAD = 8,

    /// Front L, Front R, Front C, Side L, Side R
    CEF_CHANNEL_LAYOUT_5_0 = 9,

    /// Front L, Front R, Front C, LFE, Side L, Side R
    CEF_CHANNEL_LAYOUT_5_1 = 10,

    /// Front L, Front R, Front C, Back L, Back R
    CEF_CHANNEL_LAYOUT_5_0_BACK = 11,

    /// Front L, Front R, Front C, LFE, Back L, Back R
    CEF_CHANNEL_LAYOUT_5_1_BACK = 12,

    /// Front L, Front R, Front C, Back L, Back R, Side L, Side R
    CEF_CHANNEL_LAYOUT_7_0 = 13,

    /// Front L, Front R, Front C, LFE, Back L, Back R, Side L, Side R
    CEF_CHANNEL_LAYOUT_7_1 = 14,

    /// Front L, Front R, Front C, LFE, Front LofC, Front RofC, Side L, Side R
    CEF_CHANNEL_LAYOUT_7_1_WIDE = 15,

    /// Front L, Front R
    CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16,

    /// Front L, Front R, LFE
    CEF_CHANNEL_LAYOUT_2POINT1 = 17,

    /// Front L, Front R, Front C, LFE
    CEF_CHANNEL_LAYOUT_3_1 = 18,

    /// Front L, Front R, Front C, LFE, Back C
    CEF_CHANNEL_LAYOUT_4_1 = 19,

    /// Front L, Front R, Front C, Back C, Side L, Side R
    CEF_CHANNEL_LAYOUT_6_0 = 20,

    /// Front L, Front R, Front LofC, Front RofC, Side L, Side R
    CEF_CHANNEL_LAYOUT_6_0_FRONT = 21,

    /// Front L, Front R, Front C, Back L, Back R, Back C
    CEF_CHANNEL_LAYOUT_HEXAGONAL = 22,

    /// Front L, Front R, Front C, LFE, Back C, Side L, Side R
    CEF_CHANNEL_LAYOUT_6_1 = 23,

    /// Front L, Front R, Front C, LFE, Back L, Back R, Back C
    CEF_CHANNEL_LAYOUT_6_1_BACK = 24,

    /// Front L, Front R, LFE, Front LofC, Front RofC, Side L, Side R
    CEF_CHANNEL_LAYOUT_6_1_FRONT = 25,

    /// Front L, Front R, Front C, Front LofC, Front RofC, Side L, Side R
    CEF_CHANNEL_LAYOUT_7_0_FRONT = 26,

    /// Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC
    CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27,

    /// Front L, Front R, Front C, Back L, Back R, Back C, Side L, Side R
    CEF_CHANNEL_LAYOUT_OCTAGONAL = 28,

    /// Channels are not explicitly mapped to speakers.
    CEF_CHANNEL_LAYOUT_DISCRETE = 29,

    /// Deprecated, but keeping the enum value for UMA consistency.
    /// Front L, Front R, Front C. Front C contains the keyboard mic audio. This
    /// layout is only intended for input for WebRTC. The Front C channel
    /// is stripped away in the WebRTC audio input pipeline and never seen outside
    /// of that.
    CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30,

    /// Front L, Front R, LFE, Side L, Side R
    CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31,

    /// Actual channel layout is specified in the bitstream and the actual channel
    /// count is unknown at Chromium media pipeline level (useful for audio
    /// pass-through mode).
    CEF_CHANNEL_LAYOUT_BITSTREAM = 32,

    /// Front L, Front R, Front C, LFE, Side L, Side R,
    /// Front Height L, Front Height R, Rear Height L, Rear Height R
    /// Will be represented as six channels (5.1) due to eight channel limit
    /// kMaxConcurrentChannels
    CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33,

    /// Front C, LFE
    CEF_CHANNEL_LAYOUT_1_1 = 34,

    /// Front L, Front R, LFE, Back C
    CEF_CHANNEL_LAYOUT_3_1_BACK = 35,

    /// Max value, must always equal the largest entry ever logged.
    CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_3_1_BACK
}

alias CEF_CHANNEL_LAYOUT_NONE = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_NONE;
alias CEF_CHANNEL_LAYOUT_UNSUPPORTED = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_UNSUPPORTED;
alias CEF_CHANNEL_LAYOUT_MONO = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_MONO;
alias CEF_CHANNEL_LAYOUT_STEREO = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_STEREO;
alias CEF_CHANNEL_LAYOUT_2_1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_2_1;
alias CEF_CHANNEL_LAYOUT_SURROUND = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_SURROUND;
alias CEF_CHANNEL_LAYOUT_4_0 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_4_0;
alias CEF_CHANNEL_LAYOUT_2_2 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_2_2;
alias CEF_CHANNEL_LAYOUT_QUAD = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_QUAD;
alias CEF_CHANNEL_LAYOUT_5_0 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_5_0;
alias CEF_CHANNEL_LAYOUT_5_1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_5_1;
alias CEF_CHANNEL_LAYOUT_5_0_BACK = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_5_0_BACK;
alias CEF_CHANNEL_LAYOUT_5_1_BACK = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_5_1_BACK;
alias CEF_CHANNEL_LAYOUT_7_0 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_7_0;
alias CEF_CHANNEL_LAYOUT_7_1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_7_1;
alias CEF_CHANNEL_LAYOUT_7_1_WIDE = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_7_1_WIDE;
alias CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX;
alias CEF_CHANNEL_LAYOUT_2POINT1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_2POINT1;
alias CEF_CHANNEL_LAYOUT_3_1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_3_1;
alias CEF_CHANNEL_LAYOUT_4_1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_4_1;
alias CEF_CHANNEL_LAYOUT_6_0 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_6_0;
alias CEF_CHANNEL_LAYOUT_6_0_FRONT = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_6_0_FRONT;
alias CEF_CHANNEL_LAYOUT_HEXAGONAL = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_HEXAGONAL;
alias CEF_CHANNEL_LAYOUT_6_1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_6_1;
alias CEF_CHANNEL_LAYOUT_6_1_BACK = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_6_1_BACK;
alias CEF_CHANNEL_LAYOUT_6_1_FRONT = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_6_1_FRONT;
alias CEF_CHANNEL_LAYOUT_7_0_FRONT = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_7_0_FRONT;
alias CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK;
alias CEF_CHANNEL_LAYOUT_OCTAGONAL = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_OCTAGONAL;
alias CEF_CHANNEL_LAYOUT_DISCRETE = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_DISCRETE;
alias CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC;
alias CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE;
alias CEF_CHANNEL_LAYOUT_BITSTREAM = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_BITSTREAM;
alias CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX;
alias CEF_CHANNEL_LAYOUT_1_1 = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_1_1;
alias CEF_CHANNEL_LAYOUT_3_1_BACK = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_3_1_BACK;
alias CEF_CHANNEL_LAYOUT_MAX = cef_channel_layout_t.CEF_CHANNEL_LAYOUT_MAX;

///
/// Structure representing the audio parameters for setting up the audio
/// handler.
///
struct cef_audio_parameters_t
{
    ///
    /// Layout of the audio channels
    ///
    cef_channel_layout_t channel_layout;

    ///
    /// Sample rate
    //
    int sample_rate;

    ///
    /// Number of frames per buffer
    ///
    int frames_per_buffer;
}



///
/// Result codes for CefMediaRouter::CreateRoute. Should be kept in sync with
/// Chromium's media_router::mojom::RouteRequestResultCode type.
///
enum cef_media_route_create_result_t
{
    CEF_MRCR_UNKNOWN_ERROR = 0,
    CEF_MRCR_OK = 1,
    CEF_MRCR_TIMED_OUT = 2,
    CEF_MRCR_ROUTE_NOT_FOUND = 3,
    CEF_MRCR_SINK_NOT_FOUND = 4,
    CEF_MRCR_INVALID_ORIGIN = 5,
    CEF_MRCR_NO_SUPPORTED_PROVIDER = 7,
    CEF_MRCR_CANCELLED = 8,
    CEF_MRCR_ROUTE_ALREADY_EXISTS = 9,
    CEF_MRCR_ROUTE_ALREADY_TERMINATED = 11
}

alias CEF_MRCR_UNKNOWN_ERROR = cef_media_route_create_result_t.CEF_MRCR_UNKNOWN_ERROR;
alias CEF_MRCR_OK = cef_media_route_create_result_t.CEF_MRCR_OK;
alias CEF_MRCR_TIMED_OUT = cef_media_route_create_result_t.CEF_MRCR_TIMED_OUT;
alias CEF_MRCR_ROUTE_NOT_FOUND = cef_media_route_create_result_t.CEF_MRCR_ROUTE_NOT_FOUND;
alias CEF_MRCR_SINK_NOT_FOUND = cef_media_route_create_result_t.CEF_MRCR_SINK_NOT_FOUND;
alias CEF_MRCR_INVALID_ORIGIN = cef_media_route_create_result_t.CEF_MRCR_INVALID_ORIGIN;
alias CEF_MRCR_NO_SUPPORTED_PROVIDER = cef_media_route_create_result_t.CEF_MRCR_NO_SUPPORTED_PROVIDER;
alias CEF_MRCR_CANCELLED = cef_media_route_create_result_t.CEF_MRCR_CANCELLED;
alias CEF_MRCR_ROUTE_ALREADY_EXISTS = cef_media_route_create_result_t.CEF_MRCR_ROUTE_ALREADY_EXISTS;
alias CEF_MRCR_ROUTE_ALREADY_TERMINATED = cef_media_route_create_result_t.CEF_MRCR_ROUTE_ALREADY_TERMINATED;

///
/// Connection state for a MediaRoute object.
///
enum cef_media_route_connection_state_t
{
    CEF_MRCS_UNKNOWN = 0,
    CEF_MRCS_CONNECTING = 1,
    CEF_MRCS_CONNECTED = 2,
    CEF_MRCS_CLOSED = 3,
    CEF_MRCS_TERMINATED = 4
}

alias CEF_MRCS_UNKNOWN = cef_media_route_connection_state_t.CEF_MRCS_UNKNOWN;
alias CEF_MRCS_CONNECTING = cef_media_route_connection_state_t.CEF_MRCS_CONNECTING;
alias CEF_MRCS_CONNECTED = cef_media_route_connection_state_t.CEF_MRCS_CONNECTED;
alias CEF_MRCS_CLOSED = cef_media_route_connection_state_t.CEF_MRCS_CLOSED;
alias CEF_MRCS_TERMINATED = cef_media_route_connection_state_t.CEF_MRCS_TERMINATED;

///
/// Icon types for a MediaSink object. Should be kept in sync with Chromium's
/// media_router::SinkIconType type.
///
enum cef_media_sink_icon_type_t
{
    CEF_MSIT_CAST = 0,
    CEF_MSIT_CAST_AUDIO_GROUP = 1,
    CEF_MSIT_CAST_AUDIO = 2,
    CEF_MSIT_MEETING = 3,
    CEF_MSIT_HANGOUT = 4,
    CEF_MSIT_EDUCATION = 5,
    CEF_MSIT_WIRED_DISPLAY = 6,
    CEF_MSIT_GENERIC = 7,

    CEF_MSIT_TOTAL_COUNT = 8 // The total number of values.
}

alias CEF_MSIT_CAST = cef_media_sink_icon_type_t.CEF_MSIT_CAST;
alias CEF_MSIT_CAST_AUDIO_GROUP = cef_media_sink_icon_type_t.CEF_MSIT_CAST_AUDIO_GROUP;
alias CEF_MSIT_CAST_AUDIO = cef_media_sink_icon_type_t.CEF_MSIT_CAST_AUDIO;
alias CEF_MSIT_MEETING = cef_media_sink_icon_type_t.CEF_MSIT_MEETING;
alias CEF_MSIT_HANGOUT = cef_media_sink_icon_type_t.CEF_MSIT_HANGOUT;
alias CEF_MSIT_EDUCATION = cef_media_sink_icon_type_t.CEF_MSIT_EDUCATION;
alias CEF_MSIT_WIRED_DISPLAY = cef_media_sink_icon_type_t.CEF_MSIT_WIRED_DISPLAY;
alias CEF_MSIT_GENERIC = cef_media_sink_icon_type_t.CEF_MSIT_GENERIC;
alias CEF_MSIT_TOTAL_COUNT = cef_media_sink_icon_type_t.CEF_MSIT_TOTAL_COUNT;

///
/// Device information for a MediaSink object.
///
struct cef_media_sink_device_info_t
{
    cef_string_t ip_address;
    int port;
    cef_string_t model_name;
}



///
/// Represents commands available to TextField.
///
enum cef_text_field_commands_t
{
    CEF_TFC_CUT = 1,
    CEF_TFC_COPY = 2,
    CEF_TFC_PASTE = 3,
    CEF_TFC_UNDO = 4,
    CEF_TFC_DELETE = 5,
    CEF_TFC_SELECT_ALL = 6
}

alias CEF_TFC_CUT = cef_text_field_commands_t.CEF_TFC_CUT;
alias CEF_TFC_COPY = cef_text_field_commands_t.CEF_TFC_COPY;
alias CEF_TFC_PASTE = cef_text_field_commands_t.CEF_TFC_PASTE;
alias CEF_TFC_UNDO = cef_text_field_commands_t.CEF_TFC_UNDO;
alias CEF_TFC_DELETE = cef_text_field_commands_t.CEF_TFC_DELETE;
alias CEF_TFC_SELECT_ALL = cef_text_field_commands_t.CEF_TFC_SELECT_ALL;

///
/// Chrome toolbar types.
///
enum cef_chrome_toolbar_type_t
{
    CEF_CTT_NONE = 1,
    CEF_CTT_NORMAL = 2,
    CEF_CTT_LOCATION = 3
}

alias CEF_CTT_NONE = cef_chrome_toolbar_type_t.CEF_CTT_NONE;
alias CEF_CTT_NORMAL = cef_chrome_toolbar_type_t.CEF_CTT_NORMAL;
alias CEF_CTT_LOCATION = cef_chrome_toolbar_type_t.CEF_CTT_LOCATION;

///
/// Chrome page action icon types. Should be kept in sync with Chromium's
/// PageActionIconType type.
///
enum cef_chrome_page_action_icon_type_t
{
    CEF_CPAIT_BOOKMARK_STAR = 0,
    CEF_CPAIT_CLICK_TO_CALL = 1,
    CEF_CPAIT_COOKIE_CONTROLS = 2,
    CEF_CPAIT_FILE_SYSTEM_ACCESS = 3,
    CEF_CPAIT_FIND = 4,
    CEF_CPAIT_MEMORY_SAVER = 5,
    CEF_CPAIT_INTENT_PICKER = 6,
    CEF_CPAIT_LOCAL_CARD_MIGRATION = 7,
    CEF_CPAIT_MANAGE_PASSWORDS = 8,
    CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION = 9,
    CEF_CPAIT_PRICE_TRACKING = 10,
    CEF_CPAIT_PWA_INSTALL = 11,
    CEF_CPAIT_QR_CODE_GENERATOR_DEPRECATED = 12,
    CEF_CPAIT_READER_MODE_DEPRECATED = 13,
    CEF_CPAIT_SAVE_AUTOFILL_ADDRESS = 14,
    CEF_CPAIT_SAVE_CARD = 15,
    CEF_CPAIT_SEND_TAB_TO_SELF_DEPRECATED = 16,
    CEF_CPAIT_SHARING_HUB = 17,
    CEF_CPAIT_SIDE_SEARCH = 18,
    CEF_CPAIT_SMS_REMOTE_FETCHER = 19,
    CEF_CPAIT_TRANSLATE = 20,
    CEF_CPAIT_VIRTUAL_CARD_ENROLL = 21,
    CEF_CPAIT_VIRTUAL_CARD_MANUAL_FALLBACK = 22,
    CEF_CPAIT_ZOOM = 23,
    CEF_CPAIT_SAVE_IBAN = 24,
    CEF_CPAIT_MANDATORY_REAUTH = 25,
    CEF_CPAIT_PRICE_INSIGHTS = 26,
    CEF_CPAIT_PRICE_READ_ANYTHING = 27,
    CEF_CPAIT_PRODUCT_SPECIFICATIONS = 28,
    CEF_CPAIT_LENS_OVERLAY = 29,
    CEF_CPAIT_MAX_VALUE = CEF_CPAIT_LENS_OVERLAY
}

alias CEF_CPAIT_BOOKMARK_STAR = cef_chrome_page_action_icon_type_t.CEF_CPAIT_BOOKMARK_STAR;
alias CEF_CPAIT_CLICK_TO_CALL = cef_chrome_page_action_icon_type_t.CEF_CPAIT_CLICK_TO_CALL;
alias CEF_CPAIT_COOKIE_CONTROLS = cef_chrome_page_action_icon_type_t.CEF_CPAIT_COOKIE_CONTROLS;
alias CEF_CPAIT_FILE_SYSTEM_ACCESS = cef_chrome_page_action_icon_type_t.CEF_CPAIT_FILE_SYSTEM_ACCESS;
alias CEF_CPAIT_FIND = cef_chrome_page_action_icon_type_t.CEF_CPAIT_FIND;
alias CEF_CPAIT_MEMORY_SAVER = cef_chrome_page_action_icon_type_t.CEF_CPAIT_MEMORY_SAVER;
alias CEF_CPAIT_INTENT_PICKER = cef_chrome_page_action_icon_type_t.CEF_CPAIT_INTENT_PICKER;
alias CEF_CPAIT_LOCAL_CARD_MIGRATION = cef_chrome_page_action_icon_type_t.CEF_CPAIT_LOCAL_CARD_MIGRATION;
alias CEF_CPAIT_MANAGE_PASSWORDS = cef_chrome_page_action_icon_type_t.CEF_CPAIT_MANAGE_PASSWORDS;
alias CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION = cef_chrome_page_action_icon_type_t.CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION;
alias CEF_CPAIT_PRICE_TRACKING = cef_chrome_page_action_icon_type_t.CEF_CPAIT_PRICE_TRACKING;
alias CEF_CPAIT_PWA_INSTALL = cef_chrome_page_action_icon_type_t.CEF_CPAIT_PWA_INSTALL;
alias CEF_CPAIT_QR_CODE_GENERATOR_DEPRECATED = cef_chrome_page_action_icon_type_t.CEF_CPAIT_QR_CODE_GENERATOR_DEPRECATED;
alias CEF_CPAIT_READER_MODE_DEPRECATED = cef_chrome_page_action_icon_type_t.CEF_CPAIT_READER_MODE_DEPRECATED;
alias CEF_CPAIT_SAVE_AUTOFILL_ADDRESS = cef_chrome_page_action_icon_type_t.CEF_CPAIT_SAVE_AUTOFILL_ADDRESS;
alias CEF_CPAIT_SAVE_CARD = cef_chrome_page_action_icon_type_t.CEF_CPAIT_SAVE_CARD;
alias CEF_CPAIT_SEND_TAB_TO_SELF_DEPRECATED = cef_chrome_page_action_icon_type_t.CEF_CPAIT_SEND_TAB_TO_SELF_DEPRECATED;
alias CEF_CPAIT_SHARING_HUB = cef_chrome_page_action_icon_type_t.CEF_CPAIT_SHARING_HUB;
alias CEF_CPAIT_SIDE_SEARCH = cef_chrome_page_action_icon_type_t.CEF_CPAIT_SIDE_SEARCH;
alias CEF_CPAIT_SMS_REMOTE_FETCHER = cef_chrome_page_action_icon_type_t.CEF_CPAIT_SMS_REMOTE_FETCHER;
alias CEF_CPAIT_TRANSLATE = cef_chrome_page_action_icon_type_t.CEF_CPAIT_TRANSLATE;
alias CEF_CPAIT_VIRTUAL_CARD_ENROLL = cef_chrome_page_action_icon_type_t.CEF_CPAIT_VIRTUAL_CARD_ENROLL;
alias CEF_CPAIT_VIRTUAL_CARD_MANUAL_FALLBACK = cef_chrome_page_action_icon_type_t.CEF_CPAIT_VIRTUAL_CARD_MANUAL_FALLBACK;
alias CEF_CPAIT_ZOOM = cef_chrome_page_action_icon_type_t.CEF_CPAIT_ZOOM;
alias CEF_CPAIT_SAVE_IBAN = cef_chrome_page_action_icon_type_t.CEF_CPAIT_SAVE_IBAN;
alias CEF_CPAIT_MANDATORY_REAUTH = cef_chrome_page_action_icon_type_t.CEF_CPAIT_MANDATORY_REAUTH;
alias CEF_CPAIT_PRICE_INSIGHTS = cef_chrome_page_action_icon_type_t.CEF_CPAIT_PRICE_INSIGHTS;
alias CEF_CPAIT_PRICE_READ_ANYTHING = cef_chrome_page_action_icon_type_t.CEF_CPAIT_PRICE_READ_ANYTHING;
alias CEF_CPAIT_PRODUCT_SPECIFICATIONS = cef_chrome_page_action_icon_type_t.CEF_CPAIT_PRODUCT_SPECIFICATIONS;
alias CEF_CPAIT_LENS_OVERLAY = cef_chrome_page_action_icon_type_t.CEF_CPAIT_LENS_OVERLAY;
alias CEF_CPAIT_MAX_VALUE = cef_chrome_page_action_icon_type_t.CEF_CPAIT_MAX_VALUE;

///
/// Chrome toolbar button types. Should be kept in sync with CEF's internal
/// ToolbarButtonType type.
///
enum cef_chrome_toolbar_button_type_t
{
    CEF_CTBT_CAST = 0,
    CEF_CTBT_DOWNLOAD = 1,
    CEF_CTBT_SEND_TAB_TO_SELF = 2,
    CEF_CTBT_SIDE_PANEL = 3,
    CEF_CTBT_MAX_VALUE = CEF_CTBT_SIDE_PANEL
}

alias CEF_CTBT_CAST = cef_chrome_toolbar_button_type_t.CEF_CTBT_CAST;
alias CEF_CTBT_DOWNLOAD = cef_chrome_toolbar_button_type_t.CEF_CTBT_DOWNLOAD;
alias CEF_CTBT_SEND_TAB_TO_SELF = cef_chrome_toolbar_button_type_t.CEF_CTBT_SEND_TAB_TO_SELF;
alias CEF_CTBT_SIDE_PANEL = cef_chrome_toolbar_button_type_t.CEF_CTBT_SIDE_PANEL;
alias CEF_CTBT_MAX_VALUE = cef_chrome_toolbar_button_type_t.CEF_CTBT_MAX_VALUE;

///
/// Docking modes supported by CefWindow::AddOverlay.
///
enum cef_docking_mode_t
{
    CEF_DOCKING_MODE_TOP_LEFT = 1,
    CEF_DOCKING_MODE_TOP_RIGHT = 2,
    CEF_DOCKING_MODE_BOTTOM_LEFT = 3,
    CEF_DOCKING_MODE_BOTTOM_RIGHT = 4,
    CEF_DOCKING_MODE_CUSTOM = 5
}

alias CEF_DOCKING_MODE_TOP_LEFT = cef_docking_mode_t.CEF_DOCKING_MODE_TOP_LEFT;
alias CEF_DOCKING_MODE_TOP_RIGHT = cef_docking_mode_t.CEF_DOCKING_MODE_TOP_RIGHT;
alias CEF_DOCKING_MODE_BOTTOM_LEFT = cef_docking_mode_t.CEF_DOCKING_MODE_BOTTOM_LEFT;
alias CEF_DOCKING_MODE_BOTTOM_RIGHT = cef_docking_mode_t.CEF_DOCKING_MODE_BOTTOM_RIGHT;
alias CEF_DOCKING_MODE_CUSTOM = cef_docking_mode_t.CEF_DOCKING_MODE_CUSTOM;

///
/// Show states supported by CefWindowDelegate::GetInitialShowState.
///
enum cef_show_state_t
{
    // Show the window as normal.
    CEF_SHOW_STATE_NORMAL = 1,

    // Show the window as minimized.
    CEF_SHOW_STATE_MINIMIZED = 2,

    // Show the window as maximized.
    CEF_SHOW_STATE_MAXIMIZED = 3,

    // Show the window as fullscreen.
    CEF_SHOW_STATE_FULLSCREEN = 4,

    // Show the window as hidden (no dock thumbnail).
    // Only supported on MacOS.
    CEF_SHOW_STATE_HIDDEN = 5
}

alias CEF_SHOW_STATE_NORMAL = cef_show_state_t.CEF_SHOW_STATE_NORMAL;
alias CEF_SHOW_STATE_MINIMIZED = cef_show_state_t.CEF_SHOW_STATE_MINIMIZED;
alias CEF_SHOW_STATE_MAXIMIZED = cef_show_state_t.CEF_SHOW_STATE_MAXIMIZED;
alias CEF_SHOW_STATE_FULLSCREEN = cef_show_state_t.CEF_SHOW_STATE_FULLSCREEN;
alias CEF_SHOW_STATE_HIDDEN = cef_show_state_t.CEF_SHOW_STATE_HIDDEN;

///
/// Values indicating what state of the touch handle is set.
///
enum cef_touch_handle_state_flags_t
{
    CEF_THS_FLAG_NONE = 0,
    CEF_THS_FLAG_ENABLED = 1 << 0,
    CEF_THS_FLAG_ORIENTATION = 1 << 1,
    CEF_THS_FLAG_ORIGIN = 1 << 2,
    CEF_THS_FLAG_ALPHA = 1 << 3
}

alias CEF_THS_FLAG_NONE = cef_touch_handle_state_flags_t.CEF_THS_FLAG_NONE;
alias CEF_THS_FLAG_ENABLED = cef_touch_handle_state_flags_t.CEF_THS_FLAG_ENABLED;
alias CEF_THS_FLAG_ORIENTATION = cef_touch_handle_state_flags_t.CEF_THS_FLAG_ORIENTATION;
alias CEF_THS_FLAG_ORIGIN = cef_touch_handle_state_flags_t.CEF_THS_FLAG_ORIGIN;
alias CEF_THS_FLAG_ALPHA = cef_touch_handle_state_flags_t.CEF_THS_FLAG_ALPHA;

struct cef_touch_handle_state_t
{
    ///
    /// Touch handle id. Increments for each new touch handle.
    ///
    int touch_handle_id;

    ///
    /// Combination of cef_touch_handle_state_flags_t values indicating what state
    /// is set.
    ///
    uint flags;

    ///
    /// Enabled state. Only set if |flags| contains CEF_THS_FLAG_ENABLED.
    ///
    int enabled;

    ///
    /// Orientation state. Only set if |flags| contains CEF_THS_FLAG_ORIENTATION.
    ///
    cef_horizontal_alignment_t orientation;
    int mirror_vertical;
    int mirror_horizontal;

    ///
    /// Origin state. Only set if |flags| contains CEF_THS_FLAG_ORIGIN.
    ///
    cef_point_t origin;

    ///
    /// Alpha state. Only set if |flags| contains CEF_THS_FLAG_ALPHA.
    ///
    float alpha;
}



///
/// Media access permissions used by OnRequestMediaAccessPermission.
///
enum cef_media_access_permission_types_t
{
    ///
    /// No permission.
    ///
    CEF_MEDIA_PERMISSION_NONE = 0,

    ///
    /// Device audio capture permission.
    ///
    CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE = 1 << 0,

    ///
    /// Device video capture permission.
    ///
    CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE = 1 << 1,

    ///
    /// Desktop audio capture permission.
    ///
    CEF_MEDIA_PERMISSION_DESKTOP_AUDIO_CAPTURE = 1 << 2,

    ///
    /// Desktop video capture permission.
    ///
    CEF_MEDIA_PERMISSION_DESKTOP_VIDEO_CAPTURE = 1 << 3
}

alias CEF_MEDIA_PERMISSION_NONE = cef_media_access_permission_types_t.CEF_MEDIA_PERMISSION_NONE;
alias CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE = cef_media_access_permission_types_t.CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE;
alias CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE = cef_media_access_permission_types_t.CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE;
alias CEF_MEDIA_PERMISSION_DESKTOP_AUDIO_CAPTURE = cef_media_access_permission_types_t.CEF_MEDIA_PERMISSION_DESKTOP_AUDIO_CAPTURE;
alias CEF_MEDIA_PERMISSION_DESKTOP_VIDEO_CAPTURE = cef_media_access_permission_types_t.CEF_MEDIA_PERMISSION_DESKTOP_VIDEO_CAPTURE;

///
/// Permission types used with OnShowPermissionPrompt. Some types are
/// platform-specific or only supported with the Chrome runtime. Should be kept
/// in sync with Chromium's permissions::RequestType type.
///
enum cef_permission_request_types_t
{
    CEF_PERMISSION_TYPE_NONE = 0,
    CEF_PERMISSION_TYPE_ACCESSIBILITY_EVENTS = 1 << 0,
    CEF_PERMISSION_TYPE_AR_SESSION = 1 << 1,
    CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM = 1 << 2,
    CEF_PERMISSION_TYPE_CAMERA_STREAM = 1 << 3,
    CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL = 1 << 4,
    CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 5,
    CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 6,
    CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 7,
    CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 8,
    CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 9,
    CEF_PERMISSION_TYPE_IDENTITY_PROVIDER = 1 << 10,
    CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 11,
    CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 12,
    CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 13,
    CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14,
    CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15,
    CEF_PERMISSION_TYPE_KEYBOARD_LOCK = 1 << 16,
    CEF_PERMISSION_TYPE_POINTER_LOCK = 1 << 17,
    CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 18,
    CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 19,
    CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 20,
    CEF_PERMISSION_TYPE_VR_SESSION = 1 << 21,
    CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 22,
    CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 23
}

alias CEF_PERMISSION_TYPE_NONE = cef_permission_request_types_t.CEF_PERMISSION_TYPE_NONE;
alias CEF_PERMISSION_TYPE_ACCESSIBILITY_EVENTS = cef_permission_request_types_t.CEF_PERMISSION_TYPE_ACCESSIBILITY_EVENTS;
alias CEF_PERMISSION_TYPE_AR_SESSION = cef_permission_request_types_t.CEF_PERMISSION_TYPE_AR_SESSION;
alias CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM = cef_permission_request_types_t.CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM;
alias CEF_PERMISSION_TYPE_CAMERA_STREAM = cef_permission_request_types_t.CEF_PERMISSION_TYPE_CAMERA_STREAM;
alias CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL = cef_permission_request_types_t.CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL;
alias CEF_PERMISSION_TYPE_CLIPBOARD = cef_permission_request_types_t.CEF_PERMISSION_TYPE_CLIPBOARD;
alias CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = cef_permission_request_types_t.CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS;
alias CEF_PERMISSION_TYPE_DISK_QUOTA = cef_permission_request_types_t.CEF_PERMISSION_TYPE_DISK_QUOTA;
alias CEF_PERMISSION_TYPE_LOCAL_FONTS = cef_permission_request_types_t.CEF_PERMISSION_TYPE_LOCAL_FONTS;
alias CEF_PERMISSION_TYPE_GEOLOCATION = cef_permission_request_types_t.CEF_PERMISSION_TYPE_GEOLOCATION;
alias CEF_PERMISSION_TYPE_IDENTITY_PROVIDER = cef_permission_request_types_t.CEF_PERMISSION_TYPE_IDENTITY_PROVIDER;
alias CEF_PERMISSION_TYPE_IDLE_DETECTION = cef_permission_request_types_t.CEF_PERMISSION_TYPE_IDLE_DETECTION;
alias CEF_PERMISSION_TYPE_MIC_STREAM = cef_permission_request_types_t.CEF_PERMISSION_TYPE_MIC_STREAM;
alias CEF_PERMISSION_TYPE_MIDI_SYSEX = cef_permission_request_types_t.CEF_PERMISSION_TYPE_MIDI_SYSEX;
alias CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = cef_permission_request_types_t.CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS;
alias CEF_PERMISSION_TYPE_NOTIFICATIONS = cef_permission_request_types_t.CEF_PERMISSION_TYPE_NOTIFICATIONS;
alias CEF_PERMISSION_TYPE_KEYBOARD_LOCK = cef_permission_request_types_t.CEF_PERMISSION_TYPE_KEYBOARD_LOCK;
alias CEF_PERMISSION_TYPE_POINTER_LOCK = cef_permission_request_types_t.CEF_PERMISSION_TYPE_POINTER_LOCK;
alias CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = cef_permission_request_types_t.CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER;
alias CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = cef_permission_request_types_t.CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER;
alias CEF_PERMISSION_TYPE_STORAGE_ACCESS = cef_permission_request_types_t.CEF_PERMISSION_TYPE_STORAGE_ACCESS;
alias CEF_PERMISSION_TYPE_VR_SESSION = cef_permission_request_types_t.CEF_PERMISSION_TYPE_VR_SESSION;
alias CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = cef_permission_request_types_t.CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT;
alias CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = cef_permission_request_types_t.CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS;

///
/// Permission request results.
///
enum cef_permission_request_result_t
{
    ///
    /// Accept the permission request as an explicit user action.
    ///
    CEF_PERMISSION_RESULT_ACCEPT = 0,

    ///
    /// Deny the permission request as an explicit user action.
    ///
    CEF_PERMISSION_RESULT_DENY = 1,

    ///
    /// Dismiss the permission request as an explicit user action.
    ///
    CEF_PERMISSION_RESULT_DISMISS = 2,

    ///
    /// Ignore the permission request. If the prompt remains unhandled (e.g.
    /// OnShowPermissionPrompt returns false and there is no default permissions
    /// UI) then any related promises may remain unresolved.
    ///
    CEF_PERMISSION_RESULT_IGNORE = 3
}

alias CEF_PERMISSION_RESULT_ACCEPT = cef_permission_request_result_t.CEF_PERMISSION_RESULT_ACCEPT;
alias CEF_PERMISSION_RESULT_DENY = cef_permission_request_result_t.CEF_PERMISSION_RESULT_DENY;
alias CEF_PERMISSION_RESULT_DISMISS = cef_permission_request_result_t.CEF_PERMISSION_RESULT_DISMISS;
alias CEF_PERMISSION_RESULT_IGNORE = cef_permission_request_result_t.CEF_PERMISSION_RESULT_IGNORE;

///
/// Certificate types supported by CefTestServer::CreateAndStart. The matching
/// certificate file must exist in the "net/data/ssl/certificates" directory.
/// See CefSetDataDirectoryForTests() for related configuration.
///
enum cef_test_cert_type_t
{
    /// Valid certificate using the IP (127.0.0.1). Loads the "ok_cert.pem" file.
    CEF_TEST_CERT_OK_IP = 0,

    /// Valid certificate using the domain ("localhost"). Loads the
    /// "localhost_cert.pem" file.
    CEF_TEST_CERT_OK_DOMAIN = 1,

    /// Expired certificate. Loads the "expired_cert.pem" file.
    CEF_TEST_CERT_EXPIRED = 2
}

alias CEF_TEST_CERT_OK_IP = cef_test_cert_type_t.CEF_TEST_CERT_OK_IP;
alias CEF_TEST_CERT_OK_DOMAIN = cef_test_cert_type_t.CEF_TEST_CERT_OK_DOMAIN;
alias CEF_TEST_CERT_EXPIRED = cef_test_cert_type_t.CEF_TEST_CERT_EXPIRED;

///
/// Preferences type passed to
/// CefBrowserProcessHandler::OnRegisterCustomPreferences.
///
enum cef_preferences_type_t
{
    /// Global preferences registered a single time at application startup.
    CEF_PREFERENCES_TYPE_GLOBAL = 0,

    /// Request context preferences registered each time a new CefRequestContext
    /// is created.
    CEF_PREFERENCES_TYPE_REQUEST_CONTEXT = 1
}

alias CEF_PREFERENCES_TYPE_GLOBAL = cef_preferences_type_t.CEF_PREFERENCES_TYPE_GLOBAL;
alias CEF_PREFERENCES_TYPE_REQUEST_CONTEXT = cef_preferences_type_t.CEF_PREFERENCES_TYPE_REQUEST_CONTEXT;

///
/// Download interrupt reasons. Should be kept in sync with
/// Chromium's download::DownloadInterruptReason type.
///
enum cef_download_interrupt_reason_t
{
    CEF_DOWNLOAD_INTERRUPT_REASON_NONE = 0,

    /// Generic file operation failure.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED = 1,

    /// The file cannot be accessed due to security restrictions.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED = 2,

    /// There is not enough room on the drive.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE = 3,

    /// The directory or file name is too long.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG = 5,

    /// The file is too large for the file system to handle.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE = 6,

    /// The file contains a virus.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED = 7,

    /// The file was in use. Too many files are opened at once. We have run out of
    /// memory.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR = 10,

    /// The file was blocked due to local policy.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED = 11,

    /// An attempt to check the safety of the download failed due to unexpected
    /// reasons. See http://crbug.com/153212.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED = 12,

    /// An attempt was made to seek past the end of a file in opening
    /// a file (as part of resuming a previously interrupted download).
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT = 13,

    /// The partial file didn't match the expected hash.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH = 14,

    /// The source and the target of the download were the same.
    CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SAME_AS_SOURCE = 15,

    // Network errors.

    /// Generic network failure.
    CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED = 20,

    /// The network operation timed out.
    CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT = 21,

    /// The network connection has been lost.
    CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED = 22,

    /// The server has gone down.
    CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN = 23,

    /// The network request was invalid. This may be due to the original URL or a
    /// redirected URL:
    /// - Having an unsupported scheme.
    /// - Being an invalid URL.
    /// - Being disallowed by policy.
    CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST = 24,

    // Server responses.

    /// The server indicates that the operation has failed (generic).
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED = 30,

    /// The server does not support range requests.
    /// Internal use only:  must restart from the beginning.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE = 31,

    /// The server does not have the requested data.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT = 33,

    /// Server didn't authorize access to resource.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED = 34,

    /// Server certificate problem.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM = 35,

    /// Server access forbidden.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN = 36,

    /// Unexpected server response. This might indicate that the responding server
    /// may not be the intended server.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE = 37,

    /// The server sent fewer bytes than the content-length header. It may
    /// indicate that the connection was closed prematurely, or the Content-Length
    /// header was invalid. The download is only interrupted if strong validators
    /// are present. Otherwise, it is treated as finished.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH = 38,

    /// An unexpected cross-origin redirect happened.
    CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT = 39,

    // User input.

    /// The user canceled the download.
    CEF_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED = 40,

    /// The user shut down the browser.
    /// Internal use only:  resume pending downloads if possible.
    CEF_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN = 41,

    // Crash.

    /// The browser crashed.
    /// Internal use only:  resume pending downloads if possible.
    CEF_DOWNLOAD_INTERRUPT_REASON_CRASH = 50
}

alias CEF_DOWNLOAD_INTERRUPT_REASON_NONE = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_NONE;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH;
alias CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SAME_AS_SOURCE = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_FILE_SAME_AS_SOURCE;
alias CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT;
alias CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN;
alias CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH;
alias CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT;
alias CEF_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED;
alias CEF_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN;
alias CEF_DOWNLOAD_INTERRUPT_REASON_CRASH = cef_download_interrupt_reason_t.CEF_DOWNLOAD_INTERRUPT_REASON_CRASH;

///
/// Specifies the gesture commands.
///
enum cef_gesture_command_t
{
    CEF_GESTURE_COMMAND_BACK = 0,
    CEF_GESTURE_COMMAND_FORWARD = 1
}

alias CEF_GESTURE_COMMAND_BACK = cef_gesture_command_t.CEF_GESTURE_COMMAND_BACK;
alias CEF_GESTURE_COMMAND_FORWARD = cef_gesture_command_t.CEF_GESTURE_COMMAND_FORWARD;

///
/// Specifies the zoom commands supported by CefBrowserHost::Zoom.
///
enum cef_zoom_command_t
{
    CEF_ZOOM_COMMAND_OUT = 0,
    CEF_ZOOM_COMMAND_RESET = 1,
    CEF_ZOOM_COMMAND_IN = 2
}

alias CEF_ZOOM_COMMAND_OUT = cef_zoom_command_t.CEF_ZOOM_COMMAND_OUT;
alias CEF_ZOOM_COMMAND_RESET = cef_zoom_command_t.CEF_ZOOM_COMMAND_RESET;
alias CEF_ZOOM_COMMAND_IN = cef_zoom_command_t.CEF_ZOOM_COMMAND_IN;

///
/// Specifies the color variants supported by
/// CefRequestContext::SetChromeThemeColor.
///
enum cef_color_variant_t
{
    CEF_COLOR_VARIANT_SYSTEM = 0,
    CEF_COLOR_VARIANT_LIGHT = 1,
    CEF_COLOR_VARIANT_DARK = 2,
    CEF_COLOR_VARIANT_TONAL_SPOT = 3,
    CEF_COLOR_VARIANT_NEUTRAL = 4,
    CEF_COLOR_VARIANT_VIBRANT = 5,
    CEF_COLOR_VARIANT_EXPRESSIVE = 6
}

alias CEF_COLOR_VARIANT_SYSTEM = cef_color_variant_t.CEF_COLOR_VARIANT_SYSTEM;
alias CEF_COLOR_VARIANT_LIGHT = cef_color_variant_t.CEF_COLOR_VARIANT_LIGHT;
alias CEF_COLOR_VARIANT_DARK = cef_color_variant_t.CEF_COLOR_VARIANT_DARK;
alias CEF_COLOR_VARIANT_TONAL_SPOT = cef_color_variant_t.CEF_COLOR_VARIANT_TONAL_SPOT;
alias CEF_COLOR_VARIANT_NEUTRAL = cef_color_variant_t.CEF_COLOR_VARIANT_NEUTRAL;
alias CEF_COLOR_VARIANT_VIBRANT = cef_color_variant_t.CEF_COLOR_VARIANT_VIBRANT;
alias CEF_COLOR_VARIANT_EXPRESSIVE = cef_color_variant_t.CEF_COLOR_VARIANT_EXPRESSIVE;

// CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6ea5d772fb4961ae4a658b4b730aa608fa93309f$
//

extern (C):

///
/// Implement this structure to receive accessibility notification when
/// accessibility events have been registered. The functions of this structure
/// will be called on the UI thread.
///
struct cef_accessibility_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called after renderer process sends accessibility tree changes to the
    /// browser process.
    ///

    ///
    /// Called after renderer process sends accessibility location changes to the
    /// browser process.
    ///

    // CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_accessibility_handler_t* self,
        cef_value_t* value) nothrow on_accessibility_tree_change;
    extern(System) void function (
        cef_accessibility_handler_t* self,
        cef_value_t* value) nothrow on_accessibility_location_change;
}


// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dfa0d4d2da319b2fd5e92324fd14301b500ceb5c$
//

extern (C):

///
/// Implement this structure to provide handler implementations. Methods will be
/// called by the process and/or thread indicated.
///
struct cef_app_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Provides an opportunity to view and/or modify command-line arguments
    /// before processing by CEF and Chromium. The |process_type| value will be
    /// NULL for the browser process. Do not keep a reference to the
    /// cef_command_line_t object passed to this function. The
    /// cef_settings_t.command_line_args_disabled value can be used to start with
    /// an NULL command-line object. Any values specified in CefSettings that

    cef_base_ref_counted_t base;
    /// equate to command-line arguments will be set before this function is
    /// called. Be cautious when using this function to modify command-line
    /// arguments for non-browser processes as this may result in undefined
    /// behavior including crashes.
    ///
    extern(System) void function (
        cef_app_t* self,
        const(cef_string_t)* process_type,
        cef_command_line_t* command_line) nothrow on_before_command_line_processing;

    ///
    /// Provides an opportunity to register custom schemes. Do not keep a
    /// reference to the |registrar| object. This function is called on the main
    /// thread for each process and the registered schemes should be the same
    /// across all processes.
    ///
    extern(System) void function (
        cef_app_t* self,
        cef_scheme_registrar_t* registrar) nothrow on_register_custom_schemes;

    ///
    /// Return the handler for resource bundle events. If
    /// cef_settings_t.pack_loading_disabled is true (1) a handler must be
    /// returned. If no handler is returned resources will be loaded from pack
    /// files. This function is called by the browser and render processes on
    /// multiple threads.
    ///
    extern(System) cef_resource_bundle_handler_t* function (
        cef_app_t* self) nothrow get_resource_bundle_handler;

    ///
    /// Return the handler for functionality specific to the browser process. This
    /// function is called on multiple threads in the browser process.
    ///
    extern(System) cef_browser_process_handler_t* function (
        cef_app_t* self) nothrow get_browser_process_handler;

    ///
    /// Return the handler for functionality specific to the render process. This
    /// function is called on the render process main thread.
    ///
    extern(System) cef_render_process_handler_t* function (
        cef_app_t* self) nothrow get_render_process_handler;
}



///
/// This function should be called from the application entry point function to
/// execute a secondary process. It can be used to run secondary processes from
/// the browser client executable (default behavior) or from a separate
/// executable specified by the cef_settings_t.browser_subprocess_path value. If
/// called for the browser process (identified by no "type" command-line value)
/// it will return immediately with a value of -1. If called for a recognized
/// secondary process it will block until the process should exit and then
/// return the process exit code. The |application| parameter may be NULL. The
/// |windows_sandbox_info| parameter is only used on Windows and may be NULL
/// (see cef_sandbox_win.h for details).
///
int cef_execute_process (
    const(cef_main_args_t)* args,
    cef_app_t* application,
    void* windows_sandbox_info);

///
/// This function should be called on the main application thread to initialize
/// the CEF browser process. The |application| parameter may be NULL. Returns
/// true (1) if initialization succeeds. Returns false (0) if initialization
/// fails or if early exit is desired (for example, due to process singleton
/// relaunch behavior). If this function returns false (0) then the application
/// should exit immediately without calling any other CEF functions except,
/// optionally, CefGetErrorCode. The |windows_sandbox_info| parameter is only
/// used on Windows and may be NULL (see cef_sandbox_win.h for details).
///
int cef_initialize (
    const(cef_main_args_t)* args,
    const(cef_settings_t)* settings,
    cef_app_t* application,
    void* windows_sandbox_info);

///
/// This function can optionally be called on the main application thread after
/// CefInitialize to retrieve the initialization exit code. When CefInitialize
/// returns true (1) the exit code will be 0 (CEF_RESULT_CODE_NORMAL_EXIT).
/// Otherwise, see cef_resultcode_t for possible exit code values including
/// browser process initialization errors and normal early exit conditions (such
/// as CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED for process singleton
/// relaunch behavior).
///
int cef_get_exit_code ();

///
/// This function should be called on the main application thread to shut down
/// the CEF browser process before the application exits. Do not call any other
/// CEF functions after calling this function.
///
void cef_shutdown ();

///
/// Perform a single iteration of CEF message loop processing. This function is
/// provided for cases where the CEF message loop must be integrated into an
/// existing application message loop. Use of this function is not recommended
/// for most users; use either the cef_run_message_loop() function or
/// cef_settings_t.multi_threaded_message_loop if possible. When using this
/// function care must be taken to balance performance against excessive CPU
/// usage. It is recommended to enable the cef_settings_t.external_message_pump
/// option when using this function so that
/// cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can
/// facilitate the scheduling process. This function should only be called on
/// the main application thread and only if cef_initialize() is called with a
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
/// will not block.
///
void cef_do_message_loop_work ();

///
/// Run the CEF message loop. Use this function instead of an application-
/// provided message loop to get the best balance between performance and CPU
/// usage. This function should only be called on the main application thread
/// and only if cef_initialize() is called with a
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
/// will block until a quit message is received by the system.
///
void cef_run_message_loop ();

///
/// Quit the CEF message loop that was started by calling
/// cef_run_message_loop(). This function should only be called on the main
/// application thread and only if cef_run_message_loop() was used.
///
void cef_quit_message_loop ();

// CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d98482eba93dcd8b6a6f69b2732162733c73203d$
//

extern (C):

///
/// Implement this structure to handle audio events.
///
struct cef_audio_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called on the UI thread to allow configuration of audio stream parameters.
    /// Return true (1) to proceed with audio stream capture, or false (0) to
    /// cancel it. All members of |params| can optionally be configured here, but
    /// they are also pre-filled with some sensible defaults.
    ///

    ///
    /// Called on a browser audio capture thread when the browser starts streaming
    /// audio. OnAudioStreamStopped will always be called after
    /// OnAudioStreamStarted; both functions may be called multiple times for the

    cef_base_ref_counted_t base;
    extern(System) int function (
        cef_audio_handler_t* self,
        cef_browser_t* browser,
        cef_audio_parameters_t* params) nothrow get_audio_parameters;
    /// same browser. |params| contains the audio parameters like sample rate and
    /// channel layout. |channels| is the number of channels.
    ///
    extern(System) void function (
        cef_audio_handler_t* self,
        cef_browser_t* browser,
        const(cef_audio_parameters_t)* params,
        int channels) nothrow on_audio_stream_started;

    ///
    /// Called on the audio stream thread when a PCM packet is received for the
    /// stream. |data| is an array representing the raw PCM data as a floating
    /// point type, i.e. 4-byte value(s). |frames| is the number of frames in the
    /// PCM packet. |pts| is the presentation timestamp (in milliseconds since the
    /// Unix Epoch) and represents the time at which the decompressed packet
    /// should be presented to the user. Based on |frames| and the
    /// |channel_layout| value passed to OnAudioStreamStarted you can calculate
    /// the size of the |data| array in bytes.
    ///
    extern(System) void function (
        cef_audio_handler_t* self,
        cef_browser_t* browser,
        const(float*)* data,
        int frames,
        long pts) nothrow on_audio_stream_packet;

    ///
    /// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
    /// will always be called after OnAudioStreamStarted; both functions may be
    /// called multiple times for the same stream.
    ///
    extern(System) void function (
        cef_audio_handler_t* self,
        cef_browser_t* browser) nothrow on_audio_stream_stopped;

    ///
    /// Called on the UI or audio stream thread when an error occurred. During the
    /// stream creation phase this callback will be called on the UI thread while
    /// in the capturing phase it will be called on the audio stream thread. The
    /// stream will be stopped immediately.
    ///
    extern(System) void function (
        cef_audio_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* message) nothrow on_audio_stream_error;
}



// CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b63947918eca8c31790cae16b2e8a0be7e9464dd$
//

extern (C):

///
/// Callback structure used for asynchronous continuation of authentication
/// requests.
///
struct cef_auth_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Continue the authentication request.
    ///

    ///
    /// Cancel the authentication request.
    ///

    // CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_auth_callback_t* self,
        const(cef_string_t)* username,
        const(cef_string_t)* password) nothrow cont;
    extern(System) void function (cef_auth_callback_t* self) nothrow cancel;
}


// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import core.stdc.config;

extern (C):

///
// All ref-counted framework structures must include this structure first.
///
struct cef_base_ref_counted_t
{
    ///
    // Size of the data structure.
    ///

    ///
    // Called to increment the reference count for the object. Should be called
    // for every new copy of a pointer to a given object.
    ///

    ///
    // Called to decrement the reference count for the object. If the reference
    alias size_t = c_ulong;
    size_t size;
    extern(System) void function (cef_base_ref_counted_t* self) nothrow add_ref;
    // count falls to 0 the object should self-delete. Returns true (1) if the
    // resulting reference count is 0.
    ///
    extern(System) int function (cef_base_ref_counted_t* self) nothrow release;

    ///
    // Returns true (1) if the current reference count is 1.
    ///
    extern(System) int function (cef_base_ref_counted_t* self) nothrow has_one_ref;

    ///
    // Returns true (1) if the current reference count is at least 1.
    ///
    extern(System) int function (cef_base_ref_counted_t* self) nothrow has_at_least_one_ref;
}



///
// All scoped framework structures must include this structure first.
///
struct cef_base_scoped_t
{
    ///
    // Size of the data structure.
    ///
    size_t size;

    ///
    // Called to delete this object. May be NULL if the object is not owned.
    ///
    extern(System) void function (cef_base_scoped_t* self) nothrow del;
}



// Check that the structure |s|, which is defined with a size_t member at the
// top, is large enough to contain the specified member |f|.




// CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6ee74f31d37a1b5ab3c9c5ccbe2dce9841329b38$
//

import core.stdc.config;

extern (C):



///
/// Structure used to represent a browser. When used in the browser process the
/// functions of this structure may be called on any thread unless otherwise
/// indicated in the comments. When used in the render process the functions of
/// this structure may only be called on the main thread.
///
struct cef_browser_t
{
    ///
    /// Base structure.
    ///

    ///
    /// True if this object is currently valid. This will return false (0) after
    /// cef_life_span_handler_t::OnBeforeClose is called.

    cef_base_ref_counted_t base;
    ///
    extern(System) int function (cef_browser_t* self) nothrow is_valid;

    ///
    /// Returns the browser host object. This function can only be called in the
    /// browser process.
    ///
    extern(System) cef_browser_host_t* function (cef_browser_t* self) nothrow get_host;

    ///
    /// Returns true (1) if the browser can navigate backwards.
    ///
    extern(System) int function (cef_browser_t* self) nothrow can_go_back;

    ///
    /// Navigate backwards.
    ///
    extern(System) void function (cef_browser_t* self) nothrow go_back;

    ///
    /// Returns true (1) if the browser can navigate forwards.
    ///
    extern(System) int function (cef_browser_t* self) nothrow can_go_forward;

    ///
    /// Navigate forwards.
    ///
    extern(System) void function (cef_browser_t* self) nothrow go_forward;

    ///
    /// Returns true (1) if the browser is currently loading.
    ///
    extern(System) int function (cef_browser_t* self) nothrow is_loading;

    ///
    /// Reload the current page.
    ///
    extern(System) void function (cef_browser_t* self) nothrow reload;

    ///
    /// Reload the current page ignoring any cached data.
    ///
    extern(System) void function (cef_browser_t* self) nothrow reload_ignore_cache;

    ///
    /// Stop loading the page.
    ///
    extern(System) void function (cef_browser_t* self) nothrow stop_load;

    ///
    /// Returns the globally unique identifier for this browser. This value is
    /// also used as the tabId for extension APIs.
    ///
    extern(System) int function (cef_browser_t* self) nothrow get_identifier;

    ///
    /// Returns true (1) if this object is pointing to the same handle as |that|
    /// object.
    ///
    extern(System) int function (cef_browser_t* self, cef_browser_t* that) nothrow is_same;

    ///
    /// Returns true (1) if the browser is a popup.
    ///
    extern(System) int function (cef_browser_t* self) nothrow is_popup;

    ///
    /// Returns true (1) if a document has been loaded in the browser.
    ///
    extern(System) int function (cef_browser_t* self) nothrow has_document;

    ///
    /// Returns the main (top-level) frame for the browser. In the browser process
    /// this will return a valid object until after
    /// cef_life_span_handler_t::OnBeforeClose is called. In the renderer process
    /// this will return NULL if the main frame is hosted in a different renderer
    /// process (e.g. for cross-origin sub-frames). The main frame object will
    /// change during cross-origin navigation or re-navigation after renderer
    /// process termination (due to crashes, etc).
    ///
    extern(System) cef_frame_t* function (cef_browser_t* self) nothrow get_main_frame;

    ///
    /// Returns the focused frame for the browser.
    ///
    extern(System) cef_frame_t* function (cef_browser_t* self) nothrow get_focused_frame;

    ///
    /// Returns the frame with the specified identifier, or NULL if not found.
    ///
    extern(System) cef_frame_t* function (
        cef_browser_t* self,
        const(cef_string_t)* identifier) nothrow get_frame_by_identifier;

    ///
    /// Returns the frame with the specified name, or NULL if not found.
    ///
    extern(System) cef_frame_t* function (
        cef_browser_t* self,
        const(cef_string_t)* name) nothrow get_frame_by_name;

    ///
    /// Returns the number of frames that currently exist.
    ///
    extern(System) size_t function (cef_browser_t* self) nothrow get_frame_count;

    ///
    /// Returns the identifiers of all existing frames.
    ///
    extern(System) void function (
        cef_browser_t* self,
        cef_string_list_t identifiers) nothrow get_frame_identifiers;

    ///
    /// Returns the names of all existing frames.
    ///
    extern(System) void function (
        cef_browser_t* self,
        cef_string_list_t names) nothrow get_frame_names;
}



///
/// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
/// this structure will be called on the browser process UI thread.
///
struct cef_run_file_dialog_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called asynchronously after the file dialog is dismissed. |file_paths|
    /// will be a single value or a list of values depending on the dialog mode.
    /// If the selection was cancelled |file_paths| will be NULL.
    ///
    extern(System) void function (
        cef_run_file_dialog_callback_t* self,
        cef_string_list_t file_paths) nothrow on_file_dialog_dismissed;
}



///
/// Callback structure for cef_browser_host_t::GetNavigationEntries. The
/// functions of this structure will be called on the browser process UI thread.
///
struct cef_navigation_entry_visitor_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be executed. Do not keep a reference to |entry| outside
    /// of this callback. Return true (1) to continue visiting entries or false
    /// (0) to stop. |current| is true (1) if this entry is the currently loaded
    /// navigation entry. |index| is the 0-based index of this entry and |total|
    /// is the total number of entries.
    ///
    extern(System) int function (
        cef_navigation_entry_visitor_t* self,
        cef_navigation_entry_t* entry,
        int current,
        int index,
        int total) nothrow visit;
}



///
/// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
/// structure will be called on the browser process UI thread.
///
struct cef_pdf_print_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be executed when the PDF printing has completed. |path|
    /// is the output path. |ok| will be true (1) if the printing completed
    /// successfully or false (0) otherwise.
    ///
    extern(System) void function (
        cef_pdf_print_callback_t* self,
        const(cef_string_t)* path,
        int ok) nothrow on_pdf_print_finished;
}



///
/// Callback structure for cef_browser_host_t::DownloadImage. The functions of
/// this structure will be called on the browser process UI thread.
///
struct cef_download_image_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be executed when the image download has completed.
    /// |image_url| is the URL that was downloaded and |http_status_code| is the
    /// resulting HTTP status code. |image| is the resulting image, possibly at
    /// multiple scale factors, or NULL if the download failed.
    ///
    extern(System) void function (
        cef_download_image_callback_t* self,
        const(cef_string_t)* image_url,
        int http_status_code,
        cef_image_t* image) nothrow on_download_image_finished;
}



///
/// Structure used to represent the browser process aspects of a browser. The
/// functions of this structure can only be called in the browser process. They
/// may be called on any thread in that process unless otherwise indicated in
/// the comments.
///
struct cef_browser_host_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the hosted browser object.
    ///
    extern(System) cef_browser_t* function (cef_browser_host_t* self) nothrow get_browser;

    ///
    /// Request that the browser close. The JavaScript 'onbeforeunload' event will
    /// be fired. If |force_close| is false (0) the event handler, if any, will be
    /// allowed to prompt the user and the user can optionally cancel the close.
    /// If |force_close| is true (1) the prompt will not be displayed and the
    /// close will proceed. Results in a call to
    /// cef_life_span_handler_t::do_close() if the event handler allows the close
    /// or if |force_close| is true (1). See cef_life_span_handler_t::do_close()
    /// documentation for additional usage information.
    ///
    extern(System) void function (cef_browser_host_t* self, int force_close) nothrow close_browser;

    ///
    /// Helper for closing a browser. Call this function from the top-level window
    /// close handler (if any). Internally this calls CloseBrowser(false (0)) if
    /// the close has not yet been initiated. This function returns false (0)
    /// while the close is pending and true (1) after the close has completed. See
    /// close_browser() and cef_life_span_handler_t::do_close() documentation for
    /// additional usage information. This function must be called on the browser
    /// process UI thread.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow try_close_browser;

    ///
    /// Set whether the browser is focused.
    ///
    extern(System) void function (cef_browser_host_t* self, int focus) nothrow set_focus;

    ///
    /// Retrieve the window handle (if any) for this browser. If this browser is
    /// wrapped in a cef_browser_view_t this function should be called on the
    /// browser process UI thread and it will return the handle for the top-level
    /// native window.
    ///
    extern(System) c_ulong function (cef_browser_host_t* self) nothrow get_window_handle;

    ///
    /// Retrieve the window handle (if any) of the browser that opened this
    /// browser. Will return NULL for non-popup browsers or if this browser is
    /// wrapped in a cef_browser_view_t. This function can be used in combination
    /// with custom handling of modal windows.
    ///
    extern(System) c_ulong function (cef_browser_host_t* self) nothrow get_opener_window_handle;

    ///
    /// Returns true (1) if this browser is wrapped in a cef_browser_view_t.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow has_view;

    ///
    /// Returns the client for this browser.
    ///
    extern(System) cef_client_t* function (cef_browser_host_t* self) nothrow get_client;

    ///
    /// Returns the request context for this browser.
    ///
    extern(System) cef_request_context_t* function (
        cef_browser_host_t* self) nothrow get_request_context;

    ///
    /// Returns true (1) if this browser can execute the specified zoom command.
    /// This function can only be called on the UI thread.
    ///
    extern(System) int function (
        cef_browser_host_t* self,
        cef_zoom_command_t command) nothrow can_zoom;

    ///
    /// Execute a zoom command in this browser. If called on the UI thread the
    /// change will be applied immediately. Otherwise, the change will be applied
    /// asynchronously on the UI thread.
    ///
    extern(System) void function (cef_browser_host_t* self, cef_zoom_command_t command) nothrow zoom;

    ///
    /// Get the default zoom level. This value will be 0.0 by default but can be
    /// configured with the Chrome runtime. This function can only be called on
    /// the UI thread.
    ///
    extern(System) double function (cef_browser_host_t* self) nothrow get_default_zoom_level;

    ///
    /// Get the current zoom level. This function can only be called on the UI
    /// thread.
    ///
    extern(System) double function (cef_browser_host_t* self) nothrow get_zoom_level;

    ///
    /// Change the zoom level to the specified value. Specify 0.0 to reset the
    /// zoom level to the default. If called on the UI thread the change will be
    /// applied immediately. Otherwise, the change will be applied asynchronously
    /// on the UI thread.
    ///
    extern(System) void function (cef_browser_host_t* self, double zoomLevel) nothrow set_zoom_level;

    ///
    /// Call to run a file chooser dialog. Only a single file chooser dialog may
    /// be pending at any given time. |mode| represents the type of dialog to
    /// display. |title| to the title to be used for the dialog and may be NULL to
    /// show the default title ("Open" or "Save" depending on the mode).
    /// |default_file_path| is the path with optional directory and/or file name
    /// component that will be initially selected in the dialog. |accept_filters|
    /// are used to restrict the selectable file types and may any combination of
    /// (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
    /// individual file extensions (e.g. ".txt" or ".png"), or (c) combined
    /// description and file extension delimited using "|" and ";" (e.g. "Image
    /// Types|.png;.gif;.jpg"). |callback| will be executed after the dialog is
    /// dismissed or immediately if another dialog is already pending. The dialog
    /// will be initiated asynchronously on the UI thread.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        cef_file_dialog_mode_t mode,
        const(cef_string_t)* title,
        const(cef_string_t)* default_file_path,
        cef_string_list_t accept_filters,
        cef_run_file_dialog_callback_t* callback) nothrow run_file_dialog;

    ///
    /// Download the file at |url| using cef_download_handler_t.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* url) nothrow start_download;

    ///
    /// Download |image_url| and execute |callback| on completion with the images
    /// received from the renderer. If |is_favicon| is true (1) then cookies are
    /// not sent and not accepted during download. Images with density independent
    /// pixel (DIP) sizes larger than |max_image_size| are filtered out from the
    /// image results. Versions of the image at different scale factors may be
    /// downloaded up to the maximum scale factor supported by the system. If
    /// there are no image results <= |max_image_size| then the smallest image is
    /// resized to |max_image_size| and is the only result. A |max_image_size| of
    /// 0 means unlimited. If |bypass_cache| is true (1) then |image_url| is
    /// requested from the server even if it is present in the browser cache.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* image_url,
        int is_favicon,
        uint max_image_size,
        int bypass_cache,
        cef_download_image_callback_t* callback) nothrow download_image;

    ///
    /// Print the current browser contents.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow print;

    ///
    /// Print the current browser contents to the PDF file specified by |path| and
    /// execute |callback| on completion. The caller is responsible for deleting
    /// |path| when done. For PDF printing to work on Linux you must implement the
    /// cef_print_handler_t::GetPdfPaperSize function.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* path,
        const(cef_pdf_print_settings_t)* settings,
        cef_pdf_print_callback_t* callback) nothrow print_to_pdf;

    ///
    /// Search for |searchText|. |forward| indicates whether to search forward or
    /// backward within the page. |matchCase| indicates whether the search should
    /// be case-sensitive. |findNext| indicates whether this is the first request
    /// or a follow-up. The search will be restarted if |searchText| or
    /// |matchCase| change. The search will be stopped if |searchText| is NULL.
    /// The cef_find_handler_t instance, if any, returned via
    /// cef_client_t::GetFindHandler will be called to report find results.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* searchText,
        int forward,
        int matchCase,
        int findNext) nothrow find;

    ///
    /// Cancel all searches that are currently going on.
    ///
    extern(System) void function (cef_browser_host_t* self, int clearSelection) nothrow stop_finding;

    ///
    /// Open developer tools (DevTools) in its own browser. The DevTools browser
    /// will remain associated with this browser. If the DevTools browser is
    /// already open then it will be focused, in which case the |windowInfo|,
    /// |client| and |settings| parameters will be ignored. If
    /// |inspect_element_at| is non-NULL then the element at the specified (x,y)
    /// location will be inspected. The |windowInfo| parameter will be ignored if
    /// this browser is wrapped in a cef_browser_view_t.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_window_info_t)* windowInfo,
        cef_client_t* client,
        const(cef_browser_settings_t)* settings,
        const(cef_point_t)* inspect_element_at) nothrow show_dev_tools;

    ///
    /// Explicitly close the associated DevTools browser, if any.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow close_dev_tools;

    ///
    /// Returns true (1) if this browser currently has an associated DevTools
    /// browser. Must be called on the browser process UI thread.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow has_dev_tools;

    ///
    /// Send a function call message over the DevTools protocol. |message| must be
    /// a UTF8-encoded JSON dictionary that contains "id" (int), "function"
    /// (string) and "params" (dictionary, optional) values. See the DevTools
    /// protocol documentation at https://chromedevtools.github.io/devtools-
    /// protocol/ for details of supported functions and the expected "params"
    /// dictionary contents. |message| will be copied if necessary. This function
    /// will return true (1) if called on the UI thread and the message was
    /// successfully submitted for validation, otherwise false (0). Validation
    /// will be applied asynchronously and any messages that fail due to
    /// formatting errors or missing parameters may be discarded without
    /// notification. Prefer ExecuteDevToolsMethod if a more structured approach
    /// to message formatting is desired.
    ///
    /// Every valid function call will result in an asynchronous function result
    /// or error message that references the sent message "id". Event messages are
    /// received while notifications are enabled (for example, between function
    /// calls for "Page.enable" and "Page.disable"). All received messages will be
    /// delivered to the observer(s) registered with AddDevToolsMessageObserver.
    /// See cef_dev_tools_message_observer_t::OnDevToolsMessage documentation for
    /// details of received message contents.
    ///
    /// Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and
    /// AddDevToolsMessageObserver functions does not require an active DevTools
    /// front-end or remote-debugging session. Other active DevTools sessions will
    /// continue to function independently. However, any modification of global
    /// browser state by one session may not be reflected in the UI of other
    /// sessions.
    ///
    /// Communication with the DevTools front-end (when displayed) can be logged
    /// for development purposes by passing the `--devtools-protocol-log-
    /// file=<path>` command-line flag.
    ///
    extern(System) int function (
        cef_browser_host_t* self,
        const(void)* message,
        size_t message_size) nothrow send_dev_tools_message;

    ///
    /// Execute a function call over the DevTools protocol. This is a more
    /// structured version of SendDevToolsMessage. |message_id| is an incremental
    /// number that uniquely identifies the message (pass 0 to have the next
    /// number assigned automatically based on previous values). |function| is the
    /// function name. |params| are the function parameters, which may be NULL.
    /// See the DevTools protocol documentation (linked above) for details of
    /// supported functions and the expected |params| dictionary contents. This
    /// function will return the assigned message ID if called on the UI thread
    /// and the message was successfully submitted for validation, otherwise 0.
    /// See the SendDevToolsMessage documentation for additional usage
    /// information.
    ///
    extern(System) int function (
        cef_browser_host_t* self,
        int message_id,
        const(cef_string_t)* method,
        cef_dictionary_value_t* params) nothrow execute_dev_tools_method;

    ///
    /// Add an observer for DevTools protocol messages (function results and
    /// events). The observer will remain registered until the returned
    /// Registration object is destroyed. See the SendDevToolsMessage
    /// documentation for additional usage information.
    ///
    extern(System) cef_registration_t* function (
        cef_browser_host_t* self,
        cef_dev_tools_message_observer_t* observer) nothrow add_dev_tools_message_observer;

    ///
    /// Retrieve a snapshot of current navigation entries as values sent to the
    /// specified visitor. If |current_only| is true (1) only the current
    /// navigation entry will be sent, otherwise all navigation entries will be
    /// sent.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        cef_navigation_entry_visitor_t* visitor,
        int current_only) nothrow get_navigation_entries;

    ///
    /// If a misspelled word is currently selected in an editable node calling
    /// this function will replace it with the specified |word|.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* word) nothrow replace_misspelling;

    ///
    /// Add the specified |word| to the spelling dictionary.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* word) nothrow add_word_to_dictionary;

    ///
    /// Returns true (1) if window rendering is disabled.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow is_window_rendering_disabled;

    ///
    /// Notify the browser that the widget has been resized. The browser will
    /// first call cef_render_handler_t::GetViewRect to get the new size and then
    /// call cef_render_handler_t::OnPaint asynchronously with the updated
    /// regions. This function is only used when window rendering is disabled.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow was_resized;

    ///
    /// Notify the browser that it has been hidden or shown. Layouting and
    /// cef_render_handler_t::OnPaint notification will stop when the browser is
    /// hidden. This function is only used when window rendering is disabled.
    ///
    extern(System) void function (cef_browser_host_t* self, int hidden) nothrow was_hidden;

    ///
    /// Send a notification to the browser that the screen info has changed. The
    /// browser will then call cef_render_handler_t::GetScreenInfo to update the
    /// screen information with the new values. This simulates moving the webview
    /// window from one display to another, or changing the properties of the
    /// current display. This function is only used when window rendering is
    /// disabled.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow notify_screen_info_changed;

    ///
    /// Invalidate the view. The browser will call cef_render_handler_t::OnPaint
    /// asynchronously. This function is only used when window rendering is
    /// disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        cef_paint_element_type_t type) nothrow invalidate;

    ///
    /// Issue a BeginFrame request to Chromium.  Only valid when
    /// cef_window_tInfo::external_begin_frame_enabled is set to true (1).
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow send_external_begin_frame;

    ///
    /// Send a key event to the browser.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_key_event_t)* event) nothrow send_key_event;

    ///
    /// Send a mouse click event to the browser. The |x| and |y| coordinates are
    /// relative to the upper-left corner of the view.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_mouse_event_t)* event,
        cef_mouse_button_type_t type,
        int mouseUp,
        int clickCount) nothrow send_mouse_click_event;

    ///
    /// Send a mouse move event to the browser. The |x| and |y| coordinates are
    /// relative to the upper-left corner of the view.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_mouse_event_t)* event,
        int mouseLeave) nothrow send_mouse_move_event;

    ///
    /// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
    /// relative to the upper-left corner of the view. The |deltaX| and |deltaY|
    /// values represent the movement delta in the X and Y directions
    /// respectively. In order to scroll inside select popups with window
    /// rendering disabled cef_render_handler_t::GetScreenPoint should be
    /// implemented properly.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_mouse_event_t)* event,
        int deltaX,
        int deltaY) nothrow send_mouse_wheel_event;

    ///
    /// Send a touch event to the browser for a windowless browser.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_touch_event_t)* event) nothrow send_touch_event;

    ///
    /// Send a capture lost event to the browser.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow send_capture_lost_event;

    ///
    /// Notify the browser that the window hosting it is about to be moved or
    /// resized. This function is only used on Windows and Linux.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow notify_move_or_resize_started;

    ///
    /// Returns the maximum rate in frames per second (fps) that
    /// cef_render_handler_t::OnPaint will be called for a windowless browser. The
    /// actual fps may be lower if the browser cannot generate frames at the
    /// requested rate. The minimum value is 1 and the maximum value is 60
    /// (default 30). This function can only be called on the UI thread.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow get_windowless_frame_rate;

    ///
    /// Set the maximum rate in frames per second (fps) that
    /// cef_render_handler_t:: OnPaint will be called for a windowless browser.
    /// The actual fps may be lower if the browser cannot generate frames at the
    /// requested rate. The minimum value is 1 and the maximum value is 60
    /// (default 30). Can also be set at browser creation via
    /// cef_browser_tSettings.windowless_frame_rate.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        int frame_rate) nothrow set_windowless_frame_rate;

    ///
    /// Begins a new composition or updates the existing composition. Blink has a
    /// special node (a composition node) that allows the input function to change
    /// text without affecting other DOM nodes. |text| is the optional text that
    /// will be inserted into the composition node. |underlines| is an optional
    /// set of ranges that will be underlined in the resulting text.
    /// |replacement_range| is an optional range of the existing text that will be
    /// replaced. |selection_range| is an optional range of the resulting text
    /// that will be selected after insertion or replacement. The
    /// |replacement_range| value is only used on OS X.
    ///
    /// This function may be called multiple times as the composition changes.
    /// When the client is done making changes the composition should either be
    /// canceled or completed. To cancel the composition call
    /// ImeCancelComposition. To complete the composition call either
    /// ImeCommitText or ImeFinishComposingText. Completion is usually signaled
    /// when:
    ///
    /// 1. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR
    ///    flag (on Windows), or;
    /// 2. The client receives a "commit" signal of GtkIMContext (on Linux), or;
    /// 3. insertText of NSTextInput is called (on Mac).
    ///
    /// This function is only used when window rendering is disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* text,
        size_t underlinesCount,
        const(cef_composition_underline_t)* underlines,
        const(cef_range_t)* replacement_range,
        const(cef_range_t)* selection_range) nothrow ime_set_composition;

    ///
    /// Completes the existing composition by optionally inserting the specified
    /// |text| into the composition node. |replacement_range| is an optional range
    /// of the existing text that will be replaced. |relative_cursor_pos| is where
    /// the cursor will be positioned relative to the current cursor position. See
    /// comments on ImeSetComposition for usage. The |replacement_range| and
    /// |relative_cursor_pos| values are only used on OS X. This function is only
    /// used when window rendering is disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_string_t)* text,
        const(cef_range_t)* replacement_range,
        int relative_cursor_pos) nothrow ime_commit_text;

    ///
    /// Completes the existing composition by applying the current composition
    /// node contents. If |keep_selection| is false (0) the current selection, if
    /// any, will be discarded. See comments on ImeSetComposition for usage. This
    /// function is only used when window rendering is disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        int keep_selection) nothrow ime_finish_composing_text;

    ///
    /// Cancels the existing composition and discards the composition node
    /// contents without applying them. See comments on ImeSetComposition for
    /// usage. This function is only used when window rendering is disabled.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow ime_cancel_composition;

    ///
    /// Call this function when the user drags the mouse into the web view (before
    /// calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data|
    /// should not contain file contents as this type of data is not allowed to be
    /// dragged into the web view. File contents can be removed using
    /// cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from
    /// cef_render_handler_t::StartDragging). This function is only used when
    /// window rendering is disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        cef_drag_data_t* drag_data,
        const(cef_mouse_event_t)* event,
        cef_drag_operations_mask_t allowed_ops) nothrow drag_target_drag_enter;

    ///
    /// Call this function each time the mouse is moved across the web view during
    /// a drag operation (after calling DragTargetDragEnter and before calling
    /// DragTargetDragLeave/DragTargetDrop). This function is only used when
    /// window rendering is disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_mouse_event_t)* event,
        cef_drag_operations_mask_t allowed_ops) nothrow drag_target_drag_over;

    ///
    /// Call this function when the user drags the mouse out of the web view
    /// (after calling DragTargetDragEnter). This function is only used when
    /// window rendering is disabled.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow drag_target_drag_leave;

    ///
    /// Call this function when the user completes the drag operation by dropping
    /// the object onto the web view (after calling DragTargetDragEnter). The
    /// object being dropped is |drag_data|, given as an argument to the previous
    /// DragTargetDragEnter call. This function is only used when window rendering
    /// is disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        const(cef_mouse_event_t)* event) nothrow drag_target_drop;

    ///
    /// Call this function when the drag operation started by a
    /// cef_render_handler_t::StartDragging call has ended either in a drop or by
    /// being cancelled. |x| and |y| are mouse coordinates relative to the upper-
    /// left corner of the view. If the web view is both the drag source and the
    /// drag target then all DragTarget* functions should be called before
    /// DragSource* mthods. This function is only used when window rendering is
    /// disabled.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        int x,
        int y,
        cef_drag_operations_mask_t op) nothrow drag_source_ended_at;

    ///
    /// Call this function when the drag operation started by a
    /// cef_render_handler_t::StartDragging call has completed. This function may
    /// be called immediately without first calling DragSourceEndedAt to cancel a
    /// drag operation. If the web view is both the drag source and the drag
    /// target then all DragTarget* functions should be called before DragSource*
    /// mthods. This function is only used when window rendering is disabled.
    ///
    extern(System) void function (cef_browser_host_t* self) nothrow drag_source_system_drag_ended;

    ///
    /// Returns the current visible navigation entry for this browser. This
    /// function can only be called on the UI thread.
    ///
    extern(System) cef_navigation_entry_t* function (
        cef_browser_host_t* self) nothrow get_visible_navigation_entry;

    ///
    /// Set accessibility state for all frames. |accessibility_state| may be
    /// default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT
    /// then accessibility will be disabled by default and the state may be
    /// further controlled with the "force-renderer-accessibility" and "disable-
    /// renderer-accessibility" command-line switches. If |accessibility_state| is
    /// STATE_ENABLED then accessibility will be enabled. If |accessibility_state|
    /// is STATE_DISABLED then accessibility will be completely disabled.
    ///
    /// For windowed browsers accessibility will be enabled in Complete mode
    /// (which corresponds to kAccessibilityModeComplete in Chromium). In this
    /// mode all platform accessibility objects will be created and managed by
    /// Chromium's internal implementation. The client needs only to detect the
    /// screen reader and call this function appropriately. For example, on macOS
    /// the client can handle the @"AXEnhancedUserStructure" accessibility
    /// attribute to detect VoiceOver state changes and on Windows the client can
    /// handle WM_GETOBJECT with OBJID_CLIENT to detect accessibility readers.
    ///
    /// For windowless browsers accessibility will be enabled in TreeOnly mode
    /// (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In
    /// this mode renderer accessibility is enabled, the full tree is computed,
    /// and events are passed to CefAccessibiltyHandler, but platform
    /// accessibility objects are not created. The client may implement platform
    /// accessibility objects using CefAccessibiltyHandler callbacks if desired.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        cef_state_t accessibility_state) nothrow set_accessibility_state;

    ///
    /// Enable notifications of auto resize via
    /// cef_display_handler_t::OnAutoResize. Notifications are disabled by
    /// default. |min_size| and |max_size| define the range of allowed sizes.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        int enabled,
        const(cef_size_t)* min_size,
        const(cef_size_t)* max_size) nothrow set_auto_resize_enabled;

    ///
    /// Returns the extension hosted in this browser or NULL if no extension is
    /// hosted. See cef_request_context_t::LoadExtension for details.
    ///
    /// WARNING: This function is deprecated and will be removed in ~M127.
    ///
    extern(System) cef_extension_t* function (cef_browser_host_t* self) nothrow get_extension;

    ///
    /// Returns true (1) if this browser is hosting an extension background
    /// script. Background hosts do not have a window and are not displayable. See
    /// cef_request_context_t::LoadExtension for details.
    ///
    /// WARNING: This function is deprecated and will be removed in ~M127.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow is_background_host;

    ///
    /// Set whether the browser's audio is muted.
    ///
    extern(System) void function (cef_browser_host_t* self, int mute) nothrow set_audio_muted;

    ///
    /// Returns true (1) if the browser's audio is muted.  This function can only
    /// be called on the UI thread.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow is_audio_muted;

    ///
    /// Returns true (1) if the renderer is currently in browser fullscreen. This
    /// differs from window fullscreen in that browser fullscreen is entered using
    /// the JavaScript Fullscreen API and modifies CSS attributes such as the
    /// ::backdrop pseudo-element and :fullscreen pseudo-structure. This function
    /// can only be called on the UI thread.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow is_fullscreen;

    ///
    /// Requests the renderer to exit browser fullscreen. In most cases exiting
    /// window fullscreen should also exit browser fullscreen. With the Alloy
    /// runtime this function should be called in response to a user action such
    /// as clicking the green traffic light button on MacOS
    /// (cef_window_delegate_t::OnWindowFullscreenTransition callback) or pressing
    /// the "ESC" key (cef_keyboard_handler_t::OnPreKeyEvent callback). With the
    /// Chrome runtime these standard exit actions are handled internally but
    /// new/additional user actions can use this function. Set |will_cause_resize|
    /// to true (1) if exiting browser fullscreen will cause a view resize.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        int will_cause_resize) nothrow exit_fullscreen;

    ///
    /// Returns true (1) if a Chrome command is supported and enabled. Values for
    /// |command_id| can be found in the cef_command_ids.h file. This function can
    /// only be called on the UI thread. Only used with the Chrome runtime.
    ///
    extern(System) int function (
        cef_browser_host_t* self,
        int command_id) nothrow can_execute_chrome_command;

    ///
    /// Execute a Chrome command. Values for |command_id| can be found in the
    /// cef_command_ids.h file. |disposition| provides information about the
    /// intended command target. Only used with the Chrome runtime.
    ///
    extern(System) void function (
        cef_browser_host_t* self,
        int command_id,
        cef_window_open_disposition_t disposition) nothrow execute_chrome_command;

    ///
    /// Returns true (1) if the render process associated with this browser is
    /// currently unresponsive as indicated by a lack of input event processing
    /// for at least 15 seconds. To receive associated state change notifications
    /// and optionally handle an unresponsive render process implement
    /// cef_request_handler_t::OnRenderProcessUnresponsive. This function can only
    /// be called on the UI thread.
    ///
    extern(System) int function (cef_browser_host_t* self) nothrow is_render_process_unresponsive;

    ///
    /// Returns the runtime style for this browser (ALLOY or CHROME). See
    /// cef_runtime_style_t documentation for details.
    ///
    extern(System) cef_runtime_style_t function (cef_browser_host_t* self) nothrow get_runtime_style;
}

struct cef_accelerated_paint_info_t;

///
/// Describes how to interpret the components of a pixel.
///
enum cef_color_type_t
{
    ///
    /// RGBA with 8 bits per pixel (32bits total).
    ///
    CEF_COLOR_TYPE_RGBA_8888 = 0,

    ///
    /// BGRA with 8 bits per pixel (32bits total).
    ///
    CEF_COLOR_TYPE_BGRA_8888 = 1
}

enum cef_runtime_style_t
{
    ///
    /// Use the default runtime style. The default style will match the
    /// CefSettings.chrome_runtime value in most cases. See above documentation
    /// for exceptions.
    ///
    CEF_RUNTIME_STYLE_DEFAULT = 0,

    ///
    /// Use the Chrome runtime style. Only supported with the Chrome runtime.
    ///
    CEF_RUNTIME_STYLE_CHROME = 1,

    ///
    /// Use the Alloy runtime style. Supported with both the Alloy and Chrome
    /// runtime.
    ///
    CEF_RUNTIME_STYLE_ALLOY = 2
}


///
/// Create a new browser using the window parameters specified by |windowInfo|.
/// All values will be copied internally and the actual window (if any) will be
/// created on the UI thread. If |request_context| is NULL the global request
/// context will be used. This function can be called on any browser process
/// thread and will not block. The optional |extra_info| parameter provides an
/// opportunity to specify extra information specific to the created browser
/// that will be passed to cef_render_process_handler_t::on_browser_created() in
/// the render process.
///
int cef_browser_host_create_browser (
    const(cef_window_info_t)* windowInfo,
    cef_client_t* client,
    const(cef_string_t)* url,
    const(cef_browser_settings_t)* settings,
    cef_dictionary_value_t* extra_info,
    cef_request_context_t* request_context);

///
/// Create a new browser using the window parameters specified by |windowInfo|.
/// If |request_context| is NULL the global request context will be used. This
/// function can only be called on the browser process UI thread. The optional
/// |extra_info| parameter provides an opportunity to specify extra information
/// specific to the created browser that will be passed to
/// cef_render_process_handler_t::on_browser_created() in the render process.
///
cef_browser_t* cef_browser_host_create_browser_sync (
    const(cef_window_info_t)* windowInfo,
    cef_client_t* client,
    const(cef_string_t)* url,
    const(cef_browser_settings_t)* settings,
    cef_dictionary_value_t* extra_info,
    cef_request_context_t* request_context);

// CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d958d5bed7f909f6313facef3440fb8ba07a5c01$
//

extern (C):

///
/// Structure used to implement browser process callbacks. The functions of this
/// structure will be called on the browser process main thread unless otherwise
/// indicated.
///
struct cef_browser_process_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Provides an opportunity to register custom preferences prior to global and
    /// request context initialization.
    ///
    /// If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be
    /// accessed via cef_preference_manager_t::GetGlobalPreferences after
    /// OnContextInitialized is called. Global preferences are registered a single

    cef_base_ref_counted_t base;
    /// time at application startup. See related cef_settings_t.cache_path and
    /// cef_settings_t.persist_user_preferences configuration.
    ///
    /// If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be
    /// accessed via the cef_request_context_t after
    /// cef_request_context_handler_t::OnRequestContextInitialized is called.
    /// Request context preferences are registered each time a new
    /// cef_request_context_t is created. It is intended but not required that all
    /// request contexts have the same registered preferences. See related
    /// cef_request_context_settings_t.cache_path and
    /// cef_request_context_settings_t.persist_user_preferences configuration.
    ///
    /// Do not keep a reference to the |registrar| object. This function is called
    /// on the browser process UI thread.
    ///
    extern(System) void function (
        cef_browser_process_handler_t* self,
        cef_preferences_type_t type,
        cef_preference_registrar_t* registrar) nothrow on_register_custom_preferences;

    ///
    /// Called on the browser process UI thread immediately after the CEF context
    /// has been initialized.
    ///
    extern(System) void function (
        cef_browser_process_handler_t* self) nothrow on_context_initialized;

    ///
    /// Called before a child process is launched. Will be called on the browser
    /// process UI thread when launching a render process and on the browser
    /// process IO thread when launching a GPU process. Provides an opportunity to
    /// modify the child process command line. Do not keep a reference to
    /// |command_line| outside of this function.
    ///
    extern(System) void function (
        cef_browser_process_handler_t* self,
        cef_command_line_t* command_line) nothrow on_before_child_process_launch;

    ///
    /// Implement this function to provide app-specific behavior when an already
    /// running app is relaunched with the same CefSettings.root_cache_path value.
    /// For example, activate an existing app window or create a new app window.
    /// |command_line| will be read-only. Do not keep a reference to
    /// |command_line| outside of this function. Return true (1) if the relaunch
    /// is handled or false (0) for default relaunch behavior. Default behavior
    /// will create a new default styled Chrome window.
    ///
    /// To avoid cache corruption only a single app instance is allowed to run for
    /// a given CefSettings.root_cache_path value. On relaunch the app checks a
    /// process singleton lock and then forwards the new launch arguments to the
    /// already running app process before exiting early. Client apps should
    /// therefore check the cef_initialize() return value for early exit before
    /// proceeding.
    ///
    /// This function will be called on the browser process UI thread.
    ///
    extern(System) int function (
        cef_browser_process_handler_t* self,
        cef_command_line_t* command_line,
        const(cef_string_t)* current_directory) nothrow on_already_running_app_relaunch;

    ///
    /// Called from any thread when work has been scheduled for the browser
    /// process main (UI) thread. This callback is used in combination with
    /// cef_settings_t.external_message_pump and cef_do_message_loop_work() in
    /// cases where the CEF message loop must be integrated into an existing
    /// application message loop (see additional comments and warnings on
    /// CefDoMessageLoopWork). This callback should schedule a
    /// cef_do_message_loop_work() call to happen on the main (UI) thread.
    /// |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0
    /// then the call should happen reasonably soon. If |delay_ms| is > 0 then the
    /// call should be scheduled to happen after the specified delay and any
    /// currently pending scheduled call should be cancelled.
    ///
    extern(System) void function (
        cef_browser_process_handler_t* self,
        long delay_ms) nothrow on_schedule_message_pump_work;

    ///
    /// Return the default client for use with a newly created browser window
    /// (cef_browser_t object). If null is returned the cef_browser_t will be
    /// unmanaged (no callbacks will be executed for that cef_browser_t) and
    /// application shutdown will be blocked until the browser window is closed
    /// manually. This function is currently only used with the Chrome runtime
    /// when creating new browser windows via Chrome UI.
    ///
    extern(System) cef_client_t* function (
        cef_browser_process_handler_t* self) nothrow get_default_client;

    ///
    /// Return the default handler for use with a new user or incognito profile
    /// (cef_request_context_t object). If null is returned the
    /// cef_request_context_t will be unmanaged (no callbacks will be executed for
    /// that cef_request_context_t). This function is currently only used with the
    /// Chrome runtime when creating new browser windows via Chrome UI.
    ///
    extern(System) cef_request_context_handler_t* function (
        cef_browser_process_handler_t* self) nothrow get_default_request_context_handler;
}



// CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=46bc048bec64590735298a95633167d66e445844$
//

extern (C):

///
/// Generic callback structure used for asynchronous continuation.
///
struct cef_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Continue processing.
    ///

    ///
    /// Cancel processing.
    ///

    ///
    /// Generic callback structure used for asynchronous completion.
    ///

    ///
    /// Base structure.
    ///

    ///
    /// Method that will be called once the task is complete.
    ///

    // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_

    cef_base_ref_counted_t base;
    extern(System) void function (cef_callback_t* self) nothrow cont;
    extern(System) void function (cef_callback_t* self) nothrow cancel;
}



struct cef_completion_callback_t
{
    cef_base_ref_counted_t base;
    extern(System) void function (cef_completion_callback_t* self) nothrow on_complete;
}


// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=09bd4140605645c9dfbd81e7e22d029d0bb50129$
//

extern (C):

///
/// Implement this structure to provide handler implementations.
///
struct cef_client_t
{
    ///
    /// Base structure.
    ///

    cef_base_ref_counted_t base; ///
    /// Return the handler for audio rendering events.
    ///
    extern(System) cef_audio_handler_t* function (cef_client_t* self) nothrow get_audio_handler;

    ///
    /// Return the handler for commands. If no handler is provided the default
    /// implementation will be used.
    ///
    extern(System) cef_command_handler_t* function (cef_client_t* self) nothrow get_command_handler;

    ///
    /// Return the handler for context menus. If no handler is provided the
    /// default implementation will be used.
    ///
    extern(System) cef_context_menu_handler_t* function (
        cef_client_t* self) nothrow get_context_menu_handler;

    ///
    /// Return the handler for dialogs. If no handler is provided the default
    /// implementation will be used.
    ///
    extern(System) cef_dialog_handler_t* function (cef_client_t* self) nothrow get_dialog_handler;

    ///
    /// Return the handler for browser display state events.
    ///
    extern(System) cef_display_handler_t* function (cef_client_t* self) nothrow get_display_handler;

    ///
    /// Return the handler for download events. If no handler is returned
    /// downloads will not be allowed.
    ///
    extern(System) cef_download_handler_t* function (
        cef_client_t* self) nothrow get_download_handler;

    ///
    /// Return the handler for drag events.
    ///
    extern(System) cef_drag_handler_t* function (cef_client_t* self) nothrow get_drag_handler;

    ///
    /// Return the handler for find result events.
    ///
    extern(System) cef_find_handler_t* function (cef_client_t* self) nothrow get_find_handler;

    ///
    /// Return the handler for focus events.
    ///
    extern(System) cef_focus_handler_t* function (cef_client_t* self) nothrow get_focus_handler;

    ///
    /// Return the handler for events related to cef_frame_t lifespan. This
    /// function will be called once during cef_browser_t creation and the result
    /// will be cached for performance reasons.
    ///
    extern(System) cef_frame_handler_t* function (cef_client_t* self) nothrow get_frame_handler;

    ///
    /// Return the handler for permission requests.
    ///
    extern(System) cef_permission_handler_t* function (
        cef_client_t* self) nothrow get_permission_handler;

    ///
    /// Return the handler for JavaScript dialogs. If no handler is provided the
    /// default implementation will be used.
    ///
    extern(System) cef_jsdialog_handler_t* function (
        cef_client_t* self) nothrow get_jsdialog_handler;

    ///
    /// Return the handler for keyboard events.
    ///
    extern(System) cef_keyboard_handler_t* function (
        cef_client_t* self) nothrow get_keyboard_handler;

    ///
    /// Return the handler for browser life span events.
    ///
    extern(System) cef_life_span_handler_t* function (
        cef_client_t* self) nothrow get_life_span_handler;

    ///
    /// Return the handler for browser load status events.
    ///
    extern(System) cef_load_handler_t* function (cef_client_t* self) nothrow get_load_handler;

    ///
    /// Return the handler for printing on Linux. If a print handler is not
    /// provided then printing will not be supported on the Linux platform.
    ///
    extern(System) cef_print_handler_t* function (cef_client_t* self) nothrow get_print_handler;

    ///
    /// Return the handler for off-screen rendering events.
    ///
    extern(System) cef_render_handler_t* function (cef_client_t* self) nothrow get_render_handler;

    ///
    /// Return the handler for browser request events.
    ///
    extern(System) cef_request_handler_t* function (cef_client_t* self) nothrow get_request_handler;

    ///
    /// Called when a new message is received from a different process. Return
    /// true (1) if the message was handled or false (0) otherwise.  It is safe to
    /// keep a reference to |message| outside of this callback.
    ///
    extern(System) int function (
        cef_client_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_process_id_t source_process,
        cef_process_message_t* message) nothrow on_process_message_received;
}



// CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dd183a473b1e8c5ee8bdcf99949fc5274c4cc892$
//

extern (C):

///
/// Implement this structure to handle events related to commands. The functions
/// of this structure will be called on the UI thread.
///
struct cef_command_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called to execute a Chrome command triggered via menu selection or
    /// keyboard shortcut. Values for |command_id| can be found in the
    /// cef_command_ids.h file. |disposition| provides information about the
    /// intended command target. Return true (1) if the command was handled or
    /// false (0) for the default implementation. For context menu commands this
    /// will be called after cef_context_menu_handler_t::OnContextMenuCommand.
    /// Only used with the Chrome runtime.
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (
        cef_command_handler_t* self,
        cef_browser_t* browser,
        int command_id,
        cef_window_open_disposition_t disposition) nothrow on_chrome_command;
    ///
    /// Called to check if a Chrome app menu item should be visible. Values for
    /// |command_id| can be found in the cef_command_ids.h file. Only called for
    /// menu items that would be visible by default. Only used with the Chrome
    /// runtime.
    ///
    extern(System) int function (
        cef_command_handler_t* self,
        cef_browser_t* browser,
        int command_id) nothrow is_chrome_app_menu_item_visible;

    ///
    /// Called to check if a Chrome app menu item should be enabled. Values for
    /// |command_id| can be found in the cef_command_ids.h file. Only called for
    /// menu items that would be enabled by default. Only used with the Chrome
    /// runtime.
    ///
    extern(System) int function (
        cef_command_handler_t* self,
        cef_browser_t* browser,
        int command_id) nothrow is_chrome_app_menu_item_enabled;

    ///
    /// Called during browser creation to check if a Chrome page action icon
    /// should be visible. Only called for icons that would be visible by default.
    /// Only used with the Chrome runtime.
    ///
    extern(System) int function (
        cef_command_handler_t* self,
        cef_chrome_page_action_icon_type_t icon_type) nothrow is_chrome_page_action_icon_visible;

    ///
    /// Called during browser creation to check if a Chrome toolbar button should
    /// be visible. Only called for buttons that would be visible by default. Only
    /// used with the Chrome runtime.
    ///
    extern(System) int function (
        cef_command_handler_t* self,
        cef_chrome_toolbar_button_type_t button_type) nothrow is_chrome_toolbar_button_visible;
}



// CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fce786b3f054d6581438e2906b77e573c797372a$
//

extern (C):

///
/// Structure used to create and/or parse command line arguments. Arguments with
/// "--", "-" and, on Windows, "/" prefixes are considered switches. Switches
/// will always precede any arguments without switch prefixes. Switches can
/// optionally have a value specified using the "=" delimiter (e.g.
/// "-switch=value"). An argument of "--" will terminate switch parsing with all
/// subsequent tokens, regardless of prefix, being interpreted as non-switch
/// arguments. Switch names should be lowercase ASCII and will be converted to
/// such if necessary. Switch values will retain the original case and UTF8
/// encoding. This structure can be used before cef_initialize() is called.
///
struct cef_command_line_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is valid. Do not call any other functions
    /// if this function returns false (0).

    cef_base_ref_counted_t base;
    ///
    extern(System) int function (cef_command_line_t* self) nothrow is_valid;

    ///
    /// Returns true (1) if the values of this object are read-only. Some APIs may
    /// expose read-only objects.
    ///
    extern(System) int function (cef_command_line_t* self) nothrow is_read_only;

    ///
    /// Returns a writable copy of this object.
    ///
    extern(System) cef_command_line_t* function (cef_command_line_t* self) nothrow copy;

    ///
    /// Initialize the command line with the specified |argc| and |argv| values.
    /// The first argument must be the name of the program. This function is only
    /// supported on non-Windows platforms.
    ///
    extern(System) void function (
        cef_command_line_t* self,
        int argc,
        const(char*)* argv) nothrow init_from_argv;

    ///
    /// Initialize the command line with the string returned by calling
    /// GetCommandLineW(). This function is only supported on Windows.
    ///
    extern(System) void function (
        cef_command_line_t* self,
        const(cef_string_t)* command_line) nothrow init_from_string;

    ///
    /// Reset the command-line switches and arguments but leave the program
    /// component unchanged.
    ///
    extern(System) void function (cef_command_line_t* self) nothrow reset;

    ///
    /// Retrieve the original command line string as a vector of strings. The argv
    /// array: `{ program, [(--|-|/)switch[=value]]*, [--], [argument]* }`
    ///
    extern(System) void function (cef_command_line_t* self, cef_string_list_t argv) nothrow get_argv;

    ///
    /// Constructs and returns the represented command line string. Use this
    /// function cautiously because quoting behavior is unclear.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_command_line_t* self) nothrow get_command_line_string;

    ///
    /// Get the program part of the command line string (the first item).
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_command_line_t* self) nothrow get_program;

    ///
    /// Set the program part of the command line string (the first item).
    ///
    extern(System) void function (
        cef_command_line_t* self,
        const(cef_string_t)* program) nothrow set_program;

    ///
    /// Returns true (1) if the command line has switches.
    ///
    extern(System) int function (cef_command_line_t* self) nothrow has_switches;

    ///
    /// Returns true (1) if the command line contains the given switch.
    ///
    extern(System) int function (
        cef_command_line_t* self,
        const(cef_string_t)* name) nothrow has_switch;

    ///
    /// Returns the value associated with the given switch. If the switch has no
    /// value or isn't present this function returns the NULL string.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_command_line_t* self,
        const(cef_string_t)* name) nothrow get_switch_value;

    ///
    /// Returns the map of switch names and values. If a switch has no value an
    /// NULL string is returned.
    ///
    extern(System) void function (
        cef_command_line_t* self,
        cef_string_map_t switches) nothrow get_switches;

    ///
    /// Add a switch to the end of the command line.
    ///
    extern(System) void function (
        cef_command_line_t* self,
        const(cef_string_t)* name) nothrow append_switch;

    ///
    /// Add a switch with the specified value to the end of the command line. If
    /// the switch has no value pass an NULL value string.
    ///
    extern(System) void function (
        cef_command_line_t* self,
        const(cef_string_t)* name,
        const(cef_string_t)* value) nothrow append_switch_with_value;

    ///
    /// True if there are remaining command line arguments.
    ///
    extern(System) int function (cef_command_line_t* self) nothrow has_arguments;

    ///
    /// Get the remaining command line arguments.
    ///
    extern(System) void function (
        cef_command_line_t* self,
        cef_string_list_t arguments) nothrow get_arguments;

    ///
    /// Add an argument to the end of the command line.
    ///
    extern(System) void function (
        cef_command_line_t* self,
        const(cef_string_t)* argument) nothrow append_argument;

    ///
    /// Insert a command before the current command. Common for debuggers, like
    /// "valgrind" or "gdb --args".
    ///
    extern(System) void function (
        cef_command_line_t* self,
        const(cef_string_t)* wrapper) nothrow prepend_wrapper;
}



///
/// Create a new cef_command_line_t instance.
///
cef_command_line_t* cef_command_line_create ();

///
/// Returns the singleton global cef_command_line_t object. The returned object
/// will be read-only.
///
cef_command_line_t* cef_command_line_get_global ();

// CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=3ae7dbb24ec7a95a2f4d4e390c9b6622221c2f42$
//

extern (C):

///
/// Callback structure used for continuation of custom context menu display.
///
struct cef_run_context_menu_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Complete context menu display by selecting the specified |command_id| and
    /// |event_flags|.
    ///

    ///
    /// Cancel context menu display.
    ///

    ///
    /// Callback structure used for continuation of custom quick menu display.

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_run_context_menu_callback_t* self,
        int command_id,
        cef_event_flags_t event_flags) nothrow cont;
    extern(System) void function (cef_run_context_menu_callback_t* self) nothrow cancel;
}


///
struct cef_run_quick_menu_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Complete quick menu display by selecting the specified |command_id| and
    /// |event_flags|.
    ///
    extern(System) void function (
        cef_run_quick_menu_callback_t* self,
        int command_id,
        cef_event_flags_t event_flags) nothrow cont;

    ///
    /// Cancel quick menu display.
    ///
    extern(System) void function (cef_run_quick_menu_callback_t* self) nothrow cancel;
}



///
/// Implement this structure to handle context menu events. The functions of
/// this structure will be called on the UI thread.
///
struct cef_context_menu_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called before a context menu is displayed. |params| provides information
    /// about the context menu state. |model| initially contains the default
    /// context menu. The |model| can be cleared to show no context menu or
    /// modified to show a custom menu. Do not keep references to |params| or
    /// |model| outside of this callback.
    ///
    extern(System) void function (
        cef_context_menu_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_context_menu_params_t* params,
        cef_menu_model_t* model) nothrow on_before_context_menu;

    ///
    /// Called to allow custom display of the context menu. |params| provides
    /// information about the context menu state. |model| contains the context
    /// menu model resulting from OnBeforeContextMenu. For custom display return
    /// true (1) and execute |callback| either synchronously or asynchronously
    /// with the selected command ID. For default display return false (0). Do not
    /// keep references to |params| or |model| outside of this callback.
    ///
    extern(System) int function (
        cef_context_menu_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_context_menu_params_t* params,
        cef_menu_model_t* model,
        cef_run_context_menu_callback_t* callback) nothrow run_context_menu;

    ///
    /// Called to execute a command selected from the context menu. Return true
    /// (1) if the command was handled or false (0) for the default
    /// implementation. See cef_menu_id_t for the command ids that have default
    /// implementations. All user-defined command ids should be between
    /// MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |params| will have the same
    /// values as what was passed to on_before_context_menu(). Do not keep a
    /// reference to |params| outside of this callback.
    ///
    extern(System) int function (
        cef_context_menu_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_context_menu_params_t* params,
        int command_id,
        cef_event_flags_t event_flags) nothrow on_context_menu_command;

    ///
    /// Called when the context menu is dismissed irregardless of whether the menu
    /// was canceled or a command was selected.
    ///
    extern(System) void function (
        cef_context_menu_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame) nothrow on_context_menu_dismissed;

    ///
    /// Called to allow custom display of the quick menu for a windowless browser.
    /// |location| is the top left corner of the selected region. |size| is the
    /// size of the selected region. |edit_state_flags| is a combination of flags
    /// that represent the state of the quick menu. Return true (1) if the menu
    /// will be handled and execute |callback| either synchronously or
    /// asynchronously with the selected command ID. Return false (0) to cancel
    /// the menu.
    ///
    extern(System) int function (
        cef_context_menu_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        const(cef_point_t)* location,
        const(cef_size_t)* size,
        cef_quick_menu_edit_state_flags_t edit_state_flags,
        cef_run_quick_menu_callback_t* callback) nothrow run_quick_menu;

    ///
    /// Called to execute a command selected from the quick menu for a windowless
    /// browser. Return true (1) if the command was handled or false (0) for the
    /// default implementation. See cef_menu_id_t for command IDs that have
    /// default implementations.
    ///
    extern(System) int function (
        cef_context_menu_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        int command_id,
        cef_event_flags_t event_flags) nothrow on_quick_menu_command;

    ///
    /// Called when the quick menu for a windowless browser is dismissed
    /// irregardless of whether the menu was canceled or a command was selected.
    ///
    extern(System) void function (
        cef_context_menu_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame) nothrow on_quick_menu_dismissed;
}



///
/// Provides information about the context menu state. The functions of this
/// structure can only be accessed on browser process the UI thread.
///
struct cef_context_menu_params_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the X coordinate of the mouse where the context menu was invoked.
    /// Coords are relative to the associated RenderView's origin.
    ///
    extern(System) int function (cef_context_menu_params_t* self) nothrow get_xcoord;

    ///
    /// Returns the Y coordinate of the mouse where the context menu was invoked.
    /// Coords are relative to the associated RenderView's origin.
    ///
    extern(System) int function (cef_context_menu_params_t* self) nothrow get_ycoord;

    ///
    /// Returns flags representing the type of node that the context menu was
    /// invoked on.
    ///
    extern(System) cef_context_menu_type_flags_t function (
        cef_context_menu_params_t* self) nothrow get_type_flags;

    ///
    /// Returns the URL of the link, if any, that encloses the node that the
    /// context menu was invoked on.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_link_url;

    ///
    /// Returns the link URL, if any, to be used ONLY for "copy link address". We
    /// don't validate this field in the frontend process.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_unfiltered_link_url;

    ///
    /// Returns the source URL, if any, for the element that the context menu was
    /// invoked on. Example of elements with source URLs are img, audio, and
    /// video.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_source_url;

    ///
    /// Returns true (1) if the context menu was invoked on an image which has
    /// non-NULL contents.
    ///
    extern(System) int function (cef_context_menu_params_t* self) nothrow has_image_contents;

    ///
    /// Returns the title text or the alt text if the context menu was invoked on
    /// an image.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_title_text;

    ///
    /// Returns the URL of the top level page that the context menu was invoked
    /// on.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_page_url;

    ///
    /// Returns the URL of the subframe that the context menu was invoked on.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_frame_url;

    ///
    /// Returns the character encoding of the subframe that the context menu was
    /// invoked on.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_frame_charset;

    ///
    /// Returns the type of context node that the context menu was invoked on.
    ///
    extern(System) cef_context_menu_media_type_t function (
        cef_context_menu_params_t* self) nothrow get_media_type;

    ///
    /// Returns flags representing the actions supported by the media element, if
    /// any, that the context menu was invoked on.
    ///
    extern(System) cef_context_menu_media_state_flags_t function (
        cef_context_menu_params_t* self) nothrow get_media_state_flags;

    ///
    /// Returns the text of the selection, if any, that the context menu was
    /// invoked on.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_selection_text;

    ///
    /// Returns the text of the misspelled word, if any, that the context menu was
    /// invoked on.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_context_menu_params_t* self) nothrow get_misspelled_word;

    ///
    /// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
    /// |suggestions| from the spell check service for the misspelled word if
    /// there is one.
    ///
    extern(System) int function (
        cef_context_menu_params_t* self,
        cef_string_list_t suggestions) nothrow get_dictionary_suggestions;

    ///
    /// Returns true (1) if the context menu was invoked on an editable node.
    ///
    extern(System) int function (cef_context_menu_params_t* self) nothrow is_editable;

    ///
    /// Returns true (1) if the context menu was invoked on an editable node where
    /// spell-check is enabled.
    ///
    extern(System) int function (cef_context_menu_params_t* self) nothrow is_spell_check_enabled;

    ///
    /// Returns flags representing the actions supported by the editable node, if
    /// any, that the context menu was invoked on.
    ///
    extern(System) cef_context_menu_edit_state_flags_t function (
        cef_context_menu_params_t* self) nothrow get_edit_state_flags;

    ///
    /// Returns true (1) if the context menu contains items specified by the
    /// renderer process.
    ///
    extern(System) int function (cef_context_menu_params_t* self) nothrow is_custom_menu;
}



// CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=76ba2e59636aa71c8c6286093198a1e64d012c62$
//

extern (C):

///
/// Structure used for managing cookies. The functions of this structure may be
/// called on any thread unless otherwise indicated.
///
struct cef_cookie_manager_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Visit all cookies on the UI thread. The returned cookies are ordered by
    /// longest path, then by earliest creation date. Returns false (0) if cookies
    /// cannot be accessed.
    ///

    ///
    /// Visit a subset of cookies on the UI thread. The results are filtered by
    /// the given url scheme, host, domain and path. If |includeHttpOnly| is true
    /// (1) HTTP-only cookies will also be included in the results. The returned

    cef_base_ref_counted_t base;
    extern(System) int function (
        cef_cookie_manager_t* self,
        cef_cookie_visitor_t* visitor) nothrow visit_all_cookies;
    /// cookies are ordered by longest path, then by earliest creation date.
    /// Returns false (0) if cookies cannot be accessed.
    ///
    extern(System) int function (
        cef_cookie_manager_t* self,
        const(cef_string_t)* url,
        int includeHttpOnly,
        cef_cookie_visitor_t* visitor) nothrow visit_url_cookies;

    ///
    /// Sets a cookie given a valid URL and explicit user-provided cookie
    /// attributes. This function expects each attribute to be well-formed. It
    /// will check for disallowed characters (e.g. the ';' character is disallowed
    /// within the cookie value attribute) and fail without setting the cookie if
    /// such characters are found. If |callback| is non-NULL it will be executed
    /// asnychronously on the UI thread after the cookie has been set. Returns
    /// false (0) if an invalid URL is specified or if cookies cannot be accessed.
    ///
    extern(System) int function (
        cef_cookie_manager_t* self,
        const(cef_string_t)* url,
        const(cef_cookie_t)* cookie,
        cef_set_cookie_callback_t* callback) nothrow set_cookie;

    ///
    /// Delete all cookies that match the specified parameters. If both |url| and
    /// |cookie_name| values are specified all host and domain cookies matching
    /// both will be deleted. If only |url| is specified all host cookies (but not
    /// domain cookies) irrespective of path will be deleted. If |url| is NULL all
    /// cookies for all hosts and domains will be deleted. If |callback| is non-
    /// NULL it will be executed asnychronously on the UI thread after the cookies
    /// have been deleted. Returns false (0) if a non-NULL invalid URL is
    /// specified or if cookies cannot be accessed. Cookies can alternately be
    /// deleted using the Visit*Cookies() functions.
    ///
    extern(System) int function (
        cef_cookie_manager_t* self,
        const(cef_string_t)* url,
        const(cef_string_t)* cookie_name,
        cef_delete_cookies_callback_t* callback) nothrow delete_cookies;

    ///
    /// Flush the backing store (if any) to disk. If |callback| is non-NULL it
    /// will be executed asnychronously on the UI thread after the flush is
    /// complete. Returns false (0) if cookies cannot be accessed.
    ///
    extern(System) int function (
        cef_cookie_manager_t* self,
        cef_completion_callback_t* callback) nothrow flush_store;
}



///
/// Returns the global cookie manager. By default data will be stored at
/// cef_settings_t.cache_path if specified or in memory otherwise. If |callback|
/// is non-NULL it will be executed asnychronously on the UI thread after the
/// manager's storage has been initialized. Using this function is equivalent to
/// calling cef_request_context_t::cef_request_context_get_global_context()-
/// >GetDefaultCookieManager().
///
cef_cookie_manager_t* cef_cookie_manager_get_global_manager (
    cef_completion_callback_t* callback);

///
/// Structure to implement for visiting cookie values. The functions of this
/// structure will always be called on the UI thread.
///
struct cef_cookie_visitor_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be called once for each cookie. |count| is the 0-based
    /// index for the current cookie. |total| is the total number of cookies. Set
    /// |deleteCookie| to true (1) to delete the cookie currently being visited.
    /// Return false (0) to stop visiting cookies. This function may never be
    /// called if no cookies are found.
    ///
    extern(System) int function (
        cef_cookie_visitor_t* self,
        const(cef_cookie_t)* cookie,
        int count,
        int total,
        int* deleteCookie) nothrow visit;
}



///
/// Structure to implement to be notified of asynchronous completion via
/// cef_cookie_manager_t::set_cookie().
///
struct cef_set_cookie_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be called upon completion. |success| will be true (1) if
    /// the cookie was set successfully.
    ///
    extern(System) void function (cef_set_cookie_callback_t* self, int success) nothrow on_complete;
}



///
/// Structure to implement to be notified of asynchronous completion via
/// cef_cookie_manager_t::delete_cookies().
///
struct cef_delete_cookies_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be called upon completion. |num_deleted| will be the
    /// number of cookies that were deleted.
    ///
    extern(System) void function (
        cef_delete_cookies_callback_t* self,
        int num_deleted) nothrow on_complete;
}



// CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=46a6432f66cce88d8597c3d070681b09a712dc54$
//

extern (C):

///
/// Crash reporting is configured using an INI-style config file named
/// "crash_reporter.cfg". On Windows and Linux this file must be placed next to
/// the main application executable. On macOS this file must be placed in the
/// top-level app bundle Resources directory (e.g.
/// "<appname>.app/Contents/Resources"). File contents are as follows:
///
/// <pre>
///  # Comments start with a hash character and must be on their own line.
///
///  [Config]
///  ProductName=<Value of the "prod" crash key; defaults to "cef">
///  ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
///  AppName=<Windows only; App-specific folder name component for storing crash
///           information; default to "CEF">
///  ExternalHandler=<Windows only; Name of the external handler exe to use
///                   instead of re-launching the main exe; default to empty>
///  BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes
///                                 should be forwarded to the system crash
///                                 reporter; default to false>
///  ServerURL=<crash server URL; default to empty>
///  RateLimitEnabled=<True if uploads should be rate limited; default to true>
///  MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled;
///                    default to 5>
///  MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
///                       will cause older reports to be deleted; default to 20>
///  MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
///                        default to 5>
///
///  [CrashKeys]
///  my_key1=<small|medium|large>
///  my_key2=<small|medium|large>
/// </pre>
///
/// <b>Config section:</b>
///
/// If "ProductName" and/or "ProductVersion" are set then the specified values
/// will be included in the crash dump metadata. On macOS if these values are
/// set to NULL then they will be retrieved from the Info.plist file using the
/// "CFBundleName" and "CFBundleShortVersionString" keys respectively.
///
/// If "AppName" is set on Windows then crash report information (metrics,
/// database and dumps) will be stored locally on disk under the
/// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
/// platforms the cef_settings_t.root_cache_path value will be used.
///
/// If "ExternalHandler" is set on Windows then the specified exe will be
/// launched as the crashpad-handler instead of re-launching the main process
/// exe. The value can be an absolute path or a path relative to the main exe
/// directory. On Linux the cef_settings_t.browser_subprocess_path value will be
/// used. On macOS the existing subprocess app bundle will be used.
///
/// If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser
/// process crashes will be forwarded to the system crash reporter. This results
/// in the crash UI dialog being displayed to the user and crash reports being
/// logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports
/// from non-browser processes and Debug builds is always disabled.
///
/// If "ServerURL" is set then crashes will be uploaded as a multi-part POST
/// request to the specified URL. Otherwise, reports will only be stored locally
/// on disk.
///
/// If "RateLimitEnabled" is set to true (1) then crash report uploads will be
/// rate limited as follows:
///  1. If "MaxUploadsPerDay" is set to a positive value then at most the
///     specified number of crashes will be uploaded in each 24 hour period.
///  2. If crash upload fails due to a network or server error then an
///     incremental backoff delay up to a maximum of 24 hours will be applied
///     for retries.
///  3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
///     "MaxUploadsPerDay" value will be reduced to 1 until the client is
///     restarted. This helps to avoid an upload flood when the network or
///     server error is resolved.
/// Rate limiting is not supported on Linux.
///
/// If "MaxDatabaseSizeInMb" is set to a positive value then crash report
/// storage on disk will be limited to that size in megabytes. For example, on
/// Windows each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20
/// equates to about 34 crash reports stored on disk. Not supported on Linux.
///
/// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports
/// older than the specified age in days will be deleted. Not supported on
/// Linux.
///
/// <b>CrashKeys section:</b>
///
/// A maximum of 26 crash keys of each size can be specified for use by the
/// application. Crash key values will be truncated based on the specified size
/// (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
/// crash keys can be set from any thread or process using the
/// CefSetCrashKeyValue function. These key/value pairs will be sent to the
/// crash server along with the crash dump file.
///
int cef_crash_reporting_enabled ();

///
/// Sets or clears a specific key-value pair from the crash metadata.
///
void cef_set_crash_key_value (
    const(cef_string_t)* key,
    const(cef_string_t)* value);

// CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dd94c50619e92bf5bed4fe61479813ee559f779d$
//

extern (C):



///
/// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The
/// functions of this structure will be called on the browser process UI thread.
///
struct cef_dev_tools_message_observer_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Method that will be called on receipt of a DevTools protocol message.
    /// |browser| is the originating browser instance. |message| is a UTF8-encoded
    /// JSON dictionary representing either a function result or an event.
    /// |message| is only valid for the scope of this callback and should be
    /// copied if necessary. Return true (1) if the message was handled or false
    /// (0) if the message should be further processed and passed to the
    /// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
    ///
    /// Method result dictionaries include an "id" (int) value that identifies the

    cef_base_ref_counted_t base;
    /// orginating function call sent from
    /// cef_browser_host_t::SendDevToolsMessage, and optionally either a "result"
    /// (dictionary) or "error" (dictionary) value. The "error" dictionary will
    /// contain "code" (int) and "message" (string) values. Event dictionaries
    /// include a "function" (string) value and optionally a "params" (dictionary)
    /// value. See the DevTools protocol documentation at
    /// https://chromedevtools.github.io/devtools-protocol/ for details of
    /// supported function calls and the expected "result" or "params" dictionary
    /// contents. JSON dictionaries can be parsed using the CefParseJSON function
    /// if desired, however be aware of performance considerations when parsing
    /// large messages (some of which may exceed 1MB in size).
    ///
    extern(System) int function (
        cef_dev_tools_message_observer_t* self,
        cef_browser_t* browser,
        const(void)* message,
        size_t message_size) nothrow on_dev_tools_message;

    ///
    /// Method that will be called after attempted execution of a DevTools
    /// protocol function. |browser| is the originating browser instance.
    /// |message_id| is the "id" value that identifies the originating function
    /// call message. If the function succeeded |success| will be true (1) and
    /// |result| will be the UTF8-encoded JSON "result" dictionary value (which
    /// may be NULL). If the function failed |success| will be false (0) and
    /// |result| will be the UTF8-encoded JSON "error" dictionary value. |result|
    /// is only valid for the scope of this callback and should be copied if
    /// necessary. See the OnDevToolsMessage documentation for additional details
    /// on |result| contents.
    ///
    extern(System) void function (
        cef_dev_tools_message_observer_t* self,
        cef_browser_t* browser,
        int message_id,
        int success,
        const(void)* result,
        size_t result_size) nothrow on_dev_tools_method_result;

    ///
    /// Method that will be called on receipt of a DevTools protocol event.
    /// |browser| is the originating browser instance. |function| is the
    /// "function" value. |params| is the UTF8-encoded JSON "params" dictionary
    /// value (which may be NULL). |params| is only valid for the scope of this
    /// callback and should be copied if necessary. See the OnDevToolsMessage
    /// documentation for additional details on |params| contents.
    ///
    extern(System) void function (
        cef_dev_tools_message_observer_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* method,
        const(void)* params,
        size_t params_size) nothrow on_dev_tools_event;

    ///
    /// Method that will be called when the DevTools agent has attached. |browser|
    /// is the originating browser instance. This will generally occur in response
    /// to the first message sent while the agent is detached.
    ///
    extern(System) void function (
        cef_dev_tools_message_observer_t* self,
        cef_browser_t* browser) nothrow on_dev_tools_agent_attached;

    ///
    /// Method that will be called when the DevTools agent has detached. |browser|
    /// is the originating browser instance. Any function results that were
    /// pending before the agent became detached will not be delivered, and any
    /// active event subscriptions will be canceled.
    ///
    extern(System) void function (
        cef_dev_tools_message_observer_t* self,
        cef_browser_t* browser) nothrow on_dev_tools_agent_detached;
}



// CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=bf7208a86ee17f63fd7163cef8c3a13373a1f1c8$
//

extern (C):

///
/// Callback structure for asynchronous continuation of file dialog requests.
///
struct cef_file_dialog_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Continue the file selection. |file_paths| should be a single value or a
    /// list of values depending on the dialog mode. An NULL |file_paths| value is
    /// treated the same as calling cancel().
    ///

    ///
    /// Cancel the file selection.
    ///

    ///
    /// Implement this structure to handle dialog events. The functions of this
    /// structure will be called on the browser process UI thread.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_file_dialog_callback_t* self,
        cef_string_list_t file_paths) nothrow cont;
    extern(System) void function (cef_file_dialog_callback_t* self) nothrow cancel;
}



struct cef_dialog_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called to run a file chooser dialog. |mode| represents the type of dialog
    /// to display. |title| to the title to be used for the dialog and may be NULL
    /// to show the default title ("Open" or "Save" depending on the mode).
    /// |default_file_path| is the path with optional directory and/or file name
    /// component that should be initially selected in the dialog.
    /// |accept_filters| are used to restrict the selectable file types and may be
    /// any combination of valid lower-cased MIME types (e.g. "text/*" or
    /// "image/*") and individual file extensions (e.g. ".txt" or ".png").
    /// |accept_extensions| provides the semicolon-delimited expansion of MIME
    /// types to file extensions (if known, or NULL string otherwise).
    /// |accept_descriptions| provides the descriptions for MIME types (if known,
    /// or NULL string otherwise). For example, the "image/*" mime type might have
    /// extensions ".png;.jpg;.bmp;..." and description "Image Files".
    /// |accept_filters|, |accept_extensions| and |accept_descriptions| will all
    /// be the same size. To display a custom dialog return true (1) and execute
    /// |callback| either inline or at a later time. To display the default dialog
    /// return false (0). If this function returns false (0) it may be called an
    /// additional time for the same dialog (both before and after MIME type
    /// expansion).
    ///
    extern(System) int function (
        cef_dialog_handler_t* self,
        cef_browser_t* browser,
        cef_file_dialog_mode_t mode,
        const(cef_string_t)* title,
        const(cef_string_t)* default_file_path,
        cef_string_list_t accept_filters,
        cef_string_list_t accept_extensions,
        cef_string_list_t accept_descriptions,
        cef_file_dialog_callback_t* callback) nothrow on_file_dialog;
}



// CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5a99c5e88ea0e123087234b2795fa625fed183f2$
//

import core.stdc.config;

extern (C):

///
/// Implement this structure to handle events related to browser display state.
/// The functions of this structure will be called on the UI thread.
///
struct cef_display_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called when a frame's address has changed.
    ///

    ///
    /// Called when the page title changes.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        const(cef_string_t)* url) nothrow on_address_change;
    extern(System) void function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* title) nothrow on_title_change;
    ///
    /// Called when the page icon changes.
    ///
    extern(System) void function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        cef_string_list_t icon_urls) nothrow on_favicon_urlchange;

    ///
    /// Called when web content in the page has toggled fullscreen mode. If
    /// |fullscreen| is true (1) the content will automatically be sized to fill
    /// the browser content area. If |fullscreen| is false (0) the content will
    /// automatically return to its original size and position. With the Alloy
    /// runtime the client is responsible for triggering the fullscreen transition
    /// (for example, by calling cef_window_t::SetFullscreen when using Views).
    /// With the Chrome runtime the fullscreen transition will be triggered
    /// automatically. The cef_window_delegate_t::OnWindowFullscreenTransition
    /// function will be called during the fullscreen transition for notification
    /// purposes.
    ///
    extern(System) void function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        int fullscreen) nothrow on_fullscreen_mode_change;

    ///
    /// Called when the browser is about to display a tooltip. |text| contains the
    /// text that will be displayed in the tooltip. To handle the display of the
    /// tooltip yourself return true (1). Otherwise, you can optionally modify
    /// |text| and then return false (0) to allow the browser to display the
    /// tooltip. When window rendering is disabled the application is responsible
    /// for drawing tooltips and the return value is ignored.
    ///
    extern(System) int function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        cef_string_t* text) nothrow on_tooltip;

    ///
    /// Called when the browser receives a status message. |value| contains the
    /// text that will be displayed in the status message.
    ///
    extern(System) void function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* value) nothrow on_status_message;

    ///
    /// Called to display a console message. Return true (1) to stop the message
    /// from being output to the console.
    ///
    extern(System) int function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        cef_log_severity_t level,
        const(cef_string_t)* message,
        const(cef_string_t)* source,
        int line) nothrow on_console_message;

    ///
    /// Called when auto-resize is enabled via
    /// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
    /// resized. |new_size| will be the desired size in view coordinates. Return
    /// true (1) if the resize was handled or false (0) for default handling.
    ///
    extern(System) int function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        const(cef_size_t)* new_size) nothrow on_auto_resize;

    ///
    /// Called when the overall page loading progress has changed. |progress|
    /// ranges from 0.0 to 1.0.
    ///
    extern(System) void function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        double progress) nothrow on_loading_progress_change;

    ///
    /// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
    /// |custom_cursor_info| will be populated with the custom cursor information.
    /// Return true (1) if the cursor change was handled or false (0) for default
    /// handling.
    ///
    extern(System) int function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        c_ulong cursor,
        cef_cursor_type_t type,
        const(cef_cursor_info_t)* custom_cursor_info) nothrow on_cursor_change;

    ///
    /// Called when the browser's access to an audio and/or video source has
    /// changed.
    ///
    extern(System) void function (
        cef_display_handler_t* self,
        cef_browser_t* browser,
        int has_video_access,
        int has_audio_access) nothrow on_media_access_change;
}



// CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a4d2f79163205ed4367916546240a6aedc2165f9$
//

extern (C):

///
/// Structure to implement for visiting the DOM. The functions of this structure
/// will be called on the render process main thread.
///
struct cef_domvisitor_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Method executed for visiting the DOM. The document object passed to this
    /// function represents a snapshot of the DOM at the time this function is
    /// executed. DOM objects are only valid for the scope of this function. Do
    /// not keep references to or attempt to access any DOM objects outside the
    /// scope of this function.
    ///

    ///
    /// Structure used to represent a DOM document. The functions of this structure
    /// should only be called on the render process main thread thread.

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_domvisitor_t* self,
        cef_domdocument_t* document) nothrow visit;
}


///
struct cef_domdocument_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the document type.
    ///
    extern(System) cef_dom_document_type_t function (cef_domdocument_t* self) nothrow get_type;

    ///
    /// Returns the root document node.
    ///
    extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_document;

    ///
    /// Returns the BODY node of an HTML document.
    ///
    extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_body;

    ///
    /// Returns the HEAD node of an HTML document.
    ///
    extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_head;

    ///
    /// Returns the title of an HTML document.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_domdocument_t* self) nothrow get_title;

    ///
    /// Returns the document element with the specified ID value.
    ///
    extern(System) cef_domnode_t* function (
        cef_domdocument_t* self,
        const(cef_string_t)* id) nothrow get_element_by_id;

    ///
    /// Returns the node that currently has keyboard focus.
    ///
    extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_focused_node;

    ///
    /// Returns true (1) if a portion of the document is selected.
    ///
    extern(System) int function (cef_domdocument_t* self) nothrow has_selection;

    ///
    /// Returns the selection offset within the start node.
    ///
    extern(System) int function (cef_domdocument_t* self) nothrow get_selection_start_offset;

    ///
    /// Returns the selection offset within the end node.
    ///
    extern(System) int function (cef_domdocument_t* self) nothrow get_selection_end_offset;

    ///
    /// Returns the contents of this selection as markup.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_domdocument_t* self) nothrow get_selection_as_markup;

    ///
    /// Returns the contents of this selection as text.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_domdocument_t* self) nothrow get_selection_as_text;

    ///
    /// Returns the base URL for the document.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_domdocument_t* self) nothrow get_base_url;

    ///
    /// Returns a complete URL based on the document base URL and the specified
    /// partial URL.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_domdocument_t* self,
        const(cef_string_t)* partialURL) nothrow get_complete_url;
}



///
/// Structure used to represent a DOM node. The functions of this structure
/// should only be called on the render process main thread.
///
struct cef_domnode_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the type for this node.
    ///
    extern(System) cef_dom_node_type_t function (cef_domnode_t* self) nothrow get_type;

    ///
    /// Returns true (1) if this is a text node.
    ///
    extern(System) int function (cef_domnode_t* self) nothrow is_text;

    ///
    /// Returns true (1) if this is an element node.
    ///
    extern(System) int function (cef_domnode_t* self) nothrow is_element;

    ///
    /// Returns true (1) if this is an editable node.
    ///
    extern(System) int function (cef_domnode_t* self) nothrow is_editable;

    ///
    /// Returns true (1) if this is a form control element node.
    ///
    extern(System) int function (cef_domnode_t* self) nothrow is_form_control_element;

    ///
    /// Returns the type of this form control element node.
    ///
    extern(System) cef_dom_form_control_type_t function (
        cef_domnode_t* self) nothrow get_form_control_element_type;

    ///
    /// Returns true (1) if this object is pointing to the same handle as |that|
    /// object.
    ///
    extern(System) int function (cef_domnode_t* self, cef_domnode_t* that) nothrow is_same;

    ///
    /// Returns the name of this node.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_name;

    ///
    /// Returns the value of this node.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_value;

    ///
    /// Set the value of this node. Returns true (1) on success.
    ///
    extern(System) int function (cef_domnode_t* self, const(cef_string_t)* value) nothrow set_value;

    ///
    /// Returns the contents of this node as markup.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_as_markup;

    ///
    /// Returns the document associated with this node.
    ///
    extern(System) cef_domdocument_t* function (cef_domnode_t* self) nothrow get_document;

    ///
    /// Returns the parent node.
    ///
    extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_parent;

    ///
    /// Returns the previous sibling node.
    ///
    extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_previous_sibling;

    ///
    /// Returns the next sibling node.
    ///
    extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_next_sibling;

    ///
    /// Returns true (1) if this node has child nodes.
    ///
    extern(System) int function (cef_domnode_t* self) nothrow has_children;

    ///
    /// Return the first child node.
    ///
    extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_first_child;

    ///
    /// Returns the last child node.
    ///
    extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_last_child;

    ///
    /// Returns the tag name of this element.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_element_tag_name;

    ///
    /// Returns true (1) if this element has attributes.
    ///
    extern(System) int function (cef_domnode_t* self) nothrow has_element_attributes;

    ///
    /// Returns true (1) if this element has an attribute named |attrName|.
    ///
    extern(System) int function (
        cef_domnode_t* self,
        const(cef_string_t)* attrName) nothrow has_element_attribute;

    ///
    /// Returns the element attribute named |attrName|.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_domnode_t* self,
        const(cef_string_t)* attrName) nothrow get_element_attribute;

    ///
    /// Returns a map of all element attributes.
    ///
    extern(System) void function (
        cef_domnode_t* self,
        cef_string_map_t attrMap) nothrow get_element_attributes;

    ///
    /// Set the value for the element attribute named |attrName|. Returns true (1)
    /// on success.
    ///
    extern(System) int function (
        cef_domnode_t* self,
        const(cef_string_t)* attrName,
        const(cef_string_t)* value) nothrow set_element_attribute;

    ///
    /// Returns the inner text of the element.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_domnode_t* self) nothrow get_element_inner_text;

    ///
    /// Returns the bounds of the element in device pixels. Use
    /// "window.devicePixelRatio" to convert to/from CSS pixels.
    ///
    extern(System) cef_rect_t function (cef_domnode_t* self) nothrow get_element_bounds;
}



// CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7ecfb07a95315ff81937e9f68d419122fc88f1b7$
//

extern (C):

///
/// Callback structure used to asynchronously continue a download.
///
struct cef_before_download_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Call to continue the download. Set |download_path| to the full file path
    /// for the download including the file name or leave blank to use the
    /// suggested name and the default temp directory. Set |show_dialog| to true
    /// (1) if you do wish to show the default "Save As" dialog.
    ///

    ///
    /// Callback structure used to asynchronously cancel a download.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_before_download_callback_t* self,
        const(cef_string_t)* download_path,
        int show_dialog) nothrow cont;
}



struct cef_download_item_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Call to cancel the download.
    ///
    extern(System) void function (cef_download_item_callback_t* self) nothrow cancel;

    ///
    /// Call to pause the download.
    ///
    extern(System) void function (cef_download_item_callback_t* self) nothrow pause;

    ///
    /// Call to resume the download.
    ///
    extern(System) void function (cef_download_item_callback_t* self) nothrow resume;
}



///
/// Structure used to handle file downloads. The functions of this structure
/// will called on the browser process UI thread.
///
struct cef_download_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called before a download begins in response to a user-initiated action
    /// (e.g. alt + link click or link click that returns a `Content-Disposition:
    /// attachment` response from the server). |url| is the target download URL
    /// and |request_function| is the target function (GET, POST, etc) nothrow. Return
    /// true (1) to proceed with the download or false (0) to cancel the download.
    ///
    extern(System) int function (
        cef_download_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* url,
        const(cef_string_t)* request_method) nothrow can_download;

    ///
    /// Called before a download begins. |suggested_name| is the suggested name
    /// for the download file. Return true (1) and execute |callback| either
    /// asynchronously or in this function to continue or cancel the download.
    /// Return false (0) to proceed with default handling (cancel with Alloy
    /// style, download shelf with Chrome style). Do not keep a reference to
    /// |download_item| outside of this function.
    ///
    extern(System) int function (
        cef_download_handler_t* self,
        cef_browser_t* browser,
        cef_download_item_t* download_item,
        const(cef_string_t)* suggested_name,
        cef_before_download_callback_t* callback) nothrow on_before_download;

    ///
    /// Called when a download's status or progress information has been updated.
    /// This may be called multiple times before and after on_before_download().
    /// Execute |callback| either asynchronously or in this function to cancel the
    /// download if desired. Do not keep a reference to |download_item| outside of
    /// this function.
    ///
    extern(System) void function (
        cef_download_handler_t* self,
        cef_browser_t* browser,
        cef_download_item_t* download_item,
        cef_download_item_callback_t* callback) nothrow on_download_updated;
}



// CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=9af8ade3addfd112db41792c4e80682a8143e8c4$
//

extern (C):

///
/// Structure used to represent a download item.
///
struct cef_download_item_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is valid. Do not call any other functions
    /// if this function returns false (0).
    ///

    ///
    /// Returns true (1) if the download is in progress.
    ///

    ///
    /// Returns true (1) if the download is complete.
    ///

    ///
    /// Returns true (1) if the download has been canceled.
    ///

    ///
    /// Returns true (1) if the download has been interrupted.
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (cef_download_item_t* self) nothrow is_valid;
    extern(System) int function (cef_download_item_t* self) nothrow is_in_progress;
    extern(System) int function (cef_download_item_t* self) nothrow is_complete;
    extern(System) int function (cef_download_item_t* self) nothrow is_canceled;
    extern(System) int function (cef_download_item_t* self) nothrow is_interrupted;

    ///
    /// Returns the most recent interrupt reason.
    ///
    extern(System) cef_download_interrupt_reason_t function (
        cef_download_item_t* self) nothrow get_interrupt_reason;

    ///
    /// Returns a simple speed estimate in bytes/s.
    ///
    extern(System) long function (cef_download_item_t* self) nothrow get_current_speed;

    ///
    /// Returns the rough percent complete or -1 if the receive total size is
    /// unknown.
    ///
    extern(System) int function (cef_download_item_t* self) nothrow get_percent_complete;

    ///
    /// Returns the total number of bytes.
    ///
    extern(System) long function (cef_download_item_t* self) nothrow get_total_bytes;

    ///
    /// Returns the number of received bytes.
    ///
    extern(System) long function (cef_download_item_t* self) nothrow get_received_bytes;

    ///
    /// Returns the time that the download started.
    ///
    extern(System) cef_basetime_t function (cef_download_item_t* self) nothrow get_start_time;

    ///
    /// Returns the time that the download ended.
    ///
    extern(System) cef_basetime_t function (cef_download_item_t* self) nothrow get_end_time;

    ///
    /// Returns the full path to the downloaded or downloading file.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_full_path;

    ///
    /// Returns the unique identifier for this download.
    ///
    extern(System) uint function (cef_download_item_t* self) nothrow get_id;

    ///
    /// Returns the URL.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_url;

    ///
    /// Returns the original URL before any redirections.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_download_item_t* self) nothrow get_original_url;

    ///
    /// Returns the suggested file name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_download_item_t* self) nothrow get_suggested_file_name;

    ///
    /// Returns the content disposition.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_download_item_t* self) nothrow get_content_disposition;

    ///
    /// Returns the mime type.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_mime_type;
}



// CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a096775255ddc4d7616095e48e7370bd87bf4bb5$
//

extern (C):

///
/// Structure used to represent drag data. The functions of this structure may
/// be called on any thread.
///
struct cef_drag_data_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns a copy of the current object.
    ///

    ///
    /// Returns true (1) if this object is read-only.
    ///

    ///
    /// Returns true (1) if the drag data is a link.
    ///

    ///
    /// Returns true (1) if the drag data is a text or html fragment.
    ///

    ///
    /// Returns true (1) if the drag data is a file.
    ///

    cef_base_ref_counted_t base;
    extern(System) cef_drag_data_t* function (cef_drag_data_t* self) nothrow clone;
    extern(System) int function (cef_drag_data_t* self) nothrow is_read_only;
    extern(System) int function (cef_drag_data_t* self) nothrow is_link;
    extern(System) int function (cef_drag_data_t* self) nothrow is_fragment;
    extern(System) int function (cef_drag_data_t* self) nothrow is_file;

    ///
    /// Return the link URL that is being dragged.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_url;

    ///
    /// Return the title associated with the link being dragged.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_title;

    ///
    /// Return the metadata, if any, associated with the link being dragged.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_metadata;

    ///
    /// Return the plain text fragment that is being dragged.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_fragment_text;

    ///
    /// Return the text/html fragment that is being dragged.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_fragment_html;

    ///
    /// Return the base URL that the fragment came from. This value is used for
    /// resolving relative URLs and may be NULL.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_drag_data_t* self) nothrow get_fragment_base_url;

    ///
    /// Return the name of the file being dragged out of the browser window.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_file_name;

    ///
    /// Write the contents of the file being dragged out of the web view into
    /// |writer|. Returns the number of bytes sent to |writer|. If |writer| is
    /// NULL this function will return the size of the file contents in bytes.
    /// Call get_file_name() to get a suggested name for the file.
    ///
    extern(System) size_t function (
        cef_drag_data_t* self,
        cef_stream_writer_t* writer) nothrow get_file_contents;

    ///
    /// Retrieve the list of file names that are being dragged into the browser
    /// window.
    ///
    extern(System) int function (
        cef_drag_data_t* self,
        cef_string_list_t names) nothrow get_file_names;

    ///
    /// Retrieve the list of file paths that are being dragged into the browser
    /// window.
    ///
    extern(System) int function (
        cef_drag_data_t* self,
        cef_string_list_t paths) nothrow get_file_paths;

    ///
    /// Set the link URL that is being dragged.
    ///
    extern(System) void function (
        cef_drag_data_t* self,
        const(cef_string_t)* url) nothrow set_link_url;

    ///
    /// Set the title associated with the link being dragged.
    ///
    extern(System) void function (
        cef_drag_data_t* self,
        const(cef_string_t)* title) nothrow set_link_title;

    ///
    /// Set the metadata associated with the link being dragged.
    ///
    extern(System) void function (
        cef_drag_data_t* self,
        const(cef_string_t)* data) nothrow set_link_metadata;

    ///
    /// Set the plain text fragment that is being dragged.
    ///
    extern(System) void function (
        cef_drag_data_t* self,
        const(cef_string_t)* text) nothrow set_fragment_text;

    ///
    /// Set the text/html fragment that is being dragged.
    ///
    extern(System) void function (
        cef_drag_data_t* self,
        const(cef_string_t)* html) nothrow set_fragment_html;

    ///
    /// Set the base URL that the fragment came from.
    ///
    extern(System) void function (
        cef_drag_data_t* self,
        const(cef_string_t)* base_url) nothrow set_fragment_base_url;

    ///
    /// Reset the file contents. You should do this before calling
    /// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
    /// to drag in this kind of data.
    ///
    extern(System) void function (cef_drag_data_t* self) nothrow reset_file_contents;

    ///
    /// Add a file that is being dragged into the webview.
    ///
    extern(System) void function (
        cef_drag_data_t* self,
        const(cef_string_t)* path,
        const(cef_string_t)* display_name) nothrow add_file;

    ///
    /// Clear list of filenames.
    ///
    extern(System) void function (cef_drag_data_t* self) nothrow clear_filenames;

    ///
    /// Get the image representation of drag data. May return NULL if no image
    /// representation is available.
    ///
    extern(System) cef_image_t* function (cef_drag_data_t* self) nothrow get_image;

    ///
    /// Get the image hotspot (drag start location relative to image dimensions).
    ///
    extern(System) cef_point_t function (cef_drag_data_t* self) nothrow get_image_hotspot;

    ///
    /// Returns true (1) if an image representation of drag data is available.
    ///
    extern(System) int function (cef_drag_data_t* self) nothrow has_image;
}



///
/// Create a new cef_drag_data_t object.
///
cef_drag_data_t* cef_drag_data_create ();

// CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0723a2a59d46e465ac94f198351dc871f0b35b96$
//

extern (C):

///
/// Implement this structure to handle events related to dragging. The functions
/// of this structure will be called on the UI thread.
///
struct cef_drag_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called when an external drag event enters the browser window. |dragData|
    /// contains the drag event data and |mask| represents the type of drag
    /// operation. Return false (0) for default drag handling behavior or true (1)
    /// to cancel the drag event.
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (
        cef_drag_handler_t* self,
        cef_browser_t* browser,
        cef_drag_data_t* dragData,
        cef_drag_operations_mask_t mask) nothrow on_drag_enter;
    ///
    /// Called whenever draggable regions for the browser window change. These can
    /// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
    /// draggable regions are never defined in a document this function will also
    /// never be called. If the last draggable region is removed from a document
    /// this function will be called with an NULL vector.
    ///
    extern(System) void function (
        cef_drag_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        size_t regionsCount,
        const(cef_draggable_region_t)* regions) nothrow on_draggable_regions_changed;
}



// CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=634054ad25154c30fb4ec630fe7fb79b0cf1f9b3$
//

extern (C):




///
/// Object representing an extension. Methods may be called on any thread unless
/// otherwise indicated.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
struct cef_extension_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns the unique extension identifier. This is calculated based on the
    /// extension public key, if available, or on the extension path. See
    /// https://developer.chrome.com/extensions/manifest/key for details.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    ///
    /// Returns the absolute path to the extension directory on disk. This value
    /// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to

    cef_base_ref_counted_t base;
    extern(System) cef_string_userfree_t function (cef_extension_t* self) nothrow get_identifier; /// cef_request_context_t::LoadExtension.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_extension_t* self) nothrow get_path;

    ///
    /// Returns the extension manifest contents as a cef_dictionary_value_t
    /// object. See https://developer.chrome.com/extensions/manifest for details.
    ///
    extern(System) cef_dictionary_value_t* function (cef_extension_t* self) nothrow get_manifest;

    ///
    /// Returns true (1) if this object is the same extension as |that| object.
    /// Extensions are considered the same if identifier, path and loader context
    /// match.
    ///
    extern(System) int function (cef_extension_t* self, cef_extension_t* that) nothrow is_same;

    ///
    /// Returns the handler for this extension. Will return NULL for internal
    /// extensions or if no handler was passed to
    /// cef_request_context_t::LoadExtension.
    ///
    extern(System) cef_extension_handler_t* function (cef_extension_t* self) nothrow get_handler;

    ///
    /// Returns the request context that loaded this extension. Will return NULL
    /// for internal extensions or if the extension has been unloaded. See the
    /// cef_request_context_t::LoadExtension documentation for more information
    /// about loader contexts. Must be called on the browser process UI thread.
    ///
    extern(System) cef_request_context_t* function (
        cef_extension_t* self) nothrow get_loader_context;

    ///
    /// Returns true (1) if this extension is currently loaded. Must be called on
    /// the browser process UI thread.
    ///
    extern(System) int function (cef_extension_t* self) nothrow is_loaded;

    ///
    /// Unload this extension if it is not an internal extension and is currently
    /// loaded. Will result in a call to
    /// cef_extension_handler_t::OnExtensionUnloaded on success.
    ///
    extern(System) void function (cef_extension_t* self) nothrow unload;
}



// CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ebac34c9b85de780ce7524211c5dd61a80d4576c$
//

extern (C):



///
/// Callback structure used for asynchronous continuation of
/// cef_extension_handler_t::GetExtensionResource.
///
struct cef_get_extension_resource_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Continue the request. Read the resource contents from |stream|.
    ///

    ///
    /// Cancel the request.
    ///

    ///
    /// Implement this structure to handle events related to browser extensions. The
    /// functions of this structure will be called on the UI thread. See

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_get_extension_resource_callback_t* self,
        cef_stream_reader_t* stream) nothrow cont;
    extern(System) void function (cef_get_extension_resource_callback_t* self) nothrow cancel;
}


/// cef_request_context_t::LoadExtension for information about extension
/// loading.
///
/// WARNING: This API is deprecated and will be removed in ~M127.
///
struct cef_extension_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called if the cef_request_context_t::LoadExtension request fails. |result|
    /// will be the error code.
    ///
    extern(System) void function (
        cef_extension_handler_t* self,
        cef_errorcode_t result) nothrow on_extension_load_failed;

    ///
    /// Called if the cef_request_context_t::LoadExtension request succeeds.
    /// |extension| is the loaded extension.
    ///
    extern(System) void function (
        cef_extension_handler_t* self,
        cef_extension_t* extension) nothrow on_extension_loaded;

    ///
    /// Called after the cef_extension_t::Unload request has completed.
    ///
    extern(System) void function (
        cef_extension_handler_t* self,
        cef_extension_t* extension) nothrow on_extension_unloaded;

    ///
    /// Called when an extension needs a browser to host a background script
    /// specified via the "background" manifest key. The browser will have no
    /// visible window and cannot be displayed. |extension| is the extension that
    /// is loading the background script. |url| is an internally generated
    /// reference to an HTML page that will be used to load the background script
    /// via a "<script>" src attribute. To allow creation of the browser
    /// optionally modify |client| and |settings| and return false (0). To cancel
    /// creation of the browser (and consequently cancel load of the background
    /// script) return true (1). Successful creation will be indicated by a call
    /// to cef_life_span_handler_t::OnAfterCreated, and
    /// cef_browser_host_t::IsBackgroundHost will return true (1) for the
    /// resulting browser. See https://developer.chrome.com/extensions/event_pages
    /// for more information about extension background script usage.
    ///
    extern(System) int function (
        cef_extension_handler_t* self,
        cef_extension_t* extension,
        const(cef_string_t)* url,
        cef_client_t** client,
        cef_browser_settings_t* settings) nothrow on_before_background_browser;

    ///
    /// Called when an extension API (e.g. chrome.tabs.create) requests creation
    /// of a new browser. |extension| and |browser| are the source of the API
    /// call. |active_browser| may optionally be specified via the windowId
    /// property or returned via the get_active_browser() callback and provides
    /// the default |client| and |settings| values for the new browser. |index| is
    /// the position value optionally specified via the index property. |url| is
    /// the URL that will be loaded in the browser. |active| is true (1) if the
    /// new browser should be active when opened.  To allow creation of the
    /// browser optionally modify |windowInfo|, |client| and |settings| and return
    /// false (0). To cancel creation of the browser return true (1). Successful
    /// creation will be indicated by a call to
    /// cef_life_span_handler_t::OnAfterCreated. Any modifications to |windowInfo|
    /// will be ignored if |active_browser| is wrapped in a cef_browser_view_t.
    ///
    extern(System) int function (
        cef_extension_handler_t* self,
        cef_extension_t* extension,
        cef_browser_t* browser,
        cef_browser_t* active_browser,
        int index,
        const(cef_string_t)* url,
        int active,
        cef_window_info_t* windowInfo,
        cef_client_t** client,
        cef_browser_settings_t* settings) nothrow on_before_browser;

    ///
    /// Called when no tabId is specified to an extension API call that accepts a
    /// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
    /// source of the API call. Return the browser that will be acted on by the
    /// API call or return NULL to act on |browser|. The returned browser must
    /// share the same cef_request_context_t as |browser|. Incognito browsers
    /// should not be considered unless the source extension has incognito access
    /// enabled, in which case |include_incognito| will be true (1).
    ///
    extern(System) cef_browser_t* function (
        cef_extension_handler_t* self,
        cef_extension_t* extension,
        cef_browser_t* browser,
        int include_incognito) nothrow get_active_browser;

    ///
    /// Called when the tabId associated with |target_browser| is specified to an
    /// extension API call that accepts a tabId parameter (e.g. chrome.tabs.*).
    /// |extension| and |browser| are the source of the API call. Return true (1)
    /// to allow access of false (0) to deny access. Access to incognito browsers
    /// should not be allowed unless the source extension has incognito access
    /// enabled, in which case |include_incognito| will be true (1).
    ///
    extern(System) int function (
        cef_extension_handler_t* self,
        cef_extension_t* extension,
        cef_browser_t* browser,
        int include_incognito,
        cef_browser_t* target_browser) nothrow can_access_browser;

    ///
    /// Called to retrieve an extension resource that would normally be loaded
    /// from disk (e.g. if a file parameter is specified to
    /// chrome.tabs.executeScript). |extension| and |browser| are the source of
    /// the resource request. |file| is the requested relative file path. To
    /// handle the resource request return true (1) and execute |callback| either
    /// synchronously or asynchronously. For the default behavior which reads the
    /// resource from the extension directory on disk return false (0).
    /// Localization substitutions will not be applied to resources handled via
    /// this function.
    ///
    extern(System) int function (
        cef_extension_handler_t* self,
        cef_extension_t* extension,
        cef_browser_t* browser,
        const(cef_string_t)* file,
        cef_get_extension_resource_callback_t* callback) nothrow get_extension_resource;
}



// CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e10581d1f6aeb104646ae106aaa5fb36016643dd$
//

extern (C):

///
/// Creates a directory and all parent directories if they don't already exist.
/// Returns true (1) on successful creation or if the directory already exists.
/// The directory is only readable by the current user. Calling this function on
/// the browser process UI or IO threads is not allowed.
///
int cef_create_directory (const(cef_string_t)* full_path);

///
/// Get the temporary directory provided by the system.
///
/// WARNING: In general, you should use the temp directory variants below
/// instead of this function. Those variants will ensure that the proper
/// permissions are set so that other users on the system can't edit them while
/// they're open (which could lead to security issues).
///
int cef_get_temp_directory (cef_string_t* temp_dir);

///
/// Creates a new directory. On Windows if |prefix| is provided the new
/// directory name is in the format of "prefixyyyy". Returns true (1) on success
/// and sets |new_temp_path| to the full path of the directory that was created.
/// The directory is only readable by the current user. Calling this function on
/// the browser process UI or IO threads is not allowed.
///
int cef_create_new_temp_directory (
    const(cef_string_t)* prefix,
    cef_string_t* new_temp_path);

///
/// Creates a directory within another directory. Extra characters will be
/// appended to |prefix| to ensure that the new directory does not have the same
/// name as an existing directory. Returns true (1) on success and sets
/// |new_dir| to the full path of the directory that was created. The directory
/// is only readable by the current user. Calling this function on the browser
/// process UI or IO threads is not allowed.
///
int cef_create_temp_directory_in_directory (
    const(cef_string_t)* base_dir,
    const(cef_string_t)* prefix,
    cef_string_t* new_dir);

///
/// Returns true (1) if the given path exists and is a directory. Calling this
/// function on the browser process UI or IO threads is not allowed.
///
int cef_directory_exists (const(cef_string_t)* path);

///
/// Deletes the given path whether it's a file or a directory. If |path| is a
/// directory all contents will be deleted.  If |recursive| is true (1) any sub-
/// directories and their contents will also be deleted (equivalent to executing
/// "rm -rf", so use with caution). On POSIX environments if |path| is a
/// symbolic link then only the symlink will be deleted. Returns true (1) on
/// successful deletion or if |path| does not exist. Calling this function on
/// the browser process UI or IO threads is not allowed.
///
int cef_delete_file (const(cef_string_t)* path, int recursive);

///
/// Writes the contents of |src_dir| into a zip archive at |dest_file|. If
/// |include_hidden_files| is true (1) files starting with "." will be included.
/// Returns true (1) on success.  Calling this function on the browser process
/// UI or IO threads is not allowed.
///
int cef_zip_directory (
    const(cef_string_t)* src_dir,
    const(cef_string_t)* dest_file,
    int include_hidden_files);

///
/// Loads the existing "Certificate Revocation Lists" file that is managed by
/// Google Chrome. This file can generally be found in Chrome's User Data
/// directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on
/// Windows) and is updated periodically by Chrome's component updater service.
/// Must be called in the browser process after the context has been
/// initialized. See https://dev.chromium.org/Home/chromium-security/crlsets for
/// background.
///
void cef_load_crlsets_file (const(cef_string_t)* path);

// CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=da0a9242b309fbd70d19949fb1c5b4ec4475ef94$
//

extern (C):

///
/// Implement this structure to handle events related to find results. The
/// functions of this structure will be called on the UI thread.
///
struct cef_find_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called to report find results returned by cef_browser_host_t::find().
    /// |identifer| is a unique incremental identifier for the currently active
    /// search, |count| is the number of matches currently identified,
    /// |selectionRect| is the location of where the match was found (in window
    /// coordinates), |activeMatchOrdinal| is the current position in the search
    /// results, and |finalUpdate| is true (1) if this is the last find
    /// notification.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_find_handler_t* self,
        cef_browser_t* browser,
        int identifier,
        int count,
        const(cef_rect_t)* selectionRect,
        int activeMatchOrdinal,
        int finalUpdate) nothrow on_find_result;
}



// CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6eefc2c650908461fb7536dd3314c77a3f89dceb$
//

extern (C):

///
/// Implement this structure to handle events related to focus. The functions of
/// this structure will be called on the UI thread.
///
struct cef_focus_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called when the browser component is about to loose focus. For instance,
    /// if focus was on the last HTML element and the user pressed the TAB key.
    /// |next| will be true (1) if the browser is giving focus to the next
    /// component and false (0) if the browser is giving focus to the previous
    /// component.
    ///

    ///
    /// Called when the browser component is requesting focus. |source| indicates

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_focus_handler_t* self,
        cef_browser_t* browser,
        int next) nothrow on_take_focus;
    /// where the focus request is originating from. Return false (0) to allow the
    /// focus to be set or true (1) to cancel setting the focus.
    ///
    extern(System) int function (
        cef_focus_handler_t* self,
        cef_browser_t* browser,
        cef_focus_source_t source) nothrow on_set_focus;

    ///
    /// Called when the browser component has received focus.
    ///
    extern(System) void function (
        cef_focus_handler_t* self,
        cef_browser_t* browser) nothrow on_got_focus;
}



// CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8f347a95168778ec0e686cdef93be3bc517e2f68$
//

extern (C):






///
/// Structure used to represent a frame in the browser window. When used in the
/// browser process the functions of this structure may be called on any thread
/// unless otherwise indicated in the comments. When used in the render process
/// the functions of this structure may only be called on the main thread.
///
struct cef_frame_t
{
    ///
    /// Base structure.
    ///

    ///
    /// True if this object is currently attached to a valid frame.
    ///

    ///
    /// Execute undo in this frame.

    cef_base_ref_counted_t base;
    extern(System) int function (cef_frame_t* self) nothrow is_valid;
    ///
    extern(System) void function (cef_frame_t* self) nothrow undo;

    ///
    /// Execute redo in this frame.
    ///
    extern(System) void function (cef_frame_t* self) nothrow redo;

    ///
    /// Execute cut in this frame.
    ///
    extern(System) void function (cef_frame_t* self) nothrow cut;

    ///
    /// Execute copy in this frame.
    ///
    extern(System) void function (cef_frame_t* self) nothrow copy;

    ///
    /// Execute paste in this frame.
    ///
    extern(System) void function (cef_frame_t* self) nothrow paste;

    ///
    /// Execute delete in this frame.
    ///
    extern(System) void function (cef_frame_t* self) nothrow del;

    ///
    /// Execute select all in this frame.
    ///
    extern(System) void function (cef_frame_t* self) nothrow select_all;

    ///
    /// Save this frame's HTML source to a temporary file and open it in the
    /// default text viewing application. This function can only be called from
    /// the browser process.
    ///
    extern(System) void function (cef_frame_t* self) nothrow view_source;

    ///
    /// Retrieve this frame's HTML source as a string sent to the specified
    /// visitor.
    ///
    extern(System) void function (
        cef_frame_t* self,
        cef_string_visitor_t* visitor) nothrow get_source;

    ///
    /// Retrieve this frame's display text as a string sent to the specified
    /// visitor.
    ///
    extern(System) void function (
        cef_frame_t* self,
        cef_string_visitor_t* visitor) nothrow get_text;

    ///
    /// Load the request represented by the |request| object.
    ///
    /// WARNING: This function will fail with "bad IPC message" reason
    /// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
    /// origin using some other mechanism (LoadURL, link click, etc).
    ///
    extern(System) void function (cef_frame_t* self, cef_request_t* request) nothrow load_request;

    ///
    /// Load the specified |url|.
    ///
    extern(System) void function (cef_frame_t* self, const(cef_string_t)* url) nothrow load_url;

    ///
    /// Execute a string of JavaScript code in this frame. The |script_url|
    /// parameter is the URL where the script in question can be found, if any.
    /// The renderer may request this URL to show the developer the source of the
    /// error.  The |start_line| parameter is the base line number to use for
    /// error reporting.
    ///
    extern(System) void function (
        cef_frame_t* self,
        const(cef_string_t)* code,
        const(cef_string_t)* script_url,
        int start_line) nothrow execute_java_script;

    ///
    /// Returns true (1) if this is the main (top-level) frame.
    ///
    extern(System) int function (cef_frame_t* self) nothrow is_main;

    ///
    /// Returns true (1) if this is the focused frame.
    ///
    extern(System) int function (cef_frame_t* self) nothrow is_focused;

    ///
    /// Returns the name for this frame. If the frame has an assigned name (for
    /// example, set via the iframe "name" attribute) then that value will be
    /// returned. Otherwise a unique name will be constructed based on the frame
    /// parent hierarchy. The main (top-level) frame will always have an NULL name
    /// value.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_frame_t* self) nothrow get_name;

    ///
    /// Returns the globally unique identifier for this frame or NULL if the
    /// underlying frame does not yet exist.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_frame_t* self) nothrow get_identifier;

    ///
    /// Returns the parent of this frame or NULL if this is the main (top-level)
    /// frame.
    ///
    extern(System) cef_frame_t* function (cef_frame_t* self) nothrow get_parent;

    ///
    /// Returns the URL currently loaded in this frame.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_frame_t* self) nothrow get_url;

    ///
    /// Returns the browser that this frame belongs to.
    ///
    extern(System) cef_browser_t* function (cef_frame_t* self) nothrow get_browser;

    ///
    /// Get the V8 context associated with the frame. This function can only be
    /// called from the render process.
    ///
    extern(System) cef_v8context_t* function (cef_frame_t* self) nothrow get_v8context;

    ///
    /// Visit the DOM document. This function can only be called from the render
    /// process.
    ///
    extern(System) void function (cef_frame_t* self, cef_domvisitor_t* visitor) nothrow visit_dom;

    ///
    /// Create a new URL request that will be treated as originating from this
    /// frame and the associated browser. Use cef_urlrequest_t::Create instead if
    /// you do not want the request to have this association, in which case it may
    /// be handled differently (see documentation on that function). A request
    /// created with this function may only originate from the browser process,
    /// and will behave as follows:
    ///   - It may be intercepted by the client via CefResourceRequestHandler or
    ///     CefSchemeHandlerFactory.
    ///   - POST data may only contain a single element of type PDE_TYPE_FILE or
    ///     PDE_TYPE_BYTES.
    ///
    /// The |request| object will be marked as read-only after calling this
    /// function.
    ///
    extern(System) cef_urlrequest_t* function (
        cef_frame_t* self,
        cef_request_t* request,
        cef_urlrequest_client_t* client) nothrow create_urlrequest;

    ///
    /// Send a message to the specified |target_process|. Ownership of the message
    /// contents will be transferred and the |message| reference will be
    /// invalidated. Message delivery is not guaranteed in all cases (for example,
    /// if the browser is closing, navigating, or if the target process crashes).
    /// Send an ACK message back from the target process if confirmation is
    /// required.
    ///
    extern(System) void function (
        cef_frame_t* self,
        cef_process_id_t target_process,
        cef_process_message_t* message) nothrow send_process_message;
}



// CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fc6fbee765ce2b649f5293c8c4b076d36014e4aa$
//

extern (C):

///
/// Implement this structure to handle events related to cef_frame_t life span.
/// The order of callbacks is:
///
/// (1) During initial cef_browser_host_t creation and navigation of the main
/// frame:
/// - cef_frame_handler_t::OnFrameCreated => The initial main frame object has
///   been created. Any commands will be queued until the frame is attached.
/// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
///   has been assigned to the browser.
/// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and
///   can be used.
/// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
///   now connected to its peer in the renderer process. Commands can be routed.
///
/// (2) During further cef_browser_host_t navigation/loading of the main frame
///     and/or sub-frames:
/// - cef_frame_handler_t::OnFrameCreated => A new main frame or sub-frame
///   object has been created. Any commands will be queued until the frame is
///   attached.
/// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
///   object is now connected to its peer in the renderer process. Commands can
///   be routed.
/// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-
///   frame object has lost its connection to the renderer process. If multiple
///   objects are detached at the same time then notifications will be sent for
///   any sub-frame objects before the main frame object. Commands can no longer
///   be routed and will be discarded.
/// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has
///   been assigned to the browser. This will only occur with cross-origin
///   navigation or re-navigation after renderer process termination (due to
///   crashes, etc).
///
/// (3) During final cef_browser_host_t destruction of the main frame:
/// - cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
///   their connection to the renderer process. Commands can no longer be routed
///   and will be discarded.
/// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed.
/// - cef_frame_handler_t::OnFrameDetached => The main frame object have lost
///   its connection to the renderer process. Notifications will be sent for any
///   sub-frame objects before the main frame object. Commands can no longer be
///   routed and will be discarded.
/// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
///   been removed from the browser.
///
/// Cross-origin navigation and/or loading receives special handling.
///
/// When the main frame navigates to a different origin the OnMainFrameChanged
/// callback (2) will be executed with the old and new main frame objects.
///
/// When a new sub-frame is loaded in, or an existing sub-frame is navigated to,
/// a different origin from the parent frame, a temporary sub-frame object will
/// first be created in the parent's renderer process. That temporary sub-frame
/// will then be discarded after the real cross-origin sub-frame is created in
/// the new/target renderer process. The client will receive cross-origin
/// navigation callbacks (2) for the transition from the temporary sub-frame to
/// the real sub-frame. The temporary sub-frame will not receive or execute
/// commands during this transitional period (any sent commands will be
/// discarded).
///
/// When a new popup browser is created in a different origin from the parent
/// browser, a temporary main frame object for the popup will first be created
/// in the parent's renderer process. That temporary main frame will then be
/// discarded after the real cross-origin main frame is created in the
/// new/target renderer process. The client will receive creation and initial
/// navigation callbacks (1) for the temporary main frame, followed by cross-
/// origin navigation callbacks (2) for the transition from the temporary main
/// frame to the real main frame. The temporary main frame may receive and
/// execute commands during this transitional period (any sent commands may be
/// executed, but the behavior is potentially undesirable since they execute in
/// the parent browser's renderer process and not the new/target renderer
/// process).
///
/// Callbacks will not be executed for placeholders that may be created during
/// pre-commit navigation for sub-frames that do not yet exist in the renderer
/// process. Placeholders will have cef_frame_t::get_identifier() == -4.
///
/// The functions of this structure will be called on the UI thread unless
/// otherwise indicated.
///
struct cef_frame_handler_t
{
    ///
    /// Base structure.
    ///

    cef_base_ref_counted_t base;

    ///
    /// Called when a new frame is created. This will be the first notification
    /// that references |frame|. Any commands that require transport to the
    /// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
    /// etc.) will be queued until OnFrameAttached is called for |frame|.
    ///
    extern(System) void function (
        cef_frame_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame) nothrow on_frame_created;

    ///
    /// Called when a frame can begin routing commands to/from the associated
    /// renderer process. |reattached| will be true (1) if the frame was re-
    /// attached after exiting the BackForwardCache. Any commands that were queued
    /// have now been dispatched.
    ///
    extern(System) void function (
        cef_frame_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        int reattached) nothrow on_frame_attached;

    ///
    /// Called when a frame loses its connection to the renderer process and will
    /// be destroyed. Any pending or future commands will be discarded and
    /// cef_frame_t::is_valid() will now return false (0) for |frame|. If called
    /// after cef_life_span_handler_t::on_before_close() during browser
    /// destruction then cef_browser_t::is_valid() will return false (0) for
    /// |browser|.
    ///
    extern(System) void function (
        cef_frame_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame) nothrow on_frame_detached;

    ///
    /// Called when the main frame changes due to (a) initial browser creation,
    /// (b) final browser destruction, (c) cross-origin navigation or (d) re-
    /// navigation after renderer process termination (due to crashes, etc).
    /// |old_frame| will be NULL and |new_frame| will be non-NULL when a main
    /// frame is assigned to |browser| for the first time. |old_frame| will be
    /// non-NULL and |new_frame| will be NULL and  when a main frame is removed
    /// from |browser| for the last time. Both |old_frame| and |new_frame| will be
    /// non-NULL for cross-origin navigations or re-navigation after renderer
    /// process termination. This function will be called after on_frame_created()
    /// for |new_frame| and/or after on_frame_detached() for |old_frame|. If
    /// called after cef_life_span_handler_t::on_before_close() during browser
    /// destruction then cef_browser_t::is_valid() will return false (0) for
    /// |browser|.
    ///
    extern(System) void function (
        cef_frame_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* old_frame,
        cef_frame_t* new_frame) nothrow on_main_frame_changed;
}



// CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=990e80ab5ae04298e6b70cbc0a67115825563251$
//

extern (C):

///
/// Returns true (1) if the application text direction is right-to-left.
///
int cef_is_rtl ();

// CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7512ccf755017d5b1866b753890b498e8163006d$
//

extern (C):

///
/// Container for a single image represented at different scale factors. All
/// image representations should be the same size in density independent pixel
/// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels
/// then the image at scale factor 2.0 should be 200x200 pixels -- both images
/// will display with a DIP size of 100x100 units. The functions of this
/// structure can be called on any browser process thread.
///
struct cef_image_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this Image is NULL.
    ///

    ///
    /// Returns true (1) if this Image and |that| Image share the same underlying
    /// storage. Will also return true (1) if both images are NULL.
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (cef_image_t* self) nothrow is_empty;
    extern(System) int function (cef_image_t* self, cef_image_t* that) nothrow is_same;
    ///
    /// Add a bitmap image representation for |scale_factor|. Only 32-bit
    /// RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the
    /// bitmap representation size in pixel coordinates. |pixel_data| is the array
    /// of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in
    /// size. |color_type| and |alpha_type| values specify the pixel format.
    ///
    extern(System) int function (
        cef_image_t* self,
        float scale_factor,
        int pixel_width,
        int pixel_height,
        cef_color_type_t color_type,
        cef_alpha_type_t alpha_type,
        const(void)* pixel_data,
        size_t pixel_data_size) nothrow add_bitmap;

    ///
    /// Add a PNG image representation for |scale_factor|. |png_data| is the image
    /// data of size |png_data_size|. Any alpha transparency in the PNG data will
    /// be maintained.
    ///
    extern(System) int function (
        cef_image_t* self,
        float scale_factor,
        const(void)* png_data,
        size_t png_data_size) nothrow add_png;

    ///
    /// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
    /// image data of size |jpeg_data_size|. The JPEG format does not support
    /// transparency so the alpha byte will be set to 0xFF for all pixels.
    ///
    extern(System) int function (
        cef_image_t* self,
        float scale_factor,
        const(void)* jpeg_data,
        size_t jpeg_data_size) nothrow add_jpeg;

    ///
    /// Returns the image width in density independent pixel (DIP) units.
    ///
    extern(System) size_t function (cef_image_t* self) nothrow get_width;

    ///
    /// Returns the image height in density independent pixel (DIP) units.
    ///
    extern(System) size_t function (cef_image_t* self) nothrow get_height;

    ///
    /// Returns true (1) if this image contains a representation for
    /// |scale_factor|.
    ///
    extern(System) int function (cef_image_t* self, float scale_factor) nothrow has_representation;

    ///
    /// Removes the representation for |scale_factor|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (
        cef_image_t* self,
        float scale_factor) nothrow remove_representation;

    ///
    /// Returns information for the representation that most closely matches
    /// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
    /// representation. |pixel_width| and |pixel_height| are the representation
    /// size in pixel coordinates. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_image_t* self,
        float scale_factor,
        float* actual_scale_factor,
        int* pixel_width,
        int* pixel_height) nothrow get_representation_info;

    ///
    /// Returns the bitmap representation that most closely matches
    /// |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type|
    /// and |alpha_type| values specify the desired output pixel format.
    /// |pixel_width| and |pixel_height| are the output representation size in
    /// pixel coordinates. Returns a cef_binary_value_t containing the pixel data
    /// on success or NULL on failure.
    ///
    extern(System) cef_binary_value_t* function (
        cef_image_t* self,
        float scale_factor,
        cef_color_type_t color_type,
        cef_alpha_type_t alpha_type,
        int* pixel_width,
        int* pixel_height) nothrow get_as_bitmap;

    ///
    /// Returns the PNG representation that most closely matches |scale_factor|.
    /// If |with_transparency| is true (1) any alpha transparency in the image
    /// will be represented in the resulting PNG data. |pixel_width| and
    /// |pixel_height| are the output representation size in pixel coordinates.
    /// Returns a cef_binary_value_t containing the PNG image data on success or
    /// NULL on failure.
    ///
    extern(System) cef_binary_value_t* function (
        cef_image_t* self,
        float scale_factor,
        int with_transparency,
        int* pixel_width,
        int* pixel_height) nothrow get_as_png;

    ///
    /// Returns the JPEG representation that most closely matches |scale_factor|.
    /// |quality| determines the compression level with 0 == lowest and 100 ==
    /// highest. The JPEG format does not support alpha transparency and the alpha
    /// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
    /// the output representation size in pixel coordinates. Returns a
    /// cef_binary_value_t containing the JPEG image data on success or NULL on
    /// failure.
    ///
    extern(System) cef_binary_value_t* function (
        cef_image_t* self,
        float scale_factor,
        int quality,
        int* pixel_width,
        int* pixel_height) nothrow get_as_jpeg;
}



///
/// Create a new cef_image_t. It will initially be NULL. Use the Add*()
/// functions to add representations at different scale factors.
///
cef_image_t* cef_image_create ();

// CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c6810367ba3a17824247dcb17f87040cd021c295$
//

extern (C):

///
/// Callback structure used for asynchronous continuation of JavaScript dialog
/// requests.
///
struct cef_jsdialog_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Continue the JS dialog request. Set |success| to true (1) if the OK button
    /// was pressed. The |user_input| value should be specified for prompt
    /// dialogs.
    ///

    ///
    /// Implement this structure to handle events related to JavaScript dialogs. The
    /// functions of this structure will be called on the UI thread.
    ///

    ///
    /// Base structure.
    ///

    ///
    /// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_jsdialog_callback_t* self,
        int success,
        const(cef_string_t)* user_input) nothrow cont;
}



struct cef_jsdialog_handler_t
{
    cef_base_ref_counted_t base;
    /// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
    /// and user-friendly display string. The |default_prompt_text| value will be
    /// specified for prompt dialogs only. Set |suppress_message| to true (1) and
    /// return false (0) to suppress the message (suppressing messages is
    /// preferable to immediately executing the callback as this is used to detect
    /// presumably malicious behavior like spamming alert messages in
    /// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
    /// to use the default implementation (the default implementation will show
    /// one modal dialog at a time and suppress any additional dialog requests
    /// until the displayed dialog is dismissed). Return true (1) if the
    /// application will use a custom dialog or if the callback has been executed
    /// immediately. Custom dialogs may be either modal or modeless. If a custom
    /// dialog is used the application must execute |callback| once the custom
    /// dialog is dismissed.
    ///
    extern(System) int function (
        cef_jsdialog_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* origin_url,
        cef_jsdialog_type_t dialog_type,
        const(cef_string_t)* message_text,
        const(cef_string_t)* default_prompt_text,
        cef_jsdialog_callback_t* callback,
        int* suppress_message) nothrow on_jsdialog;

    ///
    /// Called to run a dialog asking the user if they want to leave a page.
    /// Return false (0) to use the default dialog implementation. Return true (1)
    /// if the application will use a custom dialog or if the callback has been
    /// executed immediately. Custom dialogs may be either modal or modeless. If a
    /// custom dialog is used the application must execute |callback| once the
    /// custom dialog is dismissed.
    ///
    extern(System) int function (
        cef_jsdialog_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* message_text,
        int is_reload,
        cef_jsdialog_callback_t* callback) nothrow on_before_unload_dialog;

    ///
    /// Called to cancel any pending dialogs and reset any saved dialog state.
    /// Will be called due to events like page navigation irregardless of whether
    /// any dialogs are currently pending.
    ///
    extern(System) void function (
        cef_jsdialog_handler_t* self,
        cef_browser_t* browser) nothrow on_reset_dialog_state;

    ///
    /// Called when the dialog is closed.
    ///
    extern(System) void function (
        cef_jsdialog_handler_t* self,
        cef_browser_t* browser) nothrow on_dialog_closed;
}



// CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0bfe161c51cc6378b2e8e2e2b2c017b750b46864$
//

extern (C):

///
/// Implement this structure to handle events related to keyboard input. The
/// functions of this structure will be called on the UI thread.
///
struct cef_keyboard_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called before a keyboard event is sent to the renderer. |event| contains
    /// information about the keyboard event. |os_event| is the operating system
    /// event message, if any. Return true (1) if the event was handled or false
    /// (0) otherwise. If the event will be handled in on_key_event() as a
    /// keyboard shortcut set |is_keyboard_shortcut| to true (1) and return false
    /// (0).
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (
        cef_keyboard_handler_t* self,
        cef_browser_t* browser,
        const(cef_key_event_t)* event,
        XEvent* os_event,
        int* is_keyboard_shortcut) nothrow on_pre_key_event;
    ///
    /// Called after the renderer and JavaScript in the page has had a chance to
    /// handle the event. |event| contains information about the keyboard event.
    /// |os_event| is the operating system event message, if any. Return true (1)
    /// if the keyboard event was handled or false (0) otherwise.
    ///
    extern(System) int function (
        cef_keyboard_handler_t* self,
        cef_browser_t* browser,
        const(cef_key_event_t)* event,
        XEvent* os_event) nothrow on_key_event;
}



// CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=54edf9e9c2a12acdc4cab55079a4a5cb8e2a1e43$
//

extern (C):



///
/// Implement this structure to handle events related to browser life span. The
/// functions of this structure will be called on the UI thread unless otherwise
/// indicated.
///
struct cef_life_span_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called on the UI thread before a new popup browser is created. The
    /// |browser| and |frame| values represent the source of the popup request.
    /// The |target_url| and |target_frame_name| values indicate where the popup
    /// browser should navigate and may be NULL if not specified with the request.
    /// The |target_disposition| value indicates where the user intended to open
    /// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
    /// be true (1) if the popup was opened via explicit user gesture (e.g.

    cef_base_ref_counted_t base;
    /// clicking a link) or false (0) if the popup opened automatically (e.g. via
    /// the DomContentLoaded event). The |popupFeatures| structure contains
    /// additional information about the requested popup window. To allow creation
    /// of the popup browser optionally modify |windowInfo|, |client|, |settings|
    /// and |no_javascript_access| and return false (0). To cancel creation of the
    /// popup browser return true (1). The |client| and |settings| values will
    /// default to the source browser's values. If the |no_javascript_access|
    /// value is set to false (0) the new browser will not be scriptable and may
    /// not be hosted in the same renderer process as the source browser. Any
    /// modifications to |windowInfo| will be ignored if the parent browser is
    /// wrapped in a cef_browser_view_t. Popup browser creation will be canceled
    /// if the parent browser is destroyed before the popup browser creation
    /// completes (indicated by a call to OnAfterCreated for the popup browser).
    /// The |extra_info| parameter provides an opportunity to specify extra
    /// information specific to the created popup browser that will be passed to
    /// cef_render_process_handler_t::on_browser_created() in the render process.
    ///
    extern(System) int function (
        cef_life_span_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        const(cef_string_t)* target_url,
        const(cef_string_t)* target_frame_name,
        cef_window_open_disposition_t target_disposition,
        int user_gesture,
        const(cef_popup_features_t)* popupFeatures,
        cef_window_info_t* windowInfo,
        cef_client_t** client,
        cef_browser_settings_t* settings,
        cef_dictionary_value_t** extra_info,
        int* no_javascript_access) nothrow on_before_popup;

    ///
    /// Called on the UI thread before a new DevTools popup browser is created.
    /// The |browser| value represents the source of the popup request. Optionally
    /// modify |windowInfo|, |client|, |settings| and |extra_info| values. The
    /// |client|, |settings| and |extra_info| values will default to the source
    /// browser's values. Any modifications to |windowInfo| will be ignored if the
    /// parent browser is Views-hosted (wrapped in a cef_browser_view_t).
    ///
    /// The |extra_info| parameter provides an opportunity to specify extra
    /// information specific to the created popup browser that will be passed to
    /// cef_render_process_handler_t::on_browser_created() in the render process.
    /// The existing |extra_info| object, if any, will be read-only but may be
    /// replaced with a new object.
    ///
    /// Views-hosted source browsers will create Views-hosted DevTools popups
    /// unless |use_default_window| is set to to true (1). DevTools popups can be
    /// blocked by returning true (1) from cef_command_handler_t::OnChromeCommand
    /// for IDC_DEV_TOOLS. Only used with the Chrome runtime.
    ///
    extern(System) void function (
        cef_life_span_handler_t* self,
        cef_browser_t* browser,
        cef_window_info_t* windowInfo,
        cef_client_t** client,
        cef_browser_settings_t* settings,
        cef_dictionary_value_t** extra_info,
        int* use_default_window) nothrow on_before_dev_tools_popup;

    ///
    /// Called after a new browser is created. It is now safe to begin performing
    /// actions with |browser|. cef_frame_handler_t callbacks related to initial
    /// main frame creation will arrive before this callback. See
    /// cef_frame_handler_t documentation for additional usage information.
    ///
    extern(System) void function (
        cef_life_span_handler_t* self,
        cef_browser_t* browser) nothrow on_after_created;

    ///
    /// Called when a browser has received a request to close. This may result
    /// directly from a call to cef_browser_host_t::*close_browser() or indirectly
    /// if the browser is parented to a top-level window created by CEF and the
    /// user attempts to close that window (by clicking the 'X', for example). The
    /// do_close() function will be called after the JavaScript 'onunload' event
    /// has been fired.
    ///
    /// An application should handle top-level owner window close notifications by
    /// calling cef_browser_host_t::try_close_browser() or
    /// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
    /// to close immediately (see the examples below). This gives CEF an
    /// opportunity to process the 'onbeforeunload' event and optionally cancel
    /// the close before do_close() is called.
    ///
    /// When windowed rendering is enabled CEF will internally create a window or
    /// view to host the browser. In that case returning false (0) from do_close()
    /// will send the standard close notification to the browser's top-level owner
    /// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
    /// Linux or cef_window_delegate_t::can_close() callback from Views). If the
    /// browser's host window/view has already been destroyed (via view hierarchy
    /// tear-down, for example) then do_close() will not be called for that
    /// browser since is no longer possible to cancel the close.
    ///
    /// When windowed rendering is disabled returning false (0) from do_close()
    /// will cause the browser object to be destroyed immediately.
    ///
    /// If the browser's top-level owner window requires a non-standard close
    /// notification then send that notification from do_close() and return true
    /// (1).
    ///
    /// The cef_life_span_handler_t::on_before_close() function will be called
    /// after do_close() (if do_close() is called) and immediately before the
    /// browser object is destroyed. The application should only exit after
    /// on_before_close() has been called for all existing browsers.
    ///
    /// The below examples describe what should happen during window close when
    /// the browser is parented to an application-provided top-level window.
    ///
    /// Example 1: Using cef_browser_host_t::try_close_browser(). This is
    /// recommended for clients using standard close handling and windows created
    /// on the browser process UI thread. 1.  User clicks the window close button
    /// which sends a close notification
    ///     to the application's top-level window.
    /// 2.  Application's top-level window receives the close notification and
    ///     calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
    ///     TryCloseBrowser() returns false so the client cancels the window
    ///     close.
    /// 3.  JavaScript 'onbeforeunload' handler executes and shows the close
    ///     confirmation dialog (which can be overridden via
    ///     CefJSDialogHandler::OnBeforeUnloadDialog()).
    /// 4.  User approves the close. 5.  JavaScript 'onunload' handler executes.
    /// 6.  CEF sends a close notification to the application's top-level window
    ///     (because DoClose() returned false by default).
    /// 7.  Application's top-level window receives the close notification and
    ///     calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
    ///     allows the window close.
    /// 8.  Application's top-level window is destroyed. 9.  Application's
    /// on_before_close() handler is called and the browser object
    ///     is destroyed.
    /// 10. Application exits by calling cef_quit_message_loop() if no other
    /// browsers
    ///     exist.
    ///
    /// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
    /// implementing the do_close() callback. This is recommended for clients
    /// using non-standard close handling or windows that were not created on the
    /// browser process UI thread. 1.  User clicks the window close button which
    /// sends a close notification
    ///     to the application's top-level window.
    /// 2.  Application's top-level window receives the close notification and:
    ///     A. Calls CefBrowserHost::CloseBrowser(false).
    ///     B. Cancels the window close.
    /// 3.  JavaScript 'onbeforeunload' handler executes and shows the close
    ///     confirmation dialog (which can be overridden via
    ///     CefJSDialogHandler::OnBeforeUnloadDialog()).
    /// 4.  User approves the close. 5.  JavaScript 'onunload' handler executes.
    /// 6.  Application's do_close() handler is called. Application will:
    ///     A. Set a flag to indicate that the next close attempt will be allowed.
    ///     B. Return false.
    /// 7.  CEF sends an close notification to the application's top-level window.
    /// 8.  Application's top-level window receives the close notification and
    ///     allows the window to close based on the flag from #6B.
    /// 9.  Application's top-level window is destroyed. 10. Application's
    /// on_before_close() handler is called and the browser object
    ///     is destroyed.
    /// 11. Application exits by calling cef_quit_message_loop() if no other
    /// browsers
    ///     exist.
    ///
    extern(System) int function (
        cef_life_span_handler_t* self,
        cef_browser_t* browser) nothrow do_close;

    ///
    /// Called just before a browser is destroyed. Release all references to the
    /// browser object and do not attempt to execute any functions on the browser
    /// object (other than IsValid, GetIdentifier or IsSame) after this callback
    /// returns. cef_frame_handler_t callbacks related to final main frame
    /// destruction will arrive after this callback and cef_browser_t::IsValid
    /// will return false (0) at that time. Any in-progress network requests
    /// associated with |browser| will be aborted when the browser is destroyed,
    /// and cef_resource_request_handler_t callbacks related to those requests may
    /// still arrive on the IO thread after this callback. See cef_frame_handler_t
    /// and do_close() documentation for additional usage information.
    ///
    extern(System) void function (
        cef_life_span_handler_t* self,
        cef_browser_t* browser) nothrow on_before_close;
}



// CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=eb842e65cd2e7c4a8a6baa2813b57ac0d3977261$
//

extern (C):

///
/// Implement this structure to handle events related to browser load status.
/// The functions of this structure will be called on the browser process UI
/// thread or render process main thread (TID_RENDERER).
///
struct cef_load_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called when the loading state has changed. This callback will be executed
    /// twice -- once when loading is initiated either programmatically or by user
    /// action, and once when loading is terminated due to completion,
    /// cancellation of failure. It will be called before any calls to OnLoadStart
    /// and after all calls to OnLoadError and/or OnLoadEnd.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_load_handler_t* self,
        cef_browser_t* browser,
        int isLoading,
        int canGoBack,
        int canGoForward) nothrow on_loading_state_change;
    ///
    /// Called after a navigation has been committed and before the browser begins
    /// loading contents in the frame. The |frame| value will never be NULL --
    /// call the is_main() function to check if this frame is the main frame.
    /// |transition_type| provides information about the source of the navigation
    /// and an accurate value is only available in the browser process. Multiple
    /// frames may be loading at the same time. Sub-frames may start or continue
    /// loading after the main frame load has ended. This function will not be
    /// called for same page navigations (fragments, history state, etc.) or for
    /// navigations that fail or are canceled before commit. For notification of
    /// overall browser load status use OnLoadingStateChange instead.
    ///
    extern(System) void function (
        cef_load_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_transition_type_t transition_type) nothrow on_load_start;

    ///
    /// Called when the browser is done loading a frame. The |frame| value will
    /// never be NULL -- call the is_main() function to check if this frame is the
    /// main frame. Multiple frames may be loading at the same time. Sub-frames
    /// may start or continue loading after the main frame load has ended. This
    /// function will not be called for same page navigations (fragments, history
    /// state, etc.) or for navigations that fail or are canceled before commit.
    /// For notification of overall browser load status use OnLoadingStateChange
    /// instead.
    ///
    extern(System) void function (
        cef_load_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        int httpStatusCode) nothrow on_load_end;

    ///
    /// Called when a navigation fails or is canceled. This function may be called
    /// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
    /// after commit. |errorCode| is the error code number, |errorText| is the
    /// error text and |failedUrl| is the URL that failed to load. See
    /// net\base\net_error_list.h for complete descriptions of the error codes.
    ///
    extern(System) void function (
        cef_load_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_errorcode_t errorCode,
        const(cef_string_t)* errorText,
        const(cef_string_t)* failedUrl) nothrow on_load_error;
}



// CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8eec1100e8470cbe3ebc54d5962416d2fa4d57fb$
//

extern (C):

///
/// Supports discovery of and communication with media devices on the local
/// network via the Cast and DIAL protocols. The functions of this structure may
/// be called on any browser process thread unless otherwise indicated.
///
struct cef_media_router_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Add an observer for MediaRouter events. The observer will remain
    /// registered until the returned Registration object is destroyed.
    ///

    cef_base_ref_counted_t base;
    extern(System) cef_registration_t* function (
        cef_media_router_t* self,
        cef_media_observer_t* observer) nothrow add_observer; ///
    /// Returns a MediaSource object for the specified media source URN. Supported
    /// URN schemes include "cast:" and "dial:", and will be already known by the
    /// client application (e.g. "cast:<appId>?clientId=<clientId>").
    ///
    extern(System) cef_media_source_t* function (
        cef_media_router_t* self,
        const(cef_string_t)* urn) nothrow get_source;

    ///
    /// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all
    /// registered observers.
    ///
    extern(System) void function (cef_media_router_t* self) nothrow notify_current_sinks;

    ///
    /// Create a new route between |source| and |sink|. Source and sink must be
    /// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and
    /// a route between them must not already exist. |callback| will be executed
    /// on success or failure. If route creation succeeds it will also trigger an
    /// asynchronous call to cef_media_observer_t::OnRoutes on all registered
    /// observers.
    ///
    extern(System) void function (
        cef_media_router_t* self,
        cef_media_source_t* source,
        cef_media_sink_t* sink,
        cef_media_route_create_callback_t* callback) nothrow create_route;

    ///
    /// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all
    /// registered observers.
    ///
    extern(System) void function (cef_media_router_t* self) nothrow notify_current_routes;
}



///
/// Returns the MediaRouter object associated with the global request context.
/// If |callback| is non-NULL it will be executed asnychronously on the UI
/// thread after the manager's storage has been initialized. Equivalent to
/// calling cef_request_context_t::cef_request_context_get_global_context()-
/// >get_media_router().
///
cef_media_router_t* cef_media_router_get_global (
    cef_completion_callback_t* callback);

///
/// Implemented by the client to observe MediaRouter events and registered via
/// cef_media_router_t::AddObserver. The functions of this structure will be
/// called on the browser process UI thread.
///
struct cef_media_observer_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// The list of available media sinks has changed or
    /// cef_media_router_t::NotifyCurrentSinks was called.
    ///
    extern(System) void function (
        cef_media_observer_t* self,
        size_t sinksCount,
        cef_media_sink_t** sinks) nothrow on_sinks;

    ///
    /// The list of available media routes has changed or
    /// cef_media_router_t::NotifyCurrentRoutes was called.
    ///
    extern(System) void function (
        cef_media_observer_t* self,
        size_t routesCount,
        cef_media_route_t** routes) nothrow on_routes;

    ///
    /// The connection state of |route| has changed.
    ///
    extern(System) void function (
        cef_media_observer_t* self,
        cef_media_route_t* route,
        cef_media_route_connection_state_t state) nothrow on_route_state_changed;

    ///
    /// A message was received over |route|. |message| is only valid for the scope
    /// of this callback and should be copied if necessary.
    ///
    extern(System) void function (
        cef_media_observer_t* self,
        cef_media_route_t* route,
        const(void)* message,
        size_t message_size) nothrow on_route_message_received;
}



///
/// Represents the route between a media source and sink. Instances of this
/// object are created via cef_media_router_t::CreateRoute and retrieved via
/// cef_media_observer_t::OnRoutes. Contains the status and metadata of a
/// routing operation. The functions of this structure may be called on any
/// browser process thread unless otherwise indicated.
///
struct cef_media_route_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the ID for this route.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_media_route_t* self) nothrow get_id;

    ///
    /// Returns the source associated with this route.
    ///
    extern(System) cef_media_source_t* function (cef_media_route_t* self) nothrow get_source;

    ///
    /// Returns the sink associated with this route.
    ///
    extern(System) cef_media_sink_t* function (cef_media_route_t* self) nothrow get_sink;

    ///
    /// Send a message over this route. |message| will be copied if necessary.
    ///
    extern(System) void function (
        cef_media_route_t* self,
        const(void)* message,
        size_t message_size) nothrow send_route_message;

    ///
    /// Terminate this route. Will result in an asynchronous call to
    /// cef_media_observer_t::OnRoutes on all registered observers.
    ///
    extern(System) void function (cef_media_route_t* self) nothrow terminate;
}



///
/// Callback structure for cef_media_router_t::CreateRoute. The functions of
/// this structure will be called on the browser process UI thread.
///
struct cef_media_route_create_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be executed when the route creation has finished.
    /// |result| will be CEF_MRCR_OK if the route creation succeeded. |error| will
    /// be a description of the error if the route creation failed. |route| is the
    /// resulting route, or NULL if the route creation failed.
    ///
    extern(System) void function (
        cef_media_route_create_callback_t* self,
        cef_media_route_create_result_t result,
        const(cef_string_t)* error,
        cef_media_route_t* route) nothrow on_media_route_create_finished;
}



///
/// Represents a sink to which media can be routed. Instances of this object are
/// retrieved via cef_media_observer_t::OnSinks. The functions of this structure
/// may be called on any browser process thread unless otherwise indicated.
///
struct cef_media_sink_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the ID for this sink.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_id;

    ///
    /// Returns the name of this sink.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_name;

    ///
    /// Returns the icon type for this sink.
    ///
    extern(System) cef_media_sink_icon_type_t function (
        cef_media_sink_t* self) nothrow get_icon_type;

    ///
    /// Asynchronously retrieves device info.
    ///
    extern(System) void function (
        cef_media_sink_t* self,
        cef_media_sink_device_info_callback_t* callback) nothrow get_device_info;

    ///
    /// Returns true (1) if this sink accepts content via Cast.
    ///
    extern(System) int function (cef_media_sink_t* self) nothrow is_cast_sink;

    ///
    /// Returns true (1) if this sink accepts content via DIAL.
    ///
    extern(System) int function (cef_media_sink_t* self) nothrow is_dial_sink;

    ///
    /// Returns true (1) if this sink is compatible with |source|.
    ///
    extern(System) int function (
        cef_media_sink_t* self,
        cef_media_source_t* source) nothrow is_compatible_with;
}



///
/// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of
/// this structure will be called on the browser process UI thread.
///
struct cef_media_sink_device_info_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Method that will be executed asyncronously once device information has
    /// been retrieved.
    ///
    extern(System) void function (
        cef_media_sink_device_info_callback_t* self,
        const(cef_media_sink_device_info_t)* device_info) nothrow on_media_sink_device_info;
}



///
/// Represents a source from which media can be routed. Instances of this object
/// are retrieved via cef_media_router_t::GetSource. The functions of this
/// structure may be called on any browser process thread unless otherwise
/// indicated.
///
struct cef_media_source_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the ID (media source URN or URL) for this source.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_media_source_t* self) nothrow get_id;

    ///
    /// Returns true (1) if this source outputs its content via Cast.
    ///
    extern(System) int function (cef_media_source_t* self) nothrow is_cast_source;

    ///
    /// Returns true (1) if this source outputs its content via DIAL.
    ///
    extern(System) int function (cef_media_source_t* self) nothrow is_dial_source;
}



// CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5dae0b1a1271e79a5fd9b2c6e71e7a719a450161$
//

extern (C):

///
/// Supports creation and modification of menus. See cef_menu_id_t for the
/// command ids that have default implementations. All user-defined command ids
/// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of
/// this structure can only be accessed on the browser process the UI thread.
///
struct cef_menu_model_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this menu is a submenu.
    ///

    ///
    /// Clears the menu. Returns true (1) on success.
    ///

    ///
    /// Returns the number of items in this menu.
    ///

    ///
    /// Add a separator to the menu. Returns true (1) on success.

    cef_base_ref_counted_t base;
    extern(System) int function (cef_menu_model_t* self) nothrow is_sub_menu;
    extern(System) int function (cef_menu_model_t* self) nothrow clear;
    extern(System) size_t function (cef_menu_model_t* self) nothrow get_count;
    ///
    extern(System) int function (cef_menu_model_t* self) nothrow add_separator;

    ///
    /// Add an item to the menu. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        const(cef_string_t)* label) nothrow add_item;

    ///
    /// Add a check item to the menu. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        const(cef_string_t)* label) nothrow add_check_item;

    ///
    /// Add a radio item to the menu. Only a single item with the specified
    /// |group_id| can be checked at a time. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        const(cef_string_t)* label,
        int group_id) nothrow add_radio_item;

    ///
    /// Add a sub-menu to the menu. The new sub-menu is returned.
    ///
    extern(System) cef_menu_model_t* function (
        cef_menu_model_t* self,
        int command_id,
        const(cef_string_t)* label) nothrow add_sub_menu;

    ///
    /// Insert a separator in the menu at the specified |index|. Returns true (1)
    /// on success.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow insert_separator_at;

    ///
    /// Insert an item in the menu at the specified |index|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int command_id,
        const(cef_string_t)* label) nothrow insert_item_at;

    ///
    /// Insert a check item in the menu at the specified |index|. Returns true (1)
    /// on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int command_id,
        const(cef_string_t)* label) nothrow insert_check_item_at;

    ///
    /// Insert a radio item in the menu at the specified |index|. Only a single
    /// item with the specified |group_id| can be checked at a time. Returns true
    /// (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int command_id,
        const(cef_string_t)* label,
        int group_id) nothrow insert_radio_item_at;

    ///
    /// Insert a sub-menu in the menu at the specified |index|. The new sub-menu
    /// is returned.
    ///
    extern(System) cef_menu_model_t* function (
        cef_menu_model_t* self,
        size_t index,
        int command_id,
        const(cef_string_t)* label) nothrow insert_sub_menu_at;

    ///
    /// Removes the item with the specified |command_id|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow remove;

    ///
    /// Removes the item at the specified |index|. Returns true (1) on success.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow remove_at;

    ///
    /// Returns the index associated with the specified |command_id| or -1 if not
    /// found due to the command id not existing in the menu.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow get_index_of;

    ///
    /// Returns the command id at the specified |index| or -1 if not found due to
    /// invalid range or the index being a separator.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow get_command_id_at;

    ///
    /// Sets the command id at the specified |index|. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int command_id) nothrow set_command_id_at;

    ///
    /// Returns the label for the specified |command_id| or NULL if not found.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_menu_model_t* self,
        int command_id) nothrow get_label;

    ///
    /// Returns the label at the specified |index| or NULL if not found due to
    /// invalid range or the index being a separator.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_menu_model_t* self,
        size_t index) nothrow get_label_at;

    ///
    /// Sets the label for the specified |command_id|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        const(cef_string_t)* label) nothrow set_label;

    ///
    /// Set the label at the specified |index|. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        const(cef_string_t)* label) nothrow set_label_at;

    ///
    /// Returns the item type for the specified |command_id|.
    ///
    extern(System) cef_menu_item_type_t function (
        cef_menu_model_t* self,
        int command_id) nothrow get_type;

    ///
    /// Returns the item type at the specified |index|.
    ///
    extern(System) cef_menu_item_type_t function (
        cef_menu_model_t* self,
        size_t index) nothrow get_type_at;

    ///
    /// Returns the group id for the specified |command_id| or -1 if invalid.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow get_group_id;

    ///
    /// Returns the group id at the specified |index| or -1 if invalid.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow get_group_id_at;

    ///
    /// Sets the group id for the specified |command_id|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        int group_id) nothrow set_group_id;

    ///
    /// Sets the group id at the specified |index|. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int group_id) nothrow set_group_id_at;

    ///
    /// Returns the submenu for the specified |command_id| or NULL if invalid.
    ///
    extern(System) cef_menu_model_t* function (
        cef_menu_model_t* self,
        int command_id) nothrow get_sub_menu;

    ///
    /// Returns the submenu at the specified |index| or NULL if invalid.
    ///
    extern(System) cef_menu_model_t* function (
        cef_menu_model_t* self,
        size_t index) nothrow get_sub_menu_at;

    ///
    /// Returns true (1) if the specified |command_id| is visible.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_visible;

    ///
    /// Returns true (1) if the specified |index| is visible.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow is_visible_at;

    ///
    /// Change the visibility of the specified |command_id|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        int visible) nothrow set_visible;

    ///
    /// Change the visibility at the specified |index|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int visible) nothrow set_visible_at;

    ///
    /// Returns true (1) if the specified |command_id| is enabled.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_enabled;

    ///
    /// Returns true (1) if the specified |index| is enabled.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow is_enabled_at;

    ///
    /// Change the enabled status of the specified |command_id|. Returns true (1)
    /// on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        int enabled) nothrow set_enabled;

    ///
    /// Change the enabled status at the specified |index|. Returns true (1) on
    /// success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int enabled) nothrow set_enabled_at;

    ///
    /// Returns true (1) if the specified |command_id| is checked. Only applies to
    /// check and radio items.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_checked;

    ///
    /// Returns true (1) if the specified |index| is checked. Only applies to
    /// check and radio items.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow is_checked_at;

    ///
    /// Check the specified |command_id|. Only applies to check and radio items.
    /// Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        int checked) nothrow set_checked;

    ///
    /// Check the specified |index|. Only applies to check and radio items.
    /// Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int checked) nothrow set_checked_at;

    ///
    /// Returns true (1) if the specified |command_id| has a keyboard accelerator
    /// assigned.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow has_accelerator;

    ///
    /// Returns true (1) if the specified |index| has a keyboard accelerator
    /// assigned.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow has_accelerator_at;

    ///
    /// Set the keyboard accelerator for the specified |command_id|. |key_code|
    /// can be any virtual key or character value. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        int key_code,
        int shift_pressed,
        int ctrl_pressed,
        int alt_pressed) nothrow set_accelerator;

    ///
    /// Set the keyboard accelerator at the specified |index|. |key_code| can be
    /// any virtual key or character value. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int key_code,
        int shift_pressed,
        int ctrl_pressed,
        int alt_pressed) nothrow set_accelerator_at;

    ///
    /// Remove the keyboard accelerator for the specified |command_id|. Returns
    /// true (1) on success.
    ///
    extern(System) int function (cef_menu_model_t* self, int command_id) nothrow remove_accelerator;

    ///
    /// Remove the keyboard accelerator at the specified |index|. Returns true (1)
    /// on success.
    ///
    extern(System) int function (cef_menu_model_t* self, size_t index) nothrow remove_accelerator_at;

    ///
    /// Retrieves the keyboard accelerator for the specified |command_id|. Returns
    /// true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        int* key_code,
        int* shift_pressed,
        int* ctrl_pressed,
        int* alt_pressed) nothrow get_accelerator;

    ///
    /// Retrieves the keyboard accelerator for the specified |index|. Returns true
    /// (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        size_t index,
        int* key_code,
        int* shift_pressed,
        int* ctrl_pressed,
        int* alt_pressed) nothrow get_accelerator_at;

    ///
    /// Set the explicit color for |command_id| and |color_type| to |color|.
    /// Specify a |color| value of 0 to remove the explicit color. If no explicit
    /// color or default color is set for |color_type| then the system color will
    /// be used. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        cef_menu_color_type_t color_type,
        cef_color_t color) nothrow set_color;

    ///
    /// Set the explicit color for |command_id| and |index| to |color|. Specify a
    /// |color| value of 0 to remove the explicit color. Specify an |index| value
    /// of -1 to set the default color for items that do not have an explicit
    /// color set. If no explicit color or default color is set for |color_type|
    /// then the system color will be used. Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int index,
        cef_menu_color_type_t color_type,
        cef_color_t color) nothrow set_color_at;

    ///
    /// Returns in |color| the color that was explicitly set for |command_id| and
    /// |color_type|. If a color was not set then 0 will be returned in |color|.
    /// Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        cef_menu_color_type_t color_type,
        cef_color_t* color) nothrow get_color;

    ///
    /// Returns in |color| the color that was explicitly set for |command_id| and
    /// |color_type|. Specify an |index| value of -1 to return the default color
    /// in |color|. If a color was not set then 0 will be returned in |color|.
    /// Returns true (1) on success.
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int index,
        cef_menu_color_type_t color_type,
        cef_color_t* color) nothrow get_color_at;

    ///
    /// Sets the font list for the specified |command_id|. If |font_list| is NULL
    /// the system font will be used. Returns true (1) on success. The format is
    /// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
    /// - FONT_FAMILY_LIST is a comma-separated list of font family names,
    /// - STYLES is an optional space-separated list of style names (case-
    ///   sensitive "Bold" and "Italic" are supported), and
    /// - SIZE is an integer font size in pixels with the suffix "px".
    ///
    /// Here are examples of valid font description strings:
    /// - "Arial, Helvetica, Bold Italic 14px"
    /// - "Arial, 14px"
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int command_id,
        const(cef_string_t)* font_list) nothrow set_font_list;

    ///
    /// Sets the font list for the specified |index|. Specify an |index| value of
    /// - 1 to set the default font. If |font_list| is NULL the system font will
    /// - FONT_FAMILY_LIST is a comma-separated list of font family names,
    /// - STYLES is an optional space-separated list of style names (case-
    ///   sensitive "Bold" and "Italic" are supported), and
    /// - SIZE is an integer font size in pixels with the suffix "px".
    ///
    /// Here are examples of valid font description strings:
    /// - "Arial, Helvetica, Bold Italic 14px"
    /// - "Arial, 14px"
    ///
    extern(System) int function (
        cef_menu_model_t* self,
        int index,
        const(cef_string_t)* font_list) nothrow set_font_list_at;
}



///
/// Create a new MenuModel with the specified |delegate|.
///
cef_menu_model_t* cef_menu_model_create (cef_menu_model_delegate_t* delegate_);

// CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=01bdeaf96ea01591689b52b0955504644d6614b8$
//

extern (C):



///
/// Implement this structure to handle menu model events. The functions of this
/// structure will be called on the browser process UI thread unless otherwise
/// indicated.
///
struct cef_menu_model_delegate_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Perform the action associated with the specified |command_id| and optional
    /// |event_flags|.
    ///

    ///
    /// Called when the user moves the mouse outside the menu and over the owning
    /// window.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_menu_model_delegate_t* self,
        cef_menu_model_t* menu_model,
        int command_id,
        cef_event_flags_t event_flags) nothrow execute_command;
    extern(System) void function (
        cef_menu_model_delegate_t* self,
        cef_menu_model_t* menu_model,
        const(cef_point_t)* screen_point) nothrow mouse_outside_menu;

    ///
    /// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
    /// (1) if the menu is displaying a right-to-left language.
    ///
    extern(System) void function (
        cef_menu_model_delegate_t* self,
        cef_menu_model_t* menu_model,
        int is_rtl) nothrow unhandled_open_submenu;

    ///
    /// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
    /// (1) if the menu is displaying a right-to-left language.
    ///
    extern(System) void function (
        cef_menu_model_delegate_t* self,
        cef_menu_model_t* menu_model,
        int is_rtl) nothrow unhandled_close_submenu;

    ///
    /// The menu is about to show.
    ///
    extern(System) void function (
        cef_menu_model_delegate_t* self,
        cef_menu_model_t* menu_model) nothrow menu_will_show;

    ///
    /// The menu has closed.
    ///
    extern(System) void function (
        cef_menu_model_delegate_t* self,
        cef_menu_model_t* menu_model) nothrow menu_closed;

    ///
    /// Optionally modify a menu item label. Return true (1) if |label| was
    /// modified.
    ///
    extern(System) int function (
        cef_menu_model_delegate_t* self,
        cef_menu_model_t* menu_model,
        cef_string_t* label) nothrow format_label;
}



// CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dbdac05f2ebd8e8a357eacfe5095676a5bd5b1ac$
//

extern (C):

///
/// Structure used to represent an entry in navigation history.
///
struct cef_navigation_entry_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is valid. Do not call any other functions
    /// if this function returns false (0).
    ///

    ///
    /// Returns the actual URL of the page. For some pages this may be data: URL
    /// or similar. Use get_display_url() to return a display-friendly version.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    ///
    /// Returns a display-friendly version of the URL.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    cef_base_ref_counted_t base;
    extern(System) int function (cef_navigation_entry_t* self) nothrow is_valid;
    extern(System) cef_string_userfree_t function (cef_navigation_entry_t* self) nothrow get_url;
    extern(System) cef_string_userfree_t function (
        cef_navigation_entry_t* self) nothrow get_display_url;

    ///
    /// Returns the original URL that was entered by the user before any
    /// redirects.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_navigation_entry_t* self) nothrow get_original_url;

    ///
    /// Returns the title set by the page. This value may be NULL.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_navigation_entry_t* self) nothrow get_title;

    ///
    /// Returns the transition type which indicates what the user did to move to
    /// this page from the previous page.
    ///
    extern(System) cef_transition_type_t function (
        cef_navigation_entry_t* self) nothrow get_transition_type;

    ///
    /// Returns true (1) if this navigation includes post data.
    ///
    extern(System) int function (cef_navigation_entry_t* self) nothrow has_post_data;

    ///
    /// Returns the time for the last known successful navigation completion. A
    /// navigation may be completed more than once if the page is reloaded. May be
    /// 0 if the navigation has not yet completed.
    ///
    extern(System) cef_basetime_t function (
        cef_navigation_entry_t* self) nothrow get_completion_time;

    ///
    /// Returns the HTTP status code for the last known successful navigation
    /// response. May be 0 if the response has not yet been received or if the
    /// navigation has not yet completed.
    ///
    extern(System) int function (cef_navigation_entry_t* self) nothrow get_http_status_code;

    ///
    /// Returns the SSL information for this navigation entry.
    ///
    extern(System) cef_sslstatus_t* function (cef_navigation_entry_t* self) nothrow get_sslstatus;
}



// CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f146fd9172033e77e90994841df9fa55ff71aa4b$
//

extern (C):

///
/// Add an entry to the cross-origin access whitelist.
///
/// The same-origin policy restricts how scripts hosted from different origins
/// (scheme + domain + port) can communicate. By default, scripts can only
/// access resources with the same origin. Scripts hosted on the HTTP and HTTPS
/// schemes (but no other schemes) can use the "Access-Control-Allow-Origin"
/// header to allow cross-origin requests. For example,
/// https://source.example.com can make XMLHttpRequest requests on
/// http://target.example.com if the http://target.example.com request returns
/// an "Access-Control-Allow-Origin: https://source.example.com" response
/// header.
///
/// Scripts in separate frames or iframes and hosted from the same protocol and
/// domain suffix can execute cross-origin JavaScript if both pages set the
/// document.domain value to the same domain suffix. For example,
/// scheme://foo.example.com and scheme://bar.example.com can communicate using
/// JavaScript if both domains set document.domain="example.com".
///
/// This function is used to allow access to origins that would otherwise
/// violate the same-origin policy. Scripts hosted underneath the fully
/// qualified |source_origin| URL (like http://www.example.com) will be allowed
/// access to all resources hosted on the specified |target_protocol| and
/// |target_domain|. If |target_domain| is non-NULL and
/// |allow_target_subdomains| is false (0) only exact domain matches will be
/// allowed. If |target_domain| contains a top- level domain component (like
/// "example.com") and |allow_target_subdomains| is true (1) sub-domain matches
/// will be allowed. If |target_domain| is NULL and |allow_target_subdomains| if
/// true (1) all domains and IP addresses will be allowed.
///
/// This function cannot be used to bypass the restrictions on local or display
/// isolated schemes. See the comments on CefRegisterCustomScheme for more
/// information.
///
/// This function may be called on any thread. Returns false (0) if
/// |source_origin| is invalid or the whitelist cannot be accessed.
///
int cef_add_cross_origin_whitelist_entry (
    const(cef_string_t)* source_origin,
    const(cef_string_t)* target_protocol,
    const(cef_string_t)* target_domain,
    int allow_target_subdomains);

///
/// Remove an entry from the cross-origin access whitelist. Returns false (0) if
/// |source_origin| is invalid or the whitelist cannot be accessed.
///
int cef_remove_cross_origin_whitelist_entry (
    const(cef_string_t)* source_origin,
    const(cef_string_t)* target_protocol,
    const(cef_string_t)* target_domain,
    int allow_target_subdomains);

///
/// Remove all entries from the cross-origin access whitelist. Returns false (0)
/// if the whitelist cannot be accessed.
///
int cef_clear_cross_origin_whitelist ();

// CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8accded29b97df1549e86e58d8976fe0f800359a$
//

extern (C):

///
/// Combines specified |base_url| and |relative_url| into |resolved_url|.
/// Returns false (0) if one of the URLs is NULL or invalid.
///
int cef_resolve_url (
    const(cef_string_t)* base_url,
    const(cef_string_t)* relative_url,
    cef_string_t* resolved_url);

///
/// Parse the specified |url| into its component parts. Returns false (0) if the
/// URL is NULL or invalid.
///
int cef_parse_url (const(cef_string_t)* url, cef_urlparts_t* parts);

///
/// Creates a URL from the specified |parts|, which must contain a non-NULL spec
/// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
/// if |parts| isn't initialized as described.
///
int cef_create_url (const(cef_urlparts_t)* parts, cef_string_t* url);

///
/// This is a convenience function for formatting a URL in a concise and human-
/// friendly way to help users make security-related decisions (or in other
/// circumstances when people need to distinguish sites, origins, or otherwise-
/// simplified URLs from each other). Internationalized domain names (IDN) may
/// be presented in Unicode if the conversion is considered safe. The returned
/// value will (a) omit the path for standard schemes, excepting file and
/// filesystem, and (b) omit the port if it is the default for the scheme. Do
/// not use this for URLs which will be parsed or sent to other applications.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t cef_format_url_for_security_display (
    const(cef_string_t)* origin_url);

///
/// Returns the mime type for the specified file extension or an NULL string if
/// unknown.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t cef_get_mime_type (const(cef_string_t)* extension);

///
/// Get the extensions associated with the given mime type. This should be
/// passed in lower case. There could be multiple extensions for a given mime
/// type, like "html,htm" for "text/html", or "txt,text,html,..." for "text/*".
/// Any existing elements in the provided vector will not be erased.
///
void cef_get_extensions_for_mime_type (
    const(cef_string_t)* mime_type,
    cef_string_list_t extensions);

///
/// Encodes |data| as a base64 string.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t cef_base64encode (const(void)* data, size_t data_size);

///
/// Decodes the base64 encoded string |data|. The returned value will be NULL if
/// the decoding fails.
///

cef_binary_value_t* cef_base64decode (const(cef_string_t)* data);

///
/// Escapes characters in |text| which are unsuitable for use as a query
/// parameter value. Everything except alphanumerics and -_.!~*'() will be
/// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The
/// result is basically the same as encodeURIComponent in Javacript.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t cef_uriencode (const(cef_string_t)* text, int use_plus);

///
/// Unescapes |text| and returns the result. Unescaping consists of looking for
/// the exact pattern "%XX" where each X is a hex digit and converting to the
/// character with the numerical value of those digits (e.g. "i%20=%203%3b"
/// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will
/// attempt to interpret the initial decoded result as UTF-8. If the result is
/// convertable into UTF-8 it will be returned as converted. Otherwise the
/// initial decoded result will be returned.  The |unescape_rule| parameter
/// supports further customization the decoding process.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t cef_uridecode (
    const(cef_string_t)* text,
    int convert_to_utf8,
    cef_uri_unescape_rule_t unescape_rule);

///
/// Parses the specified |json_string| and returns a dictionary or list
/// representation. If JSON parsing fails this function returns NULL.
///

cef_value_t* cef_parse_json (
    const(cef_string_t)* json_string,
    cef_json_parser_options_t options);

///
/// Parses the specified UTF8-encoded |json| buffer of size |json_size| and
/// returns a dictionary or list representation. If JSON parsing fails this
/// function returns NULL.
///
cef_value_t* cef_parse_json_buffer (
    const(void)* json,
    size_t json_size,
    cef_json_parser_options_t options);

///
/// Parses the specified |json_string| and returns a dictionary or list
/// representation. If JSON parsing fails this function returns NULL and
/// populates |error_msg_out| with a formatted error message.
///
cef_value_t* cef_parse_jsonand_return_error (
    const(cef_string_t)* json_string,
    cef_json_parser_options_t options,
    cef_string_t* error_msg_out);

///
/// Generates a JSON string from the specified root |node| which should be a
/// dictionary or list value. Returns an NULL string on failure. This function
/// requires exclusive access to |node| including any underlying data.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t cef_write_json (
    cef_value_t* node,
    cef_json_writer_options_t options);

// CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ee0c50b4e1f51fb2286da24bb9244ae74f3b0c6f$
//

extern (C):

///
/// Retrieve the path associated with the specified |key|. Returns true (1) on
/// success. Can be called on any thread in the browser process.
///
int cef_get_path (cef_path_key_t key, cef_string_t* path);

// CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c9b3913701581cd6a1077fa3a39d197f338a2507$
//

extern (C):

///
/// Callback structure used for asynchronous continuation of media access
/// permission requests.
///
struct cef_media_access_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Call to allow or deny media access. If this callback was initiated in
    /// response to a getUserMedia (indicated by
    /// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
    /// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) then
    /// |allowed_permissions| must match |required_permissions| passed to
    /// OnRequestMediaAccessPermission.
    ///

    ///
    /// Cancel the media access request.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_media_access_callback_t* self,
        uint allowed_permissions) nothrow cont;
    extern(System) void function (cef_media_access_callback_t* self) nothrow cancel;
}

 ///
/// Callback structure used for asynchronous continuation of permission prompts.
///
struct cef_permission_prompt_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Complete the permissions request with the specified |result|.
    ///
    extern(System) void function (
        cef_permission_prompt_callback_t* self,
        cef_permission_request_result_t result) nothrow cont;
}



///
/// Implement this structure to handle events related to permission requests.
/// The functions of this structure will be called on the browser process UI
/// thread.
///
struct cef_permission_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called when a page requests permission to access media.
    /// |requesting_origin| is the URL origin requesting permission.
    /// |requested_permissions| is a combination of values from
    /// cef_media_access_permission_types_t that represent the requested
    /// permissions. Return true (1) and call cef_media_access_callback_t
    /// functions either in this function or at a later time to continue or cancel
    /// the request. Return false (0) to proceed with default handling. With the
    /// Chrome runtime, default handling will display the permission request UI.
    /// With the Alloy runtime, default handling will deny the request. This
    /// function will not be called if the "--enable-media-stream" command-line
    /// switch is used to grant all permissions.
    ///
    extern(System) int function (
        cef_permission_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        const(cef_string_t)* requesting_origin,
        uint requested_permissions,
        cef_media_access_callback_t* callback) nothrow on_request_media_access_permission;

    ///
    /// Called when a page should show a permission prompt. |prompt_id| uniquely
    /// identifies the prompt. |requesting_origin| is the URL origin requesting
    /// permission. |requested_permissions| is a combination of values from
    /// cef_permission_request_types_t that represent the requested permissions.
    /// Return true (1) and call cef_permission_prompt_callback_t::Continue either
    /// in this function or at a later time to continue or cancel the request.
    /// Return false (0) to proceed with default handling. With the Chrome
    /// runtime, default handling will display the permission prompt UI. With the
    /// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
    ///
    extern(System) int function (
        cef_permission_handler_t* self,
        cef_browser_t* browser,
        ulong prompt_id,
        const(cef_string_t)* requesting_origin,
        uint requested_permissions,
        cef_permission_prompt_callback_t* callback) nothrow on_show_permission_prompt;

    ///
    /// Called when a permission prompt handled via OnShowPermissionPrompt is
    /// dismissed. |prompt_id| will match the value that was passed to
    /// OnShowPermissionPrompt. |result| will be the value passed to
    /// cef_permission_prompt_callback_t::Continue or CEF_PERMISSION_RESULT_IGNORE
    /// if the dialog was dismissed for other reasons such as navigation, browser
    /// closure, etc. This function will not be called if OnShowPermissionPrompt
    /// returned false (0) for |prompt_id|.
    ///
    extern(System) void function (
        cef_permission_handler_t* self,
        cef_browser_t* browser,
        ulong prompt_id,
        cef_permission_request_result_t result) nothrow on_dismiss_permission_prompt;
}



// CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1c0e469a283538945834404bcd5934b9bb9a0756$
//

extern (C):

///
/// Structure that manages custom preference registrations.
///
struct cef_preference_registrar_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Register a preference with the specified |name| and |default_value|. To
    /// avoid conflicts with built-in preferences the |name| value should contain
    /// an application-specific prefix followed by a period (e.g. "myapp.value").
    /// The contents of |default_value| will be copied. The data type for the
    /// preference will be inferred from |default_value|'s type and cannot be
    /// changed after registration. Returns true (1) on success. Returns false (0)
    /// if |name| is already registered or if |default_value| has an invalid type.
    /// This function must be called from within the scope of the
    /// cef_browser_process_handler_t::OnRegisterCustomPreferences callback.
    ///

    ///
    /// Manage access to preferences. Many built-in preferences are registered by
    /// Chromium. Custom preferences can be registered in

    cef_base_scoped_t base;
    extern(System) int function (
        cef_preference_registrar_t* self,
        const(cef_string_t)* name,
        cef_value_t* default_value) nothrow add_preference;
}


/// cef_browser_process_handler_t::OnRegisterCustomPreferences.
///
struct cef_preference_manager_t
{
    ///
    /// Base structure.
    ///

    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if a preference with the specified |name| exists. This
    /// function must be called on the browser process UI thread.
    ///
    extern(System) int function (
        cef_preference_manager_t* self,
        const(cef_string_t)* name) nothrow has_preference;

    ///
    /// Returns the value for the preference with the specified |name|. Returns
    /// NULL if the preference does not exist. The returned object contains a copy
    /// of the underlying preference value and modifications to the returned
    /// object will not modify the underlying preference value. This function must
    /// be called on the browser process UI thread.
    ///
    extern(System) cef_value_t* function (
        cef_preference_manager_t* self,
        const(cef_string_t)* name) nothrow get_preference;

    ///
    /// Returns all preferences as a dictionary. If |include_defaults| is true (1)
    /// then preferences currently at their default value will be included. The
    /// returned object contains a copy of the underlying preference values and
    /// modifications to the returned object will not modify the underlying
    /// preference values. This function must be called on the browser process UI
    /// thread.
    ///
    extern(System) cef_dictionary_value_t* function (
        cef_preference_manager_t* self,
        int include_defaults) nothrow get_all_preferences;

    ///
    /// Returns true (1) if the preference with the specified |name| can be
    /// modified using SetPreference. As one example preferences set via the
    /// command-line usually cannot be modified. This function must be called on
    /// the browser process UI thread.
    ///
    extern(System) int function (
        cef_preference_manager_t* self,
        const(cef_string_t)* name) nothrow can_set_preference;

    ///
    /// Set the |value| associated with preference |name|. Returns true (1) if the
    /// value is set successfully and false (0) otherwise. If |value| is NULL the
    /// preference will be restored to its default value. If setting the
    /// preference fails then |error| will be populated with a detailed
    /// description of the problem. This function must be called on the browser
    /// process UI thread.
    ///
    extern(System) int function (
        cef_preference_manager_t* self,
        const(cef_string_t)* name,
        cef_value_t* value,
        cef_string_t* error) nothrow set_preference;
}



///
/// Returns the global preference manager object.
///
cef_preference_manager_t* cef_preference_manager_get_global ();

// CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=96d5b6c0dc8f2575e686fb79684c63787cdfe876$
//

extern (C):

///
/// Callback structure for asynchronous continuation of print dialog requests.
///
struct cef_print_dialog_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Continue printing with the specified |settings|.
    ///

    ///
    /// Cancel the printing.
    ///

    ///
    /// Callback structure for asynchronous continuation of print job requests.
    ///

    ///
    /// Base structure.
    ///

    ///
    /// Indicate completion of the print job.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_print_dialog_callback_t* self,
        cef_print_settings_t* settings) nothrow cont;
    extern(System) void function (cef_print_dialog_callback_t* self) nothrow cancel;
}



struct cef_print_job_callback_t
{
    cef_base_ref_counted_t base;
    extern(System) void function (cef_print_job_callback_t* self) nothrow cont;
}



///
/// Implement this structure to handle printing on Linux. Each browser will have
/// only one print job in progress at a time. The functions of this structure
/// will be called on the browser process UI thread.
///
struct cef_print_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called when printing has started for the specified |browser|. This
    /// function will be called before the other OnPrint*() functions and
    /// irrespective of how printing was initiated (e.g.
    /// cef_browser_host_t::print(), JavaScript window.print() or PDF extension
    /// print button).
    ///
    extern(System) void function (
        cef_print_handler_t* self,
        cef_browser_t* browser) nothrow on_print_start;

    ///
    /// Synchronize |settings| with client state. If |get_defaults| is true (1)
    /// then populate |settings| with the default print settings. Do not keep a
    /// reference to |settings| outside of this callback.
    ///
    extern(System) void function (
        cef_print_handler_t* self,
        cef_browser_t* browser,
        cef_print_settings_t* settings,
        int get_defaults) nothrow on_print_settings;

    ///
    /// Show the print dialog. Execute |callback| once the dialog is dismissed.
    /// Return true (1) if the dialog will be displayed or false (0) to cancel the
    /// printing immediately.
    ///
    extern(System) int function (
        cef_print_handler_t* self,
        cef_browser_t* browser,
        int has_selection,
        cef_print_dialog_callback_t* callback) nothrow on_print_dialog;

    ///
    /// Send the print job to the printer. Execute |callback| once the job is
    /// completed. Return true (1) if the job will proceed or false (0) to cancel
    /// the job immediately.
    ///
    extern(System) int function (
        cef_print_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* document_name,
        const(cef_string_t)* pdf_file_path,
        cef_print_job_callback_t* callback) nothrow on_print_job;

    ///
    /// Reset client state related to printing.
    ///
    extern(System) void function (
        cef_print_handler_t* self,
        cef_browser_t* browser) nothrow on_print_reset;

    ///
    /// Return the PDF paper size in device units. Used in combination with
    /// cef_browser_host_t::print_to_pdf().
    ///
    extern(System) cef_size_t function (
        cef_print_handler_t* self,
        cef_browser_t* browser,
        int device_units_per_inch) nothrow get_pdf_paper_size;
}



// CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=63977fcbe4567db202914f69539f49b254352053$
//

extern (C):

///
/// Structure representing print settings.
///
struct cef_print_settings_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is valid. Do not call any other functions
    /// if this function returns false (0).
    ///

    ///
    /// Returns true (1) if the values of this object are read-only. Some APIs may
    /// expose read-only objects.
    ///

    ///
    /// Set the page orientation.
    ///

    ///
    /// Returns true (1) if the orientation is landscape.
    ///

    ///
    /// Set the printer printable area in device units. Some platforms already

    cef_base_ref_counted_t base;
    extern(System) int function (cef_print_settings_t* self) nothrow is_valid;
    extern(System) int function (cef_print_settings_t* self) nothrow is_read_only;
    extern(System) void function (cef_print_settings_t* self, int landscape) nothrow set_orientation;
    extern(System) int function (cef_print_settings_t* self) nothrow is_landscape;
    /// provide flipped area. Set |landscape_needs_flip| to false (0) on those
    /// platforms to avoid double flipping.
    ///
    extern(System) void function (
        cef_print_settings_t* self,
        const(cef_size_t)* physical_size_device_units,
        const(cef_rect_t)* printable_area_device_units,
        int landscape_needs_flip) nothrow set_printer_printable_area;

    ///
    /// Set the device name.
    ///
    extern(System) void function (
        cef_print_settings_t* self,
        const(cef_string_t)* name) nothrow set_device_name;

    ///
    /// Get the device name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_print_settings_t* self) nothrow get_device_name;

    ///
    /// Set the DPI (dots per inch).
    ///
    extern(System) void function (cef_print_settings_t* self, int dpi) nothrow set_dpi;

    ///
    /// Get the DPI (dots per inch).
    ///
    extern(System) int function (cef_print_settings_t* self) nothrow get_dpi;

    ///
    /// Set the page ranges.
    ///
    extern(System) void function (
        cef_print_settings_t* self,
        size_t rangesCount,
        const(cef_range_t)* ranges) nothrow set_page_ranges;

    ///
    /// Returns the number of page ranges that currently exist.
    ///
    extern(System) size_t function (cef_print_settings_t* self) nothrow get_page_ranges_count;

    ///
    /// Retrieve the page ranges.
    ///
    extern(System) void function (
        cef_print_settings_t* self,
        size_t* rangesCount,
        cef_range_t* ranges) nothrow get_page_ranges;

    ///
    /// Set whether only the selection will be printed.
    ///
    extern(System) void function (
        cef_print_settings_t* self,
        int selection_only) nothrow set_selection_only;

    ///
    /// Returns true (1) if only the selection will be printed.
    ///
    extern(System) int function (cef_print_settings_t* self) nothrow is_selection_only;

    ///
    /// Set whether pages will be collated.
    ///
    extern(System) void function (cef_print_settings_t* self, int collate) nothrow set_collate;

    ///
    /// Returns true (1) if pages will be collated.
    ///
    extern(System) int function (cef_print_settings_t* self) nothrow will_collate;

    ///
    /// Set the color model.
    ///
    extern(System) void function (
        cef_print_settings_t* self,
        cef_color_model_t model) nothrow set_color_model;

    ///
    /// Get the color model.
    ///
    extern(System) cef_color_model_t function (cef_print_settings_t* self) nothrow get_color_model;

    ///
    /// Set the number of copies.
    ///
    extern(System) void function (cef_print_settings_t* self, int copies) nothrow set_copies;

    ///
    /// Get the number of copies.
    ///
    extern(System) int function (cef_print_settings_t* self) nothrow get_copies;

    ///
    /// Set the duplex mode.
    ///
    extern(System) void function (
        cef_print_settings_t* self,
        cef_duplex_mode_t mode) nothrow set_duplex_mode;

    ///
    /// Get the duplex mode.
    ///
    extern(System) cef_duplex_mode_t function (cef_print_settings_t* self) nothrow get_duplex_mode;
}



///
/// Create a new cef_print_settings_t object.
///
cef_print_settings_t* cef_print_settings_create ();

// CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=89c569df7e5e4a6035d4527218ce4dc1d68e20f0$
//

extern (C):

///
/// Structure representing a message. Can be used on any process and thread.
///
struct cef_process_message_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is valid. Do not call any other functions
    /// if this function returns false (0).
    ///

    ///
    /// Returns true (1) if the values of this object are read-only. Some APIs may
    /// expose read-only objects.
    ///

    ///
    /// Returns a writable copy of this object. Returns nullptr when message
    /// contains a shared memory region.
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (cef_process_message_t* self) nothrow is_valid;
    extern(System) int function (cef_process_message_t* self) nothrow is_read_only;
    extern(System) cef_process_message_t* function (cef_process_message_t* self) nothrow copy;

    ///
    /// Returns the message name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_process_message_t* self) nothrow get_name;

    ///
    /// Returns the list of arguments. Returns nullptr when message contains a
    /// shared memory region.
    ///
    extern(System) cef_list_value_t* function (
        cef_process_message_t* self) nothrow get_argument_list;

    ///
    /// Returns the shared memory region. Returns nullptr when message contains an
    /// argument list.
    ///
    extern(System) cef_shared_memory_region_t* function (
        cef_process_message_t* self) nothrow get_shared_memory_region;
}



///
/// Create a new cef_process_message_t object with the specified name.
///
cef_process_message_t* cef_process_message_create (const(cef_string_t)* name);

// CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a61a639c7e53ecd9481eae363bac557055f0442e$
//

extern (C):

///
/// Launches the process specified via |command_line|. Returns true (1) upon
/// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
///
/// Unix-specific notes:
/// - All file descriptors open in the parent process will be closed in the
///   child process except for stdin, stdout, and stderr.
/// - If the first argument on the command line does not contain a slash, PATH
///   will be searched. (See man execvp.)
///
int cef_launch_process (cef_command_line_t* command_line);

// CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c53a67bbf1497a51766bf03040714b5edb2117d5$
//

extern (C):

///
/// Generic callback structure used for managing the lifespan of a registration.
///
struct cef_registration_t
{
    ///
    /// Base structure.
    ///

    // CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_

    cef_base_ref_counted_t base;
}


// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5151b6ea3c06e46a75f2cd7679044a2891063d29$
//

extern (C):

///
/// Implement this structure to handle events when window rendering is disabled.
/// The functions of this structure will be called on the UI thread.
///
struct cef_render_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Return the handler for accessibility notifications. If no handler is
    /// provided the default implementation will be used.
    ///

    ///
    /// Called to retrieve the root window rectangle in screen DIP coordinates.
    /// Return true (1) if the rectangle was provided. If this function returns
    /// false (0) the rectangle from GetViewRect will be used.

    cef_base_ref_counted_t base;
    extern(System) cef_accessibility_handler_t* function (
        cef_render_handler_t* self) nothrow get_accessibility_handler;
    ///
    extern(System) int function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_rect_t* rect) nothrow get_root_screen_rect;

    ///
    /// Called to retrieve the view rectangle in screen DIP coordinates. This
    /// function must always provide a non-NULL rectangle.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_rect_t* rect) nothrow get_view_rect;

    ///
    /// Called to retrieve the translation from view DIP coordinates to screen
    /// coordinates. Windows/Linux should provide screen device (pixel)
    /// coordinates and MacOS should provide screen DIP coordinates. Return true
    /// (1) if the requested coordinates were provided.
    ///
    extern(System) int function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        int viewX,
        int viewY,
        int* screenX,
        int* screenY) nothrow get_screen_point;

    ///
    /// Called to allow the client to fill in the CefScreenInfo object with
    /// appropriate values. Return true (1) if the |screen_info| structure has
    /// been modified.
    ///
    /// If the screen info rectangle is left NULL the rectangle from GetViewRect
    /// will be used. If the rectangle is still NULL or invalid popups may not be
    /// drawn correctly.
    ///
    extern(System) int function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_screen_info_t* screen_info) nothrow get_screen_info;

    ///
    /// Called when the browser wants to show or hide the popup widget. The popup
    /// should be shown if |show| is true (1) and hidden if |show| is false (0).
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        int show) nothrow on_popup_show;

    ///
    /// Called when the browser wants to move or resize the popup widget. |rect|
    /// contains the new location and size in view coordinates.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        const(cef_rect_t)* rect) nothrow on_popup_size;

    ///
    /// Called when an element should be painted. Pixel values passed to this
    /// function are scaled relative to view coordinates based on the value of
    /// CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
    /// indicates whether the element is the view or the popup widget. |buffer|
    /// contains the pixel data for the whole image. |dirtyRects| contains the set
    /// of rectangles in pixel coordinates that need to be repainted. |buffer|
    /// will be |width|*|height|*4 bytes in size and represents a BGRA image with
    /// an upper-left origin. This function is only called when
    /// cef_window_tInfo::shared_texture_enabled is set to false (0).
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_paint_element_type_t type,
        size_t dirtyRectsCount,
        const(cef_rect_t)* dirtyRects,
        const(void)* buffer,
        int width,
        int height) nothrow on_paint;

    ///
    /// Called when an element has been rendered to the shared texture handle.
    /// |type| indicates whether the element is the view or the popup widget.
    /// |dirtyRects| contains the set of rectangles in pixel coordinates that need
    /// to be repainted. |info| contains the shared handle; on Windows it is a
    /// HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on
    /// macOS it is an IOSurface pointer that can be opened with Metal or OpenGL,
    /// and on Linux it contains several planes, each with an fd to the underlying
    /// system native buffer.
    ///
    /// The underlying implementation uses a pool to deliver frames. As a result,
    /// the handle may differ every frame depending on how many frames are in-
    /// progress. The handle's resource cannot be cached and cannot be accessed
    /// outside of this callback. It should be reopened each time this callback is
    /// executed and the contents should be copied to a texture owned by the
    /// client application. The contents of |info| will be released back to the
    /// pool after this callback returns.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_paint_element_type_t type,
        size_t dirtyRectsCount,
        const(cef_rect_t)* dirtyRects,
        const(cef_accelerated_paint_info_t)* info) nothrow on_accelerated_paint;

    ///
    /// Called to retrieve the size of the touch handle for the specified
    /// |orientation|.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_horizontal_alignment_t orientation,
        cef_size_t* size) nothrow get_touch_handle_size;

    ///
    /// Called when touch handle state is updated. The client is responsible for
    /// rendering the touch handles.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        const(cef_touch_handle_state_t)* state) nothrow on_touch_handle_state_changed;

    ///
    /// Called when the user starts dragging content in the web view. Contextual
    /// information about the dragged content is supplied by |drag_data|. (|x|,
    /// |y|) is the drag start location in screen coordinates. OS APIs that run a
    /// system message loop may be used within the StartDragging call.
    ///
    /// Return false (0) to abort the drag operation. Don't call any of
    /// cef_browser_host_t::DragSource*Ended* functions after returning false (0).
    ///
    /// Return true (1) to handle the drag operation. Call
    /// cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either
    /// synchronously or asynchronously to inform the web view that the drag
    /// operation has ended.
    ///
    extern(System) int function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_drag_data_t* drag_data,
        cef_drag_operations_mask_t allowed_ops,
        int x,
        int y) nothrow start_dragging;

    ///
    /// Called when the web view wants to update the mouse cursor during a drag &
    /// drop operation. |operation| describes the allowed operation (none, move,
    /// copy, link).
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_drag_operations_mask_t operation) nothrow update_drag_cursor;

    ///
    /// Called when the scroll offset has changed.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        double x,
        double y) nothrow on_scroll_offset_changed;

    ///
    /// Called when the IME composition range has changed. |selected_range| is the
    /// range of characters that have been selected. |character_bounds| is the
    /// bounds of each character in view coordinates.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        const(cef_range_t)* selected_range,
        size_t character_boundsCount,
        const(cef_rect_t)* character_bounds) nothrow on_ime_composition_range_changed;

    ///
    /// Called when text selection has changed for the specified |browser|.
    /// |selected_text| is the currently selected text and |selected_range| is the
    /// character range.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* selected_text,
        const(cef_range_t)* selected_range) nothrow on_text_selection_changed;

    ///
    /// Called when an on-screen keyboard should be shown or hidden for the
    /// specified |browser|. |input_mode| specifies what kind of keyboard should
    /// be opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing
    /// keyboard for this browser should be hidden.
    ///
    extern(System) void function (
        cef_render_handler_t* self,
        cef_browser_t* browser,
        cef_text_input_mode_t input_mode) nothrow on_virtual_keyboard_requested;
}



// CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6e2fccb5a8e49918d723f6c5223062cf98b0f9de$
//

extern (C):

///
/// Structure used to implement render process callbacks. The functions of this
/// structure will be called on the render process main thread (TID_RENDERER)
/// unless otherwise indicated.
///
struct cef_render_process_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called after WebKit has been initialized.
    ///

    ///
    /// Called after a browser has been created. When browsing cross-origin a new
    /// browser will be created before the old browser with the same identifier is

    cef_base_ref_counted_t base;
    extern(System) void function (cef_render_process_handler_t* self) nothrow on_web_kit_initialized;
    /// destroyed. |extra_info| is an optional read-only value originating from
    /// cef_browser_host_t::cef_browser_host_create_browser(),
    /// cef_browser_host_t::cef_browser_host_create_browser_sync(),
    /// cef_life_span_handler_t::on_before_popup() or
    /// cef_browser_view_t::cef_browser_view_create().
    ///
    extern(System) void function (
        cef_render_process_handler_t* self,
        cef_browser_t* browser,
        cef_dictionary_value_t* extra_info) nothrow on_browser_created;

    ///
    /// Called before a browser is destroyed.
    ///
    extern(System) void function (
        cef_render_process_handler_t* self,
        cef_browser_t* browser) nothrow on_browser_destroyed;

    ///
    /// Return the handler for browser load status events.
    ///
    extern(System) cef_load_handler_t* function (
        cef_render_process_handler_t* self) nothrow get_load_handler;

    ///
    /// Called immediately after the V8 context for a frame has been created. To
    /// retrieve the JavaScript 'window' object use the
    /// cef_v8context_t::get_global() function. V8 handles can only be accessed
    /// from the thread on which they are created. A task runner for posting tasks
    /// on the associated thread can be retrieved via the
    /// cef_v8context_t::get_task_runner() function.
    ///
    extern(System) void function (
        cef_render_process_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_v8context_t* context) nothrow on_context_created;

    ///
    /// Called immediately before the V8 context for a frame is released. No
    /// references to the context should be kept after this function is called.
    ///
    extern(System) void function (
        cef_render_process_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_v8context_t* context) nothrow on_context_released;

    ///
    /// Called for global uncaught exceptions in a frame. Execution of this
    /// callback is disabled by default. To enable set
    /// cef_settings_t.uncaught_exception_stack_size > 0.
    ///
    extern(System) void function (
        cef_render_process_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_v8context_t* context,
        cef_v8exception_t* exception,
        cef_v8stack_trace_t* stackTrace) nothrow on_uncaught_exception;

    ///
    /// Called when a new node in the the browser gets focus. The |node| value may
    /// be NULL if no specific node has gained focus. The node object passed to
    /// this function represents a snapshot of the DOM at the time this function
    /// is executed. DOM objects are only valid for the scope of this function. Do
    /// not keep references to or attempt to access any DOM objects outside the
    /// scope of this function.
    ///
    extern(System) void function (
        cef_render_process_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_domnode_t* node) nothrow on_focused_node_changed;

    ///
    /// Called when a new message is received from a different process. Return
    /// true (1) if the message was handled or false (0) otherwise. It is safe to
    /// keep a reference to |message| outside of this callback.
    ///
    extern(System) int function (
        cef_render_process_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_process_id_t source_process,
        cef_process_message_t* message) nothrow on_process_message_received;
}



// CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=14ce483864835eca476d08d39ed4236fbd1a874c$
//

extern (C):

///
/// Structure used to represent a web request. The functions of this structure
/// may be called on any thread.
///
struct cef_request_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is read-only.
    ///

    ///
    /// Get the fully qualified URL.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    ///
    /// Set the fully qualified URL.
    ///

    ///
    /// Get the request function type. The value will default to POST if post data
    /// is provided and GET otherwise.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    cef_base_ref_counted_t base;
    extern(System) int function (cef_request_t* self) nothrow is_read_only;
    extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_url;
    extern(System) void function (cef_request_t* self, const(cef_string_t)* url) nothrow set_url;
    extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_method;

    ///
    /// Set the request function type.
    ///
    extern(System) void function (
        cef_request_t* self,
        const(cef_string_t)* method) nothrow set_method;

    ///
    /// Set the referrer URL and policy. If non-NULL the referrer URL must be
    /// fully qualified with an HTTP or HTTPS scheme component. Any username,
    /// password or ref component will be removed.
    ///
    extern(System) void function (
        cef_request_t* self,
        const(cef_string_t)* referrer_url,
        cef_referrer_policy_t policy) nothrow set_referrer;

    ///
    /// Get the referrer URL.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_referrer_url;

    ///
    /// Get the referrer policy.
    ///
    extern(System) cef_referrer_policy_t function (cef_request_t* self) nothrow get_referrer_policy;

    ///
    /// Get the post data.
    ///
    extern(System) cef_post_data_t* function (cef_request_t* self) nothrow get_post_data;

    ///
    /// Set the post data.
    ///
    extern(System) void function (
        cef_request_t* self,
        cef_post_data_t* postData) nothrow set_post_data;

    ///
    /// Get the header values. Will not include the Referer value if any.
    ///
    extern(System) void function (
        cef_request_t* self,
        cef_string_multimap_t headerMap) nothrow get_header_map;

    ///
    /// Set the header values. If a Referer value exists in the header map it will
    /// be removed and ignored.
    ///
    extern(System) void function (
        cef_request_t* self,
        cef_string_multimap_t headerMap) nothrow set_header_map;

    ///
    /// Returns the first header value for |name| or an NULL string if not found.
    /// Will not return the Referer value if any. Use GetHeaderMap instead if
    /// |name| might have multiple values.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_request_t* self,
        const(cef_string_t)* name) nothrow get_header_by_name;

    ///
    /// Set the header |name| to |value|. If |overwrite| is true (1) any existing
    /// values will be replaced with the new value. If |overwrite| is false (0)
    /// any existing values will not be overwritten. The Referer value cannot be
    /// set using this function.
    ///
    extern(System) void function (
        cef_request_t* self,
        const(cef_string_t)* name,
        const(cef_string_t)* value,
        int overwrite) nothrow set_header_by_name;

    ///
    /// Set all values at one time.
    ///
    extern(System) void function (
        cef_request_t* self,
        const(cef_string_t)* url,
        const(cef_string_t)* method,
        cef_post_data_t* postData,
        cef_string_multimap_t headerMap) nothrow set;

    ///
    /// Get the flags used in combination with cef_urlrequest_t. See
    /// cef_urlrequest_flags_t for supported values.
    ///
    extern(System) int function (cef_request_t* self) nothrow get_flags;

    ///
    /// Set the flags used in combination with cef_urlrequest_t.  See
    /// cef_urlrequest_flags_t for supported values.
    ///
    extern(System) void function (cef_request_t* self, int flags) nothrow set_flags;

    ///
    /// Get the URL to the first party for cookies used in combination with
    /// cef_urlrequest_t.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_request_t* self) nothrow get_first_party_for_cookies;

    ///
    /// Set the URL to the first party for cookies used in combination with
    /// cef_urlrequest_t.
    ///
    extern(System) void function (
        cef_request_t* self,
        const(cef_string_t)* url) nothrow set_first_party_for_cookies;

    ///
    /// Get the resource type for this request. Only available in the browser
    /// process.
    ///
    extern(System) cef_resource_type_t function (cef_request_t* self) nothrow get_resource_type;

    ///
    /// Get the transition type for this request. Only available in the browser
    /// process and only applies to requests that represent a main frame or sub-
    /// frame navigation.
    ///
    extern(System) cef_transition_type_t function (cef_request_t* self) nothrow get_transition_type;

    ///
    /// Returns the globally unique identifier for this request or 0 if not
    /// specified. Can be used by cef_resource_request_handler_t implementations
    /// in the browser process to track a single request across multiple
    /// callbacks.
    ///
    extern(System) ulong function (cef_request_t* self) nothrow get_identifier;
}



///
/// Create a new cef_request_t object.
///
cef_request_t* cef_request_create ();

///
/// Structure used to represent post data for a web request. The functions of
/// this structure may be called on any thread.
///
struct cef_post_data_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if this object is read-only.
    ///
    extern(System) int function (cef_post_data_t* self) nothrow is_read_only;

    ///
    /// Returns true (1) if the underlying POST data includes elements that are
    /// not represented by this cef_post_data_t object (for example, multi-part
    /// file upload data). Modifying cef_post_data_t objects with excluded
    /// elements may result in the request failing.
    ///
    extern(System) int function (cef_post_data_t* self) nothrow has_excluded_elements;

    ///
    /// Returns the number of existing post data elements.
    ///
    extern(System) size_t function (cef_post_data_t* self) nothrow get_element_count;

    ///
    /// Retrieve the post data elements.
    ///
    extern(System) void function (
        cef_post_data_t* self,
        size_t* elementsCount,
        cef_post_data_element_t** elements) nothrow get_elements;

    ///
    /// Remove the specified post data element.  Returns true (1) if the removal
    /// succeeds.
    ///
    extern(System) int function (
        cef_post_data_t* self,
        cef_post_data_element_t* element) nothrow remove_element;

    ///
    /// Add the specified post data element.  Returns true (1) if the add
    /// succeeds.
    ///
    extern(System) int function (
        cef_post_data_t* self,
        cef_post_data_element_t* element) nothrow add_element;

    ///
    /// Remove all existing post data elements.
    ///
    extern(System) void function (cef_post_data_t* self) nothrow remove_elements;
}



///
/// Create a new cef_post_data_t object.
///
cef_post_data_t* cef_post_data_create ();

///
/// Structure used to represent a single element in the request post data. The
/// functions of this structure may be called on any thread.
///
struct cef_post_data_element_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if this object is read-only.
    ///
    extern(System) int function (cef_post_data_element_t* self) nothrow is_read_only;

    ///
    /// Remove all contents from the post data element.
    ///
    extern(System) void function (cef_post_data_element_t* self) nothrow set_to_empty;

    ///
    /// The post data element will represent a file.
    ///
    extern(System) void function (
        cef_post_data_element_t* self,
        const(cef_string_t)* fileName) nothrow set_to_file;

    ///
    /// The post data element will represent bytes.  The bytes passed in will be
    /// copied.
    ///
    extern(System) void function (
        cef_post_data_element_t* self,
        size_t size,
        const(void)* bytes) nothrow set_to_bytes;

    ///
    /// Return the type of this post data element.
    ///
    extern(System) cef_postdataelement_type_t function (
        cef_post_data_element_t* self) nothrow get_type;

    ///
    /// Return the file name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_post_data_element_t* self) nothrow get_file;

    ///
    /// Return the number of bytes.
    ///
    extern(System) size_t function (cef_post_data_element_t* self) nothrow get_bytes_count;

    ///
    /// Read up to |size| bytes into |bytes| and return the number of bytes
    /// actually read.
    ///
    extern(System) size_t function (
        cef_post_data_element_t* self,
        size_t size,
        void* bytes) nothrow get_bytes;
}



///
/// Create a new cef_post_data_element_t object.
///
cef_post_data_element_t* cef_post_data_element_create ();

// CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2c496139ca9a59303b1493ee93d2c3ae96a956c0$
//

extern (C):




///
/// Callback structure for cef_request_context_t::ResolveHost.
///
struct cef_resolve_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called on the UI thread after the ResolveHost request has completed.
    /// |result| will be the result code. |resolved_ips| will be the list of
    /// resolved IP addresses or NULL if the resolution failed.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_resolve_callback_t* self,
        cef_errorcode_t result,
        cef_string_list_t resolved_ips) nothrow on_resolve_completed;
}

 ///
/// A request context provides request handling for a set of related browser or
/// URL request objects. A request context can be specified when creating a new
/// browser via the cef_browser_host_t static factory functions or when creating
/// a new URL request via the cef_urlrequest_t static factory functions. Browser
/// objects with different request contexts will never be hosted in the same
/// render process. Browser objects with the same request context may or may not
/// be hosted in the same render process depending on the process model. Browser
/// objects created indirectly via the JavaScript window.open function or
/// targeted links will share the same render process and the same request
/// context as the source browser. When running in single-process mode there is
/// only a single render process (the main process) and so all browsers created
/// in single-process mode will share the same request context. This will be the
/// first request context passed into a cef_browser_host_t static factory
/// function and all other request context objects will be ignored.
///
struct cef_request_context_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is pointing to the same context as |that|
    /// object.
    ///

    ///
    /// Returns true (1) if this object is sharing the same storage as |that|
    /// object.
    ///

    ///
    /// Returns true (1) if this object is the global context. The global context
    /// is used by default when creating a browser or URL request with a NULL
    /// context argument.
    ///

    ///
    /// Returns the handler for this context if any.
    ///

    ///
    /// Returns the cache path for this object. If NULL an "incognito mode" in-
    /// memory cache is being used.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    ///
    /// Returns the cookie manager for this object. If |callback| is non-NULL it
    /// will be executed asnychronously on the UI thread after the manager's
    /// storage has been initialized.
    ///

    ///
    /// Register a scheme handler factory for the specified |scheme_name| and
    /// optional |domain_name|. An NULL |domain_name| value for a standard scheme

    cef_preference_manager_t base;
    extern(System) int function (
        cef_request_context_t* self,
        cef_request_context_t* other) nothrow is_same;
    extern(System) int function (
        cef_request_context_t* self,
        cef_request_context_t* other) nothrow is_sharing_with;
    extern(System) int function (cef_request_context_t* self) nothrow is_global;
    extern(System) cef_request_context_handler_t* function (
        cef_request_context_t* self) nothrow get_handler;
    extern(System) cef_string_userfree_t function (
        cef_request_context_t* self) nothrow get_cache_path;
    extern(System) cef_cookie_manager_t* function (
        cef_request_context_t* self,
        cef_completion_callback_t* callback) nothrow get_cookie_manager;
    /// will cause the factory to match all domain names. The |domain_name| value
    /// will be ignored for non-standard schemes. If |scheme_name| is a built-in
    /// scheme and no handler is returned by |factory| then the built-in scheme
    /// handler factory will be called. If |scheme_name| is a custom scheme then
    /// you must also implement the cef_app_t::on_register_custom_schemes()
    /// function in all processes. This function may be called multiple times to
    /// change or remove the factory that matches the specified |scheme_name| and
    /// optional |domain_name|. Returns false (0) if an error occurs. This
    /// function may be called on any thread in the browser process.
    ///
    extern(System) int function (
        cef_request_context_t* self,
        const(cef_string_t)* scheme_name,
        const(cef_string_t)* domain_name,
        cef_scheme_handler_factory_t* factory) nothrow register_scheme_handler_factory;

    ///
    /// Clear all registered scheme handler factories. Returns false (0) on error.
    /// This function may be called on any thread in the browser process.
    ///
    extern(System) int function (cef_request_context_t* self) nothrow clear_scheme_handler_factories;

    ///
    /// Clears all certificate exceptions that were added as part of handling
    /// cef_request_handler_t::on_certificate_error(). If you call this it is
    /// recommended that you also call close_all_connections() or you risk not
    /// being prompted again for server certificates if you reconnect quickly. If
    /// |callback| is non-NULL it will be executed on the UI thread after
    /// completion.
    ///
    extern(System) void function (
        cef_request_context_t* self,
        cef_completion_callback_t* callback) nothrow clear_certificate_exceptions;

    ///
    /// Clears all HTTP authentication credentials that were added as part of
    /// handling GetAuthCredentials. If |callback| is non-NULL it will be executed
    /// on the UI thread after completion.
    ///
    extern(System) void function (
        cef_request_context_t* self,
        cef_completion_callback_t* callback) nothrow clear_http_auth_credentials;

    ///
    /// Clears all active and idle connections that Chromium currently has. This
    /// is only recommended if you have released all other CEF objects but don't
    /// yet want to call cef_shutdown(). If |callback| is non-NULL it will be
    /// executed on the UI thread after completion.
    ///
    extern(System) void function (
        cef_request_context_t* self,
        cef_completion_callback_t* callback) nothrow close_all_connections;

    ///
    /// Attempts to resolve |origin| to a list of associated IP addresses.
    /// |callback| will be executed on the UI thread after completion.
    ///
    extern(System) void function (
        cef_request_context_t* self,
        const(cef_string_t)* origin,
        cef_resolve_callback_t* callback) nothrow resolve_host;

    ///
    /// Load an extension.
    ///
    /// If extension resources will be read from disk using the default load
    /// implementation then |root_directory| should be the absolute path to the
    /// extension resources directory and |manifest| should be NULL. If extension
    /// resources will be provided by the client (e.g. via cef_request_handler_t
    /// and/or cef_extension_handler_t) then |root_directory| should be a path
    /// component unique to the extension (if not absolute this will be internally
    /// prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the
    /// contents that would otherwise be read from the "manifest.json" file on
    /// disk.
    ///
    /// The loaded extension will be accessible in all contexts sharing the same
    /// storage (HasExtension returns true (1)). However, only the context on
    /// which this function was called is considered the loader (DidLoadExtension
    /// returns true (1)) and only the loader will receive
    /// cef_request_context_handler_t callbacks for the extension.
    ///
    /// cef_extension_handler_t::OnExtensionLoaded will be called on load success
    /// or cef_extension_handler_t::OnExtensionLoadFailed will be called on load
    /// failure.
    ///
    /// If the extension specifies a background script via the "background"
    /// manifest key then cef_extension_handler_t::OnBeforeBackgroundBrowser will
    /// be called to create the background browser. See that function for
    /// additional information about background scripts.
    ///
    /// For visible extension views the client application should evaluate the
    /// manifest to determine the correct extension URL to load and then pass that
    /// URL to the cef_browser_host_t::CreateBrowser* function after the extension
    /// has loaded. For example, the client can look for the "browser_action"
    /// manifest key as documented at
    /// https://developer.chrome.com/extensions/browserAction. Extension URLs take
    /// the form "chrome-extension://<extension_id>/<path>".
    ///
    /// Browsers that host extensions differ from normal browsers as follows:
    ///  - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit
    ///    chrome://extensions-support for the list of extension APIs currently
    ///    supported by CEF.
    ///  - Main frame navigation to non-extension content is blocked.
    ///  - Pinch-zooming is disabled.
    ///  - CefBrowserHost::GetExtension returns the hosted extension.
    ///  - CefBrowserHost::IsBackgroundHost returns true for background hosts.
    ///
    /// See https://developer.chrome.com/extensions for extension implementation
    /// and usage documentation.
    ///
    /// WARNING: This function is deprecated and will be removed in ~M127.
    ///
    extern(System) void function (
        cef_request_context_t* self,
        const(cef_string_t)* root_directory,
        cef_dictionary_value_t* manifest,
        cef_extension_handler_t* handler) nothrow load_extension;

    ///
    /// Returns true (1) if this context was used to load the extension identified
    /// by |extension_id|. Other contexts sharing the same storage will also have
    /// access to the extension (see HasExtension). This function must be called
    /// on the browser process UI thread.
    ///
    /// WARNING: This function is deprecated and will be removed in ~M127.
    ///
    extern(System) int function (
        cef_request_context_t* self,
        const(cef_string_t)* extension_id) nothrow did_load_extension;

    ///
    /// Returns true (1) if this context has access to the extension identified by
    /// |extension_id|. This may not be the context that was used to load the
    /// extension (see DidLoadExtension). This function must be called on the
    /// browser process UI thread.
    ///
    /// WARNING: This function is deprecated and will be removed in ~M127.
    ///
    extern(System) int function (
        cef_request_context_t* self,
        const(cef_string_t)* extension_id) nothrow has_extension;

    ///
    /// Retrieve the list of all extensions that this context has access to (see
    /// HasExtension). |extension_ids| will be populated with the list of
    /// extension ID values. Returns true (1) on success. This function must be
    /// called on the browser process UI thread.
    ///
    /// WARNING: This function is deprecated and will be removed in ~M127.
    ///
    extern(System) int function (
        cef_request_context_t* self,
        cef_string_list_t extension_ids) nothrow get_extensions;

    ///
    /// Returns the extension matching |extension_id| or NULL if no matching
    /// extension is accessible in this context (see HasExtension). This function
    /// must be called on the browser process UI thread.
    ///
    /// WARNING: This function is deprecated and will be removed in ~M127.
    ///
    extern(System) cef_extension_t* function (
        cef_request_context_t* self,
        const(cef_string_t)* extension_id) nothrow get_extension;

    ///
    /// Returns the MediaRouter object associated with this context.  If
    /// |callback| is non-NULL it will be executed asnychronously on the UI thread
    /// after the manager's context has been initialized.
    ///
    extern(System) cef_media_router_t* function (
        cef_request_context_t* self,
        cef_completion_callback_t* callback) nothrow get_media_router;

    ///
    /// Returns the current value for |content_type| that applies for the
    /// specified URLs. If both URLs are NULL the default value will be returned.
    /// Returns nullptr if no value is configured. Must be called on the browser
    /// process UI thread.
    ///
    extern(System) cef_value_t* function (
        cef_request_context_t* self,
        const(cef_string_t)* requesting_url,
        const(cef_string_t)* top_level_url,
        cef_content_setting_types_t content_type) nothrow get_website_setting;

    ///
    /// Sets the current value for |content_type| for the specified URLs in the
    /// default scope. If both URLs are NULL, and the context is not incognito,
    /// the default value will be set. Pass nullptr for |value| to remove the
    /// default value for this content type.
    ///
    /// WARNING: Incorrect usage of this function may cause instability or
    /// security issues in Chromium. Make sure that you first understand the
    /// potential impact of any changes to |content_type| by reviewing the related
    /// source code in Chromium. For example, if you plan to modify
    /// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
    /// ContentSettingsType::POPUPS in Chromium:
    /// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
    ///
    extern(System) void function (
        cef_request_context_t* self,
        const(cef_string_t)* requesting_url,
        const(cef_string_t)* top_level_url,
        cef_content_setting_types_t content_type,
        cef_value_t* value) nothrow set_website_setting;

    ///
    /// Returns the current value for |content_type| that applies for the
    /// specified URLs. If both URLs are NULL the default value will be returned.
    /// Returns CEF_CONTENT_SETTING_VALUE_DEFAULT if no value is configured. Must
    /// be called on the browser process UI thread.
    ///
    extern(System) cef_content_setting_values_t function (
        cef_request_context_t* self,
        const(cef_string_t)* requesting_url,
        const(cef_string_t)* top_level_url,
        cef_content_setting_types_t content_type) nothrow get_content_setting;

    ///
    /// Sets the current value for |content_type| for the specified URLs in the
    /// default scope. If both URLs are NULL, and the context is not incognito,
    /// the default value will be set. Pass CEF_CONTENT_SETTING_VALUE_DEFAULT for
    /// |value| to use the default value for this content type.
    ///
    /// WARNING: Incorrect usage of this function may cause instability or
    /// security issues in Chromium. Make sure that you first understand the
    /// potential impact of any changes to |content_type| by reviewing the related
    /// source code in Chromium. For example, if you plan to modify
    /// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
    /// ContentSettingsType::POPUPS in Chromium:
    /// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
    ///
    extern(System) void function (
        cef_request_context_t* self,
        const(cef_string_t)* requesting_url,
        const(cef_string_t)* top_level_url,
        cef_content_setting_types_t content_type,
        cef_content_setting_values_t value) nothrow set_content_setting;

    ///
    /// Sets the Chrome color scheme for all browsers that share this request
    /// context. |variant| values of SYSTEM, LIGHT and DARK change the underlying
    /// color mode (e.g. light vs dark). Other |variant| values determine how
    /// |user_color| will be applied in the current color mode. If |user_color| is
    /// transparent (0) the default color will be used.
    ///
    extern(System) void function (
        cef_request_context_t* self,
        cef_color_variant_t variant,
        cef_color_t user_color) nothrow set_chrome_color_scheme;

    ///
    /// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
    /// be called on the browser process UI thread.
    ///
    extern(System) cef_color_variant_t function (
        cef_request_context_t* self) nothrow get_chrome_color_scheme_mode;

    ///
    /// Returns the current Chrome color scheme color, or transparent (0) for the
    /// default color. Must be called on the browser process UI thread.
    ///
    extern(System) cef_color_t function (
        cef_request_context_t* self) nothrow get_chrome_color_scheme_color;

    ///
    /// Returns the current Chrome color scheme variant. Must be called on the
    /// browser process UI thread.
    ///
    extern(System) cef_color_variant_t function (
        cef_request_context_t* self) nothrow get_chrome_color_scheme_variant;
}



///
/// Returns the global context object.
///
cef_request_context_t* cef_request_context_get_global_context ();

///
/// Creates a new context object with the specified |settings| and optional
/// |handler|.
///
cef_request_context_t* cef_request_context_create_context (
    const(cef_request_context_settings_t)* settings,
    cef_request_context_handler_t* handler);

///
/// Creates a new context object that shares storage with |other| and uses an
/// optional |handler|.
///
cef_request_context_t* cef_create_context_shared (
    cef_request_context_t* other,
    cef_request_context_handler_t* handler);

// CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d90d816565429ad304f43490b0619af5ffa70274$
//

extern (C):

///
/// Implement this structure to provide handler implementations. The handler
/// instance will not be released until all objects related to the context have
/// been destroyed.
///
struct cef_request_context_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called on the browser process UI thread immediately after the request
    /// context has been initialized.
    ///

    ///
    /// Called on the browser process IO thread before a resource request is

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_request_context_handler_t* self,
        cef_request_context_t* request_context) nothrow on_request_context_initialized;
    /// initiated. The |browser| and |frame| values represent the source of the
    /// request, and may be NULL for requests originating from service workers or
    /// cef_urlrequest_t. |request| represents the request contents and cannot be
    /// modified in this callback. |is_navigation| will be true (1) if the
    /// resource request is a navigation. |is_download| will be true (1) if the
    /// resource request is a download. |request_initiator| is the origin (scheme
    /// + domain) of the page that initiated the request. Set
    /// |disable_default_handling| to true (1) to disable default handling of the
    /// request, in which case it will need to be handled via
    /// cef_resource_request_handler_t::GetResourceHandler or it will be canceled.
    /// To allow the resource load to proceed with default handling return NULL.
    /// To specify a handler for the resource return a
    /// cef_resource_request_handler_t object. This function will not be called if
    /// the client associated with |browser| returns a non-NULL value from
    /// cef_request_handler_t::GetResourceRequestHandler for the same request
    /// (identified by cef_request_t::GetIdentifier).
    ///
    extern(System) cef_resource_request_handler_t* function (
        cef_request_context_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        int is_navigation,
        int is_download,
        const(cef_string_t)* request_initiator,
        int* disable_default_handling) nothrow get_resource_request_handler;
}



// CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2e8b5c5107f61e3d4c333dc02c76a9f30cd0cf83$
//

extern (C):

///
/// Callback structure used to select a client certificate for authentication.
///
struct cef_select_client_certificate_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Chooses the specified certificate for client certificate authentication.
    /// NULL value means that no client certificate should be used.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_select_client_certificate_callback_t* self,
        cef_x509certificate_t* cert) nothrow select;
}


///
/// Implement this structure to handle events related to browser requests. The
/// functions of this structure will be called on the thread indicated.
///
struct cef_request_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called on the UI thread before browser navigation. Return true (1) to
    /// cancel the navigation or false (0) to allow the navigation to proceed. The
    /// |request| object cannot be modified in this callback.
    /// cef_load_handler_t::OnLoadingStateChange will be called twice in all
    /// cases. If the navigation is allowed cef_load_handler_t::OnLoadStart and
    /// cef_load_handler_t::OnLoadEnd will be called. If the navigation is
    /// canceled cef_load_handler_t::OnLoadError will be called with an
    /// |errorCode| value of ERR_ABORTED. The |user_gesture| value will be true
    /// (1) if the browser navigated via explicit user gesture (e.g. clicking a
    /// link) or false (0) if it navigated automatically (e.g. via the
    /// DomContentLoaded event).
    ///
    extern(System) int function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        int user_gesture,
        int is_redirect) nothrow on_before_browse;

    ///
    /// Called on the UI thread before OnBeforeBrowse in certain limited cases
    /// where navigating a new or different browser might be desirable. This
    /// includes user-initiated navigation that might open in a special way (e.g.
    /// links clicked via middle-click or ctrl + left-click) and certain types of
    /// cross-origin navigation initiated from the renderer process (e.g.
    /// navigating the top-level frame to/from a file URL). The |browser| and
    /// |frame| values represent the source of the navigation. The
    /// |target_disposition| value indicates where the user intended to navigate
    /// the browser based on standard Chromium behaviors (e.g. current tab, new
    /// tab, etc). The |user_gesture| value will be true (1) if the browser
    /// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
    /// it navigated automatically (e.g. via the DomContentLoaded event). Return
    /// true (1) to cancel the navigation or false (0) to allow the navigation to
    /// proceed in the source browser's top-level frame.
    ///
    extern(System) int function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        const(cef_string_t)* target_url,
        cef_window_open_disposition_t target_disposition,
        int user_gesture) nothrow on_open_urlfrom_tab;

    ///
    /// Called on the browser process IO thread before a resource request is
    /// initiated. The |browser| and |frame| values represent the source of the
    /// request. |request| represents the request contents and cannot be modified
    /// in this callback. |is_navigation| will be true (1) if the resource request
    /// is a navigation. |is_download| will be true (1) if the resource request is
    /// a download. |request_initiator| is the origin (scheme + domain) of the
    /// page that initiated the request. Set |disable_default_handling| to true
    /// (1) to disable default handling of the request, in which case it will need
    /// to be handled via cef_resource_request_handler_t::GetResourceHandler or it
    /// will be canceled. To allow the resource load to proceed with default
    /// handling return NULL. To specify a handler for the resource return a
    /// cef_resource_request_handler_t object. If this callback returns NULL the
    /// same function will be called on the associated
    /// cef_request_context_handler_t, if any.
    ///
    extern(System) cef_resource_request_handler_t* function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        int is_navigation,
        int is_download,
        const(cef_string_t)* request_initiator,
        int* disable_default_handling) nothrow get_resource_request_handler;

    ///
    /// Called on the IO thread when the browser needs credentials from the user.
    /// |origin_url| is the origin making this authentication request. |isProxy|
    /// indicates whether the host is a proxy server. |host| contains the hostname
    /// and |port| contains the port number. |realm| is the realm of the challenge
    /// and may be NULL. |scheme| is the authentication scheme used, such as
    /// "basic" or "digest", and will be NULL if the source of the request is an
    /// FTP server. Return true (1) to continue the request and call
    /// cef_auth_callback_t::cont() either in this function or at a later time
    /// when the authentication information is available. Return false (0) to
    /// cancel the request immediately.
    ///
    extern(System) int function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        const(cef_string_t)* origin_url,
        int isProxy,
        const(cef_string_t)* host,
        int port,
        const(cef_string_t)* realm,
        const(cef_string_t)* scheme,
        cef_auth_callback_t* callback) nothrow get_auth_credentials;

    ///
    /// Called on the UI thread to handle requests for URLs with an invalid SSL
    /// certificate. Return true (1) and call cef_callback_t functions either in
    /// this function or at a later time to continue or cancel the request. Return
    /// false (0) to cancel the request immediately. If
    /// cef_settings_t.ignore_certificate_errors is set all invalid certificates
    /// will be accepted without calling this function.
    ///
    extern(System) int function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        cef_errorcode_t cert_error,
        const(cef_string_t)* request_url,
        cef_sslinfo_t* ssl_info,
        cef_callback_t* callback) nothrow on_certificate_error;

    ///
    /// Called on the UI thread when a client certificate is being requested for
    /// authentication. Return false (0) to use the default behavior and
    /// automatically select the first certificate available. Return true (1) and
    /// call cef_select_client_certificate_callback_t::Select either in this
    /// function or at a later time to select a certificate. Do not call Select or
    /// call it with NULL to continue without using any certificate. |isProxy|
    /// indicates whether the host is an HTTPS proxy or the origin server. |host|
    /// and |port| contains the hostname and port of the SSL server.
    /// |certificates| is the list of certificates to choose from; this list has
    /// already been pruned by Chromium so that it only contains certificates from
    /// issuers that the server trusts.
    ///
    extern(System) int function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        int isProxy,
        const(cef_string_t)* host,
        int port,
        size_t certificatesCount,
        cef_x509certificate_t** certificates,
        cef_select_client_certificate_callback_t* callback) nothrow on_select_client_certificate;

    ///
    /// Called on the browser process UI thread when the render view associated
    /// with |browser| is ready to receive/handle IPC messages in the render
    /// process.
    ///
    extern(System) void function (
        cef_request_handler_t* self,
        cef_browser_t* browser) nothrow on_render_view_ready;

    ///
    /// Called on the browser process UI thread when the render process is
    /// unresponsive as indicated by a lack of input event processing for at least
    /// 15 seconds. Return false (0) for the default behavior which is an
    /// indefinite wait with the Alloy runtime or display of the "Page
    /// unresponsive" dialog with the Chrome runtime. Return true (1) and don't
    /// execute the callback for an indefinite wait without display of the Chrome
    /// runtime dialog. Return true (1) and call
    /// cef_unresponsive_process_callback_t::Wait either in this function or at a
    /// later time to reset the wait timer, potentially triggering another call to
    /// this function if the process remains unresponsive. Return true (1) and
    /// call cef_unresponsive_process_callback_t:: Terminate either in this
    /// function or at a later time to terminate the unresponsive process,
    /// resulting in a call to OnRenderProcessTerminated.
    /// OnRenderProcessResponsive will be called if the process becomes responsive
    /// after this function is called. This functionality depends on the hang
    /// monitor which can be disabled by passing the `--disable-hang-monitor`
    /// command-line flag.
    ///
    extern(System) int function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        cef_unresponsive_process_callback_t* callback) nothrow on_render_process_unresponsive;

    ///
    /// Called on the browser process UI thread when the render process becomes
    /// responsive after previously being unresponsive. See documentation on
    /// OnRenderProcessUnresponsive.
    ///
    extern(System) void function (
        cef_request_handler_t* self,
        cef_browser_t* browser) nothrow on_render_process_responsive;

    ///
    /// Called on the browser process UI thread when the render process terminates
    /// unexpectedly. |status| indicates how the process terminated. |error_code|
    /// and |error_string| represent the error that would be displayed in Chrome's
    /// "Aw, Snap!" view. Possible |error_code| values include cef_resultcode_t
    /// non-normal exit values and platform-specific crash values (for example, a
    /// Posix signal or Windows hardware exception).
    ///
    extern(System) void function (
        cef_request_handler_t* self,
        cef_browser_t* browser,
        cef_termination_status_t status,
        int error_code,
        const(cef_string_t)* error_string) nothrow on_render_process_terminated;

    ///
    /// Called on the browser process UI thread when the window.document object of
    /// the main frame has been created.
    ///
    extern(System) void function (
        cef_request_handler_t* self,
        cef_browser_t* browser) nothrow on_document_available_in_main_frame;
}



// CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d97d3ca6c8d610627538c58f3b4ba3869f3d9ac7$
//

extern (C):

///
/// Structure used for retrieving resources from the resource bundle (*.pak)
/// files loaded by CEF during startup or via the cef_resource_bundle_handler_t
/// returned from cef_app_t::GetResourceBundleHandler. See CefSettings for
/// additional options related to resource bundle loading. The functions of this
/// structure may be called on any thread unless otherwise indicated.
///
struct cef_resource_bundle_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns the localized string for the specified |string_id| or an NULL
    /// string if the value is not found. Include cef_pack_strings.h for a listing
    /// of valid string ID values.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    cef_base_ref_counted_t base;
    extern(System) cef_string_userfree_t function (
        cef_resource_bundle_t* self,
        int string_id) nothrow get_localized_string;
    ///
    /// Returns a cef_binary_value_t containing the decompressed contents of the
    /// specified scale independent |resource_id| or NULL if not found. Include
    /// cef_pack_resources.h for a listing of valid resource ID values.
    ///
    extern(System) cef_binary_value_t* function (
        cef_resource_bundle_t* self,
        int resource_id) nothrow get_data_resource;

    ///
    /// Returns a cef_binary_value_t containing the decompressed contents of the
    /// specified |resource_id| nearest the scale factor |scale_factor| or NULL if
    /// not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale
    /// independent resources or call GetDataResource instead.Include
    /// cef_pack_resources.h for a listing of valid resource ID values.
    ///
    extern(System) cef_binary_value_t* function (
        cef_resource_bundle_t* self,
        int resource_id,
        cef_scale_factor_t scale_factor) nothrow get_data_resource_for_scale;
}



///
/// Returns the global resource bundle instance.
///
cef_resource_bundle_t* cef_resource_bundle_get_global ();

// CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b25f3131d67980e493da4d7e484676d000334995$
//

extern (C):

///
/// Structure used to implement a custom resource bundle structure. See
/// CefSettings for additional options related to resource bundle loading. The
/// functions of this structure may be called on multiple threads.
///
struct cef_resource_bundle_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called to retrieve a localized translation for the specified |string_id|.
    /// To provide the translation set |string| to the translation string and
    /// return true (1). To use the default translation return false (0). Include
    /// cef_pack_strings.h for a listing of valid string ID values.
    ///

    ///
    /// Called to retrieve data for the specified scale independent |resource_id|.

    cef_base_ref_counted_t base;
    extern(System) int function (
        cef_resource_bundle_handler_t* self,
        int string_id,
        cef_string_t* string) nothrow get_localized_string;
    /// To provide the resource data set |data| and |data_size| to the data
    /// pointer and size respectively and return true (1). To use the default
    /// resource data return false (0). The resource data will not be copied and
    /// must remain resident in memory. Include cef_pack_resources.h for a listing
    /// of valid resource ID values.
    ///
    extern(System) int function (
        cef_resource_bundle_handler_t* self,
        int resource_id,
        void** data,
        size_t* data_size) nothrow get_data_resource;

    ///
    /// Called to retrieve data for the specified |resource_id| nearest the scale
    /// factor |scale_factor|. To provide the resource data set |data| and
    /// |data_size| to the data pointer and size respectively and return true (1).
    /// To use the default resource data return false (0). The resource data will
    /// not be copied and must remain resident in memory. Include
    /// cef_pack_resources.h for a listing of valid resource ID values.
    ///
    extern(System) int function (
        cef_resource_bundle_handler_t* self,
        int resource_id,
        cef_scale_factor_t scale_factor,
        void** data,
        size_t* data_size) nothrow get_data_resource_for_scale;
}



// CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ad8218a8ac9e313884110e72bb2af32ec916907f$
//

extern (C):

///
/// Callback for asynchronous continuation of cef_resource_handler_t::skip().
///
struct cef_resource_skip_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Callback for asynchronous continuation of skip(). If |bytes_skipped| > 0
    /// then either skip() will be called again until the requested number of
    /// bytes have been skipped or the request will proceed. If |bytes_skipped| <=
    /// 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
    ///

    ///
    /// Callback for asynchronous continuation of cef_resource_handler_t::read().

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_resource_skip_callback_t* self,
        long bytes_skipped) nothrow cont;
}


///
struct cef_resource_read_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Callback for asynchronous continuation of read(). If |bytes_read| == 0 the
    /// response will be considered complete. If |bytes_read| > 0 then read() will
    /// be called again until the request is complete (based on either the result
    /// or the expected content length). If |bytes_read| < 0 then the request will
    /// fail and the |bytes_read| value will be treated as the error code.
    ///
    extern(System) void function (cef_resource_read_callback_t* self, int bytes_read) nothrow cont;
}



///
/// Structure used to implement a custom request handler structure. The
/// functions of this structure will be called on the IO thread unless otherwise
/// indicated.
///
struct cef_resource_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Open the response stream. To handle the request immediately set
    /// |handle_request| to true (1) and return true (1). To decide at a later
    /// time set |handle_request| to false (0), return true (1), and execute
    /// |callback| to continue or cancel the request. To cancel the request
    /// immediately set |handle_request| to true (1) and return false (0). This
    /// function will be called in sequence but not from a dedicated thread. For
    /// backwards compatibility set |handle_request| to false (0) and return false
    /// (0) and the ProcessRequest function will be called.
    ///
    extern(System) int function (
        cef_resource_handler_t* self,
        cef_request_t* request,
        int* handle_request,
        cef_callback_t* callback) nothrow open;

    ///
    /// Begin processing the request. To handle the request return true (1) and
    /// call cef_callback_t::cont() once the response header information is
    /// available (cef_callback_t::cont() can also be called from inside this
    /// function if header information is available immediately). To cancel the
    /// request return false (0).
    ///
    /// WARNING: This function is deprecated. Use Open instead.
    ///
    extern(System) int function (
        cef_resource_handler_t* self,
        cef_request_t* request,
        cef_callback_t* callback) nothrow process_request;

    ///
    /// Retrieve response header information. If the response length is not known
    /// set |response_length| to -1 and read_response() will be called until it
    /// returns false (0). If the response length is known set |response_length|
    /// to a positive value and read_response() will be called until it returns
    /// false (0) or the specified number of bytes have been read. Use the
    /// |response| object to set the mime type, http status code and other
    /// optional header values. To redirect the request to a new URL set
    /// |redirectUrl| to the new URL. |redirectUrl| can be either a relative or
    /// fully qualified URL. It is also possible to set |response| to a redirect
    /// http status code and pass the new URL via a Location header. Likewise with
    /// |redirectUrl| it is valid to set a relative or fully qualified URL as the
    /// Location header value. If an error occured while setting up the request
    /// you can call set_error() on |response| to indicate the error condition.
    ///
    extern(System) void function (
        cef_resource_handler_t* self,
        cef_response_t* response,
        long* response_length,
        cef_string_t* redirectUrl) nothrow get_response_headers;

    ///
    /// Skip response data when requested by a Range header. Skip over and discard
    /// |bytes_to_skip| bytes of response data. If data is available immediately
    /// set |bytes_skipped| to the number of bytes skipped and return true (1). To
    /// read the data at a later time set |bytes_skipped| to 0, return true (1)
    /// and execute |callback| when the data is available. To indicate failure set
    /// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
    /// function will be called in sequence but not from a dedicated thread.
    ///
    extern(System) int function (
        cef_resource_handler_t* self,
        long bytes_to_skip,
        long* bytes_skipped,
        cef_resource_skip_callback_t* callback) nothrow skip;

    ///
    /// Read response data. If data is available immediately copy up to
    /// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
    /// bytes copied, and return true (1). To read the data at a later time keep a
    /// pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute
    /// |callback| when the data is available (|data_out| will remain valid until
    /// the callback is executed). To indicate response completion set
    /// |bytes_read| to 0 and return false (0). To indicate failure set
    /// |bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
    /// function will be called in sequence but not from a dedicated thread. For
    /// backwards compatibility set |bytes_read| to -1 and return false (0) and
    /// the ReadResponse function will be called.
    ///
    extern(System) int function (
        cef_resource_handler_t* self,
        void* data_out,
        int bytes_to_read,
        int* bytes_read,
        cef_resource_read_callback_t* callback) nothrow read;

    ///
    /// Read response data. If data is available immediately copy up to
    /// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
    /// bytes copied, and return true (1). To read the data at a later time set
    /// |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when
    /// the data is available. To indicate response completion return false (0).
    ///
    /// WARNING: This function is deprecated. Use Skip and Read instead.
    ///
    extern(System) int function (
        cef_resource_handler_t* self,
        void* data_out,
        int bytes_to_read,
        int* bytes_read,
        cef_callback_t* callback) nothrow read_response;

    ///
    /// Request processing has been canceled.
    ///
    extern(System) void function (cef_resource_handler_t* self) nothrow cancel;
}



// CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c4416644786e3c1999cdcd7e6bf78af94ff7f0da$
//

extern (C):

///
/// Implement this structure to handle events related to browser requests. The
/// functions of this structure will be called on the IO thread unless otherwise
/// indicated.
///
struct cef_resource_request_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called on the IO thread before a resource request is loaded. The |browser|
    /// and |frame| values represent the source of the request, and may be NULL
    /// for requests originating from service workers or cef_urlrequest_t. To

    cef_base_ref_counted_t base;
    /// optionally filter cookies for the request return a
    /// cef_cookie_access_filter_t object. The |request| object cannot not be
    /// modified in this callback.
    ///
    extern(System) cef_cookie_access_filter_t* function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request) nothrow get_cookie_access_filter;

    ///
    /// Called on the IO thread before a resource request is loaded. The |browser|
    /// and |frame| values represent the source of the request, and may be NULL
    /// for requests originating from service workers or cef_urlrequest_t. To
    /// redirect or change the resource load optionally modify |request|.
    /// Modification of the request URL will be treated as a redirect. Return
    /// RV_CONTINUE to continue the request immediately. Return RV_CONTINUE_ASYNC
    /// and call cef_callback_t functions at a later time to continue or cancel
    /// the request asynchronously. Return RV_CANCEL to cancel the request
    /// immediately.
    ///
    extern(System) cef_return_value_t function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        cef_callback_t* callback) nothrow on_before_resource_load;

    ///
    /// Called on the IO thread before a resource is loaded. The |browser| and
    /// |frame| values represent the source of the request, and may be NULL for
    /// requests originating from service workers or cef_urlrequest_t. To allow
    /// the resource to load using the default network loader return NULL. To
    /// specify a handler for the resource return a cef_resource_handler_t object.
    /// The |request| object cannot not be modified in this callback.
    ///
    extern(System) cef_resource_handler_t* function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request) nothrow get_resource_handler;

    ///
    /// Called on the IO thread when a resource load is redirected. The |browser|
    /// and |frame| values represent the source of the request, and may be NULL
    /// for requests originating from service workers or cef_urlrequest_t. The
    /// |request| parameter will contain the old URL and other request-related
    /// information. The |response| parameter will contain the response that
    /// resulted in the redirect. The |new_url| parameter will contain the new URL
    /// and can be changed if desired. The |request| and |response| objects cannot
    /// be modified in this callback.
    ///
    extern(System) void function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        cef_response_t* response,
        cef_string_t* new_url) nothrow on_resource_redirect;

    ///
    /// Called on the IO thread when a resource response is received. The
    /// |browser| and |frame| values represent the source of the request, and may
    /// be NULL for requests originating from service workers or cef_urlrequest_t.
    /// To allow the resource load to proceed without modification return false
    /// (0). To redirect or retry the resource load optionally modify |request|
    /// and return true (1). Modification of the request URL will be treated as a
    /// redirect. Requests handled using the default network loader cannot be
    /// redirected in this callback. The |response| object cannot be modified in
    /// this callback.
    ///
    /// WARNING: Redirecting using this function is deprecated. Use
    /// OnBeforeResourceLoad or GetResourceHandler to perform redirects.
    ///
    extern(System) int function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        cef_response_t* response) nothrow on_resource_response;

    ///
    /// Called on the IO thread to optionally filter resource response content.
    /// The |browser| and |frame| values represent the source of the request, and
    /// may be NULL for requests originating from service workers or
    /// cef_urlrequest_t. |request| and |response| represent the request and
    /// response respectively and cannot be modified in this callback.
    ///
    extern(System) cef_response_filter_t* function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        cef_response_t* response) nothrow get_resource_response_filter;

    ///
    /// Called on the IO thread when a resource load has completed. The |browser|
    /// and |frame| values represent the source of the request, and may be NULL
    /// for requests originating from service workers or cef_urlrequest_t.
    /// |request| and |response| represent the request and response respectively
    /// and cannot be modified in this callback. |status| indicates the load
    /// completion status. |received_content_length| is the number of response
    /// bytes actually read. This function will be called for all requests,
    /// including requests that are aborted due to CEF shutdown or destruction of
    /// the associated browser. In cases where the associated browser is destroyed
    /// this callback may arrive after the cef_life_span_handler_t::OnBeforeClose
    /// callback for that browser. The cef_frame_t::IsValid function can be used
    /// to test for this situation, and care should be taken not to call |browser|
    /// or |frame| functions that modify state (like LoadURL, SendProcessMessage,
    /// etc.) if the frame is invalid.
    ///
    extern(System) void function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        cef_response_t* response,
        cef_urlrequest_status_t status,
        long received_content_length) nothrow on_resource_load_complete;

    ///
    /// Called on the IO thread to handle requests for URLs with an unknown
    /// protocol component. The |browser| and |frame| values represent the source
    /// of the request, and may be NULL for requests originating from service
    /// workers or cef_urlrequest_t. |request| cannot be modified in this
    /// callback. Set |allow_os_execution| to true (1) to attempt execution via
    /// the registered OS protocol handler, if any. SECURITY WARNING: YOU SHOULD
    /// USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL
    /// ANALYSIS BEFORE ALLOWING OS EXECUTION.
    ///
    extern(System) void function (
        cef_resource_request_handler_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        int* allow_os_execution) nothrow on_protocol_execution;
}



///
/// Implement this structure to filter cookies that may be sent or received from
/// resource requests. The functions of this structure will be called on the IO
/// thread unless otherwise indicated.
///
struct cef_cookie_access_filter_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called on the IO thread before a resource request is sent. The |browser|
    /// and |frame| values represent the source of the request, and may be NULL
    /// for requests originating from service workers or cef_urlrequest_t.
    /// |request| cannot be modified in this callback. Return true (1) if the
    /// specified cookie can be sent with the request or false (0) otherwise.
    ///
    extern(System) int function (
        cef_cookie_access_filter_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        const(cef_cookie_t)* cookie) nothrow can_send_cookie;

    ///
    /// Called on the IO thread after a resource response is received. The
    /// |browser| and |frame| values represent the source of the request, and may
    /// be NULL for requests originating from service workers or cef_urlrequest_t.
    /// |request| cannot be modified in this callback. Return true (1) if the
    /// specified cookie returned with the response can be saved or false (0)
    /// otherwise.
    ///
    extern(System) int function (
        cef_cookie_access_filter_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        cef_request_t* request,
        cef_response_t* response,
        const(cef_cookie_t)* cookie) nothrow can_save_cookie;
}



// CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=de559e5cd4b539ce129beab8f7627576c4249cd5$
//

extern (C):

///
/// Structure used to represent a web response. The functions of this structure
/// may be called on any thread.
///
struct cef_response_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if this object is read-only.
    ///

    ///
    /// Get the response error code. Returns ERR_NONE if there was no error.
    ///

    ///
    /// Set the response error code. This can be used by custom scheme handlers to
    /// return errors during initial request processing.
    ///

    ///
    /// Get the response status code.
    ///

    ///
    /// Set the response status code.

    cef_base_ref_counted_t base;
    extern(System) int function (cef_response_t* self) nothrow is_read_only;
    extern(System) cef_errorcode_t function (cef_response_t* self) nothrow get_error;
    extern(System) void function (cef_response_t* self, cef_errorcode_t error) nothrow set_error;
    extern(System) int function (cef_response_t* self) nothrow get_status;
    ///
    extern(System) void function (cef_response_t* self, int status) nothrow set_status;

    ///
    /// Get the response status text.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_status_text;

    ///
    /// Set the response status text.
    ///
    extern(System) void function (
        cef_response_t* self,
        const(cef_string_t)* statusText) nothrow set_status_text;

    ///
    /// Get the response mime type.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_mime_type;

    ///
    /// Set the response mime type.
    ///
    extern(System) void function (
        cef_response_t* self,
        const(cef_string_t)* mimeType) nothrow set_mime_type;

    ///
    /// Get the response charset.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_charset;

    ///
    /// Set the response charset.
    ///
    extern(System) void function (
        cef_response_t* self,
        const(cef_string_t)* charset) nothrow set_charset;

    ///
    /// Get the value for the specified response header field.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_response_t* self,
        const(cef_string_t)* name) nothrow get_header_by_name;

    ///
    /// Set the header |name| to |value|. If |overwrite| is true (1) any existing
    /// values will be replaced with the new value. If |overwrite| is false (0)
    /// any existing values will not be overwritten.
    ///
    extern(System) void function (
        cef_response_t* self,
        const(cef_string_t)* name,
        const(cef_string_t)* value,
        int overwrite) nothrow set_header_by_name;

    ///
    /// Get all response header fields.
    ///
    extern(System) void function (
        cef_response_t* self,
        cef_string_multimap_t headerMap) nothrow get_header_map;

    ///
    /// Set all response header fields.
    ///
    extern(System) void function (
        cef_response_t* self,
        cef_string_multimap_t headerMap) nothrow set_header_map;

    ///
    /// Get the resolved URL after redirects or changed as a result of HSTS.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_url;

    ///
    /// Set the resolved URL after redirects or changed as a result of HSTS.
    ///
    extern(System) void function (cef_response_t* self, const(cef_string_t)* url) nothrow set_url;
}



///
/// Create a new cef_response_t object.
///
cef_response_t* cef_response_create ();

// CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1c83177e8030f7637d8ce0aa68831e417fbf37d3$
//

extern (C):

///
/// Implement this structure to filter resource response content. The functions
/// of this structure will be called on the browser process IO thread.
///
struct cef_response_filter_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Initialize the response filter. Will only be called a single time. The
    /// filter will not be installed if this function returns false (0).
    ///

    ///
    /// Called to filter a chunk of data. Expected usage is as follows:
    ///
    ///  1. Read input data from |data_in| and set |data_in_read| to the number of
    ///     bytes that were read up to a maximum of |data_in_size|. |data_in| will
    ///     be NULL if |data_in_size| is zero.
    ///  2. Write filtered output data to |data_out| and set |data_out_written| to
    ///     the number of bytes that were written up to a maximum of

    cef_base_ref_counted_t base;
    extern(System) int function (cef_response_filter_t* self) nothrow init_filter;
    ///     |data_out_size|. If no output data was written then all data must be
    ///     read from |data_in| (user must set |data_in_read| = |data_in_size|).
    ///  3. Return RESPONSE_FILTER_DONE if all output data was written or
    ///     RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.
    ///
    /// This function will be called repeatedly until the input buffer has been
    /// fully read (user sets |data_in_read| = |data_in_size|) and there is no
    /// more input data to filter (the resource response is complete). This
    /// function may then be called an additional time with an NULL input buffer
    /// if the user filled the output buffer (set |data_out_written| =
    /// |data_out_size|) and returned RESPONSE_FILTER_NEED_MORE_DATA to indicate
    /// that output data is still pending.
    ///
    /// Calls to this function will stop when one of the following conditions is
    /// met:
    ///
    ///  1. There is no more input data to filter (the resource response is
    ///     complete) and the user sets |data_out_written| = 0 or returns
    ///     RESPONSE_FILTER_DONE to indicate that all data has been written, or;
    ///  2. The user returns RESPONSE_FILTER_ERROR to indicate an error.
    ///
    /// Do not keep a reference to the buffers passed to this function.
    ///
    extern(System) cef_response_filter_status_t function (
        cef_response_filter_t* self,
        void* data_in,
        size_t data_in_size,
        size_t* data_in_read,
        void* data_out,
        size_t data_out_size,
        size_t* data_out_written) nothrow filter;
}



// CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dd3f6003f9a8f59c2eb4320c382651a441086aee$
//

extern (C):

///
/// Structure that manages custom scheme registrations.
///
struct cef_scheme_registrar_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Register a custom scheme. This function should not be called for the
    /// built-in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
    ///
    /// See cef_scheme_options_t for possible values for |options|.
    ///
    /// This function may be called on any thread. It should only be called once
    /// per unique |scheme_name| value. If |scheme_name| is already registered or
    /// if an error occurs this function will return false (0).
    ///

    ///
    /// Structure that creates cef_resource_handler_t instances for handling scheme
    /// requests. The functions of this structure will always be called on the IO

    cef_base_scoped_t base;
    extern(System) int function (
        cef_scheme_registrar_t* self,
        const(cef_string_t)* scheme_name,
        int options) nothrow add_custom_scheme;
}


/// thread.
///
struct cef_scheme_handler_factory_t
{
    ///
    /// Base structure.
    ///

    cef_base_ref_counted_t base;

    ///
    /// Return a new resource handler instance to handle the request or an NULL
    /// reference to allow default handling of the request. |browser| and |frame|
    /// will be the browser window and frame respectively that originated the
    /// request or NULL if the request did not originate from a browser window
    /// (for example, if the request came from cef_urlrequest_t). The |request|
    /// object passed to this function cannot be modified.
    ///
    extern(System) cef_resource_handler_t* function (
        cef_scheme_handler_factory_t* self,
        cef_browser_t* browser,
        cef_frame_t* frame,
        const(cef_string_t)* scheme_name,
        cef_request_t* request) nothrow create;
}



///
/// Register a scheme handler factory with the global request context. An NULL
/// |domain_name| value for a standard scheme will cause the factory to match
/// all domain names. The |domain_name| value will be ignored for non-standard
/// schemes. If |scheme_name| is a built-in scheme and no handler is returned by
/// |factory| then the built-in scheme handler factory will be called. If
/// |scheme_name| is a custom scheme then you must also implement the
/// cef_app_t::on_register_custom_schemes() function in all processes. This
/// function may be called multiple times to change or remove the factory that
/// matches the specified |scheme_name| and optional |domain_name|. Returns
/// false (0) if an error occurs. This function may be called on any thread in
/// the browser process. Using this function is equivalent to calling cef_reques
/// t_context_t::cef_request_context_get_global_context()-
/// >register_scheme_handler_factory().
///
int cef_register_scheme_handler_factory (
    const(cef_string_t)* scheme_name,
    const(cef_string_t)* domain_name,
    cef_scheme_handler_factory_t* factory);

///
/// Clear all scheme handler factories registered with the global request
/// context. Returns false (0) on error. This function may be called on any
/// thread in the browser process. Using this function is equivalent to calling
/// cef_request_context_t::cef_request_context_get_global_context()-
/// >clear_scheme_handler_factories().
///
int cef_clear_scheme_handler_factories ();

// CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b85c5d4060c951571f122e519e7dc7e9a4c4e629$
//

extern (C):

///
/// Structure representing a server that supports HTTP and WebSocket requests.
/// Server capacity is limited and is intended to handle only a small number of
/// simultaneous connections (e.g. for communicating between applications on
/// localhost). The functions of this structure are safe to call from any thread
/// in the brower process unless otherwise indicated.
///
struct cef_server_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns the task runner for the dedicated server thread.
    ///

    ///
    /// Stop the server and shut down the dedicated server thread. See
    /// cef_server_handler_t::OnServerCreated documentation for a description of

    cef_base_ref_counted_t base;
    extern(System) cef_task_runner_t* function (cef_server_t* self) nothrow get_task_runner;
    /// server lifespan.
    ///
    extern(System) void function (cef_server_t* self) nothrow shutdown;

    ///
    /// Returns true (1) if the server is currently running and accepting incoming
    /// connections. See cef_server_handler_t::OnServerCreated documentation for a
    /// description of server lifespan. This function must be called on the
    /// dedicated server thread.
    ///
    extern(System) int function (cef_server_t* self) nothrow is_running;

    ///
    /// Returns the server address including the port number.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_server_t* self) nothrow get_address;

    ///
    /// Returns true (1) if the server currently has a connection. This function
    /// must be called on the dedicated server thread.
    ///
    extern(System) int function (cef_server_t* self) nothrow has_connection;

    ///
    /// Returns true (1) if |connection_id| represents a valid connection. This
    /// function must be called on the dedicated server thread.
    ///
    extern(System) int function (cef_server_t* self, int connection_id) nothrow is_valid_connection;

    ///
    /// Send an HTTP 200 "OK" response to the connection identified by
    /// |connection_id|. |content_type| is the response content type (e.g.
    /// "text/html"), |data| is the response content, and |data_size| is the size
    /// of |data| in bytes. The contents of |data| will be copied. The connection
    /// will be closed automatically after the response is sent.
    ///
    extern(System) void function (
        cef_server_t* self,
        int connection_id,
        const(cef_string_t)* content_type,
        const(void)* data,
        size_t data_size) nothrow send_http200response;

    ///
    /// Send an HTTP 404 "Not Found" response to the connection identified by
    /// |connection_id|. The connection will be closed automatically after the
    /// response is sent.
    ///
    extern(System) void function (
        cef_server_t* self,
        int connection_id) nothrow send_http404response;

    ///
    /// Send an HTTP 500 "Internal Server Error" response to the connection
    /// identified by |connection_id|. |error_message| is the associated error
    /// message. The connection will be closed automatically after the response is
    /// sent.
    ///
    extern(System) void function (
        cef_server_t* self,
        int connection_id,
        const(cef_string_t)* error_message) nothrow send_http500response;

    ///
    /// Send a custom HTTP response to the connection identified by
    /// |connection_id|. |response_code| is the HTTP response code sent in the
    /// status line (e.g. 200), |content_type| is the response content type sent
    /// as the "Content-Type" header (e.g. "text/html"), |content_length| is the
    /// expected content length, and |extra_headers| is the map of extra response
    /// headers. If |content_length| is >= 0 then the "Content-Length" header will
    /// be sent. If |content_length| is 0 then no content is expected and the
    /// connection will be closed automatically after the response is sent. If
    /// |content_length| is < 0 then no "Content-Length" header will be sent and
    /// the client will continue reading until the connection is closed. Use the
    /// SendRawData function to send the content, if applicable, and call
    /// CloseConnection after all content has been sent.
    ///
    extern(System) void function (
        cef_server_t* self,
        int connection_id,
        int response_code,
        const(cef_string_t)* content_type,
        long content_length,
        cef_string_multimap_t extra_headers) nothrow send_http_response;

    ///
    /// Send raw data directly to the connection identified by |connection_id|.
    /// |data| is the raw data and |data_size| is the size of |data| in bytes. The
    /// contents of |data| will be copied. No validation of |data| is performed
    /// internally so the client should be careful to send the amount indicated by
    /// the "Content-Length" header, if specified. See SendHttpResponse
    /// documentation for intended usage.
    ///
    extern(System) void function (
        cef_server_t* self,
        int connection_id,
        const(void)* data,
        size_t data_size) nothrow send_raw_data;

    ///
    /// Close the connection identified by |connection_id|. See SendHttpResponse
    /// documentation for intended usage.
    ///
    extern(System) void function (cef_server_t* self, int connection_id) nothrow close_connection;

    ///
    /// Send a WebSocket message to the connection identified by |connection_id|.
    /// |data| is the response content and |data_size| is the size of |data| in
    /// bytes. The contents of |data| will be copied. See
    /// cef_server_handler_t::OnWebSocketRequest documentation for intended usage.
    ///
    extern(System) void function (
        cef_server_t* self,
        int connection_id,
        const(void)* data,
        size_t data_size) nothrow send_web_socket_message;
}



///
/// Create a new server that binds to |address| and |port|. |address| must be a
/// valid IPv4 or IPv6 address (e.g. 127.0.0.1 or ::1) and |port| must be a port
/// number outside of the reserved range (e.g. between 1025 and 65535 on most
/// platforms). |backlog| is the maximum number of pending connections. A new
/// thread will be created for each CreateServer call (the "dedicated server
/// thread"). It is therefore recommended to use a different
/// cef_server_handler_t instance for each CreateServer call to avoid thread
/// safety issues in the cef_server_handler_t implementation. The
/// cef_server_handler_t::OnServerCreated function will be called on the
/// dedicated server thread to report success or failure. See
/// cef_server_handler_t::OnServerCreated documentation for a description of
/// server lifespan.
///
void cef_server_create (
    const(cef_string_t)* address,
    ushort port,
    int backlog,
    cef_server_handler_t* handler);

///
/// Implement this structure to handle HTTP server requests. A new thread will
/// be created for each cef_server_t::CreateServer call (the "dedicated server
/// thread"), and the functions of this structure will be called on that thread.
/// It is therefore recommended to use a different cef_server_handler_t instance
/// for each cef_server_t::CreateServer call to avoid thread safety issues in
/// the cef_server_handler_t implementation.
///
struct cef_server_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called when |server| is created. If the server was started successfully
    /// then cef_server_t::IsRunning will return true (1). The server will
    /// continue running until cef_server_t::Shutdown is called, after which time
    /// OnServerDestroyed will be called. If the server failed to start then
    /// OnServerDestroyed will be called immediately after this function returns.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server) nothrow on_server_created;

    ///
    /// Called when |server| is destroyed. The server thread will be stopped after
    /// this function returns. The client should release any references to
    /// |server| when this function is called. See OnServerCreated documentation
    /// for a description of server lifespan.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server) nothrow on_server_destroyed;

    ///
    /// Called when a client connects to |server|. |connection_id| uniquely
    /// identifies the connection. Each call to this function will have a matching
    /// call to OnClientDisconnected.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server,
        int connection_id) nothrow on_client_connected;

    ///
    /// Called when a client disconnects from |server|. |connection_id| uniquely
    /// identifies the connection. The client should release any data associated
    /// with |connection_id| when this function is called and |connection_id|
    /// should no longer be passed to cef_server_t functions. Disconnects can
    /// originate from either the client or the server. For example, the server
    /// will disconnect automatically after a cef_server_t::SendHttpXXXResponse
    /// function is called.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server,
        int connection_id) nothrow on_client_disconnected;

    ///
    /// Called when |server| receives an HTTP request. |connection_id| uniquely
    /// identifies the connection, |client_address| is the requesting IPv4 or IPv6
    /// client address including port number, and |request| contains the request
    /// contents (URL, function, headers and optional POST data). Call
    /// cef_server_t functions either synchronously or asynchronusly to send a
    /// response.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server,
        int connection_id,
        const(cef_string_t)* client_address,
        cef_request_t* request) nothrow on_http_request;

    ///
    /// Called when |server| receives a WebSocket request. |connection_id|
    /// uniquely identifies the connection, |client_address| is the requesting
    /// IPv4 or IPv6 client address including port number, and |request| contains
    /// the request contents (URL, function, headers and optional POST data).
    /// Execute |callback| either synchronously or asynchronously to accept or
    /// decline the WebSocket connection. If the request is accepted then
    /// OnWebSocketConnected will be called after the WebSocket has connected and
    /// incoming messages will be delivered to the OnWebSocketMessage callback. If
    /// the request is declined then the client will be disconnected and
    /// OnClientDisconnected will be called. Call the
    /// cef_server_t::SendWebSocketMessage function after receiving the
    /// OnWebSocketConnected callback to respond with WebSocket messages.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server,
        int connection_id,
        const(cef_string_t)* client_address,
        cef_request_t* request,
        cef_callback_t* callback) nothrow on_web_socket_request;

    ///
    /// Called after the client has accepted the WebSocket connection for |server|
    /// and |connection_id| via the OnWebSocketRequest callback. See
    /// OnWebSocketRequest documentation for intended usage.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server,
        int connection_id) nothrow on_web_socket_connected;

    ///
    /// Called when |server| receives an WebSocket message. |connection_id|
    /// uniquely identifies the connection, |data| is the message content and
    /// |data_size| is the size of |data| in bytes. Do not keep a reference to
    /// |data| outside of this function. See OnWebSocketRequest documentation for
    /// intended usage.
    ///
    extern(System) void function (
        cef_server_handler_t* self,
        cef_server_t* server,
        int connection_id,
        const(void)* data,
        size_t data_size) nothrow on_web_socket_message;
}



// CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=3d208a996f65f37012460edb1890773218580913$
//

extern (C):

///
/// Structure that wraps platform-dependent share memory region mapping.
///
struct cef_shared_memory_region_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if the mapping is valid.
    ///

    ///
    /// Returns the size of the mapping in bytes. Returns 0 for invalid instances.
    ///

    ///
    /// Returns the pointer to the memory. Returns nullptr for invalid instances.
    /// The returned pointer is only valid for the life span of this object.
    ///

    // CEF_INCLUDE_CAPI_CEF_SHARED_MEMORY_REGION_CAPI_H_

    cef_base_ref_counted_t base;
    extern(System) int function (cef_shared_memory_region_t* self) nothrow is_valid;
    extern(System) size_t function (cef_shared_memory_region_t* self) nothrow size;
    extern(System) void* function (cef_shared_memory_region_t* self) nothrow memory;
}


// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1ae66f6ec465fda2d62530f5871efd58c89e7568$
//

extern (C):

///
/// Structure that builds a cef_process_message_t containing a shared memory
/// region. This structure is not thread-safe but may be used exclusively on a
/// different thread from the one which constructed it.
///
struct cef_shared_process_message_builder_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if the builder is valid.
    ///

    ///
    /// Returns the size of the shared memory region in bytes. Returns 0 for
    /// invalid instances.
    ///

    ///
    /// Returns the pointer to the writable memory. Returns nullptr for invalid
    /// instances. The returned pointer is only valid for the life span of this

    cef_base_ref_counted_t base;
    extern(System) int function (cef_shared_process_message_builder_t* self) nothrow is_valid;
    extern(System) size_t function (cef_shared_process_message_builder_t* self) nothrow size;
    /// object.
    ///
    extern(System) void* function (cef_shared_process_message_builder_t* self) nothrow memory;

    ///
    /// Creates a new cef_process_message_t from the data provided to the builder.
    /// Returns nullptr for invalid instances. Invalidates the builder instance.
    ///
    extern(System) cef_process_message_t* function (
        cef_shared_process_message_builder_t* self) nothrow build;
}



///
/// Creates a new cef_shared_process_message_builder_t with the specified |name|
/// and shared memory region of specified |byte_size|.
///
cef_shared_process_message_builder_t* cef_shared_process_message_builder_create (
    const(cef_string_t)* name,
    size_t byte_size);

// CEF_INCLUDE_CAPI_CEF_SHARED_PROCESS_MESSAGE_BUILDER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d781f3791df17c6d6adc4414e8534a6b13a54ff2$
//

extern (C):

///
/// Structure representing SSL information.
///
struct cef_sslinfo_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns a bitmask containing any and all problems verifying the server
    /// certificate.
    ///

    ///
    /// Returns the X.509 certificate.
    ///

    ///
    /// Returns true (1) if the certificate status represents an error.
    ///

    // CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_

    cef_base_ref_counted_t base;
    extern(System) cef_cert_status_t function (cef_sslinfo_t* self) nothrow get_cert_status;
    extern(System) cef_x509certificate_t* function (
        cef_sslinfo_t* self) nothrow get_x509certificate;
}


int cef_is_cert_status_error (cef_cert_status_t status);
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1d224cc81c5a42ce8d7de172ff7341f1e0785f46$
//

extern (C):

///
/// Structure representing the SSL information for a navigation entry.
///
struct cef_sslstatus_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if the status is related to a secure SSL/TLS connection.
    ///

    ///
    /// Returns a bitmask containing any and all problems verifying the server
    /// certificate.
    ///

    ///
    /// Returns the SSL version used for the SSL connection.
    ///

    ///
    /// Returns a bitmask containing the page security content status.
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (cef_sslstatus_t* self) nothrow is_secure_connection;
    extern(System) cef_cert_status_t function (cef_sslstatus_t* self) nothrow get_cert_status;
    extern(System) cef_ssl_version_t function (cef_sslstatus_t* self) nothrow get_sslversion;
    extern(System) cef_ssl_content_status_t function (
        cef_sslstatus_t* self) nothrow get_content_status;

    ///
    /// Returns the X.509 certificate.
    ///
    extern(System) cef_x509certificate_t* function (
        cef_sslstatus_t* self) nothrow get_x509certificate;
}



// CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f55fa17800b9a63d128fb78201372754f9250875$
//

extern (C):

///
/// Structure the client can implement to provide a custom stream reader. The
/// functions of this structure may be called on any thread.
///
struct cef_read_handler_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Read raw binary data.
    ///

    ///
    /// Seek to the specified offset position. |whence| may be any one of
    /// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
    /// failure.
    ///

    ///
    /// Return the current offset position.
    ///

    ///

    cef_base_ref_counted_t base;
    extern(System) size_t function (
        cef_read_handler_t* self,
        void* ptr,
        size_t size,
        size_t n) nothrow read;
    extern(System) int function (cef_read_handler_t* self, long offset, int whence) nothrow seek;
    extern(System) long function (cef_read_handler_t* self) nothrow tell;
    /// Return non-zero if at end of file.
    ///
    extern(System) int function (cef_read_handler_t* self) nothrow eof;

    ///
    /// Return true (1) if this handler performs work like accessing the file
    /// system which may block. Used as a hint for determining the thread to
    /// access the handler from.
    ///
    extern(System) int function (cef_read_handler_t* self) nothrow may_block;
}



///
/// Structure used to read data from a stream. The functions of this structure
/// may be called on any thread.
///
struct cef_stream_reader_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Read raw binary data.
    ///
    extern(System) size_t function (
        cef_stream_reader_t* self,
        void* ptr,
        size_t size,
        size_t n) nothrow read;

    ///
    /// Seek to the specified offset position. |whence| may be any one of
    /// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
    /// failure.
    ///
    extern(System) int function (cef_stream_reader_t* self, long offset, int whence) nothrow seek;

    ///
    /// Return the current offset position.
    ///
    extern(System) long function (cef_stream_reader_t* self) nothrow tell;

    ///
    /// Return non-zero if at end of file.
    ///
    extern(System) int function (cef_stream_reader_t* self) nothrow eof;

    ///
    /// Returns true (1) if this reader performs work like accessing the file
    /// system which may block. Used as a hint for determining the thread to
    /// access the reader from.
    ///
    extern(System) int function (cef_stream_reader_t* self) nothrow may_block;
}



///
/// Create a new cef_stream_reader_t object from a file.
///
cef_stream_reader_t* cef_stream_reader_create_for_file (
    const(cef_string_t)* fileName);

///
/// Create a new cef_stream_reader_t object from data.
///
cef_stream_reader_t* cef_stream_reader_create_for_data (
    void* data,
    size_t size);

///
/// Create a new cef_stream_reader_t object from a custom handler.
///
cef_stream_reader_t* cef_stream_reader_create_for_handler (
    cef_read_handler_t* handler);

///
/// Structure the client can implement to provide a custom stream writer. The
/// functions of this structure may be called on any thread.
///
struct cef_write_handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Write raw binary data.
    ///
    extern(System) size_t function (
        cef_write_handler_t* self,
        const(void)* ptr,
        size_t size,
        size_t n) nothrow write;

    ///
    /// Seek to the specified offset position. |whence| may be any one of
    /// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
    /// failure.
    ///
    extern(System) int function (cef_write_handler_t* self, long offset, int whence) nothrow seek;

    ///
    /// Return the current offset position.
    ///
    extern(System) long function (cef_write_handler_t* self) nothrow tell;

    ///
    /// Flush the stream.
    ///
    extern(System) int function (cef_write_handler_t* self) nothrow flush;

    ///
    /// Return true (1) if this handler performs work like accessing the file
    /// system which may block. Used as a hint for determining the thread to
    /// access the handler from.
    ///
    extern(System) int function (cef_write_handler_t* self) nothrow may_block;
}



///
/// Structure used to write data to a stream. The functions of this structure
/// may be called on any thread.
///
struct cef_stream_writer_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Write raw binary data.
    ///
    extern(System) size_t function (
        cef_stream_writer_t* self,
        const(void)* ptr,
        size_t size,
        size_t n) nothrow write;

    ///
    /// Seek to the specified offset position. |whence| may be any one of
    /// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
    /// failure.
    ///
    extern(System) int function (cef_stream_writer_t* self, long offset, int whence) nothrow seek;

    ///
    /// Return the current offset position.
    ///
    extern(System) long function (cef_stream_writer_t* self) nothrow tell;

    ///
    /// Flush the stream.
    ///
    extern(System) int function (cef_stream_writer_t* self) nothrow flush;

    ///
    /// Returns true (1) if this writer performs work like accessing the file
    /// system which may block. Used as a hint for determining the thread to
    /// access the writer from.
    ///
    extern(System) int function (cef_stream_writer_t* self) nothrow may_block;
}



///
/// Create a new cef_stream_writer_t object for a file.
///
cef_stream_writer_t* cef_stream_writer_create_for_file (
    const(cef_string_t)* fileName);

///
/// Create a new cef_stream_writer_t object for a custom handler.
///
cef_stream_writer_t* cef_stream_writer_create_for_handler (
    cef_write_handler_t* handler);

// CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c43ca147d723753000bc819d64d09b83a23bfac2$
//

extern (C):

///
/// Implement this structure to receive string values asynchronously.
///
struct cef_string_visitor_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Method that will be executed.
    ///

    // CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_string_visitor_t* self,
        const(cef_string_t)* string) nothrow visit;
}


// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d6055c4567fec4f3e9c72b0536812f40a97c0c3c$
//

extern (C):

///
/// Implement this structure for asynchronous task execution. If the task is
/// posted successfully and if the associated message loop is still running then
/// the execute() function will be called on the target thread. If the task
/// fails to post then the task object may be destroyed on the source thread
/// instead of the target thread. For this reason be cautious when performing
/// work in the task object destructor.
///
struct cef_task_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Method that will be executed on the target thread.
    ///

    ///
    /// Structure that asynchronously executes tasks on the associated thread. It is
    /// safe to call the functions of this structure on any thread.
    ///
    /// CEF maintains multiple internal threads that are used for handling different
    /// types of tasks in different processes. The cef_thread_id_t definitions in

    cef_base_ref_counted_t base;
    extern(System) void function (cef_task_t* self) nothrow execute;
}


/// cef_types.h list the common CEF threads. Task runners are also available for
/// other CEF threads as appropriate (for example, V8 WebWorker threads).
///
struct cef_task_runner_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if this object is pointing to the same task runner as
    /// |that| object.
    ///
    extern(System) int function (cef_task_runner_t* self, cef_task_runner_t* that) nothrow is_same;

    ///
    /// Returns true (1) if this task runner belongs to the current thread.
    ///
    extern(System) int function (cef_task_runner_t* self) nothrow belongs_to_current_thread;

    ///
    /// Returns true (1) if this task runner is for the specified CEF thread.
    ///
    extern(System) int function (
        cef_task_runner_t* self,
        cef_thread_id_t threadId) nothrow belongs_to_thread;

    ///
    /// Post a task for execution on the thread associated with this task runner.
    /// Execution will occur asynchronously.
    ///
    extern(System) int function (cef_task_runner_t* self, cef_task_t* task) nothrow post_task;

    ///
    /// Post a task for delayed execution on the thread associated with this task
    /// runner. Execution will occur asynchronously. Delayed tasks are not
    /// supported on V8 WebWorker threads and will be executed without the
    /// specified delay.
    ///
    extern(System) int function (
        cef_task_runner_t* self,
        cef_task_t* task,
        long delay_ms) nothrow post_delayed_task;
}



///
/// Returns the task runner for the current thread. Only CEF threads will have
/// task runners. An NULL reference will be returned if this function is called
/// on an invalid thread.
///
cef_task_runner_t* cef_task_runner_get_for_current_thread ();

///
/// Returns the task runner for the specified CEF thread.
///
cef_task_runner_t* cef_task_runner_get_for_thread (cef_thread_id_t threadId);

///
/// Returns true (1) if called on the specified thread. Equivalent to using
/// cef_task_runner_t::GetForThread(threadId)->belongs_to_current_thread().
///
int cef_currently_on (cef_thread_id_t threadId);

///
/// Post a task for execution on the specified thread. Equivalent to using
/// cef_task_runner_t::GetForThread(threadId)->PostTask(task).
///
int cef_post_task (cef_thread_id_t threadId, cef_task_t* task);

///
/// Post a task for delayed execution on the specified thread. Equivalent to
/// using cef_task_runner_t::GetForThread(threadId)->PostDelayedTask(task,
/// delay_ms).
///
int cef_post_delayed_task (
    cef_thread_id_t threadId,
    cef_task_t* task,
    long delay_ms);

// CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=752a853dae97c9bfd9b6515d20f99af751ba2dd9$
//

extern (C):

///
/// A simple thread abstraction that establishes a message loop on a new thread.
/// The consumer uses cef_task_runner_t to execute code on the thread's message
/// loop. The thread is terminated when the cef_thread_t object is destroyed or
/// stop() is called. All pending tasks queued on the thread's message loop will
/// run to completion before the thread is terminated. cef_thread_create() can
/// be called on any valid CEF thread in either the browser or render process.
/// This structure should only be used for tasks that require a dedicated
/// thread. In most cases you can post tasks to an existing CEF thread instead
/// of creating a new one; see cef_task.h for details.
///
struct cef_thread_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns the cef_task_runner_t that will execute code on this thread's

    cef_base_ref_counted_t base;
    /// message loop. This function is safe to call from any thread.
    ///
    extern(System) cef_task_runner_t* function (cef_thread_t* self) nothrow get_task_runner;

    ///
    /// Returns the platform thread ID. It will return the same value after stop()
    /// is called. This function is safe to call from any thread.
    ///
    extern(System) cef_platform_thread_id_t function (
        cef_thread_t* self) nothrow get_platform_thread_id;

    ///
    /// Stop and join the thread. This function must be called from the same
    /// thread that called cef_thread_create(). Do not call this function if
    /// cef_thread_create() was called with a |stoppable| value of false (0).
    ///
    extern(System) void function (cef_thread_t* self) nothrow stop;

    ///
    /// Returns true (1) if the thread is currently running. This function must be
    /// called from the same thread that called cef_thread_create().
    ///
    extern(System) int function (cef_thread_t* self) nothrow is_running;
}



///
/// Create and start a new thread. This function does not block waiting for the
/// thread to run initialization. |display_name| is the name that will be used
/// to identify the thread. |priority| is the thread execution priority.
/// |message_loop_type| indicates the set of asynchronous events that the thread
/// can process. If |stoppable| is true (1) the thread will stopped and joined
/// on destruction or when stop() is called; otherwise, the thread cannot be
/// stopped and will be leaked on shutdown. On Windows the |com_init_mode| value
/// specifies how COM will be initialized for the thread. If |com_init_mode| is
/// set to COM_INIT_MODE_STA then |message_loop_type| must be set to ML_TYPE_UI.
///
cef_thread_t* cef_thread_create (
    const(cef_string_t)* display_name,
    cef_thread_priority_t priority,
    cef_message_loop_type_t message_loop_type,
    int stoppable,
    cef_com_init_mode_t com_init_mode);

// CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=740d6eb5bea1bfc7c4ea413fefd3bf6586a81f20$
//

extern (C):

///
/// Implement this structure to receive notification when tracing has completed.
/// The functions of this structure will be called on the browser process UI
/// thread.
///
struct cef_end_tracing_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Called after all processes have sent their trace data. |tracing_file| is
    /// the path at which tracing data was written. The client is responsible for
    /// deleting |tracing_file|.
    ///

    ///
    /// Start tracing events on all processes. Tracing is initialized asynchronously
    /// and |callback| will be executed on the UI thread after initialization is
    /// complete.
    ///
    /// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is

    cef_base_ref_counted_t base;
    extern(System) void function (
        cef_end_tracing_callback_t* self,
        const(cef_string_t)* tracing_file) nothrow on_end_tracing_complete;
}

 /// pending, CefBeginTracing will fail and return false (0).
///
/// |categories| is a comma-delimited list of category wildcards. A category can
/// have an optional '-' prefix to make it an excluded category. Having both
/// included and excluded categories in the same list is not supported.
///
/// Examples:
/// - "test_MyTest*"
/// - "test_MyTest*,test_OtherStuff"
/// - "-excluded_category1,-excluded_category2"
///
/// This function must be called on the browser process UI thread.
///
int cef_begin_tracing (
    const(cef_string_t)* categories,
    cef_completion_callback_t* callback);

///
/// Stop tracing events on all processes.
///
/// This function will fail and return false (0) if a previous call to
/// CefEndTracingAsync is already pending or if CefBeginTracing was not called.
///
/// |tracing_file| is the path at which tracing data will be written and
/// |callback| is the callback that will be executed once all processes have
/// sent their trace data. If |tracing_file| is NULL a new temporary file path
/// will be used. If |callback| is NULL no trace data will be written.
///
/// This function must be called on the browser process UI thread.
///
int cef_end_tracing (
    const(cef_string_t)* tracing_file,
    cef_end_tracing_callback_t* callback);

///
/// Returns the current system trace time or, if none is defined, the current
/// high-res time. Can be used by clients to synchronize with the time
/// information in trace events.
///
long cef_now_from_system_trace_time ();

// CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=9ad38f2709d9e3b1bd0e99c279b0497b8aa4c82a$
//

extern (C):

///
/// Callback structure for asynchronous handling of an unresponsive process.
///
struct cef_unresponsive_process_callback_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Reset the timeout for the unresponsive process.
    ///

    ///
    /// Terminate the unresponsive process.
    ///

    // CEF_INCLUDE_CAPI_CEF_UNRESPONSIVE_PROCESS_CALLBACK_CAPI_H_

    cef_base_ref_counted_t base;
    extern(System) void function (cef_unresponsive_process_callback_t* self) nothrow wait;
    extern(System) void function (cef_unresponsive_process_callback_t* self) nothrow terminate;
}


// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6a8ed2646d767d3c42ea79f7586f19769c1df742$
//

extern (C):

///
/// Structure used to make a URL request. URL requests are not associated with a
/// browser instance so no cef_client_t callbacks will be executed. URL requests
/// can be created on any valid CEF thread in either the browser or render
/// process. Once created the functions of the URL request object must be
/// accessed on the same thread that created it.
///
struct cef_urlrequest_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns the request object used to create this URL request. The returned
    /// object is read-only and should not be modified.
    ///

    cef_base_ref_counted_t base;
    extern(System) cef_request_t* function (cef_urlrequest_t* self) nothrow get_request;
    ///
    /// Returns the client.
    ///
    extern(System) cef_urlrequest_client_t* function (cef_urlrequest_t* self) nothrow get_client;

    ///
    /// Returns the request status.
    ///
    extern(System) cef_urlrequest_status_t function (
        cef_urlrequest_t* self) nothrow get_request_status;

    ///
    /// Returns the request error if status is UR_CANCELED or UR_FAILED, or 0
    /// otherwise.
    ///
    extern(System) cef_errorcode_t function (cef_urlrequest_t* self) nothrow get_request_error;

    ///
    /// Returns the response, or NULL if no response information is available.
    /// Response information will only be available after the upload has
    /// completed. The returned object is read-only and should not be modified.
    ///
    extern(System) cef_response_t* function (cef_urlrequest_t* self) nothrow get_response;

    ///
    /// Returns true (1) if the response body was served from the cache. This
    /// includes responses for which revalidation was required.
    ///
    extern(System) int function (cef_urlrequest_t* self) nothrow response_was_cached;

    ///
    /// Cancel the request.
    ///
    extern(System) void function (cef_urlrequest_t* self) nothrow cancel;
}



///
/// Create a new URL request that is not associated with a specific browser or
/// frame. Use cef_frame_t::CreateURLRequest instead if you want the request to
/// have this association, in which case it may be handled differently (see
/// documentation on that function). A request created with this function may
/// only originate from the browser process, and will behave as follows:
///   - It may be intercepted by the client via CefResourceRequestHandler or
///     CefSchemeHandlerFactory.
///   - POST data may only contain only a single element of type PDE_TYPE_FILE
///     or PDE_TYPE_BYTES.
///   - If |request_context| is empty the global request context will be used.
///
/// The |request| object will be marked as read-only after calling this
/// function.
///
cef_urlrequest_t* cef_urlrequest_create (
    cef_request_t* request,
    cef_urlrequest_client_t* client,
    cef_request_context_t* request_context);

///
/// Structure that should be implemented by the cef_urlrequest_t client. The
/// functions of this structure will be called on the same thread that created
/// the request unless otherwise documented.
///
struct cef_urlrequest_client_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Notifies the client that the request has completed. Use the
    /// cef_urlrequest_t::GetRequestStatus function to determine if the request
    /// was successful or not.
    ///
    extern(System) void function (
        cef_urlrequest_client_t* self,
        cef_urlrequest_t* request) nothrow on_request_complete;

    ///
    /// Notifies the client of upload progress. |current| denotes the number of
    /// bytes sent so far and |total| is the total size of uploading data (or -1
    /// if chunked upload is enabled). This function will only be called if the
    /// UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request.
    ///
    extern(System) void function (
        cef_urlrequest_client_t* self,
        cef_urlrequest_t* request,
        long current,
        long total) nothrow on_upload_progress;

    ///
    /// Notifies the client of download progress. |current| denotes the number of
    /// bytes received up to the call and |total| is the expected total size of
    /// the response (or -1 if not determined).
    ///
    extern(System) void function (
        cef_urlrequest_client_t* self,
        cef_urlrequest_t* request,
        long current,
        long total) nothrow on_download_progress;

    ///
    /// Called when some part of the response is read. |data| contains the current
    /// bytes received since the last call. This function will not be called if
    /// the UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request.
    ///
    extern(System) void function (
        cef_urlrequest_client_t* self,
        cef_urlrequest_t* request,
        const(void)* data,
        size_t data_length) nothrow on_download_data;

    ///
    /// Called on the IO thread when the browser needs credentials from the user.
    /// |isProxy| indicates whether the host is a proxy server. |host| contains
    /// the hostname and |port| contains the port number. Return true (1) to
    /// continue the request and call cef_auth_callback_t::cont() when the
    /// authentication information is available. If the request has an associated
    /// browser/frame then returning false (0) will result in a call to
    /// GetAuthCredentials on the cef_request_handler_t associated with that
    /// browser, if any. Otherwise, returning false (0) will cancel the request
    /// immediately. This function will only be called for requests initiated from
    /// the browser process.
    ///
    extern(System) int function (
        cef_urlrequest_client_t* self,
        int isProxy,
        const(cef_string_t)* host,
        int port,
        const(cef_string_t)* realm,
        const(cef_string_t)* scheme,
        cef_auth_callback_t* callback) nothrow get_auth_credentials;
}



// CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5dd4948a92af2ad69e2171f2dffb8f2c23e5c147$
//

extern (C):

///
/// Structure representing a V8 context handle. V8 handles can only be accessed
/// from the thread on which they are created. Valid threads for creating a V8
/// handle include the render process main thread (TID_RENDERER) and WebWorker
/// threads. A task runner for posting tasks on the associated thread can be
/// retrieved via the cef_v8context_t::get_task_runner() function.
///
struct cef_v8context_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns the task runner associated with this context. V8 handles can only
    /// be accessed from the thread on which they are created. This function can
    /// be called on any render process thread.

    cef_base_ref_counted_t base;
    ///
    extern(System) cef_task_runner_t* function (cef_v8context_t* self) nothrow get_task_runner;

    ///
    /// Returns true (1) if the underlying handle is valid and it can be accessed
    /// on the current thread. Do not call any other functions if this function
    /// returns false (0).
    ///
    extern(System) int function (cef_v8context_t* self) nothrow is_valid;

    ///
    /// Returns the browser for this context. This function will return an NULL
    /// reference for WebWorker contexts.
    ///
    extern(System) cef_browser_t* function (cef_v8context_t* self) nothrow get_browser;

    ///
    /// Returns the frame for this context. This function will return an NULL
    /// reference for WebWorker contexts.
    ///
    extern(System) cef_frame_t* function (cef_v8context_t* self) nothrow get_frame;

    ///
    /// Returns the global object for this context. The context must be entered
    /// before calling this function.
    ///
    extern(System) cef_v8value_t* function (cef_v8context_t* self) nothrow get_global;

    ///
    /// Enter this context. A context must be explicitly entered before creating a
    /// V8 Object, Array, Function or Date asynchronously. exit() must be called
    /// the same number of times as enter() before releasing this context. V8
    /// objects belong to the context in which they are created. Returns true (1)
    /// if the scope was entered successfully.
    ///
    extern(System) int function (cef_v8context_t* self) nothrow enter;

    ///
    /// Exit this context. Call this function only after calling enter(). Returns
    /// true (1) if the scope was exited successfully.
    ///
    extern(System) int function (cef_v8context_t* self) nothrow exit;

    ///
    /// Returns true (1) if this object is pointing to the same handle as |that|
    /// object.
    ///
    extern(System) int function (cef_v8context_t* self, cef_v8context_t* that) nothrow is_same;

    ///
    /// Execute a string of JavaScript code in this V8 context. The |script_url|
    /// parameter is the URL where the script in question can be found, if any.
    /// The |start_line| parameter is the base line number to use for error
    /// reporting. On success |retval| will be set to the return value, if any,
    /// and the function will return true (1). On failure |exception| will be set
    /// to the exception, if any, and the function will return false (0).
    ///
    extern(System) int function (
        cef_v8context_t* self,
        const(cef_string_t)* code,
        const(cef_string_t)* script_url,
        int start_line,
        cef_v8value_t** retval,
        cef_v8exception_t** exception) nothrow eval;
}



///
/// Returns the current (top) context object in the V8 context stack.
///
cef_v8context_t* cef_v8context_get_current_context ();

///
/// Returns the entered (bottom) context object in the V8 context stack.
///
cef_v8context_t* cef_v8context_get_entered_context ();

///
/// Returns true (1) if V8 is currently inside a context.
///
int cef_v8context_in_context ();

///
/// Structure that should be implemented to handle V8 function calls. The
/// functions of this structure will be called on the thread associated with the
/// V8 function.
///
struct cef_v8handler_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Handle execution of the function identified by |name|. |object| is the
    /// receiver ('this' object) of the function. |arguments| is the list of
    /// arguments passed to the function. If execution succeeds set |retval| to
    /// the function return value. If execution fails set |exception| to the
    /// exception that will be thrown. Return true (1) if execution was handled.
    ///
    extern(System) int function (
        cef_v8handler_t* self,
        const(cef_string_t)* name,
        cef_v8value_t* object,
        size_t argumentsCount,
        cef_v8value_t** arguments,
        cef_v8value_t** retval,
        cef_string_t* exception) nothrow execute;
}



///
/// Structure that should be implemented to handle V8 accessor calls. Accessor
/// identifiers are registered by calling cef_v8value_t::set_value(). The
/// functions of this structure will be called on the thread associated with the
/// V8 accessor.
///
struct cef_v8accessor_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Handle retrieval the accessor value identified by |name|. |object| is the
    /// receiver ('this' object) of the accessor. If retrieval succeeds set
    /// |retval| to the return value. If retrieval fails set |exception| to the
    /// exception that will be thrown. Return true (1) if accessor retrieval was
    /// handled.
    ///
    extern(System) int function (
        cef_v8accessor_t* self,
        const(cef_string_t)* name,
        cef_v8value_t* object,
        cef_v8value_t** retval,
        cef_string_t* exception) nothrow get;

    ///
    /// Handle assignment of the accessor value identified by |name|. |object| is
    /// the receiver ('this' object) of the accessor. |value| is the new value
    /// being assigned to the accessor. If assignment fails set |exception| to the
    /// exception that will be thrown. Return true (1) if accessor assignment was
    /// handled.
    ///
    extern(System) int function (
        cef_v8accessor_t* self,
        const(cef_string_t)* name,
        cef_v8value_t* object,
        cef_v8value_t* value,
        cef_string_t* exception) nothrow set;
}



///
/// Structure that should be implemented to handle V8 interceptor calls. The
/// functions of this structure will be called on the thread associated with the
/// V8 interceptor. Interceptor's named property handlers (with first argument
/// of type CefString) are called when object is indexed by string. Indexed
/// property handlers (with first argument of type int) are called when object
/// is indexed by integer.
///
struct cef_v8interceptor_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Handle retrieval of the interceptor value identified by |name|. |object|
    /// is the receiver ('this' object) of the interceptor. If retrieval succeeds,
    /// set |retval| to the return value. If the requested value does not exist,
    /// don't set either |retval| or |exception|. If retrieval fails, set
    /// |exception| to the exception that will be thrown. If the property has an
    /// associated accessor, it will be called only if you don't set |retval|.
    /// Return true (1) if interceptor retrieval was handled, false (0) otherwise.
    ///
    extern(System) int function (
        cef_v8interceptor_t* self,
        const(cef_string_t)* name,
        cef_v8value_t* object,
        cef_v8value_t** retval,
        cef_string_t* exception) nothrow get_byname;

    ///
    /// Handle retrieval of the interceptor value identified by |index|. |object|
    /// is the receiver ('this' object) of the interceptor. If retrieval succeeds,
    /// set |retval| to the return value. If the requested value does not exist,
    /// don't set either |retval| or |exception|. If retrieval fails, set
    /// |exception| to the exception that will be thrown. Return true (1) if
    /// interceptor retrieval was handled, false (0) otherwise.
    ///
    extern(System) int function (
        cef_v8interceptor_t* self,
        int index,
        cef_v8value_t* object,
        cef_v8value_t** retval,
        cef_string_t* exception) nothrow get_byindex;

    ///
    /// Handle assignment of the interceptor value identified by |name|. |object|
    /// is the receiver ('this' object) of the interceptor. |value| is the new
    /// value being assigned to the interceptor. If assignment fails, set
    /// |exception| to the exception that will be thrown. This setter will always
    /// be called, even when the property has an associated accessor. Return true
    /// (1) if interceptor assignment was handled, false (0) otherwise.
    ///
    extern(System) int function (
        cef_v8interceptor_t* self,
        const(cef_string_t)* name,
        cef_v8value_t* object,
        cef_v8value_t* value,
        cef_string_t* exception) nothrow set_byname;

    ///
    /// Handle assignment of the interceptor value identified by |index|. |object|
    /// is the receiver ('this' object) of the interceptor. |value| is the new
    /// value being assigned to the interceptor. If assignment fails, set
    /// |exception| to the exception that will be thrown. Return true (1) if
    /// interceptor assignment was handled, false (0) otherwise.
    ///
    extern(System) int function (
        cef_v8interceptor_t* self,
        int index,
        cef_v8value_t* object,
        cef_v8value_t* value,
        cef_string_t* exception) nothrow set_byindex;
}



///
/// Structure representing a V8 exception. The functions of this structure may
/// be called on any render process thread.
///
struct cef_v8exception_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the exception message.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_v8exception_t* self) nothrow get_message;

    ///
    /// Returns the line of source code that the exception occurred within.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_v8exception_t* self) nothrow get_source_line;

    ///
    /// Returns the resource name for the script from where the function causing
    /// the error originates.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_v8exception_t* self) nothrow get_script_resource_name;

    ///
    /// Returns the 1-based number of the line where the error occurred or 0 if
    /// the line number is unknown.
    ///
    extern(System) int function (cef_v8exception_t* self) nothrow get_line_number;

    ///
    /// Returns the index within the script of the first character where the error
    /// occurred.
    ///
    extern(System) int function (cef_v8exception_t* self) nothrow get_start_position;

    ///
    /// Returns the index within the script of the last character where the error
    /// occurred.
    ///
    extern(System) int function (cef_v8exception_t* self) nothrow get_end_position;

    ///
    /// Returns the index within the line of the first character where the error
    /// occurred.
    ///
    extern(System) int function (cef_v8exception_t* self) nothrow get_start_column;

    ///
    /// Returns the index within the line of the last character where the error
    /// occurred.
    ///
    extern(System) int function (cef_v8exception_t* self) nothrow get_end_column;
}



///
/// Callback structure that is passed to cef_v8value_t::CreateArrayBuffer.
///
struct cef_v8array_buffer_release_callback_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Called to release |buffer| when the ArrayBuffer JS object is garbage
    /// collected. |buffer| is the value that was passed to CreateArrayBuffer
    /// along with this object.
    ///
    extern(System) void function (
        cef_v8array_buffer_release_callback_t* self,
        void* buffer) nothrow release_buffer;
}



///
/// Structure representing a V8 value handle. V8 handles can only be accessed
/// from the thread on which they are created. Valid threads for creating a V8
/// handle include the render process main thread (TID_RENDERER) and WebWorker
/// threads. A task runner for posting tasks on the associated thread can be
/// retrieved via the cef_v8context_t::get_task_runner() function.
///
struct cef_v8value_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if the underlying handle is valid and it can be accessed
    /// on the current thread. Do not call any other functions if this function
    /// returns false (0).
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_valid;

    ///
    /// True if the value type is undefined.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_undefined;

    ///
    /// True if the value type is null.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_null;

    ///
    /// True if the value type is bool.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_bool;

    ///
    /// True if the value type is int.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_int;

    ///
    /// True if the value type is unsigned int.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_uint;

    ///
    /// True if the value type is double.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_double;

    ///
    /// True if the value type is Date.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_date;

    ///
    /// True if the value type is string.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_string;

    ///
    /// True if the value type is object.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_object;

    ///
    /// True if the value type is array.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_array;

    ///
    /// True if the value type is an ArrayBuffer.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_array_buffer;

    ///
    /// True if the value type is function.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_function;

    ///
    /// True if the value type is a Promise.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_promise;

    ///
    /// Returns true (1) if this object is pointing to the same handle as |that|
    /// object.
    ///
    extern(System) int function (cef_v8value_t* self, cef_v8value_t* that) nothrow is_same;

    ///
    /// Return a bool value.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow get_bool_value;

    ///
    /// Return an int value.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow get_int_value;

    ///
    /// Return an unsigned int value.
    ///
    extern(System) uint function (cef_v8value_t* self) nothrow get_uint_value;

    ///
    /// Return a double value.
    ///
    extern(System) double function (cef_v8value_t* self) nothrow get_double_value;

    ///
    /// Return a Date value.
    ///
    extern(System) cef_basetime_t function (cef_v8value_t* self) nothrow get_date_value;

    ///
    /// Return a string value.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_v8value_t* self) nothrow get_string_value;

    ///
    /// Returns true (1) if this is a user created object.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow is_user_created;

    ///
    /// Returns true (1) if the last function call resulted in an exception. This
    /// attribute exists only in the scope of the current CEF value object.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow has_exception;

    ///
    /// Returns the exception resulting from the last function call. This
    /// attribute exists only in the scope of the current CEF value object.
    ///
    extern(System) cef_v8exception_t* function (cef_v8value_t* self) nothrow get_exception;

    ///
    /// Clears the last exception and returns true (1) on success.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow clear_exception;

    ///
    /// Returns true (1) if this object will re-throw future exceptions. This
    /// attribute exists only in the scope of the current CEF value object.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow will_rethrow_exceptions;

    ///
    /// Set whether this object will re-throw future exceptions. By default
    /// exceptions are not re-thrown. If a exception is re-thrown the current
    /// context should not be accessed again until after the exception has been
    /// caught and not re-thrown. Returns true (1) on success. This attribute
    /// exists only in the scope of the current CEF value object.
    ///
    extern(System) int function (cef_v8value_t* self, int rethrow) nothrow set_rethrow_exceptions;

    ///
    /// Returns true (1) if the object has a value with the specified identifier.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        const(cef_string_t)* key) nothrow has_value_bykey;

    ///
    /// Returns true (1) if the object has a value with the specified identifier.
    ///
    extern(System) int function (cef_v8value_t* self, int index) nothrow has_value_byindex;

    ///
    /// Deletes the value with the specified identifier and returns true (1) on
    /// success. Returns false (0) if this function is called incorrectly or an
    /// exception is thrown. For read-only and don't-delete values this function
    /// will return true (1) even though deletion failed.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        const(cef_string_t)* key) nothrow delete_value_bykey;

    ///
    /// Deletes the value with the specified identifier and returns true (1) on
    /// success. Returns false (0) if this function is called incorrectly,
    /// deletion fails or an exception is thrown. For read-only and don't-delete
    /// values this function will return true (1) even though deletion failed.
    ///
    extern(System) int function (cef_v8value_t* self, int index) nothrow delete_value_byindex;

    ///
    /// Returns the value with the specified identifier on success. Returns NULL
    /// if this function is called incorrectly or an exception is thrown.
    ///
    extern(System) cef_v8value_t* function (
        cef_v8value_t* self,
        const(cef_string_t)* key) nothrow get_value_bykey;

    ///
    /// Returns the value with the specified identifier on success. Returns NULL
    /// if this function is called incorrectly or an exception is thrown.
    ///
    extern(System) cef_v8value_t* function (
        cef_v8value_t* self,
        int index) nothrow get_value_byindex;

    ///
    /// Associates a value with the specified identifier and returns true (1) on
    /// success. Returns false (0) if this function is called incorrectly or an
    /// exception is thrown. For read-only values this function will return true
    /// (1) even though assignment failed.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        const(cef_string_t)* key,
        cef_v8value_t* value,
        cef_v8_propertyattribute_t attribute) nothrow set_value_bykey;

    ///
    /// Associates a value with the specified identifier and returns true (1) on
    /// success. Returns false (0) if this function is called incorrectly or an
    /// exception is thrown. For read-only values this function will return true
    /// (1) even though assignment failed.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        int index,
        cef_v8value_t* value) nothrow set_value_byindex;

    ///
    /// Registers an identifier and returns true (1) on success. Access to the
    /// identifier will be forwarded to the cef_v8accessor_t instance passed to
    /// cef_v8value_t::cef_v8value_create_object(). Returns false (0) if this
    /// function is called incorrectly or an exception is thrown. For read-only
    /// values this function will return true (1) even though assignment failed.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        const(cef_string_t)* key,
        cef_v8_propertyattribute_t attribute) nothrow set_value_byaccessor;

    ///
    /// Read the keys for the object's values into the specified vector. Integer-
    /// based keys will also be returned as strings.
    ///
    extern(System) int function (cef_v8value_t* self, cef_string_list_t keys) nothrow get_keys;

    ///
    /// Sets the user data for this object and returns true (1) on success.
    /// Returns false (0) if this function is called incorrectly. This function
    /// can only be called on user created objects.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        cef_base_ref_counted_t* user_data) nothrow set_user_data;

    ///
    /// Returns the user data, if any, assigned to this object.
    ///
    extern(System) cef_base_ref_counted_t* function (cef_v8value_t* self) nothrow get_user_data;

    ///
    /// Returns the amount of externally allocated memory registered for the
    /// object.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow get_externally_allocated_memory;

    ///
    /// Adjusts the amount of registered external memory for the object. Used to
    /// give V8 an indication of the amount of externally allocated memory that is
    /// kept alive by JavaScript objects. V8 uses this information to decide when
    /// to perform global garbage collection. Each cef_v8value_t tracks the amount
    /// of external memory associated with it and automatically decreases the
    /// global total by the appropriate amount on its destruction.
    /// |change_in_bytes| specifies the number of bytes to adjust by. This
    /// function returns the number of bytes associated with the object after the
    /// adjustment. This function can only be called on user created objects.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        int change_in_bytes) nothrow adjust_externally_allocated_memory;

    ///
    /// Returns the number of elements in the array.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow get_array_length;

    ///
    /// Returns the ReleaseCallback object associated with the ArrayBuffer or NULL
    /// if the ArrayBuffer was not created with CreateArrayBuffer.
    ///
    extern(System) cef_v8array_buffer_release_callback_t* function (
        cef_v8value_t* self) nothrow get_array_buffer_release_callback;

    ///
    /// Prevent the ArrayBuffer from using it's memory block by setting the length
    /// to zero. This operation cannot be undone. If the ArrayBuffer was created
    /// with CreateArrayBuffer then
    /// cef_v8array_buffer_release_callback_t::ReleaseBuffer will be called to
    /// release the underlying buffer.
    ///
    extern(System) int function (cef_v8value_t* self) nothrow neuter_array_buffer;

    ///
    /// Returns the length (in bytes) of the ArrayBuffer.
    ///
    extern(System) size_t function (cef_v8value_t* self) nothrow get_array_buffer_byte_length;

    ///
    /// Returns a pointer to the beginning of the memory block for this
    /// ArrayBuffer backing store. The returned pointer is valid as long as the
    /// cef_v8value_t is alive.
    ///
    extern(System) void* function (cef_v8value_t* self) nothrow get_array_buffer_data;

    ///
    /// Returns the function name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_v8value_t* self) nothrow get_function_name;

    ///
    /// Returns the function handler or NULL if not a CEF-created function.
    ///
    extern(System) cef_v8handler_t* function (cef_v8value_t* self) nothrow get_function_handler;

    ///
    /// Execute the function using the current V8 context. This function should
    /// only be called from within the scope of a cef_v8handler_t or
    /// cef_v8accessor_t callback, or in combination with calling enter() and
    /// exit() on a stored cef_v8context_t reference. |object| is the receiver
    /// ('this' object) of the function. If |object| is NULL the current context's
    /// global object will be used. |arguments| is the list of arguments that will
    /// be passed to the function. Returns the function return value on success.
    /// Returns NULL if this function is called incorrectly or an exception is
    /// thrown.
    ///
    extern(System) cef_v8value_t* function (
        cef_v8value_t* self,
        cef_v8value_t* object,
        size_t argumentsCount,
        cef_v8value_t** arguments) nothrow execute_function;

    ///
    /// Execute the function using the specified V8 context. |object| is the
    /// receiver ('this' object) of the function. If |object| is NULL the
    /// specified context's global object will be used. |arguments| is the list of
    /// arguments that will be passed to the function. Returns the function return
    /// value on success. Returns NULL if this function is called incorrectly or
    /// an exception is thrown.
    ///
    extern(System) cef_v8value_t* function (
        cef_v8value_t* self,
        cef_v8context_t* context,
        cef_v8value_t* object,
        size_t argumentsCount,
        cef_v8value_t** arguments) nothrow execute_function_with_context;

    ///
    /// Resolve the Promise using the current V8 context. This function should
    /// only be called from within the scope of a cef_v8handler_t or
    /// cef_v8accessor_t callback, or in combination with calling enter() and
    /// exit() on a stored cef_v8context_t reference. |arg| is the argument passed
    /// to the resolved promise. Returns true (1) on success. Returns false (0) if
    /// this function is called incorrectly or an exception is thrown.
    ///
    extern(System) int function (cef_v8value_t* self, cef_v8value_t* arg) nothrow resolve_promise;

    ///
    /// Reject the Promise using the current V8 context. This function should only
    /// be called from within the scope of a cef_v8handler_t or cef_v8accessor_t
    /// callback, or in combination with calling enter() and exit() on a stored
    /// cef_v8context_t reference. Returns true (1) on success. Returns false (0)
    /// if this function is called incorrectly or an exception is thrown.
    ///
    extern(System) int function (
        cef_v8value_t* self,
        const(cef_string_t)* errorMsg) nothrow reject_promise;
}



///
/// Create a new cef_v8value_t object of type undefined.
///
cef_v8value_t* cef_v8value_create_undefined ();

///
/// Create a new cef_v8value_t object of type null.
///
cef_v8value_t* cef_v8value_create_null ();

///
/// Create a new cef_v8value_t object of type bool.
///
cef_v8value_t* cef_v8value_create_bool (int value);

///
/// Create a new cef_v8value_t object of type int.
///
cef_v8value_t* cef_v8value_create_int (int value);

///
/// Create a new cef_v8value_t object of type unsigned int.
///
cef_v8value_t* cef_v8value_create_uint (uint value);

///
/// Create a new cef_v8value_t object of type double.
///
cef_v8value_t* cef_v8value_create_double (double value);

///
/// Create a new cef_v8value_t object of type Date. This function should only be
/// called from within the scope of a cef_render_process_handler_t,
/// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
/// enter() and exit() on a stored cef_v8context_t reference.
///
cef_v8value_t* cef_v8value_create_date (cef_basetime_t date);

///
/// Create a new cef_v8value_t object of type string.
///
cef_v8value_t* cef_v8value_create_string (const(cef_string_t)* value);

///
/// Create a new cef_v8value_t object of type object with optional accessor
/// and/or interceptor. This function should only be called from within the
/// scope of a cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t
/// callback, or in combination with calling enter() and exit() on a stored
/// cef_v8context_t reference.
///
cef_v8value_t* cef_v8value_create_object (
    cef_v8accessor_t* accessor,
    cef_v8interceptor_t* interceptor);

///
/// Create a new cef_v8value_t object of type array with the specified |length|.
/// If |length| is negative the returned array will have length 0. This function
/// should only be called from within the scope of a
/// cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback,
/// or in combination with calling enter() and exit() on a stored
/// cef_v8context_t reference.
///
cef_v8value_t* cef_v8value_create_array (int length);

///
/// Create a new cef_v8value_t object of type ArrayBuffer which wraps the
/// provided |buffer| of size |length| bytes. The ArrayBuffer is externalized,
/// meaning that it does not own |buffer|. The caller is responsible for freeing
/// |buffer| when requested via a call to
/// cef_v8array_buffer_release_callback_t::ReleaseBuffer. This function should
/// only be called from within the scope of a cef_render_process_handler_t,
/// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
/// enter() and exit() on a stored cef_v8context_t reference.
///
cef_v8value_t* cef_v8value_create_array_buffer (
    void* buffer,
    size_t length,
    cef_v8array_buffer_release_callback_t* release_callback);

///
/// Create a new cef_v8value_t object of type function. This function should
/// only be called from within the scope of a cef_render_process_handler_t,
/// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
/// enter() and exit() on a stored cef_v8context_t reference.
///
extern(System) cef_v8value_t* cef_v8value_create_function (
    const(cef_string_t)* name,
    cef_v8handler_t* handler) nothrow;

///
/// Create a new cef_v8value_t object of type Promise. This function should only
/// be called from within the scope of a cef_render_process_handler_t,
/// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
/// enter() and exit() on a stored cef_v8context_t reference.
///
cef_v8value_t* cef_v8value_create_promise ();

///
/// Structure representing a V8 stack trace handle. V8 handles can only be
/// accessed from the thread on which they are created. Valid threads for
/// creating a V8 handle include the render process main thread (TID_RENDERER)
/// and WebWorker threads. A task runner for posting tasks on the associated
/// thread can be retrieved via the cef_v8context_t::get_task_runner() function.
///
struct cef_v8stack_trace_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if the underlying handle is valid and it can be accessed
    /// on the current thread. Do not call any other functions if this function
    /// returns false (0).
    ///
    extern(System) int function (cef_v8stack_trace_t* self) nothrow is_valid;

    ///
    /// Returns the number of stack frames.
    ///
    extern(System) int function (cef_v8stack_trace_t* self) nothrow get_frame_count;

    ///
    /// Returns the stack frame at the specified 0-based index.
    ///
    extern(System) cef_v8stack_frame_t* function (
        cef_v8stack_trace_t* self,
        int index) nothrow get_frame;
}



///
/// Returns the stack trace for the currently active context. |frame_limit| is
/// the maximum number of frames that will be captured.
///
cef_v8stack_trace_t* cef_v8stack_trace_get_current (int frame_limit);

///
/// Structure representing a V8 stack frame handle. V8 handles can only be
/// accessed from the thread on which they are created. Valid threads for
/// creating a V8 handle include the render process main thread (TID_RENDERER)
/// and WebWorker threads. A task runner for posting tasks on the associated
/// thread can be retrieved via the cef_v8context_t::get_task_runner() function.
///
struct cef_v8stack_frame_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if the underlying handle is valid and it can be accessed
    /// on the current thread. Do not call any other functions if this function
    /// returns false (0).
    ///
    extern(System) int function (cef_v8stack_frame_t* self) nothrow is_valid;

    ///
    /// Returns the name of the resource script that contains the function.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_v8stack_frame_t* self) nothrow get_script_name;

    ///
    /// Returns the name of the resource script that contains the function or the
    /// sourceURL value if the script name is undefined and its source ends with a
    /// "//@ sourceURL=..." string.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_v8stack_frame_t* self) nothrow get_script_name_or_source_url;

    ///
    /// Returns the name of the function.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_v8stack_frame_t* self) nothrow get_function_name;

    ///
    /// Returns the 1-based line number for the function call or 0 if unknown.
    ///
    extern(System) int function (cef_v8stack_frame_t* self) nothrow get_line_number;

    ///
    /// Returns the 1-based column offset on the line for the function call or 0
    /// if unknown.
    ///
    extern(System) int function (cef_v8stack_frame_t* self) nothrow get_column;

    ///
    /// Returns true (1) if the function was compiled using eval().
    ///
    extern(System) int function (cef_v8stack_frame_t* self) nothrow is_eval;

    ///
    /// Returns true (1) if the function was called as a constructor via "new".
    ///
    extern(System) int function (cef_v8stack_frame_t* self) nothrow is_constructor;
}



///
/// Register a new V8 extension with the specified JavaScript extension code and
/// handler. Functions implemented by the handler are prototyped using the
/// keyword 'native'. The calling of a native function is restricted to the
/// scope in which the prototype of the native function is defined. This
/// function may only be called on the render process main thread.
///
/// Example JavaScript extension code: <pre>
///   // create the 'example' global object if it doesn't already exist.
///   if (!example)
///     example = {};
///   // create the 'example.test' global object if it doesn't already exist.
///   if (!example.test)
///     example.test = {};
///   (function() {
///     // Define the function 'example.test.myfunction'.
///     example.test.myfunction = function() {
///       // Call CefV8Handler::Execute() with the function name 'MyFunction'
///       // and no arguments.
///       native function MyFunction();
///       return MyFunction();
///     };
///     // Define the getter function for parameter 'example.test.myparam'.
///     example.test.__defineGetter__('myparam', function() {
///       // Call CefV8Handler::Execute() with the function name 'GetMyParam'
///       // and no arguments.
///       native function GetMyParam();
///       return GetMyParam();
///     });
///     // Define the setter function for parameter 'example.test.myparam'.
///     example.test.__defineSetter__('myparam', function(b) {
///       // Call CefV8Handler::Execute() with the function name 'SetMyParam'
///       // and a single argument.
///       native function SetMyParam();
///       if(b) SetMyParam(b);
///     });
///
///     // Extension definitions can also contain normal JavaScript variables
///     // and functions.
///     var myint = 0;
///     example.test.increment = function() {
///       myint += 1;
///       return myint;
///     };
///   })();
/// </pre>
///
/// Example usage in the page: <pre>
///   // Call the function.
///   example.test.myfunction();
///   // Set the parameter.
///   example.test.myparam = value;
///   // Get the parameter.
///   value = example.test.myparam;
///   // Call another function.
///   example.test.increment();
/// </pre>
///
int cef_register_extension (
    const(cef_string_t)* extension_name,
    const(cef_string_t)* javascript_code,
    cef_v8handler_t* handler);

// CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f1ac6a6d5605078a38b7fa7e898619623eca6d51$
//

extern (C):

///
/// Structure that wraps other data value types. Complex types (binary,
/// dictionary and list) will be referenced but not owned by this object. Can be
/// used on any process and thread.
///
struct cef_value_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns true (1) if the underlying data is valid. This will always be true
    /// (1) for simple types. For complex types (binary, dictionary and list) the
    /// underlying data may become invalid if owned by another object (e.g. list
    /// or dictionary) and that other object is then modified or destroyed. This
    /// value object can be re-used by calling Set*() even if the underlying data
    /// is invalid.
    ///

    ///
    /// Returns true (1) if the underlying data is owned by another object.

    cef_base_ref_counted_t base;
    extern(System) int function (cef_value_t* self) nothrow is_valid;
    ///
    extern(System) int function (cef_value_t* self) nothrow is_owned;

    ///
    /// Returns true (1) if the underlying data is read-only. Some APIs may expose
    /// read-only objects.
    ///
    extern(System) int function (cef_value_t* self) nothrow is_read_only;

    ///
    /// Returns true (1) if this object and |that| object have the same underlying
    /// data. If true (1) modifications to this object will also affect |that|
    /// object and vice-versa.
    ///
    extern(System) int function (cef_value_t* self, cef_value_t* that) nothrow is_same;

    ///
    /// Returns true (1) if this object and |that| object have an equivalent
    /// underlying value but are not necessarily the same object.
    ///
    extern(System) int function (cef_value_t* self, cef_value_t* that) nothrow is_equal;

    ///
    /// Returns a copy of this object. The underlying data will also be copied.
    ///
    extern(System) cef_value_t* function (cef_value_t* self) nothrow copy;

    ///
    /// Returns the underlying value type.
    ///
    extern(System) cef_value_type_t function (cef_value_t* self) nothrow get_type;

    ///
    /// Returns the underlying value as type bool.
    ///
    extern(System) int function (cef_value_t* self) nothrow get_bool;

    ///
    /// Returns the underlying value as type int.
    ///
    extern(System) int function (cef_value_t* self) nothrow get_int;

    ///
    /// Returns the underlying value as type double.
    ///
    extern(System) double function (cef_value_t* self) nothrow get_double;

    ///
    /// Returns the underlying value as type string.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_value_t* self) nothrow get_string;

    ///
    /// Returns the underlying value as type binary. The returned reference may
    /// become invalid if the value is owned by another object or if ownership is
    /// transferred to another object in the future. To maintain a reference to
    /// the value after assigning ownership to a dictionary or list pass this
    /// object to the set_value() function instead of passing the returned
    /// reference to set_binary().
    ///
    extern(System) cef_binary_value_t* function (cef_value_t* self) nothrow get_binary;

    ///
    /// Returns the underlying value as type dictionary. The returned reference
    /// may become invalid if the value is owned by another object or if ownership
    /// is transferred to another object in the future. To maintain a reference to
    /// the value after assigning ownership to a dictionary or list pass this
    /// object to the set_value() function instead of passing the returned
    /// reference to set_dictionary().
    ///
    extern(System) cef_dictionary_value_t* function (cef_value_t* self) nothrow get_dictionary;

    ///
    /// Returns the underlying value as type list. The returned reference may
    /// become invalid if the value is owned by another object or if ownership is
    /// transferred to another object in the future. To maintain a reference to
    /// the value after assigning ownership to a dictionary or list pass this
    /// object to the set_value() function instead of passing the returned
    /// reference to set_list().
    ///
    extern(System) cef_list_value_t* function (cef_value_t* self) nothrow get_list;

    ///
    /// Sets the underlying value as type null. Returns true (1) if the value was
    /// set successfully.
    ///
    extern(System) int function (cef_value_t* self) nothrow set_null;

    ///
    /// Sets the underlying value as type bool. Returns true (1) if the value was
    /// set successfully.
    ///
    extern(System) int function (cef_value_t* self, int value) nothrow set_bool;

    ///
    /// Sets the underlying value as type int. Returns true (1) if the value was
    /// set successfully.
    ///
    extern(System) int function (cef_value_t* self, int value) nothrow set_int;

    ///
    /// Sets the underlying value as type double. Returns true (1) if the value
    /// was set successfully.
    ///
    extern(System) int function (cef_value_t* self, double value) nothrow set_double;

    ///
    /// Sets the underlying value as type string. Returns true (1) if the value
    /// was set successfully.
    ///
    extern(System) int function (cef_value_t* self, const(cef_string_t)* value) nothrow set_string;

    ///
    /// Sets the underlying value as type binary. Returns true (1) if the value
    /// was set successfully. This object keeps a reference to |value| and
    /// ownership of the underlying data remains unchanged.
    ///
    extern(System) int function (cef_value_t* self, cef_binary_value_t* value) nothrow set_binary;

    ///
    /// Sets the underlying value as type dict. Returns true (1) if the value was
    /// set successfully. This object keeps a reference to |value| and ownership
    /// of the underlying data remains unchanged.
    ///
    extern(System) int function (
        cef_value_t* self,
        cef_dictionary_value_t* value) nothrow set_dictionary;

    ///
    /// Sets the underlying value as type list. Returns true (1) if the value was
    /// set successfully. This object keeps a reference to |value| and ownership
    /// of the underlying data remains unchanged.
    ///
    extern(System) int function (cef_value_t* self, cef_list_value_t* value) nothrow set_list;
}



///
/// Creates a new object.
///
cef_value_t* cef_value_create ();

///
/// Structure representing a binary value. Can be used on any process and
/// thread.
///
struct cef_binary_value_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if this object is valid. This object may become invalid
    /// if the underlying data is owned by another object (e.g. list or
    /// dictionary) and that other object is then modified or destroyed. Do not
    /// call any other functions if this function returns false (0).
    ///
    extern(System) int function (cef_binary_value_t* self) nothrow is_valid;

    ///
    /// Returns true (1) if this object is currently owned by another object.
    ///
    extern(System) int function (cef_binary_value_t* self) nothrow is_owned;

    ///
    /// Returns true (1) if this object and |that| object have the same underlying
    /// data.
    ///
    extern(System) int function (
        cef_binary_value_t* self,
        cef_binary_value_t* that) nothrow is_same;

    ///
    /// Returns true (1) if this object and |that| object have an equivalent
    /// underlying value but are not necessarily the same object.
    ///
    extern(System) int function (
        cef_binary_value_t* self,
        cef_binary_value_t* that) nothrow is_equal;

    ///
    /// Returns a copy of this object. The data in this object will also be
    /// copied.
    ///
    extern(System) cef_binary_value_t* function (cef_binary_value_t* self) nothrow copy;

    ///
    /// Returns a pointer to the beginning of the memory block. The returned
    /// pointer is valid as long as the cef_binary_value_t is alive.
    ///
    extern(System) const(void)* function (cef_binary_value_t* self) nothrow get_raw_data;

    ///
    /// Returns the data size.
    ///
    extern(System) size_t function (cef_binary_value_t* self) nothrow get_size;

    ///
    /// Read up to |buffer_size| number of bytes into |buffer|. Reading begins at
    /// the specified byte |data_offset|. Returns the number of bytes read.
    ///
    extern(System) size_t function (
        cef_binary_value_t* self,
        void* buffer,
        size_t buffer_size,
        size_t data_offset) nothrow get_data;
}



///
/// Creates a new object that is not owned by any other object. The specified
/// |data| will be copied.
///
cef_binary_value_t* cef_binary_value_create (
    const(void)* data,
    size_t data_size);

///
/// Structure representing a dictionary value. Can be used on any process and
/// thread.
///
struct cef_dictionary_value_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if this object is valid. This object may become invalid
    /// if the underlying data is owned by another object (e.g. list or
    /// dictionary) and that other object is then modified or destroyed. Do not
    /// call any other functions if this function returns false (0).
    ///
    extern(System) int function (cef_dictionary_value_t* self) nothrow is_valid;

    ///
    /// Returns true (1) if this object is currently owned by another object.
    ///
    extern(System) int function (cef_dictionary_value_t* self) nothrow is_owned;

    ///
    /// Returns true (1) if the values of this object are read-only. Some APIs may
    /// expose read-only objects.
    ///
    extern(System) int function (cef_dictionary_value_t* self) nothrow is_read_only;

    ///
    /// Returns true (1) if this object and |that| object have the same underlying
    /// data. If true (1) modifications to this object will also affect |that|
    /// object and vice-versa.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        cef_dictionary_value_t* that) nothrow is_same;

    ///
    /// Returns true (1) if this object and |that| object have an equivalent
    /// underlying value but are not necessarily the same object.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        cef_dictionary_value_t* that) nothrow is_equal;

    ///
    /// Returns a writable copy of this object. If |exclude_NULL_children| is true
    /// (1) any NULL dictionaries or lists will be excluded from the copy.
    ///
    extern(System) cef_dictionary_value_t* function (
        cef_dictionary_value_t* self,
        int exclude_empty_children) nothrow copy;

    ///
    /// Returns the number of values.
    ///
    extern(System) size_t function (cef_dictionary_value_t* self) nothrow get_size;

    ///
    /// Removes all values. Returns true (1) on success.
    ///
    extern(System) int function (cef_dictionary_value_t* self) nothrow clear;

    ///
    /// Returns true (1) if the current dictionary has a value for the given key.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow has_key;

    ///
    /// Reads all keys for this dictionary into the specified vector.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        cef_string_list_t keys) nothrow get_keys;

    ///
    /// Removes the value at the specified key. Returns true (1) is the value was
    /// removed successfully.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow remove;

    ///
    /// Returns the value type for the specified key.
    ///
    extern(System) cef_value_type_t function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_type;

    ///
    /// Returns the value at the specified key. For simple types the returned
    /// value will copy existing data and modifications to the value will not
    /// modify this object. For complex types (binary, dictionary and list) the
    /// returned value will reference existing data and modifications to the value
    /// will modify this object.
    ///
    extern(System) cef_value_t* function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_value;

    ///
    /// Returns the value at the specified key as type bool.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_bool;

    ///
    /// Returns the value at the specified key as type int.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_int;

    ///
    /// Returns the value at the specified key as type double.
    ///
    extern(System) double function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_double;

    ///
    /// Returns the value at the specified key as type string.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_string;

    ///
    /// Returns the value at the specified key as type binary. The returned value
    /// will reference existing data.
    ///
    extern(System) cef_binary_value_t* function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_binary;

    ///
    /// Returns the value at the specified key as type dictionary. The returned
    /// value will reference existing data and modifications to the value will
    /// modify this object.
    ///
    extern(System) cef_dictionary_value_t* function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_dictionary;

    ///
    /// Returns the value at the specified key as type list. The returned value
    /// will reference existing data and modifications to the value will modify
    /// this object.
    ///
    extern(System) cef_list_value_t* function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow get_list;

    ///
    /// Sets the value at the specified key. Returns true (1) if the value was set
    /// successfully. If |value| represents simple data then the underlying data
    /// will be copied and modifications to |value| will not modify this object.
    /// If |value| represents complex data (binary, dictionary or list) then the
    /// underlying data will be referenced and modifications to |value| will
    /// modify this object.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        cef_value_t* value) nothrow set_value;

    ///
    /// Sets the value at the specified key as type null. Returns true (1) if the
    /// value was set successfully.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key) nothrow set_null;

    ///
    /// Sets the value at the specified key as type bool. Returns true (1) if the
    /// value was set successfully.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        int value) nothrow set_bool;

    ///
    /// Sets the value at the specified key as type int. Returns true (1) if the
    /// value was set successfully.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        int value) nothrow set_int;

    ///
    /// Sets the value at the specified key as type double. Returns true (1) if
    /// the value was set successfully.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        double value) nothrow set_double;

    ///
    /// Sets the value at the specified key as type string. Returns true (1) if
    /// the value was set successfully.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        const(cef_string_t)* value) nothrow set_string;

    ///
    /// Sets the value at the specified key as type binary. Returns true (1) if
    /// the value was set successfully. If |value| is currently owned by another
    /// object then the value will be copied and the |value| reference will not
    /// change. Otherwise, ownership will be transferred to this object and the
    /// |value| reference will be invalidated.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        cef_binary_value_t* value) nothrow set_binary;

    ///
    /// Sets the value at the specified key as type dict. Returns true (1) if the
    /// value was set successfully. If |value| is currently owned by another
    /// object then the value will be copied and the |value| reference will not
    /// change. Otherwise, ownership will be transferred to this object and the
    /// |value| reference will be invalidated.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        cef_dictionary_value_t* value) nothrow set_dictionary;

    ///
    /// Sets the value at the specified key as type list. Returns true (1) if the
    /// value was set successfully. If |value| is currently owned by another
    /// object then the value will be copied and the |value| reference will not
    /// change. Otherwise, ownership will be transferred to this object and the
    /// |value| reference will be invalidated.
    ///
    extern(System) int function (
        cef_dictionary_value_t* self,
        const(cef_string_t)* key,
        cef_list_value_t* value) nothrow set_list;
}



///
/// Creates a new object that is not owned by any other object.
///
cef_dictionary_value_t* cef_dictionary_value_create ();

///
/// Structure representing a list value. Can be used on any process and thread.
///
struct cef_list_value_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns true (1) if this object is valid. This object may become invalid
    /// if the underlying data is owned by another object (e.g. list or
    /// dictionary) and that other object is then modified or destroyed. Do not
    /// call any other functions if this function returns false (0).
    ///
    extern(System) int function (cef_list_value_t* self) nothrow is_valid;

    ///
    /// Returns true (1) if this object is currently owned by another object.
    ///
    extern(System) int function (cef_list_value_t* self) nothrow is_owned;

    ///
    /// Returns true (1) if the values of this object are read-only. Some APIs may
    /// expose read-only objects.
    ///
    extern(System) int function (cef_list_value_t* self) nothrow is_read_only;

    ///
    /// Returns true (1) if this object and |that| object have the same underlying
    /// data. If true (1) modifications to this object will also affect |that|
    /// object and vice-versa.
    ///
    extern(System) int function (cef_list_value_t* self, cef_list_value_t* that) nothrow is_same;

    ///
    /// Returns true (1) if this object and |that| object have an equivalent
    /// underlying value but are not necessarily the same object.
    ///
    extern(System) int function (cef_list_value_t* self, cef_list_value_t* that) nothrow is_equal;

    ///
    /// Returns a writable copy of this object.
    ///
    extern(System) cef_list_value_t* function (cef_list_value_t* self) nothrow copy;

    ///
    /// Sets the number of values. If the number of values is expanded all new
    /// value slots will default to type null. Returns true (1) on success.
    ///
    extern(System) int function (cef_list_value_t* self, size_t size) nothrow set_size;

    ///
    /// Returns the number of values.
    ///
    extern(System) size_t function (cef_list_value_t* self) nothrow get_size;

    ///
    /// Removes all values. Returns true (1) on success.
    ///
    extern(System) int function (cef_list_value_t* self) nothrow clear;

    ///
    /// Removes the value at the specified index.
    ///
    extern(System) int function (cef_list_value_t* self, size_t index) nothrow remove;

    ///
    /// Returns the value type at the specified index.
    ///
    extern(System) cef_value_type_t function (cef_list_value_t* self, size_t index) nothrow get_type;

    ///
    /// Returns the value at the specified index. For simple types the returned
    /// value will copy existing data and modifications to the value will not
    /// modify this object. For complex types (binary, dictionary and list) the
    /// returned value will reference existing data and modifications to the value
    /// will modify this object.
    ///
    extern(System) cef_value_t* function (cef_list_value_t* self, size_t index) nothrow get_value;

    ///
    /// Returns the value at the specified index as type bool.
    ///
    extern(System) int function (cef_list_value_t* self, size_t index) nothrow get_bool;

    ///
    /// Returns the value at the specified index as type int.
    ///
    extern(System) int function (cef_list_value_t* self, size_t index) nothrow get_int;

    ///
    /// Returns the value at the specified index as type double.
    ///
    extern(System) double function (cef_list_value_t* self, size_t index) nothrow get_double;

    ///
    /// Returns the value at the specified index as type string.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_list_value_t* self,
        size_t index) nothrow get_string;

    ///
    /// Returns the value at the specified index as type binary. The returned
    /// value will reference existing data.
    ///
    extern(System) cef_binary_value_t* function (
        cef_list_value_t* self,
        size_t index) nothrow get_binary;

    ///
    /// Returns the value at the specified index as type dictionary. The returned
    /// value will reference existing data and modifications to the value will
    /// modify this object.
    ///
    extern(System) cef_dictionary_value_t* function (
        cef_list_value_t* self,
        size_t index) nothrow get_dictionary;

    ///
    /// Returns the value at the specified index as type list. The returned value
    /// will reference existing data and modifications to the value will modify
    /// this object.
    ///
    extern(System) cef_list_value_t* function (
        cef_list_value_t* self,
        size_t index) nothrow get_list;

    ///
    /// Sets the value at the specified index. Returns true (1) if the value was
    /// set successfully. If |value| represents simple data then the underlying
    /// data will be copied and modifications to |value| will not modify this
    /// object. If |value| represents complex data (binary, dictionary or list)
    /// then the underlying data will be referenced and modifications to |value|
    /// will modify this object.
    ///
    extern(System) int function (
        cef_list_value_t* self,
        size_t index,
        cef_value_t* value) nothrow set_value;

    ///
    /// Sets the value at the specified index as type null. Returns true (1) if
    /// the value was set successfully.
    ///
    extern(System) int function (cef_list_value_t* self, size_t index) nothrow set_null;

    ///
    /// Sets the value at the specified index as type bool. Returns true (1) if
    /// the value was set successfully.
    ///
    extern(System) int function (cef_list_value_t* self, size_t index, int value) nothrow set_bool;

    ///
    /// Sets the value at the specified index as type int. Returns true (1) if the
    /// value was set successfully.
    ///
    extern(System) int function (cef_list_value_t* self, size_t index, int value) nothrow set_int;

    ///
    /// Sets the value at the specified index as type double. Returns true (1) if
    /// the value was set successfully.
    ///
    extern(System) int function (
        cef_list_value_t* self,
        size_t index,
        double value) nothrow set_double;

    ///
    /// Sets the value at the specified index as type string. Returns true (1) if
    /// the value was set successfully.
    ///
    extern(System) int function (
        cef_list_value_t* self,
        size_t index,
        const(cef_string_t)* value) nothrow set_string;

    ///
    /// Sets the value at the specified index as type binary. Returns true (1) if
    /// the value was set successfully. If |value| is currently owned by another
    /// object then the value will be copied and the |value| reference will not
    /// change. Otherwise, ownership will be transferred to this object and the
    /// |value| reference will be invalidated.
    ///
    extern(System) int function (
        cef_list_value_t* self,
        size_t index,
        cef_binary_value_t* value) nothrow set_binary;

    ///
    /// Sets the value at the specified index as type dict. Returns true (1) if
    /// the value was set successfully. If |value| is currently owned by another
    /// object then the value will be copied and the |value| reference will not
    /// change. Otherwise, ownership will be transferred to this object and the
    /// |value| reference will be invalidated.
    ///
    extern(System) int function (
        cef_list_value_t* self,
        size_t index,
        cef_dictionary_value_t* value) nothrow set_dictionary;

    ///
    /// Sets the value at the specified index as type list. Returns true (1) if
    /// the value was set successfully. If |value| is currently owned by another
    /// object then the value will be copied and the |value| reference will not
    /// change. Otherwise, ownership will be transferred to this object and the
    /// |value| reference will be invalidated.
    ///
    extern(System) int function (
        cef_list_value_t* self,
        size_t index,
        cef_list_value_t* value) nothrow set_list;
}



///
/// Creates a new object that is not owned by any other object.
///
cef_list_value_t* cef_list_value_create ();

// CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7dbd68a4517f8fc578a523d590d1ff7a8aa2a49a$
//

extern (C):

///
/// WaitableEvent is a thread synchronization tool that allows one thread to
/// wait for another thread to finish some work. This is equivalent to using a
/// Lock+ConditionVariable to protect a simple boolean value. However, using
/// WaitableEvent in conjunction with a Lock to wait for a more complex state
/// change (e.g., for an item to be added to a queue) is not recommended. In
/// that case consider using a ConditionVariable instead of a WaitableEvent. It
/// is safe to create and/or signal a WaitableEvent from any thread. Blocking on
/// a WaitableEvent by calling the *wait() functions is not allowed on the
/// browser process UI or IO threads.
///
struct cef_waitable_event_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Put the event in the un-signaled state.
    ///

    cef_base_ref_counted_t base;
    extern(System) void function (cef_waitable_event_t* self) nothrow reset;
    ///
    /// Put the event in the signaled state. This causes any thread blocked on
    /// Wait to be woken up.
    ///
    extern(System) void function (cef_waitable_event_t* self) nothrow signal;

    ///
    /// Returns true (1) if the event is in the signaled state, else false (0). If
    /// the event was created with |automatic_reset| set to true (1) then calling
    /// this function will also cause a reset.
    ///
    extern(System) int function (cef_waitable_event_t* self) nothrow is_signaled;

    ///
    /// Wait indefinitely for the event to be signaled. This function will not
    /// return until after the call to signal() has completed. This function
    /// cannot be called on the browser process UI or IO threads.
    ///
    extern(System) void function (cef_waitable_event_t* self) nothrow wait;

    ///
    /// Wait up to |max_ms| milliseconds for the event to be signaled. Returns
    /// true (1) if the event was signaled. A return value of false (0) does not
    /// necessarily mean that |max_ms| was exceeded. This function will not return
    /// until after the call to signal() has completed. This function cannot be
    /// called on the browser process UI or IO threads.
    ///
    extern(System) int function (cef_waitable_event_t* self, long max_ms) nothrow timed_wait;
}



///
/// Create a new waitable event. If |automatic_reset| is true (1) then the event
/// state is automatically reset to un-signaled after a single waiting thread
/// has been released; otherwise, the state remains signaled until reset() is
/// called manually. If |initially_signaled| is true (1) then the event will
/// start in the signaled state.
///
cef_waitable_event_t* cef_waitable_event_create (
    int automatic_reset,
    int initially_signaled);

// CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e20d330e3d1cd3ac5bcd3ce7ee09bc1025490f63$
//

extern (C):

///
/// Structure representing the issuer or subject field of an X.509 certificate.
///
struct cef_x509cert_principal_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Returns a name that can be used to represent the issuer. It tries in this
    /// order: Common Name (CN), Organization Name (O) and Organizational Unit
    /// Name (OU) and returns the first non-NULL one found.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    ///
    /// Returns the common name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().

    ///
    /// Returns the locality name.

    cef_base_ref_counted_t base;
    extern(System) cef_string_userfree_t function (
        cef_x509cert_principal_t* self) nothrow get_display_name;
    extern(System) cef_string_userfree_t function (
        cef_x509cert_principal_t* self) nothrow get_common_name; ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_x509cert_principal_t* self) nothrow get_locality_name;

    ///
    /// Returns the state or province name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_x509cert_principal_t* self) nothrow get_state_or_province_name;

    ///
    /// Returns the country name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_x509cert_principal_t* self) nothrow get_country_name;

    ///
    /// Retrieve the list of organization names.
    ///
    extern(System) void function (
        cef_x509cert_principal_t* self,
        cef_string_list_t names) nothrow get_organization_names;

    ///
    /// Retrieve the list of organization unit names.
    ///
    extern(System) void function (
        cef_x509cert_principal_t* self,
        cef_string_list_t names) nothrow get_organization_unit_names;
}



///
/// Structure representing a X.509 certificate.
///
struct cef_x509certificate_t
{
    ///
    /// Base structure.
    ///
    cef_base_ref_counted_t base;

    ///
    /// Returns the subject of the X.509 certificate. For HTTPS server
    /// certificates this represents the web server.  The common name of the
    /// subject should match the host name of the web server.
    ///
    extern(System) cef_x509cert_principal_t* function (
        cef_x509certificate_t* self) nothrow get_subject;

    ///
    /// Returns the issuer of the X.509 certificate.
    ///
    extern(System) cef_x509cert_principal_t* function (
        cef_x509certificate_t* self) nothrow get_issuer;

    ///
    /// Returns the DER encoded serial number for the X.509 certificate. The value
    /// possibly includes a leading 00 byte.
    ///
    extern(System) cef_binary_value_t* function (
        cef_x509certificate_t* self) nothrow get_serial_number;

    ///
    /// Returns the date before which the X.509 certificate is invalid.
    /// CefBaseTime.GetTimeT() will return 0 if no date was specified.
    ///
    extern(System) cef_basetime_t function (cef_x509certificate_t* self) nothrow get_valid_start;

    ///
    /// Returns the date after which the X.509 certificate is invalid.
    /// CefBaseTime.GetTimeT() will return 0 if no date was specified.
    ///
    extern(System) cef_basetime_t function (cef_x509certificate_t* self) nothrow get_valid_expiry;

    ///
    /// Returns the DER encoded data for the X.509 certificate.
    ///
    extern(System) cef_binary_value_t* function (
        cef_x509certificate_t* self) nothrow get_derencoded;

    ///
    /// Returns the PEM encoded data for the X.509 certificate.
    ///
    extern(System) cef_binary_value_t* function (
        cef_x509certificate_t* self) nothrow get_pemencoded;

    ///
    /// Returns the number of certificates in the issuer chain. If 0, the
    /// certificate is self-signed.
    ///
    extern(System) size_t function (cef_x509certificate_t* self) nothrow get_issuer_chain_size;

    ///
    /// Returns the DER encoded data for the certificate issuer chain. If we
    /// failed to encode a certificate in the chain it is still present in the
    /// array but is an NULL string.
    ///
    extern(System) void function (
        cef_x509certificate_t* self,
        size_t* chainCount,
        cef_binary_value_t** chain) nothrow get_derencoded_issuer_chain;

    ///
    /// Returns the PEM encoded data for the certificate issuer chain. If we
    /// failed to encode a certificate in the chain it is still present in the
    /// array but is an NULL string.
    ///
    extern(System) void function (
        cef_x509certificate_t* self,
        size_t* chainCount,
        cef_binary_value_t** chain) nothrow get_pemencoded_issuer_chain;
}



// CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=53c197aa80f55c9a1c9496de4a4d3598a9d7c735$
//

extern (C):

///
/// Structure that supports the reading of XML data via the libxml streaming
/// API. The functions of this structure should only be called on the thread
/// that creates the object.
///
struct cef_xml_reader_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Moves the cursor to the next node in the document. This function must be
    /// called at least once to set the current cursor position. Returns true (1)
    /// if the cursor position was set successfully.
    ///

    ///
    /// Close the document. This should be called directly to ensure that cleanup
    /// occurs on the correct thread.
    ///

    ///
    /// Returns true (1) if an error has been reported by the XML parser.
    ///

    cef_base_ref_counted_t base;
    extern(System) int function (cef_xml_reader_t* self) nothrow move_to_next_node;
    extern(System) int function (cef_xml_reader_t* self) nothrow close;
    extern(System) int function (cef_xml_reader_t* self) nothrow has_error;

    ///
    /// Returns the error string.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_error;

    ///
    /// Returns the node type.
    ///
    extern(System) cef_xml_node_type_t function (cef_xml_reader_t* self) nothrow get_type;

    ///
    /// Returns the node depth. Depth starts at 0 for the root node.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow get_depth;

    ///
    /// Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT-
    /// LocalPart for additional details.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_local_name;

    ///
    /// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for
    /// additional details.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_prefix;

    ///
    /// Returns the qualified name, equal to (Prefix:)LocalName. See
    /// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_xml_reader_t* self) nothrow get_qualified_name;

    ///
    /// Returns the URI defining the namespace associated with the node. See
    /// http://www.w3.org/TR/REC-xml-names/ for additional details.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_namespace_uri;

    ///
    /// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for
    /// additional details.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_base_uri;

    ///
    /// Returns the xml:lang scope within which the node resides. See
    /// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_xml_lang;

    ///
    /// Returns true (1) if the node represents an NULL element. "<a/>" is
    /// considered NULL but "<a></a>" is not.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow is_empty_element;

    ///
    /// Returns true (1) if the node has a text value.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow has_value;

    ///
    /// Returns the text value.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_value;

    ///
    /// Returns true (1) if the node has attributes.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow has_attributes;

    ///
    /// Returns the number of attributes.
    ///
    extern(System) size_t function (cef_xml_reader_t* self) nothrow get_attribute_count;

    ///
    /// Returns the value of the attribute at the specified 0-based index.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_xml_reader_t* self,
        int index) nothrow get_attribute_byindex;

    ///
    /// Returns the value of the attribute with the specified qualified name.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_xml_reader_t* self,
        const(cef_string_t)* qualifiedName) nothrow get_attribute_byqname;

    ///
    /// Returns the value of the attribute with the specified local name and
    /// namespace URI.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (
        cef_xml_reader_t* self,
        const(cef_string_t)* localName,
        const(cef_string_t)* namespaceURI) nothrow get_attribute_bylname;

    ///
    /// Returns an XML representation of the current node's children.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_inner_xml;

    ///
    /// Returns an XML representation of the current node including its children.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_outer_xml;

    ///
    /// Returns the line number for the current node.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow get_line_number;

    ///
    /// Moves the cursor to the attribute at the specified 0-based index. Returns
    /// true (1) if the cursor position was set successfully.
    ///
    extern(System) int function (
        cef_xml_reader_t* self,
        int index) nothrow move_to_attribute_byindex;

    ///
    /// Moves the cursor to the attribute with the specified qualified name.
    /// Returns true (1) if the cursor position was set successfully.
    ///
    extern(System) int function (
        cef_xml_reader_t* self,
        const(cef_string_t)* qualifiedName) nothrow move_to_attribute_byqname;

    ///
    /// Moves the cursor to the attribute with the specified local name and
    /// namespace URI. Returns true (1) if the cursor position was set
    /// successfully.
    ///
    extern(System) int function (
        cef_xml_reader_t* self,
        const(cef_string_t)* localName,
        const(cef_string_t)* namespaceURI) nothrow move_to_attribute_bylname;

    ///
    /// Moves the cursor to the first attribute in the current element. Returns
    /// true (1) if the cursor position was set successfully.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow move_to_first_attribute;

    ///
    /// Moves the cursor to the next attribute in the current element. Returns
    /// true (1) if the cursor position was set successfully.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow move_to_next_attribute;

    ///
    /// Moves the cursor back to the carrying element. Returns true (1) if the
    /// cursor position was set successfully.
    ///
    extern(System) int function (cef_xml_reader_t* self) nothrow move_to_carrying_element;
}



///
/// Create a new cef_xml_reader_t object. The returned object's functions can
/// only be called from the thread that created the object.
///
cef_xml_reader_t* cef_xml_reader_create (
    cef_stream_reader_t* stream,
    cef_xml_encoding_type_t encodingType,
    const(cef_string_t)* URI);

// CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=134a172de5a6674836b723af06baf792553bf9be$
//

extern (C):

///
/// Structure that supports the reading of zip archives via the zlib unzip API.
/// The functions of this structure should only be called on the thread that
/// creates the object.
///
struct cef_zip_reader_t
{
    ///
    /// Base structure.
    ///

    ///
    /// Moves the cursor to the first file in the archive. Returns true (1) if the
    /// cursor position was set successfully.
    ///

    ///
    /// Moves the cursor to the next file in the archive. Returns true (1) if the
    /// cursor position was set successfully.
    ///

    ///
    /// Moves the cursor to the specified file in the archive. If |caseSensitive|
    /// is true (1) then the search will be case sensitive. Returns true (1) if

    cef_base_ref_counted_t base;
    extern(System) int function (cef_zip_reader_t* self) nothrow move_to_first_file;
    extern(System) int function (cef_zip_reader_t* self) nothrow move_to_next_file;
    /// the cursor position was set successfully.
    ///
    extern(System) int function (
        cef_zip_reader_t* self,
        const(cef_string_t)* fileName,
        int caseSensitive) nothrow move_to_file;

    ///
    /// Closes the archive. This should be called directly to ensure that cleanup
    /// occurs on the correct thread.
    ///
    extern(System) int function (cef_zip_reader_t* self) nothrow close;

    ///
    /// Returns the name of the file.
    ///
    // The resulting string must be freed by calling cef_string_userfree_free().
    extern(System) cef_string_userfree_t function (cef_zip_reader_t* self) nothrow get_file_name;

    ///
    /// Returns the uncompressed size of the file.
    ///
    extern(System) long function (cef_zip_reader_t* self) nothrow get_file_size;

    ///
    /// Returns the last modified timestamp for the file.
    ///
    extern(System) cef_basetime_t function (cef_zip_reader_t* self) nothrow get_file_last_modified;

    ///
    /// Opens the file for reading of uncompressed data. A read password may
    /// optionally be specified.
    ///
    extern(System) int function (
        cef_zip_reader_t* self,
        const(cef_string_t)* password) nothrow open_file;

    ///
    /// Closes the file.
    ///
    extern(System) int function (cef_zip_reader_t* self) nothrow close_file;

    ///
    /// Read uncompressed file contents into the specified buffer. Returns < 0 if
    /// an error occurred, 0 if at the end of file, or the number of bytes read.
    ///
    extern(System) int function (
        cef_zip_reader_t* self,
        void* buffer,
        size_t bufferSize) nothrow read_file;

    ///
    /// Returns the current offset in the uncompressed file contents.
    ///
    extern(System) long function (cef_zip_reader_t* self) nothrow tell;

    ///
    /// Returns true (1) if at end of the file contents.
    ///
    extern(System) int function (cef_zip_reader_t* self) nothrow eof;
}



///
/// Create a new cef_zip_reader_t object. The returned object's functions can
/// only be called from the thread that created the object.
///
cef_zip_reader_t* cef_zip_reader_create (cef_stream_reader_t* stream);

// CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_
}

}


version(Windows) {

/+
	***** Webview2 Bindings *****

	TO UPDATE THIS:

	Get the new package from https://www.nuget.org/packages/Microsoft.Web.WebView2
	Note that is a .zip file so you can extract the WebView2.idl file by just treating it as such

	Use my idl2d fork (from ~/program/idl2d or dub) on it `./idl2d WebView2.idl` to make webview2.d.

	Just delete any `import sdk.*` lines. Comment out the lines that mention `DEFINE_ENUM_FLAG_OPERATORS` (there's like a dozen, it is some C macro that isn't translated and i don't think it is important).

	And paste it in the version(inline_webview2_bindings) block.
+/

alias EventRegistrationToken = long;
version=inline_webview2_bindings;

version(inline_webview2_bindings) {
public import core.sys.windows.windows;
public import core.sys.windows.unknwn;
public import core.sys.windows.oaidl;
public import core.sys.windows.objidl;


// Copyright (C) Microsoft Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

@("uuid(26d34152-879f-4065-bea2-3daa2cfadfb8), version(1.0)")
enum LibraryInfo;
version(all)
{ /+ library WebView2 +/

// Interface forward declarations

/+ interface ICoreWebView2AcceleratorKeyPressedEventArgs; +/
/+ interface ICoreWebView2AcceleratorKeyPressedEventArgs2; +/
/+ interface ICoreWebView2AcceleratorKeyPressedEventHandler; +/
/+ interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler; +/
/+ interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler; +/
/+ interface ICoreWebView2CapturePreviewCompletedHandler; +/
/+ interface ICoreWebView2; +/
/+ interface ICoreWebView2_2; +/
/+ interface ICoreWebView2_3; +/
/+ interface ICoreWebView2_4; +/
/+ interface ICoreWebView2_5; +/
/+ interface ICoreWebView2_6; +/
/+ interface ICoreWebView2_7; +/
/+ interface ICoreWebView2_8; +/
/+ interface ICoreWebView2_9; +/
/+ interface ICoreWebView2_10; +/
/+ interface ICoreWebView2_11; +/
/+ interface ICoreWebView2_12; +/
/+ interface ICoreWebView2_13; +/
/+ interface ICoreWebView2_14; +/
/+ interface ICoreWebView2_15; +/
/+ interface ICoreWebView2_16; +/
/+ interface ICoreWebView2_17; +/
/+ interface ICoreWebView2_18; +/
/+ interface ICoreWebView2_19; +/
/+ interface ICoreWebView2_20; +/
/+ interface ICoreWebView2BasicAuthenticationRequestedEventArgs; +/
/+ interface ICoreWebView2BasicAuthenticationRequestedEventHandler; +/
/+ interface ICoreWebView2BasicAuthenticationResponse; +/
/+ interface ICoreWebView2BrowserProcessExitedEventArgs; +/
/+ interface ICoreWebView2BrowserProcessExitedEventHandler; +/
/+ interface ICoreWebView2BytesReceivedChangedEventHandler; +/
/+ interface ICoreWebView2CompositionController; +/
/+ interface ICoreWebView2CompositionController2; +/
/+ interface ICoreWebView2CompositionController3; +/
/+ interface ICoreWebView2Controller; +/
/+ interface ICoreWebView2Controller2; +/
/+ interface ICoreWebView2Controller3; +/
/+ interface ICoreWebView2Controller4; +/
/+ interface ICoreWebView2ControllerOptions; +/
/+ interface ICoreWebView2ControllerOptions2; +/
/+ interface ICoreWebView2ContentLoadingEventArgs; +/
/+ interface ICoreWebView2ContentLoadingEventHandler; +/
/+ interface ICoreWebView2ContextMenuRequestedEventArgs; +/
/+ interface ICoreWebView2ContextMenuRequestedEventHandler; +/
/+ interface ICoreWebView2Cookie; +/
/+ interface ICoreWebView2CookieList; +/
/+ interface ICoreWebView2CookieManager; +/
/+ interface ICoreWebView2Certificate; +/
/+ interface ICoreWebView2ClientCertificate; +/
/+ interface ICoreWebView2StringCollection; +/
/+ interface ICoreWebView2ClearBrowsingDataCompletedHandler; +/
/+ interface ICoreWebView2ClientCertificateCollection; +/
/+ interface ICoreWebView2ClientCertificateRequestedEventArgs; +/
/+ interface ICoreWebView2ClientCertificateRequestedEventHandler; +/
/+ interface ICoreWebView2ContextMenuItem; +/
/+ interface ICoreWebView2ContextMenuItemCollection; +/
/+ interface ICoreWebView2ContextMenuRequestedEventArgs; +/
/+ interface ICoreWebView2ContextMenuRequestedEventHandler; +/
/+ interface ICoreWebView2ContextMenuTarget; +/
/+ interface ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler; +/
/+ interface ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler; +/
/+ interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; +/
/+ interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; +/
/+ interface ICoreWebView2ContainsFullScreenElementChangedEventHandler; +/
/+ interface ICoreWebView2CursorChangedEventHandler; +/
/+ interface ICoreWebView2CustomItemSelectedEventHandler; +/
/+ interface ICoreWebView2CustomSchemeRegistration; +/
/+ interface ICoreWebView2DocumentTitleChangedEventHandler; +/
/+ interface ICoreWebView2DOMContentLoadedEventArgs; +/
/+ interface ICoreWebView2DOMContentLoadedEventHandler; +/
/+ interface ICoreWebView2Deferral; +/
/+ interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs; +/
/+ interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs2; +/
/+ interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler; +/
/+ interface ICoreWebView2DevToolsProtocolEventReceiver; +/
/+ interface ICoreWebView2DownloadOperation; +/
/+ interface ICoreWebView2DownloadStartingEventArgs; +/
/+ interface ICoreWebView2DownloadStartingEventHandler; +/
/+ interface ICoreWebView2Environment; +/
/+ interface ICoreWebView2Environment2; +/
/+ interface ICoreWebView2Environment3; +/
/+ interface ICoreWebView2Environment4; +/
/+ interface ICoreWebView2Environment5; +/
/+ interface ICoreWebView2Environment6; +/
/+ interface ICoreWebView2Environment7; +/
/+ interface ICoreWebView2Environment8; +/
/+ interface ICoreWebView2Environment9; +/
/+ interface ICoreWebView2Environment10; +/
/+ interface ICoreWebView2Environment11; +/
/+ interface ICoreWebView2Environment12; +/
/+ interface ICoreWebView2Environment13; +/
/+ interface ICoreWebView2EnvironmentOptions; +/
/+ interface ICoreWebView2EnvironmentOptions2; +/
/+ interface ICoreWebView2EnvironmentOptions3; +/
/+ interface ICoreWebView2EnvironmentOptions4; +/
/+ interface ICoreWebView2EnvironmentOptions5; +/
/+ interface ICoreWebView2EnvironmentOptions6; +/
/+ interface ICoreWebView2EstimatedEndTimeChangedEventHandler; +/
/+ interface ICoreWebView2ExecuteScriptCompletedHandler; +/
/+ interface ICoreWebView2GetProcessExtendedInfosCompletedHandler; +/
/+ interface ICoreWebView2ProcessExtendedInfo; +/
/+ interface ICoreWebView2ProcessExtendedInfoCollection; +/
/+ interface ICoreWebView2Frame; +/
/+ interface ICoreWebView2Frame2; +/
/+ interface ICoreWebView2Frame3; +/
/+ interface ICoreWebView2Frame4; +/
/+ interface ICoreWebView2Frame5; +/
/+ interface ICoreWebView2FrameContentLoadingEventHandler; +/
/+ interface ICoreWebView2FrameCreatedEventArgs; +/
/+ interface ICoreWebView2FrameCreatedEventHandler; +/
/+ interface ICoreWebView2FrameDestroyedEventHandler; +/
/+ interface ICoreWebView2FrameDOMContentLoadedEventHandler; +/
/+ interface ICoreWebView2FrameNameChangedEventHandler; +/
/+ interface ICoreWebView2FrameNavigationCompletedEventHandler; +/
/+ interface ICoreWebView2FrameNavigationStartingEventHandler; +/
/+ interface ICoreWebView2FramePermissionRequestedEventHandler; +/
/+ interface ICoreWebView2FrameWebMessageReceivedEventHandler; +/
/+ interface ICoreWebView2FrameInfo; +/
/+ interface ICoreWebView2FrameInfo2; +/
/+ interface ICoreWebView2FrameInfoCollection; +/
/+ interface ICoreWebView2FrameInfoCollectionIterator; +/
/+ interface ICoreWebView2FocusChangedEventHandler; +/
/+ interface ICoreWebView2GetCookiesCompletedHandler; +/
/+ interface ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler; +/
/+ interface ICoreWebView2HistoryChangedEventHandler; +/
/+ interface ICoreWebView2HttpHeadersCollectionIterator; +/
/+ interface ICoreWebView2HttpRequestHeaders; +/
/+ interface ICoreWebView2HttpResponseHeaders; +/
/+ interface ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler; +/
/+ interface ICoreWebView2LaunchingExternalUriSchemeEventArgs; +/
/+ interface ICoreWebView2LaunchingExternalUriSchemeEventHandler; +/
/+ interface ICoreWebView2MoveFocusRequestedEventArgs; +/
/+ interface ICoreWebView2MoveFocusRequestedEventHandler; +/
/+ interface ICoreWebView2NavigationCompletedEventArgs; +/
/+ interface ICoreWebView2NavigationCompletedEventArgs2; +/
/+ interface ICoreWebView2NavigationCompletedEventHandler; +/
/+ interface ICoreWebView2NavigationStartingEventArgs; +/
/+ interface ICoreWebView2NavigationStartingEventArgs2; +/
/+ interface ICoreWebView2NavigationStartingEventArgs3; +/
/+ interface ICoreWebView2NavigationStartingEventHandler; +/
/+ interface ICoreWebView2NewBrowserVersionAvailableEventHandler; +/
/+ interface ICoreWebView2NewWindowRequestedEventArgs; +/
/+ interface ICoreWebView2NewWindowRequestedEventArgs2; +/
/+ interface ICoreWebView2NewWindowRequestedEventArgs3; +/
/+ interface ICoreWebView2NewWindowRequestedEventHandler; +/
/+ interface ICoreWebView2PermissionRequestedEventArgs; +/
/+ interface ICoreWebView2PermissionRequestedEventArgs2; +/
/+ interface ICoreWebView2PermissionRequestedEventArgs3; +/
/+ interface ICoreWebView2PermissionRequestedEventHandler; +/
/+ interface ICoreWebView2PermissionSettingCollectionView; +/
/+ interface ICoreWebView2PermissionSetting; +/
/+ interface ICoreWebView2PointerInfo; +/
/+ interface ICoreWebView2PrintSettings; +/
/+ interface ICoreWebView2PrintSettings2; +/
/+ interface ICoreWebView2PrintToPdfCompletedHandler; +/
/+ interface ICoreWebView2PrintCompletedHandler; +/
/+ interface ICoreWebView2PrintToPdfStreamCompletedHandler; +/
/+ interface ICoreWebView2ProcessFailedEventArgs; +/
/+ interface ICoreWebView2ProcessFailedEventArgs2; +/
/+ interface ICoreWebView2ProcessFailedEventHandler; +/
/+ interface ICoreWebView2Profile; +/
/+ interface ICoreWebView2Profile2; +/
/+ interface ICoreWebView2Profile3; +/
/+ interface ICoreWebView2Profile4; +/
/+ interface ICoreWebView2Profile5; +/
/+ interface ICoreWebView2Profile6; +/
/+ interface ICoreWebView2Profile7; +/
/+ interface ICoreWebView2Profile8; +/
/+ interface ICoreWebView2ProfileDeletedEventHandler; +/
/+ interface ICoreWebView2RasterizationScaleChangedEventHandler; +/
/+ interface ICoreWebView2ServerCertificateErrorDetectedEventArgs; +/
/+ interface ICoreWebView2ServerCertificateErrorDetectedEventHandler; +/
/+ interface ICoreWebView2SetPermissionStateCompletedHandler; +/
/+ interface ICoreWebView2ScriptDialogOpeningEventArgs; +/
/+ interface ICoreWebView2ScriptDialogOpeningEventHandler; +/
/+ interface ICoreWebView2Settings; +/
/+ interface ICoreWebView2Settings2; +/
/+ interface ICoreWebView2Settings3; +/
/+ interface ICoreWebView2Settings4; +/
/+ interface ICoreWebView2Settings5; +/
/+ interface ICoreWebView2Settings6; +/
/+ interface ICoreWebView2Settings7; +/
/+ interface ICoreWebView2Settings8; +/
/+ interface ICoreWebView2SharedBuffer; +/
/+ interface ICoreWebView2SourceChangedEventArgs; +/
/+ interface ICoreWebView2SourceChangedEventHandler; +/
/+ interface ICoreWebView2StateChangedEventHandler; +/
/+ interface ICoreWebView2StatusBarTextChangedEventHandler; +/
/+ interface ICoreWebView2TrySuspendCompletedHandler; +/
/+ interface ICoreWebView2WebMessageReceivedEventArgs; +/
/+ interface ICoreWebView2WebMessageReceivedEventHandler; +/
/+ interface ICoreWebView2WebResourceRequest; +/
/+ interface ICoreWebView2WebResourceRequestedEventArgs; +/
/+ interface ICoreWebView2WebResourceRequestedEventHandler; +/
/+ interface ICoreWebView2WebResourceResponse; +/
/+ interface ICoreWebView2WebResourceResponseReceivedEventHandler; +/
/+ interface ICoreWebView2WebResourceResponseReceivedEventArgs; +/
/+ interface ICoreWebView2WebResourceResponseView; +/
/+ interface ICoreWebView2WebResourceResponseViewGetContentCompletedHandler; +/
/+ interface ICoreWebView2WindowCloseRequestedEventHandler; +/
/+ interface ICoreWebView2WindowFeatures; +/
/+ interface ICoreWebView2ZoomFactorChangedEventHandler; +/
/+ interface ICoreWebView2IsMutedChangedEventHandler; +/
/+ interface ICoreWebView2IsDocumentPlayingAudioChangedEventHandler; +/
/+ interface ICoreWebView2ProcessInfo; +/
/+ interface ICoreWebView2ProcessInfoCollection; +/
/+ interface ICoreWebView2ProcessInfosChangedEventHandler; +/
/+ interface ICoreWebView2FaviconChangedEventHandler; +/
/+ interface ICoreWebView2GetFaviconCompletedHandler; +/
/+ interface ICoreWebView2ProfileAddBrowserExtensionCompletedHandler; +/
/+ interface ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler; +/
/+ interface ICoreWebView2BrowserExtensionList; +/
/+ interface ICoreWebView2BrowserExtension; +/
/+ interface ICoreWebView2BrowserExtensionEnableCompletedHandler; +/
/+ interface ICoreWebView2BrowserExtensionRemoveCompletedHandler; +/

// Enums and structs

/// Specifies the image format for the `ICoreWebView2::CapturePreview` method.

@("v1_enum")
enum /+ COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT+/
{

  /// Indicates that the PNG image format is used.

  COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_PNG,

  /// Indicates the JPEG image format is used.

  COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_JPEG,
}
alias int COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT;

/// Kind of cookie SameSite status used in the ICoreWebView2Cookie interface.
/// These fields match those as specified in https://developer.mozilla.org/docs/Web/HTTP/Cookies#.
/// Learn more about SameSite cookies here: https://tools.ietf.org/html/draft-west-first-party-cookies-07
@("v1_enum")
enum /+ COREWEBVIEW2_COOKIE_SAME_SITE_KIND+/
{
  /// None SameSite type. No restrictions on cross-site requests.
  COREWEBVIEW2_COOKIE_SAME_SITE_KIND_NONE,
  /// Lax SameSite type. The cookie will be sent with "same-site" requests, and with "cross-site" top level navigation.
  COREWEBVIEW2_COOKIE_SAME_SITE_KIND_LAX,
  /// Strict SameSite type. The cookie will only be sent along with "same-site" requests.
  COREWEBVIEW2_COOKIE_SAME_SITE_KIND_STRICT,
}
alias int COREWEBVIEW2_COOKIE_SAME_SITE_KIND;

/// Kind of cross origin resource access allowed for host resources during download.
/// Note that other normal access checks like same origin DOM access check and [Content
/// Security Policy](https://developer.mozilla.org/docs/Web/HTTP/CSP) still apply.
/// The following table illustrates the host resource cross origin access according to
/// access context and `COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND`.
///
/// Cross Origin Access Context | DENY | ALLOW | DENY_CORS
/// --- | --- | --- | ---
/// From DOM like src of img, script or iframe element| Deny | Allow | Allow
/// From Script like Fetch or XMLHttpRequest| Deny | Allow | Deny
@("v1_enum")
enum /+ COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND+/
{
  /// All cross origin resource access is denied, including normal sub resource access
  /// as src of a script or image element.
  COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY,

  /// All cross origin resource access is allowed, including accesses that are
  /// subject to Cross-Origin Resource Sharing(CORS) check. The behavior is similar to
  /// a web site sends back http header Access-Control-Allow-Origin: *.
  COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_ALLOW,

  /// Cross origin resource access is allowed for normal sub resource access like
  /// as src of a script or image element, while any access that subjects to CORS check
  /// will be denied.
  /// See [Cross-Origin Resource Sharing](https://developer.mozilla.org/docs/Web/HTTP/CORS)
  /// for more information.
  COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY_CORS,
}
alias int COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND;

/// Specifies the JavaScript dialog type used in the
/// `ICoreWebView2ScriptDialogOpeningEventHandler` interface.

@("v1_enum")
enum /+ COREWEBVIEW2_SCRIPT_DIALOG_KIND+/
{

  /// Indicates that the dialog uses the `window.alert` JavaScript function.

  COREWEBVIEW2_SCRIPT_DIALOG_KIND_ALERT,

  /// Indicates that the dialog uses the `window.confirm` JavaScript function.

  COREWEBVIEW2_SCRIPT_DIALOG_KIND_CONFIRM,

  /// Indicates that the dialog uses the `window.prompt` JavaScript function.

  COREWEBVIEW2_SCRIPT_DIALOG_KIND_PROMPT,

  /// Indicates that the dialog uses the `beforeunload` JavaScript event.

  COREWEBVIEW2_SCRIPT_DIALOG_KIND_BEFOREUNLOAD,
}
alias int COREWEBVIEW2_SCRIPT_DIALOG_KIND;

/// Specifies the process failure type used in the
/// `ICoreWebView2ProcessFailedEventArgs` interface. The values in this enum
/// make reference to the process kinds in the Chromium architecture. For more
/// information about what these processes are and what they do, see
/// [Browser Architecture - Inside look at modern web browser](https://developers.google.com/web/updates/2018/09/inside-browser-part1).

@("v1_enum")
enum /+ COREWEBVIEW2_PROCESS_FAILED_KIND+/
{

  /// Indicates that the browser process ended unexpectedly.  The WebView
  /// automatically moves to the Closed state.  The app has to recreate a new
  /// WebView to recover from this failure.

  COREWEBVIEW2_PROCESS_FAILED_KIND_BROWSER_PROCESS_EXITED,

  /// Indicates that the main frame's render process ended unexpectedly. Any
  /// subframes in the WebView will be gone too.  A new render process is
  /// created automatically and navigated to an error page. You can use the
  /// `Reload` method to try to recover from this failure. Alternatively, you
  /// can `Close` and recreate the WebView.

  COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED,

  /// Indicates that the main frame's render process is unresponsive. Renderer
  /// process unresponsiveness can happen for the following reasons:
  ///
  /// *   There is a **long-running script** being executed. For example, the
  /// web content in your WebView might be performing a synchronous XHR, or have
  /// entered an infinite loop.
  /// *   The **system is busy**.
  ///
  /// The `ProcessFailed` event will continue to be raised every few seconds
  /// until the renderer process has become responsive again. The application
  /// can consider taking action if the event keeps being raised. For example,
  /// the application might show UI for the user to decide to keep waiting or
  /// reload the page, or navigate away.

  COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE,

  /// Indicates that a frame-only render process ended unexpectedly. The process
  /// exit does not affect the top-level document, only a subset of the
  /// subframes within it. The content in these frames is replaced with an error
  /// page in the frame. Your application can communicate with the main frame to
  /// recover content in the impacted frames, using
  /// `ICoreWebView2ProcessFailedEventArgs2::FrameInfosForFailedProcess` to get
  /// information about the impacted frames.

  COREWEBVIEW2_PROCESS_FAILED_KIND_FRAME_RENDER_PROCESS_EXITED,

  /// Indicates that a utility process ended unexpectedly. The failed process
  /// is recreated automatically. Your application does **not** need to handle
  /// recovery for this event, but can use `ICoreWebView2ProcessFailedEventArgs`
  /// and `ICoreWebView2ProcessFailedEventArgs2` to collect information about
  /// the failure, including `ProcessDescription`.

  COREWEBVIEW2_PROCESS_FAILED_KIND_UTILITY_PROCESS_EXITED,

  /// Indicates that a sandbox helper process ended unexpectedly. This failure
  /// is not fatal. Your application does **not** need to handle recovery for
  /// this event, but can use `ICoreWebView2ProcessFailedEventArgs` and
  /// `ICoreWebView2ProcessFailedEventArgs2` to collect information about
  /// the failure.

  COREWEBVIEW2_PROCESS_FAILED_KIND_SANDBOX_HELPER_PROCESS_EXITED,

  /// Indicates that the GPU process ended unexpectedly. The failed process
  /// is recreated automatically. Your application does **not** need to handle
  /// recovery for this event, but can use `ICoreWebView2ProcessFailedEventArgs`
  /// and `ICoreWebView2ProcessFailedEventArgs2` to collect information about
  /// the failure.

  COREWEBVIEW2_PROCESS_FAILED_KIND_GPU_PROCESS_EXITED,

  /// Indicates that a PPAPI plugin process ended unexpectedly. This failure
  /// is not fatal. Your application does **not** need to handle recovery for
  /// this event, but can use `ICoreWebView2ProcessFailedEventArgs` and
  /// `ICoreWebView2ProcessFailedEventArgs2` to collect information about
  /// the failure, including `ProcessDescription`.

  COREWEBVIEW2_PROCESS_FAILED_KIND_PPAPI_PLUGIN_PROCESS_EXITED,

  /// Indicates that a PPAPI plugin broker process ended unexpectedly. This failure
  /// is not fatal. Your application does **not** need to handle recovery for
  /// this event, but can use `ICoreWebView2ProcessFailedEventArgs` and
  /// `ICoreWebView2ProcessFailedEventArgs2` to collect information about
  /// the failure.

  COREWEBVIEW2_PROCESS_FAILED_KIND_PPAPI_BROKER_PROCESS_EXITED,

  /// Indicates that a process of unspecified kind ended unexpectedly. Your
  /// application can use `ICoreWebView2ProcessFailedEventArgs` and
  /// `ICoreWebView2ProcessFailedEventArgs2` to collect information about
  /// the failure.

  COREWEBVIEW2_PROCESS_FAILED_KIND_UNKNOWN_PROCESS_EXITED,
}
alias int COREWEBVIEW2_PROCESS_FAILED_KIND;

/// Specifies the process failure reason used in the
/// `ICoreWebView2ProcessFailedEventArgs` interface. For process failures where
/// a process has exited, it indicates the type of issue that produced the
/// process exit.

@("v1_enum")
enum /+ COREWEBVIEW2_PROCESS_FAILED_REASON+/
{

  /// An unexpected process failure occurred.
  COREWEBVIEW2_PROCESS_FAILED_REASON_UNEXPECTED,

  /// The process became unresponsive.
  /// This only applies to the main frame's render process.

  COREWEBVIEW2_PROCESS_FAILED_REASON_UNRESPONSIVE,

  /// The process was terminated. For example, from Task Manager.

  COREWEBVIEW2_PROCESS_FAILED_REASON_TERMINATED,

  /// The process crashed. Most crashes will generate dumps in the location
  /// indicated by `ICoreWebView2Environment11::get_FailureReportFolderPath`.

  COREWEBVIEW2_PROCESS_FAILED_REASON_CRASHED,

  /// The process failed to launch.

  COREWEBVIEW2_PROCESS_FAILED_REASON_LAUNCH_FAILED,

  /// The process terminated due to running out of memory.

  COREWEBVIEW2_PROCESS_FAILED_REASON_OUT_OF_MEMORY,

  /// The process exited because its corresponding profile was deleted.
  COREWEBVIEW2_PROCESS_FAILED_REASON_PROFILE_DELETED,
}
alias int COREWEBVIEW2_PROCESS_FAILED_REASON;

/// Indicates the type of a permission request.

@("v1_enum")
enum /+ COREWEBVIEW2_PERMISSION_KIND+/
{

  /// Indicates an unknown permission.

  COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION,

  /// Indicates permission to capture audio.

  COREWEBVIEW2_PERMISSION_KIND_MICROPHONE,

  /// Indicates permission to capture video.

  COREWEBVIEW2_PERMISSION_KIND_CAMERA,

  /// Indicates permission to access geolocation.

  COREWEBVIEW2_PERMISSION_KIND_GEOLOCATION,

  /// Indicates permission to send web notifications. Apps that would like to
  /// show notifications should handle `PermissionRequested` events
  /// and no browser permission prompt will be shown for notification requests.
  /// Note that push notifications are currently unavailable in WebView2.

  COREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS,

  /// Indicates permission to access generic sensor.  Generic Sensor covering
  /// ambient-light-sensor, accelerometer, gyroscope, and magnetometer.

  COREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS,

  /// Indicates permission to read the system clipboard without a user gesture.

  COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ,

  /// Indicates permission to automatically download multiple files. Permission
  /// is requested when multiple downloads are triggered in quick succession.

  COREWEBVIEW2_PERMISSION_KIND_MULTIPLE_AUTOMATIC_DOWNLOADS,

  /// Indicates permission to read and write to files or folders on the device.
  /// Permission is requested when developers use the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)
  /// to show the file or folder picker to the end user, and then request
  /// "readwrite" permission for the user's selection.

  COREWEBVIEW2_PERMISSION_KIND_FILE_READ_WRITE,

  /// Indicates permission to play audio and video automatically on sites. This
  /// permission affects the autoplay attribute and play method of the audio and
  /// video HTML elements, and the start method of the Web Audio API. See the
  /// [Autoplay guide for media and Web Audio APIs](https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide) for details.

  COREWEBVIEW2_PERMISSION_KIND_AUTOPLAY,

  /// Indicates permission to use fonts on the device. Permission is requested
  /// when developers use the [Local Font Access API](https://wicg.github.io/local-font-access/)
  /// to query the system fonts available for styling web content.

  COREWEBVIEW2_PERMISSION_KIND_LOCAL_FONTS,

  /// Indicates permission to send and receive system exclusive messages to/from MIDI
  /// (Musical Instrument Digital Interface) devices. Permission is requested
  /// when developers use the [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API)
  /// to request access to system exclusive MIDI messages.
  COREWEBVIEW2_PERMISSION_KIND_MIDI_SYSTEM_EXCLUSIVE_MESSAGES,

  /// Indicates permission to open and place windows on the screen. Permission is
  /// requested when developers use the [Multi-Screen Window Placement API](https://www.w3.org/TR/window-placement/)
  /// to get screen details.
  COREWEBVIEW2_PERMISSION_KIND_WINDOW_MANAGEMENT,
}
alias int COREWEBVIEW2_PERMISSION_KIND;

/// Specifies the response to a permission request.

@("v1_enum")
enum /+ COREWEBVIEW2_PERMISSION_STATE+/
{

  /// Specifies that the default browser behavior is used, which normally
  /// prompt users for decision.

  COREWEBVIEW2_PERMISSION_STATE_DEFAULT,

  /// Specifies that the permission request is granted.

  COREWEBVIEW2_PERMISSION_STATE_ALLOW,

  /// Specifies that the permission request is denied.

  COREWEBVIEW2_PERMISSION_STATE_DENY,
}
alias int COREWEBVIEW2_PERMISSION_STATE;

/// Indicates the error status values for web navigations.

@("v1_enum")
enum /+ COREWEBVIEW2_WEB_ERROR_STATUS+/
{

  /// Indicates that an unknown error occurred.

  COREWEBVIEW2_WEB_ERROR_STATUS_UNKNOWN,

  /// Indicates that the SSL certificate common name does not match the web
  /// address.

  COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_COMMON_NAME_IS_INCORRECT,

  /// Indicates that the SSL certificate has expired.

  COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_EXPIRED,

  /// Indicates that the SSL client certificate contains errors.

  COREWEBVIEW2_WEB_ERROR_STATUS_CLIENT_CERTIFICATE_CONTAINS_ERRORS,

  /// Indicates that the SSL certificate has been revoked.

  COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_REVOKED,

  /// Indicates that the SSL certificate is not valid.  The certificate may not
  /// match the public key pins for the host name, the certificate is signed
  /// by an untrusted authority or using a weak sign algorithm, the certificate
  /// claimed DNS names violate name constraints, the certificate contains a
  /// weak key, the validity period of the certificate is too long, lack of
  /// revocation information or revocation mechanism, non-unique host name,
  /// lack of certificate transparency information, or the certificate is
  /// chained to a
  /// [legacy Symantec root](https://security.googleblog.com/2018/03/distrust-of-symantec-pki-immediate.html).

  COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_IS_INVALID,

  /// Indicates that the host is unreachable.

  COREWEBVIEW2_WEB_ERROR_STATUS_SERVER_UNREACHABLE,

  /// Indicates that the connection has timed out.

  COREWEBVIEW2_WEB_ERROR_STATUS_TIMEOUT,

  /// Indicates that the server returned an invalid or unrecognized response.

  COREWEBVIEW2_WEB_ERROR_STATUS_ERROR_HTTP_INVALID_SERVER_RESPONSE,

  /// Indicates that the connection was stopped.

  COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED,

  /// Indicates that the connection was reset.

  COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_RESET,

  /// Indicates that the Internet connection has been lost.

  COREWEBVIEW2_WEB_ERROR_STATUS_DISCONNECTED,

  /// Indicates that a connection to the destination was not established.

  COREWEBVIEW2_WEB_ERROR_STATUS_CANNOT_CONNECT,

  /// Indicates that the provided host name was not able to be resolved.

  COREWEBVIEW2_WEB_ERROR_STATUS_HOST_NAME_NOT_RESOLVED,

  /// Indicates that the operation was canceled. This status code is also used
  /// in the following cases:
  /// - When the app cancels a navigation via NavigationStarting event.
  /// - For original navigation if the app navigates the WebView2 in a rapid succession
  /// away after the load for original navigation commenced, but before it completed.

  COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED,

  /// Indicates that the request redirect failed.

  COREWEBVIEW2_WEB_ERROR_STATUS_REDIRECT_FAILED,

  /// Indicates that an unexpected error occurred.

  COREWEBVIEW2_WEB_ERROR_STATUS_UNEXPECTED_ERROR,

  /// Indicates that user is prompted with a login, waiting on user action.
  /// Initial navigation to a login site will always return this even if app provides
  /// credential using BasicAuthenticationRequested.
  /// HTTP response status code in this case is 401.
  /// See status code reference here: https://developer.mozilla.org/docs/Web/HTTP/Status.

  COREWEBVIEW2_WEB_ERROR_STATUS_VALID_AUTHENTICATION_CREDENTIALS_REQUIRED,

  /// Indicates that user lacks proper authentication credentials for a proxy server.
  /// HTTP response status code in this case is 407.
  /// See status code reference here: https://developer.mozilla.org/docs/Web/HTTP/Status.

  COREWEBVIEW2_WEB_ERROR_STATUS_VALID_PROXY_AUTHENTICATION_REQUIRED,
}
alias int COREWEBVIEW2_WEB_ERROR_STATUS;

/// Specifies the web resource request contexts.

@("v1_enum")
enum /+ COREWEBVIEW2_WEB_RESOURCE_CONTEXT+/
{

  /// Specifies all resources.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL,

  /// Specifies a document resource.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT,

  /// Specifies a CSS resource.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_STYLESHEET,

  /// Specifies an image resource.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE,

  /// Specifies another media resource such as a video.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MEDIA,

  /// Specifies a font resource.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FONT,

  /// Specifies a script resource.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SCRIPT,

  /// Specifies an XML HTTP request, Fetch and EventSource API communication.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST,

  /// Specifies a Fetch API communication.

  // Note that this isn't working. Fetch API requests are fired as a part
  // of COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FETCH,

  /// Specifies a TextTrack resource.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_TEXT_TRACK,

  /// Specifies an EventSource API communication.

  // Note that this isn't working. EventSource API requests are fired as a part
  // of COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_EVENT_SOURCE,

  /// Specifies a WebSocket API communication.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_WEBSOCKET,

  /// Specifies a Web App Manifest.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MANIFEST,

  /// Specifies a Signed HTTP Exchange.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SIGNED_EXCHANGE,

  /// Specifies a Ping request.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_PING,

  /// Specifies a CSP Violation Report.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_CSP_VIOLATION_REPORT,

  /// Specifies an other resource.

  COREWEBVIEW2_WEB_RESOURCE_CONTEXT_OTHER
}
alias int COREWEBVIEW2_WEB_RESOURCE_CONTEXT;

/// Specifies the reason for moving focus.

@("v1_enum")
enum /+ COREWEBVIEW2_MOVE_FOCUS_REASON+/
{

  /// Specifies that the code is setting focus into WebView.

  COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC,

  /// Specifies that the focus is moving due to Tab traversal forward.

  COREWEBVIEW2_MOVE_FOCUS_REASON_NEXT,

  /// Specifies that the focus is moving due to Tab traversal backward.

  COREWEBVIEW2_MOVE_FOCUS_REASON_PREVIOUS,
}
alias int COREWEBVIEW2_MOVE_FOCUS_REASON;

/// Specifies the key event type that triggered an `AcceleratorKeyPressed`
/// event.

@("v1_enum")
enum /+ COREWEBVIEW2_KEY_EVENT_KIND+/
{

  /// Specifies that the key event type corresponds to window message
  /// `WM_KEYDOWN`.

  COREWEBVIEW2_KEY_EVENT_KIND_KEY_DOWN,

  /// Specifies that the key event type corresponds to window message
  /// `WM_KEYUP`.

  COREWEBVIEW2_KEY_EVENT_KIND_KEY_UP,

  /// Specifies that the key event type corresponds to window message
  /// `WM_SYSKEYDOWN`.

  COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_DOWN,

  /// Specifies that the key event type corresponds to window message
  /// `WM_SYSKEYUP`.

  COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_UP,
}
alias int COREWEBVIEW2_KEY_EVENT_KIND;

/// Specifies the browser process exit type used in the
/// `ICoreWebView2BrowserProcessExitedEventArgs` interface.

@("v1_enum")
enum /+ COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND+/
{

  /// Indicates that the browser process ended normally.

  COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND_NORMAL,

  /// Indicates that the browser process ended unexpectedly.
  /// A `ProcessFailed` event will also be sent to listening WebViews from the
  /// `ICoreWebView2Environment` associated to the failed process.

  COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND_FAILED
}
alias int COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND;

/// Contains the information packed into the `LPARAM` sent to a Win32 key
/// event.  For more information about `WM_KEYDOWN`, navigate to
/// [WM_KEYDOWN message](/windows/win32/inputdev/wm-keydown).

struct COREWEBVIEW2_PHYSICAL_KEY_STATUS
{

  /// Specifies the repeat count for the current message.

  UINT32 RepeatCount;

  /// Specifies the scan code.

  UINT32 ScanCode;

  /// Indicates that the key is an extended key.

  BOOL IsExtendedKey;

  /// Indicates that a menu key is held down (context code).

  BOOL IsMenuKeyDown;

  /// Indicates that the key was held down.

  BOOL WasKeyDown;

  /// Indicates that the key was released.

  BOOL IsKeyReleased;
}

/// A value representing RGBA color (Red, Green, Blue, Alpha) for WebView2.
/// Each component takes a value from 0 to 255, with 0 being no intensity
/// and 255 being the highest intensity.

struct COREWEBVIEW2_COLOR
{

  /// Specifies the intensity of the Alpha ie. opacity value. 0 is transparent,
  /// 255 is opaque.

  BYTE A;

  /// Specifies the intensity of the Red color.

  BYTE R;

  /// Specifies the intensity of the Green color.

  BYTE G;

  /// Specifies the intensity of the Blue color.

  BYTE B;
}

/// Mouse event type used by SendMouseInput to convey the type of mouse event
/// being sent to WebView. The values of this enum align with the matching
/// WM_* window messages.

@("v1_enum")
enum /+ COREWEBVIEW2_MOUSE_EVENT_KIND+/
{

  /// Mouse horizontal wheel scroll event, WM_MOUSEHWHEEL.

  COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL = 0x020E,

  /// Left button double click mouse event, WM_LBUTTONDBLCLK.

  COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOUBLE_CLICK = 0x0203,

  /// Left button down mouse event, WM_LBUTTONDOWN.

  COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOWN = 0x0201,

  /// Left button up mouse event, WM_LBUTTONUP.

  COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_UP = 0x0202,

  /// Mouse leave event, WM_MOUSELEAVE.

  COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE = 0x02A3,

  /// Middle button double click mouse event, WM_MBUTTONDBLCLK.

  COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOUBLE_CLICK = 0x0209,

  /// Middle button down mouse event, WM_MBUTTONDOWN.

  COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOWN = 0x0207,

  /// Middle button up mouse event, WM_MBUTTONUP.

  COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_UP = 0x0208,

  /// Mouse move event, WM_MOUSEMOVE.

  COREWEBVIEW2_MOUSE_EVENT_KIND_MOVE = 0x0200,

  /// Right button double click mouse event, WM_RBUTTONDBLCLK.

  COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOUBLE_CLICK = 0x0206,

  /// Right button down mouse event, WM_RBUTTONDOWN.

  COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOWN = 0x0204,

  /// Right button up mouse event, WM_RBUTTONUP.

  COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_UP = 0x0205,

  /// Mouse wheel scroll event, WM_MOUSEWHEEL.

  COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL = 0x020A,

  /// First or second X button double click mouse event, WM_XBUTTONDBLCLK.

  COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOUBLE_CLICK = 0x020D,

  /// First or second X button down mouse event, WM_XBUTTONDOWN.

  COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOWN = 0x020B,

  /// First or second X button up mouse event, WM_XBUTTONUP.

  COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_UP = 0x020C,

  /// Mouse Right Button Down event over a nonclient area, WM_NCRBUTTONDOWN.

  COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_DOWN = 0x00A4,

  /// Mouse Right Button up event over a nonclient area, WM_NCRBUTTONUP.

  COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_UP = 0x00A5,
}
alias int COREWEBVIEW2_MOUSE_EVENT_KIND;

/// Mouse event virtual keys associated with a COREWEBVIEW2_MOUSE_EVENT_KIND for
/// SendMouseInput. These values can be combined into a bit flag if more than
/// one virtual key is pressed for the event. The values of this enum align
/// with the matching MK_* mouse keys.

@("v1_enum")
enum /+ COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS+/
{

  /// No additional keys pressed.

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_NONE     = 0x0,

  /// Left mouse button is down, MK_LBUTTON.

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_LEFT_BUTTON  = 0x0001,

  /// Right mouse button is down, MK_RBUTTON.

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_RIGHT_BUTTON  = 0x0002,

  /// SHIFT key is down, MK_SHIFT.

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_SHIFT    = 0x0004,

  /// CTRL key is down, MK_CONTROL.

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_CONTROL  = 0x0008,

  /// Middle mouse button is down, MK_MBUTTON.

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_MIDDLE_BUTTON  = 0x0010,

  /// First X button is down, MK_XBUTTON1

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON1 = 0x0020,

  /// Second X button is down, MK_XBUTTON2

  COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON2 = 0x0040,
}
alias int COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS;
// DEFINE_ENUM_FLAG_OPERATORS(COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS)

/// Pointer event type used by SendPointerInput to convey the type of pointer
/// event being sent to WebView. The values of this enum align with the
/// matching WM_POINTER* window messages.

@("v1_enum")
enum /+ COREWEBVIEW2_POINTER_EVENT_KIND+/
{

  /// Corresponds to WM_POINTERACTIVATE.

  COREWEBVIEW2_POINTER_EVENT_KIND_ACTIVATE = 0x024B,

  /// Corresponds to WM_POINTERDOWN.

  COREWEBVIEW2_POINTER_EVENT_KIND_DOWN = 0x0246,

  /// Corresponds to WM_POINTERENTER.

  COREWEBVIEW2_POINTER_EVENT_KIND_ENTER = 0x0249,

  /// Corresponds to WM_POINTERLEAVE.

  COREWEBVIEW2_POINTER_EVENT_KIND_LEAVE = 0x024A,

  /// Corresponds to WM_POINTERUP.

  COREWEBVIEW2_POINTER_EVENT_KIND_UP = 0x0247,

  /// Corresponds to WM_POINTERUPDATE.

  COREWEBVIEW2_POINTER_EVENT_KIND_UPDATE = 0x0245,
}
alias int COREWEBVIEW2_POINTER_EVENT_KIND;

/// Mode for how the Bounds property is interpreted in relation to the RasterizationScale property.
@("v1_enum")
enum /+ COREWEBVIEW2_BOUNDS_MODE+/
{

  /// Bounds property represents raw pixels. Physical size of Webview is not impacted by RasterizationScale.

  COREWEBVIEW2_BOUNDS_MODE_USE_RAW_PIXELS,

  /// Bounds property represents logical pixels and the RasterizationScale property is used to get the physical size of the WebView.

  COREWEBVIEW2_BOUNDS_MODE_USE_RASTERIZATION_SCALE,
}
alias int COREWEBVIEW2_BOUNDS_MODE;

/// Specifies the client certificate kind.
@("v1_enum") enum /+ COREWEBVIEW2_CLIENT_CERTIFICATE_KIND+/
{
  /// Specifies smart card certificate.
  COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_SMART_CARD,
  /// Specifies PIN certificate.
  COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_PIN,
  /// Specifies other certificate.
  COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_OTHER,
}
alias int COREWEBVIEW2_CLIENT_CERTIFICATE_KIND;

/// State of the download operation.
@("v1_enum")
enum /+ COREWEBVIEW2_DOWNLOAD_STATE+/
{
  /// The download is in progress.
  COREWEBVIEW2_DOWNLOAD_STATE_IN_PROGRESS,
  /// The connection with the file host was broken. The `InterruptReason` property
  /// can be accessed from `ICoreWebView2DownloadOperation`. See
  /// `COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON` for descriptions of kinds of
  /// interrupt reasons. Host can check whether an interrupted download can be
  /// resumed with the `CanResume` property on the `ICoreWebView2DownloadOperation`.
  /// Once resumed, a download is in the `COREWEBVIEW2_DOWNLOAD_STATE_IN_PROGRESS` state.
  COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED,
  /// The download completed successfully.
  COREWEBVIEW2_DOWNLOAD_STATE_COMPLETED,
}
alias int COREWEBVIEW2_DOWNLOAD_STATE;

/// Reason why a download was interrupted.
@("v1_enum")
enum /+ COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON+/
{
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NONE,

  /// Generic file error.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED,
  /// Access denied due to security restrictions.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED,
  /// Disk full. User should free some space or choose a different location to
  /// store the file.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE,
  /// Result file path with file name is too long.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG,
  /// File is too large for file system.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE,
  /// Microsoft Defender Smartscreen detected a virus in the file.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_MALICIOUS,
  /// File was in use, too many files opened, or out of memory.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR,
  /// File blocked by local policy.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED_BY_POLICY,
  /// Security check failed unexpectedly. Microsoft Defender SmartScreen could
  /// not scan this file.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED,
  /// Seeking past the end of a file in opening a file, as part of resuming an
  /// interrupted download. The file did not exist or was not as large as
  /// expected. Partially downloaded file was truncated or deleted, and download
  /// will be restarted automatically.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT,
  /// Partial file did not match the expected hash and was deleted. Download
  /// will be restarted automatically.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH,

  /// Generic network error. User can retry the download manually.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED,
  /// Network operation timed out.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT,
  /// Network connection lost. User can retry the download manually.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED,
  /// Server has gone down. User can retry the download manually.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN,
  /// Network request invalid because original or redirected URI is invalid, has
  /// an unsupported scheme, or is disallowed by network policy.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST,

  /// Generic server error. User can retry the download manually.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED,
  /// Server does not support range requests.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE,
  /// Server does not have the requested data.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT,
  /// Server did not authorize access to resource.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED,
  /// Server certificate problem.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CERTIFICATE_PROBLEM,
  /// Server access forbidden.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN,
  /// Unexpected server response. Responding server may not be intended server.
  /// User can retry the download manually.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_UNEXPECTED_RESPONSE,
  /// Server sent fewer bytes than the Content-Length header. Content-length
  /// header may be invalid or connection may have closed. Download is treated
  /// as complete unless there are
  /// [strong validators](https://tools.ietf.org/html/rfc7232#section-2) present
  /// to interrupt the download.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH,
  /// Unexpected cross-origin redirect.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT,

  /// User canceled the download.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED,
  /// User shut down the WebView. Resuming downloads that were interrupted
  /// during shutdown is not yet supported.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN,
  /// User paused the download.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_PAUSED,

  /// WebView crashed.
  COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_DOWNLOAD_PROCESS_CRASHED,
}
alias int COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON;

/// The orientation for printing, used by the `Orientation` property on
/// `ICoreWebView2PrintSettings`.
@("v1_enum")
enum /+ COREWEBVIEW2_PRINT_ORIENTATION+/
{
  /// Print the page(s) in portrait orientation.
  COREWEBVIEW2_PRINT_ORIENTATION_PORTRAIT,

  /// Print the page(s) in landscape orientation.
  COREWEBVIEW2_PRINT_ORIENTATION_LANDSCAPE,
}
alias int COREWEBVIEW2_PRINT_ORIENTATION;

/// The default download dialog can be aligned to any of the WebView corners
/// by setting the `DefaultDownloadDialogCornerAlignment` property. The default
/// position is top-right corner.
@("v1_enum")
enum /+ COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT+/
{

  /// Top-left corner of the WebView.
  COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_TOP_LEFT,

  /// Top-right corner of the WebView.
  COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_TOP_RIGHT,

  /// Bottom-left corner of the WebView.
  COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_BOTTOM_LEFT,

  /// Bottom-right corner of the WebView.
  COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_BOTTOM_RIGHT,
}
alias int COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT;

/// Indicates the process type used in the ICoreWebView2ProcessInfo interface.
@("v1_enum")
enum /+ COREWEBVIEW2_PROCESS_KIND+/
{
  /// Indicates the browser process kind.
  COREWEBVIEW2_PROCESS_KIND_BROWSER,

  /// Indicates the render process kind.
  COREWEBVIEW2_PROCESS_KIND_RENDERER,

  /// Indicates the utility process kind.
  COREWEBVIEW2_PROCESS_KIND_UTILITY,

  /// Indicates the sandbox helper process kind.
  COREWEBVIEW2_PROCESS_KIND_SANDBOX_HELPER,

  /// Indicates the GPU process kind.
  COREWEBVIEW2_PROCESS_KIND_GPU,

  /// Indicates the PPAPI plugin process kind.
  COREWEBVIEW2_PROCESS_KIND_PPAPI_PLUGIN,

  /// Indicates the PPAPI plugin broker process kind.
  COREWEBVIEW2_PROCESS_KIND_PPAPI_BROKER,
}
alias int COREWEBVIEW2_PROCESS_KIND;

// PDF toolbar item. This enum must be in sync with ToolBarItem in pdf-store-data-types.ts
/// Specifies the PDF toolbar item types used for the `ICoreWebView2Settings::put_HiddenPdfToolbarItems` method.
@("v1_enum")
enum /+ COREWEBVIEW2_PDF_TOOLBAR_ITEMS+/
{

  /// No item
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE  = 0x0,

  /// The save button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE  = 0x0001,

  /// The print button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT  = 0x0002,

  /// The save as button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE_AS  = 0x0004,

    /// The zoom in button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_IN  = 0x0008,

  /// The zoom out button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_OUT  = 0x0010,

  /// The rotate button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ROTATE  = 0x0020,

  /// The fit page button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FIT_PAGE  = 0x0040,

  /// The page layout button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_LAYOUT  = 0x0080,

  /// The bookmarks button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_BOOKMARKS  = 0x0100,

  /// The page select button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_SELECTOR  = 0x0200,

  /// The search button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SEARCH  = 0x0400,

  /// The full screen button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FULL_SCREEN  = 0x0800,

  /// The more settings button
  COREWEBVIEW2_PDF_TOOLBAR_ITEMS_MORE_SETTINGS  = 0x1000,
}
alias int COREWEBVIEW2_PDF_TOOLBAR_ITEMS;
// DEFINE_ENUM_FLAG_OPERATORS(COREWEBVIEW2_PDF_TOOLBAR_ITEMS)

/// Indicates the kind of context for which the context menu was created
/// for the `ICoreWebView2ContextMenuTarget::get_Kind` method.
/// This enum will always represent the active element that caused the context menu request.
/// If there is a selection with multiple images, audio and text, for example, the element that
/// the end user right clicks on within this selection will be the option represented by this enum.
@("v1_enum")
enum /+ COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND+/
{
    /// Indicates that the context menu was created for the page without any additional content.
    COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_PAGE,

    /// Indicates that the context menu was created for an image element.
    COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_IMAGE,

    /// Indicates that the context menu was created for selected text.
    COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_SELECTED_TEXT,

    /// Indicates that the context menu was created for an audio element.
    COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_AUDIO,

    /// Indicates that the context menu was created for a video element.
    COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_VIDEO,
}
alias int COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND;

/// Specifies the menu item kind
/// for the `ICoreWebView2ContextMenuItem::get_Kind` method
@("v1_enum")
enum /+ COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND+/
{
    /// Specifies a command menu item kind.
    COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_COMMAND,

    /// Specifies a check box menu item kind. `ContextMenuItem` objects of this kind
    /// will need the `IsChecked` property to determine current state of the check box.
    COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_CHECK_BOX,

    /// Specifies a radio button menu item kind. `ContextMenuItem` objects of this kind
    /// will need the `IsChecked` property to determine current state of the radio button.
    COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_RADIO,

    /// Specifies a separator menu item kind. `ContextMenuItem` objects of this kind
    /// are used to signal a visual separator with no functionality.
    COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SEPARATOR,

    /// Specifies a submenu menu item kind. `ContextMenuItem` objects of this kind will contain
    /// a `ContextMenuItemCollection` of its children `ContextMenuItem` objects.
    COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SUBMENU,
}
alias int COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND;

/// An enum to represent the options for WebView2 color scheme: auto, light, or dark.
@("v1_enum")
enum /+ COREWEBVIEW2_PREFERRED_COLOR_SCHEME+/
{
    /// Auto color scheme.
    COREWEBVIEW2_PREFERRED_COLOR_SCHEME_AUTO,

    /// Light color scheme.
    COREWEBVIEW2_PREFERRED_COLOR_SCHEME_LIGHT,

    /// Dark color scheme.
    COREWEBVIEW2_PREFERRED_COLOR_SCHEME_DARK
}
alias int COREWEBVIEW2_PREFERRED_COLOR_SCHEME;

/// Specifies the datatype for the
/// `ICoreWebView2Profile2::ClearBrowsingData` method.
@("v1_enum")
enum /+ COREWEBVIEW2_BROWSING_DATA_KINDS+/
{

    /// Specifies file systems data.
    COREWEBVIEW2_BROWSING_DATA_KINDS_FILE_SYSTEMS = 1 << 0,

    /// Specifies data stored by the IndexedDB DOM feature.
    COREWEBVIEW2_BROWSING_DATA_KINDS_INDEXED_DB = 1 << 1,

    /// Specifies data stored by the localStorage DOM API.
    COREWEBVIEW2_BROWSING_DATA_KINDS_LOCAL_STORAGE = 1 << 2,

    /// Specifies data stored by the Web SQL database DOM API.
    COREWEBVIEW2_BROWSING_DATA_KINDS_WEB_SQL = 1 << 3,

    /// Specifies data stored by the CacheStorage DOM API.
    COREWEBVIEW2_BROWSING_DATA_KINDS_CACHE_STORAGE = 1 << 4,

    /// Specifies DOM storage data, now and future. This browsing data kind is
    /// inclusive of COREWEBVIEW2_BROWSING_DATA_KINDS_FILE_SYSTEMS,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_INDEXED_DB,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_LOCAL_STORAGE,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_WEB_SQL,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_SERVICE_WORKERS,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_CACHE_STORAGE,
    /// and some other data kinds not listed yet to keep consistent with
    /// [DOM-accessible storage](https://www.w3.org/TR/clear-site-data/#storage).
    COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_DOM_STORAGE = 1 << 5,

    /// Specifies HTTP cookies data.
    COREWEBVIEW2_BROWSING_DATA_KINDS_COOKIES = 1 << 6,

    /// Specifies all site data, now and future. This browsing data kind
    /// is inclusive of COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_DOM_STORAGE and
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_COOKIES. New site data types
    /// may be added to this data kind in the future.
    COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_SITE = 1 << 7,

    /// Specifies disk cache.
    COREWEBVIEW2_BROWSING_DATA_KINDS_DISK_CACHE = 1 << 8,

    /// Specifies download history data.
    COREWEBVIEW2_BROWSING_DATA_KINDS_DOWNLOAD_HISTORY = 1 << 9,

    /// Specifies general autofill form data.
    /// This excludes password information and includes information like:
    /// names, street and email addresses, phone numbers, and arbitrary input.
    /// This also includes payment data.
    COREWEBVIEW2_BROWSING_DATA_KINDS_GENERAL_AUTOFILL = 1 << 10,

    /// Specifies password autosave data.
    COREWEBVIEW2_BROWSING_DATA_KINDS_PASSWORD_AUTOSAVE = 1 << 11,

    /// Specifies browsing history data.
    COREWEBVIEW2_BROWSING_DATA_KINDS_BROWSING_HISTORY = 1 << 12,

    /// Specifies settings data.
    COREWEBVIEW2_BROWSING_DATA_KINDS_SETTINGS = 1 << 13,

    /// Specifies profile data that should be wiped to make it look like a new profile.
    /// This does not delete account-scoped data like passwords but will remove access
    /// to account-scoped data by signing the user out.
    /// Specifies all profile data, now and future. New profile data types may be added
    /// to this data kind in the future.
    /// This browsing data kind is inclusive of COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_SITE,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_DISK_CACHE,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_DOWNLOAD_HISTORY,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_GENERAL_AUTOFILL,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_PASSWORD_AUTOSAVE,
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_BROWSING_HISTORY, and
    /// COREWEBVIEW2_BROWSING_DATA_KINDS_SETTINGS.
    COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_PROFILE =  1 << 14,

    /// Specifies service workers registered for an origin, and clear will result in
    /// termination and deregistration of them.
    COREWEBVIEW2_BROWSING_DATA_KINDS_SERVICE_WORKERS = 1 << 15,
}
alias int COREWEBVIEW2_BROWSING_DATA_KINDS;
// DEFINE_ENUM_FLAG_OPERATORS(COREWEBVIEW2_BROWSING_DATA_KINDS)

/// Specifies the action type when server certificate error is detected to be
/// used in the `ICoreWebView2ServerCertificateErrorDetectedEventArgs`
/// interface.
@("v1_enum") enum /+ COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION+/
{
  /// Indicates to ignore the warning and continue the request with the TLS
  /// certificate. This decision is cached for the RequestUri's host and the
  /// server certificate in the session.
  COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_ALWAYS_ALLOW,

  /// Indicates to reject the certificate and cancel the request.
  COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_CANCEL,

  /// Indicates to display the default TLS interstitial error page to user for
  /// page navigations.
  /// For others TLS certificate is rejected and the request is cancelled.
  COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_DEFAULT
}
alias int COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION;

/// Specifies the image format to use for favicon.
@("v1_enum")
enum /+ COREWEBVIEW2_FAVICON_IMAGE_FORMAT+/
{
    /// Indicates that the PNG image format is used.
    COREWEBVIEW2_FAVICON_IMAGE_FORMAT_PNG,

    /// Indicates the JPEG image format is used.
    COREWEBVIEW2_FAVICON_IMAGE_FORMAT_JPEG,
}
alias int COREWEBVIEW2_FAVICON_IMAGE_FORMAT;

/// Specifies the print dialog kind.
@("v1_enum") enum /+ COREWEBVIEW2_PRINT_DIALOG_KIND+/
{
  /// Opens the browser print preview dialog.
  COREWEBVIEW2_PRINT_DIALOG_KIND_BROWSER,

  /// Opens the system print dialog.
  COREWEBVIEW2_PRINT_DIALOG_KIND_SYSTEM,
}
alias int COREWEBVIEW2_PRINT_DIALOG_KIND;

/// Specifies the duplex option for a print.
@("v1_enum") enum /+ COREWEBVIEW2_PRINT_DUPLEX+/
{
  /// The default duplex for a printer.
  COREWEBVIEW2_PRINT_DUPLEX_DEFAULT,

  /// Print on only one side of the sheet.
  COREWEBVIEW2_PRINT_DUPLEX_ONE_SIDED,

  /// Print on both sides of the sheet, flipped along the long edge.
  COREWEBVIEW2_PRINT_DUPLEX_TWO_SIDED_LONG_EDGE,

  /// Print on both sides of the sheet, flipped along the short edge.
  COREWEBVIEW2_PRINT_DUPLEX_TWO_SIDED_SHORT_EDGE,
}
alias int COREWEBVIEW2_PRINT_DUPLEX;

/// Specifies the color mode for a print.
@("v1_enum") enum /+ COREWEBVIEW2_PRINT_COLOR_MODE+/
{
  /// The default color mode for a printer.
  COREWEBVIEW2_PRINT_COLOR_MODE_DEFAULT,

  /// Indicate that the printed output will be in color.
  COREWEBVIEW2_PRINT_COLOR_MODE_COLOR,

  /// Indicate that the printed output will be in shades of gray.
  COREWEBVIEW2_PRINT_COLOR_MODE_GRAYSCALE,
}
alias int COREWEBVIEW2_PRINT_COLOR_MODE;

/// Specifies the collation for a print.
@("v1_enum") enum /+ COREWEBVIEW2_PRINT_COLLATION+/
{
  /// The default collation for a printer.
  COREWEBVIEW2_PRINT_COLLATION_DEFAULT,

  /// Indicate that the collation has been selected for the printed output.
  COREWEBVIEW2_PRINT_COLLATION_COLLATED,

  /// Indicate that the collation has not been selected for the printed output.
  COREWEBVIEW2_PRINT_COLLATION_UNCOLLATED,
}
alias int COREWEBVIEW2_PRINT_COLLATION;

/// Specifies the media size for a print.
@("v1_enum") enum /+ COREWEBVIEW2_PRINT_MEDIA_SIZE+/
{
  /// The default media size for a printer.
  COREWEBVIEW2_PRINT_MEDIA_SIZE_DEFAULT,

  /// Indicate custom media size that is specific to the printer.
  COREWEBVIEW2_PRINT_MEDIA_SIZE_CUSTOM,
}
alias int COREWEBVIEW2_PRINT_MEDIA_SIZE;

/// Indicates the status for printing.
@("v1_enum") enum /+ COREWEBVIEW2_PRINT_STATUS+/
{
  /// Indicates that the print operation is succeeded.
  COREWEBVIEW2_PRINT_STATUS_SUCCEEDED,

  /// Indicates that the printer is not available.
  COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE,

  /// Indicates that the print operation is failed.
  COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR,
}
alias int COREWEBVIEW2_PRINT_STATUS;

/// Tracking prevention levels.
@("v1_enum") enum /+ COREWEBVIEW2_TRACKING_PREVENTION_LEVEL+/
{
  /// Tracking prevention is turned off.
  COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_NONE,
  /// The least restrictive level of tracking prevention. Set to this level to
  /// protect against malicious trackers but allows most other trackers and
  /// personalize content and ads.
  ///
  /// See [Current tracking prevention
  /// behavior](/microsoft-edge/web-platform/tracking-prevention#current-tracking-prevention-behavior)
  /// for fine-grained information on what is being blocked with this level and
  /// can change with different Edge versions.
  COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BASIC,
  /// The default level of tracking prevention. Set to this level to
  /// protect against social media tracking on top of malicious trackers.
  /// Content and ads will likely be less personalized.
  ///
  /// See [Current tracking prevention
  /// behavior](/microsoft-edge/web-platform/tracking-prevention#current-tracking-prevention-behavior)
  /// for fine-grained information on what is being blocked with this level and
  /// can change with different Edge versions.
  COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BALANCED,
  /// The most restrictive level of tracking prevention. Set to this level to
  /// protect
  /// against malicious trackers and most trackers across sites. Content and ads
  /// will likely have minimal personalization.
  ///
  /// This level blocks the most trackers but could cause some websites to not
  /// behave as expected.
  ///
  /// See [Current tracking prevention
  /// behavior](/microsoft-edge/web-platform/tracking-prevention#current-tracking-prevention-behavior)
  /// for fine-grained information on what is being blocked with this level and
  /// can change with different Edge versions.
  COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_STRICT,
}
alias int COREWEBVIEW2_TRACKING_PREVENTION_LEVEL;

/// Specifies the desired access from script to `CoreWebView2SharedBuffer`.
@("v1_enum")
enum /+ COREWEBVIEW2_SHARED_BUFFER_ACCESS+/
{
  /// Script from web page only has read access to the shared buffer.
  COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_ONLY,

  /// Script from web page has read and write access to the shared buffer.
  COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_WRITE
}
alias int COREWEBVIEW2_SHARED_BUFFER_ACCESS;

/// Specifies memory usage target level of WebView.
@("v1_enum")
enum /+ COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL+/
{
  /// Specifies normal memory usage target level.
  COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL,

  /// Specifies low memory usage target level.
  /// Used for inactivate WebView for reduced memory consumption.
  COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW,
}
alias int COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL;

/// Specifies the navigation kind of each navigation.
@("v1_enum")
enum /+ COREWEBVIEW2_NAVIGATION_KIND+/
{
  /// A navigation caused by `CoreWebView2.Reload()`, `location.reload()`, the end user
  /// using F5 or other UX, or other reload mechanisms to reload the current document
  /// without modifying the navigation history.
  COREWEBVIEW2_NAVIGATION_KIND_RELOAD = 0,

  /// A navigation back or forward to a different entry in the session navigation history,
  /// like via `CoreWebView2.Back()`, `location.back()`, the end user pressing Alt+Left
  /// or other UX, or other mechanisms to navigate back or forward in the current
  /// session navigation history.
  ///
  // Note: This kind doesn't distinguish back or forward, because we can't
  // distinguish it from origin source `blink.mojom.NavigationType`.
  COREWEBVIEW2_NAVIGATION_KIND_BACK_OR_FORWARD = 1,

  /// A navigation to another document, which can be caused by `CoreWebView2.Navigate()`,
  /// `window.location.href = ...`, or other WebView2 or DOM APIs that navigate to a new URI.
  COREWEBVIEW2_NAVIGATION_KIND_NEW_DOCUMENT = 2,
}
alias int COREWEBVIEW2_NAVIGATION_KIND;

/// Indicates the frame type used in the `ICoreWebView2FrameInfo` interface.
@("v1_enum")
enum /+ COREWEBVIEW2_FRAME_KIND+/
{
  /// Indicates that the frame is an unknown type frame. We may extend this enum
  /// type to identify more frame kinds in the future.
  COREWEBVIEW2_FRAME_KIND_UNKNOWN,
  /// Indicates that the frame is a primary main frame(webview).
  COREWEBVIEW2_FRAME_KIND_MAIN_FRAME,
  /// Indicates that the frame is an iframe.
  COREWEBVIEW2_FRAME_KIND_IFRAME,
  /// Indicates that the frame is an embed element.
  COREWEBVIEW2_FRAME_KIND_EMBED,
  /// Indicates that the frame is an object element.
  COREWEBVIEW2_FRAME_KIND_OBJECT,
}
alias int COREWEBVIEW2_FRAME_KIND;

// End of enums and structs

/// WebView2 enables you to host web content using the latest Microsoft Edge
/// browser and web technology.

const GUID IID_ICoreWebView2 = ICoreWebView2.iid;

interface ICoreWebView2 : IUnknown
{
    static const GUID iid = { 0x76eceacb,0x0462,0x4d94,[ 0xac,0x83,0x42,0x3a,0x67,0x93,0x77,0x5e ] };

  /// The `ICoreWebView2Settings` object contains various modifiable settings
  /// for the running WebView.

  @(" propget")
	HRESULT get_Settings(@("out, retval") ICoreWebView2Settings * settings);

  /// The URI of the current top level document.  This value potentially
  /// changes as a part of the `SourceChanged` event that runs for some cases
  /// such as navigating to a different site or fragment navigations.  It
  /// remains the same for other types of navigations such as page refreshes
  /// or `history.pushState` with the same URL as the current page.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  ///
  /// \snippet ControlComponent.cpp SourceChanged
  @(" propget")
	HRESULT get_Source(@("out, retval") LPWSTR* uri);

  /// Cause a navigation of the top-level document to run to the specified URI.
  /// For more information, navigate to [Navigation
  /// events](/microsoft-edge/webview2/concepts/navigation-events).
  ///
  /// \> [!NOTE]\n\> This operation starts a navigation and the corresponding
  /// `NavigationStarting` event triggers sometime after `Navigate` runs.
  ///
  /// \snippet ControlComponent.cpp Navigate
  HRESULT Navigate(in LPCWSTR uri);

  /// Initiates a navigation to htmlContent as source HTML of a new document.
  /// The `htmlContent` parameter may not be larger than 2 MB (2 * 1024 * 1024 bytes) in total size.
  /// The origin of the new page is `about:blank`.
  ///
  /// ```cpp
  ///    SetVirtualHostNameToFolderMapping(
  ///        L"appassets.example", L"assets",
  ///        COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY);
  ///
  ///    WCHAR c_navString[] = LR"
  ///    <head><link rel='stylesheet' href ='http://appassets.example/wv2.css'/></head>
  ///    <body>
  ///      <img src='http://appassets.example/wv2.png' />
  ///      <p><a href='http://appassets.example/winrt_test.txt'>Click me</a></p>
  ///    </body>";
  ///    m_webView->NavigateToString(c_navString);
  /// ```
  /// \snippet SettingsComponent.cpp NavigateToString
  HRESULT NavigateToString(in LPCWSTR htmlContent);

  /// Add an event handler for the `NavigationStarting` event.
  /// `NavigationStarting` runs when the WebView main frame is requesting
  /// permission to navigate to a different URI.  Redirects trigger this
  /// operation as well, and the navigation id is the same as the original
  /// one.
  ///
  /// Navigations will be blocked until all `NavigationStarting` event handlers
  /// return.
  ///
  /// \snippet SettingsComponent.cpp NavigationStarting
  HRESULT add_NavigationStarting(
      /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_NavigationStarting`.
  HRESULT remove_NavigationStarting(
      in EventRegistrationToken token);

  /// Add an event handler for the `ContentLoading` event.  `ContentLoading`
  /// triggers before any content is loaded, including scripts added with
  /// `AddScriptToExecuteOnDocumentCreated`.  `ContentLoading` does not trigger
  /// if a same page navigation occurs (such as through `fragment`
  /// navigations or `history.pushState` navigations).  This operation
  /// follows the `NavigationStarting` and `SourceChanged` events and precedes
  /// the `HistoryChanged` and `NavigationCompleted` events.
  HRESULT add_ContentLoading(
      /+[in]+/ ICoreWebView2ContentLoadingEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_ContentLoading`.
  HRESULT remove_ContentLoading(
      in EventRegistrationToken token);

  /// Add an event handler for the `SourceChanged` event.  `SourceChanged`
  /// triggers when the `Source` property changes.  `SourceChanged` runs when
  /// navigating to a different site or fragment navigations.  It does not
  /// trigger for other types of navigations such as page refreshes or
  /// `history.pushState` with the same URL as the current page.
  /// `SourceChanged` runs before `ContentLoading` for navigation to a new
  /// document.
  ///
  /// \snippet ControlComponent.cpp SourceChanged
  HRESULT add_SourceChanged(
      /+[in]+/ ICoreWebView2SourceChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_SourceChanged`.
  HRESULT remove_SourceChanged(
      in EventRegistrationToken token);

  /// Add an event handler for the `HistoryChanged` event.  `HistoryChanged` is
  /// raised for changes to joint session history, which consists of top-level
  /// and manual frame navigations.  Use `HistoryChanged` to verify that the
  /// `CanGoBack` or `CanGoForward` value has changed.  `HistoryChanged` also
  /// runs for using `GoBack` or `GoForward`.  `HistoryChanged` runs after
  /// `SourceChanged` and `ContentLoading`.  `CanGoBack` is false for
  /// navigations initiated through ICoreWebView2Frame APIs if there has not yet
  /// been a user gesture.
  ///
  /// \snippet ControlComponent.cpp HistoryChanged
  HRESULT add_HistoryChanged(
      /+[in]+/ ICoreWebView2HistoryChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_HistoryChanged`.
  HRESULT remove_HistoryChanged(
      in EventRegistrationToken token);

  /// Add an event handler for the `NavigationCompleted` event.
  /// `NavigationCompleted` runs when the WebView has completely loaded
  /// (concurrently when `body.onload` runs) or loading stopped with error.
  ///
  /// \snippet ControlComponent.cpp NavigationCompleted
  HRESULT add_NavigationCompleted(
      /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_NavigationCompleted`.
  HRESULT remove_NavigationCompleted(
      in EventRegistrationToken token);

  /// Add an event handler for the `FrameNavigationStarting` event.
  /// `FrameNavigationStarting` triggers when a child frame in the WebView
  /// requests permission to navigate to a different URI.  Redirects trigger
  /// this operation as well, and the navigation id is the same as the original
  /// one.
  ///
  /// Navigations will be blocked until all `FrameNavigationStarting` event
  /// handlers return.
  ///
  /// \snippet SettingsComponent.cpp FrameNavigationStarting
  HRESULT add_FrameNavigationStarting(
      /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with
  /// `add_FrameNavigationStarting`.
  HRESULT remove_FrameNavigationStarting(
      in EventRegistrationToken token);

  /// Add an event handler for the `FrameNavigationCompleted` event.
  /// `FrameNavigationCompleted` triggers when a child frame has completely
  /// loaded (concurrently when `body.onload` has triggered) or loading stopped with error.
  ///
  /// \snippet ControlComponent.cpp FrameNavigationCompleted
  HRESULT add_FrameNavigationCompleted(
      /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with
  /// `add_FrameNavigationCompleted`.
  HRESULT remove_FrameNavigationCompleted(
      in EventRegistrationToken token);

  /// Add an event handler for the `ScriptDialogOpening` event.
  /// `ScriptDialogOpening` runs when a JavaScript dialog (`alert`, `confirm`,
  /// `prompt`, or `beforeunload`) displays for the webview.  This event only
  /// triggers if the `ICoreWebView2Settings::AreDefaultScriptDialogsEnabled`
  /// property is set to `FALSE`.  The `ScriptDialogOpening` event suppresses
  /// dialogs or replaces default dialogs with custom dialogs.
  ///
  /// If a deferral is not taken on the event args, the subsequent scripts are
  /// blocked until the event handler returns.  If a deferral is taken, the
  /// scripts are blocked until the deferral is completed.
  ///
  /// \snippet SettingsComponent.cpp ScriptDialogOpening
  HRESULT add_ScriptDialogOpening(
      /+[in]+/ ICoreWebView2ScriptDialogOpeningEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_ScriptDialogOpening`.
  HRESULT remove_ScriptDialogOpening(
      in EventRegistrationToken token);

  /// Add an event handler for the `PermissionRequested` event.
  /// `PermissionRequested` runs when content in a WebView requests permission
  /// to access some privileged resources.
  ///
  /// If a deferral is not taken on the event args, the subsequent scripts are
  /// blocked until the event handler returns.  If a deferral is taken, the
  /// scripts are blocked until the deferral is completed.
  ///
  /// \snippet SettingsComponent.cpp PermissionRequested0
  /// \snippet SettingsComponent.cpp PermissionRequested1
  HRESULT add_PermissionRequested(
      /+[in]+/ ICoreWebView2PermissionRequestedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_PermissionRequested`.
  HRESULT remove_PermissionRequested(
      in EventRegistrationToken token);

  /// Add an event handler for the `ProcessFailed` event.
  /// `ProcessFailed` runs when any of the processes in the
  /// [WebView2 Process Group](/microsoft-edge/webview2/concepts/process-model?tabs=csharp#processes-in-the-webview2-runtime)
  /// encounters one of the following conditions:
  ///
  /// Condition | Details
  /// ---|---
  /// Unexpected exit | The process indicated by the event args has exited unexpectedly (usually due to a crash). The failure might or might not be recoverable and some failures are auto-recoverable.
  /// Unresponsiveness | The process indicated by the event args has become unresponsive to user input. This is only reported for renderer processes, and will run every few seconds until the process becomes responsive again.
  ///
  /// \> [!NOTE]\n\> When the failing process is the browser process, a
  /// `ICoreWebView2Environment5::BrowserProcessExited` event will run too.
  ///
  /// Your application can use `ICoreWebView2ProcessFailedEventArgs` and
  /// `ICoreWebView2ProcessFailedEventArgs2` to identify which condition and
  /// process the event is for, and to collect diagnostics and handle recovery
  /// if necessary. For more details about which cases need to be handled by
  /// your application, see `COREWEBVIEW2_PROCESS_FAILED_KIND`.
  ///
  /// \snippet ProcessComponent.cpp ProcessFailed
  HRESULT add_ProcessFailed(
      /+[in]+/ ICoreWebView2ProcessFailedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_ProcessFailed`.
  HRESULT remove_ProcessFailed(
      in EventRegistrationToken token);

  /// Add the provided JavaScript to a list of scripts that should be run after
  /// the global object has been created, but before the HTML document has
  /// been parsed and before any other script included by the HTML document is
  /// run.  This method injects a script that runs on all top-level document
  /// and child frame page navigations.  This method runs asynchronously, and
  /// you must wait for the completion handler to finish before the injected
  /// script is ready to run.  When this method completes, the `Invoke` method
  /// of the handler is run with the `id` of the injected script.  `id` is a
  /// string.  To remove the injected script, use
  /// `RemoveScriptToExecuteOnDocumentCreated`.
  ///
  /// If the method is run in add_NewWindowRequested handler it should be called
  /// before the new window is set. If called after setting the NewWindow property, the initial script
  /// may or may not apply to the initial navigation and may only apply to the subsequent navigation.
  /// For more details see `ICoreWebView2NewWindowRequestedEventArgs::put_NewWindow`.
  ///
  /// \> [!NOTE]\n\> If an HTML document is running in a sandbox of some kind using
  /// [sandbox](https://developer.mozilla.org/docs/Web/HTML/Element/iframe#attr-sandbox)
  /// properties or the
  /// [Content-Security-Policy](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy)
  /// HTTP header affects the script that runs.  For example, if the
  /// `allow-modals` keyword is not set then requests to run the `alert`
  /// function are ignored.
  ///
  /// \snippet ScriptComponent.cpp AddScriptToExecuteOnDocumentCreated
  HRESULT AddScriptToExecuteOnDocumentCreated(
      in LPCWSTR javaScript,
      /+[in]+/ ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler handler);

  /// Remove the corresponding JavaScript added using
  /// `AddScriptToExecuteOnDocumentCreated` with the specified script ID. The
  /// script ID should be the one returned by the `AddScriptToExecuteOnDocumentCreated`.
  /// Both use `AddScriptToExecuteOnDocumentCreated` and this method in `NewWindowRequested`
  /// event handler at the same time sometimes causes trouble.  Since invalid scripts will
  /// be ignored, the script IDs you got may not be valid anymore.
  HRESULT RemoveScriptToExecuteOnDocumentCreated(in LPCWSTR id);

  /// Run JavaScript code from the javascript parameter in the current
  /// top-level document rendered in the WebView.  The result of evaluating
  /// the provided JavaScript is used in this parameter.  The result value is
  /// a JSON encoded string.  If the result is undefined, contains a reference
  /// cycle, or otherwise is not able to be encoded into JSON, then the result
  /// is considered to be null, which is encoded in JSON as the string "null".
  ///
  /// \> [!NOTE]\n\> A function that has no explicit return value returns undefined. If the
  /// script that was run throws an unhandled exception, then the result is
  /// also "null".  This method is applied asynchronously. If the method is
  /// run after the `NavigationStarting` event during a navigation, the script
  /// runs in the new document when loading it, around the time
  /// `ContentLoading` is run.  This operation executes the script even if
  /// `ICoreWebView2Settings::IsScriptEnabled` is set to `FALSE`.
  ///
  /// \snippet ScriptComponent.cpp ExecuteScript
  HRESULT ExecuteScript(
      in LPCWSTR javaScript,
      /+[in]+/ ICoreWebView2ExecuteScriptCompletedHandler handler);

  /// Capture an image of what WebView is displaying.  Specify the format of
  /// the image with the `imageFormat` parameter.  The resulting image binary
  /// data is written to the provided `imageStream` parameter.  When
  /// `CapturePreview` finishes writing to the stream, the `Invoke` method on
  /// the provided `handler` parameter is run.  This method fails if called
  /// before the first ContentLoading event.  For example if this is called in
  /// the NavigationStarting event for the first navigation it will fail.
  /// For subsequent navigations, the method may not fail, but will not capture
  /// an image of a given webpage until the ContentLoading event has been fired
  /// for it.  Any call to this method prior to that will result in a capture of
  /// the page being navigated away from.
  ///
  /// \snippet FileComponent.cpp CapturePreview
  HRESULT CapturePreview(
      in COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT imageFormat,
      in IStream* imageStream,
      /+[in]+/ ICoreWebView2CapturePreviewCompletedHandler handler);

  /// Reload the current page.  This is similar to navigating to the URI of
  /// current top level document including all navigation events firing and
  /// respecting any entries in the HTTP cache.  But, the back or forward
  /// history are not modified.
  HRESULT Reload();

  /// Post the specified webMessage to the top level document in this WebView.
  /// The main page receives the message by subscribing to the `message` event of the
  /// `window.chrome.webview` of the page document.
  ///
  /// ```cpp
  /// window.chrome.webview.addEventListener('message', handler)
  /// window.chrome.webview.removeEventListener('message', handler)
  /// ```
  ///
  /// The event args is an instance of `MessageEvent`.  The
  /// `ICoreWebView2Settings::IsWebMessageEnabled` setting must be `TRUE` or
  /// the web message will not be sent. The `data` property of the event
  /// arg is the `webMessage` string parameter parsed as a JSON string into a
  /// JavaScript object.  The `source` property of the event arg is a reference
  ///  to the `window.chrome.webview` object.  For information about sending
  /// messages from the HTML document in the WebView to the host, navigate to
  /// [add_WebMessageReceived](/microsoft-edge/webview2/reference/win32/icorewebview2#add_webmessagereceived).
  /// The message is delivered asynchronously.  If a navigation occurs before
  /// the message is posted to the page, the message is discarded.
  ///
  /// \snippet ScenarioWebMessage.cpp WebMessageReceived
  HRESULT PostWebMessageAsJson(in LPCWSTR webMessageAsJson);

  /// Posts a message that is a simple string rather than a JSON string
  /// representation of a JavaScript object.  This behaves in exactly the same
  /// manner as `PostWebMessageAsJson`, but the `data` property of the event
  /// arg of the `window.chrome.webview` message is a string with the same
  /// value as `webMessageAsString`.  Use this instead of
  /// `PostWebMessageAsJson` if you want to communicate using simple strings
  /// rather than JSON objects.
  HRESULT PostWebMessageAsString(in LPCWSTR webMessageAsString);

  /// Add an event handler for the `WebMessageReceived` event.
  /// `WebMessageReceived` runs when the
  /// `ICoreWebView2Settings::IsWebMessageEnabled` setting is set and the
  /// top-level document of the WebView runs
  /// `window.chrome.webview.postMessage`.  The `postMessage` function is
  /// `void postMessage(object)` where object is any object supported by JSON
  /// conversion.
  ///
  /// \snippet assets\ScenarioWebMessage.html chromeWebView
  ///
  /// When the page calls `postMessage`, the object parameter is converted to a
  /// JSON string and is posted asynchronously to the host process. This will
  /// result in the handler's `Invoke` method being called with the JSON string
  /// as a parameter.
  ///
  /// \snippet ScenarioWebMessage.cpp WebMessageReceived
  ///
  /// If the same page calls `postMessage` multiple times, the corresponding
  /// `WebMessageReceived` events are guaranteed to be fired in the same order.
  /// However, if multiple frames call `postMessage`, there is no guaranteed
  /// order.  In addition, `WebMessageReceived` events caused by calls to
  /// `postMessage` are not guaranteed to be sequenced with events caused by DOM
  /// APIs.  For example, if the page runs
  ///
  /// ```javascript
  /// chrome.webview.postMessage("message");
  /// window.open();
  /// ```
  ///
  /// then the `NewWindowRequested` event might be fired before the
  /// `WebMessageReceived` event.  If you need the `WebMessageReceived` event
  /// to happen before anything else, then in the `WebMessageReceived` handler
  /// you can post a message back to the page and have the page wait until it
  /// receives that message before continuing.
  HRESULT add_WebMessageReceived(
      /+[in]+/ ICoreWebView2WebMessageReceivedEventHandler handler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_WebMessageReceived`.
  HRESULT remove_WebMessageReceived(
      in EventRegistrationToken token);

  /// Runs an asynchronous `DevToolsProtocol` method.  For more information
  /// about available methods, navigate to
  /// [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/tot)
  /// .  The `methodName` parameter is the full name of the method in the
  /// `{domain}.{method}` format.  The `parametersAsJson` parameter is a JSON
  /// formatted string containing the parameters for the corresponding method.
  /// The `Invoke` method of the `handler` is run when the method
  /// asynchronously completes.  `Invoke` is run with the return object of the
  /// method as a JSON string.  This function returns E_INVALIDARG if the `methodName` is
  /// unknown or the `parametersAsJson` has an error.  In the case of such an error, the
  /// `returnObjectAsJson` parameter of the handler will include information
  /// about the error.
  /// Note even though WebView2 dispatches the CDP messages in the order called,
  /// CDP method calls may be processed out of order.
  /// If you require CDP methods to run in a particular order, you should wait
  /// for the previous method's completed handler to run before calling the
  /// next method.
  ///
  /// \snippet ScriptComponent.cpp CallDevToolsProtocolMethod
  HRESULT CallDevToolsProtocolMethod(
      in LPCWSTR methodName,
      in LPCWSTR parametersAsJson,
      /+[in]+/ ICoreWebView2CallDevToolsProtocolMethodCompletedHandler handler);

  /// The process ID of the browser process that hosts the WebView.
  @(" propget")
	HRESULT get_BrowserProcessId(@("out, retval") UINT32* value);

  /// `TRUE` if the WebView is able to navigate to a previous page in the
  /// navigation history.  If `CanGoBack` changes value, the `HistoryChanged`
  /// event runs.
  @(" propget")
	HRESULT get_CanGoBack(@("out, retval") BOOL* canGoBack);

  /// `TRUE` if the WebView is able to navigate to a next page in the
  /// navigation history.  If `CanGoForward` changes value, the
  /// `HistoryChanged` event runs.
  @(" propget")
	HRESULT get_CanGoForward(@("out, retval") BOOL* canGoForward);

  /// Navigates the WebView to the previous page in the navigation history.
  HRESULT GoBack();

  /// Navigates the WebView to the next page in the navigation history.
  HRESULT GoForward();

  /// Get a DevTools Protocol event receiver that allows you to subscribe to a
  /// DevTools Protocol event.  The `eventName` parameter is the full name of
  /// the event in the format `{domain}.{event}`.  For more information about
  /// DevTools Protocol events description and event args, navigate to
  /// [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/tot).
  ///
  /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived
  HRESULT GetDevToolsProtocolEventReceiver(
      in LPCWSTR eventName,
      @("out, retval") ICoreWebView2DevToolsProtocolEventReceiver * receiver);

  /// Stop all navigations and pending resource fetches.  Does not stop scripts.
  HRESULT Stop();

  /// Add an event handler for the `NewWindowRequested` event.
  /// `NewWindowRequested` runs when content inside the WebView requests to
  /// open a new window, such as through `window.open`.  The app can pass a
  /// target WebView that is considered the opened window or mark the event as
  /// `Handled`, in which case WebView2 does not open a window.
  /// If either `Handled` or `NewWindow` properties are not set, the target
  /// content will be opened on a popup window.
  ///
  /// If a deferral is not taken on the event args, scripts that resulted in the
  /// new window that are requested are blocked until the event handler returns.
  /// If a deferral is taken, then scripts are blocked until the deferral is
  /// completed or new window is set.
  ///
  /// For more details and considerations on the target WebView to be supplied
  /// at the opened window, see `ICoreWebView2NewWindowRequestedEventArgs::put_NewWindow`.
  ///
  /// \snippet AppWindow.cpp NewWindowRequested
  HRESULT add_NewWindowRequested(
      /+[in]+/ ICoreWebView2NewWindowRequestedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_NewWindowRequested`.
  HRESULT remove_NewWindowRequested(
      in EventRegistrationToken token);

  /// Add an event handler for the `DocumentTitleChanged` event.
  /// `DocumentTitleChanged` runs when the `DocumentTitle` property of the
  /// WebView changes and may run before or after the `NavigationCompleted`
  /// event.
  ///
  /// \snippet FileComponent.cpp DocumentTitleChanged
  HRESULT add_DocumentTitleChanged(
      /+[in]+/ ICoreWebView2DocumentTitleChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_DocumentTitleChanged`.
  HRESULT remove_DocumentTitleChanged(
      in EventRegistrationToken token);

  /// The title for the current top-level document.  If the document has no
  /// explicit title or is otherwise empty, a default that may or may not match
  ///  the URI of the document is used.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_DocumentTitle(@("out, retval") LPWSTR* title);

  /// Add the provided host object to script running in the WebView with the
  /// specified name.  Host objects are exposed as host object proxies using
  /// `window.chrome.webview.hostObjects.{name}`.  Host object proxies are
  /// promises and resolves to an object representing the host object.  The
  /// promise is rejected if the app has not added an object with the name.
  /// When JavaScript code access a property or method of the object, a promise
  ///  is return, which resolves to the value returned from the host for the
  /// property or method, or rejected in case of error, for example, no
  /// property or method on the object or parameters are not valid.
  ///
  /// \> [!NOTE]\n\> While simple types, `IDispatch` and array are supported, and
  /// `IUnknown` objects that also implement `IDispatch` are treated as `IDispatch`,
  /// generic `IUnknown`, `VT_DECIMAL`, or `VT_RECORD` variant is not supported.
  /// Remote JavaScript objects like callback functions are represented as an
  /// `VT_DISPATCH` `VARIANT` with the object implementing `IDispatch`.  The
  /// JavaScript callback method may be invoked using `DISPID_VALUE` for the
  /// `DISPID`.  Such callback method invocations will return immediately and will
  /// not wait for the JavaScript function to run and so will not provide the return
  /// value of the JavaScript function.
  /// Nested arrays are supported up to a depth of 3.  Arrays of by
  /// reference types are not supported. `VT_EMPTY` and `VT_NULL` are mapped
  /// into JavaScript as `null`.  In JavaScript, `null` and undefined are
  /// mapped to `VT_EMPTY`.
  ///
  /// Additionally, all host objects are exposed as
  /// `window.chrome.webview.hostObjects.sync.{name}`.  Here the host objects
  /// are exposed as synchronous host object proxies. These are not promises
  /// and function runtimes or property access synchronously block running
  /// script waiting to communicate cross process for the host code to run.
  /// Accordingly the result may have reliability issues and it is recommended
  /// that you use the promise-based asynchronous
  /// `window.chrome.webview.hostObjects.{name}` API.
  ///
  /// Synchronous host object proxies and asynchronous host object proxies may
  /// both use a proxy to the same host object.  Remote changes made by one
  /// proxy propagates to any other proxy of that same host object whether
  /// the other proxies and synchronous or asynchronous.
  ///
  /// While JavaScript is blocked on a synchronous run to native code, that
  /// native code is unable to run back to JavaScript.  Attempts to do so fail
  ///  with `HRESULT_FROM_WIN32(ERROR_POSSIBLE_DEADLOCK)`.
  ///
  /// Host object proxies are JavaScript Proxy objects that intercept all
  /// property get, property set, and method invocations. Properties or methods
  ///  that are a part of the Function or Object prototype are run locally.
  /// Additionally any property or method in the
  /// `chrome.webview.hostObjects.options.forceLocalProperties`
  /// array are also run locally.  This defaults to including optional methods
  /// that have meaning in JavaScript like `toJSON` and `Symbol.toPrimitive`.
  /// Add more to the array as required.
  ///
  /// The `chrome.webview.hostObjects.cleanupSome` method performs a best
  /// effort garbage collection on host object proxies.
  ///
  /// The `chrome.webview.hostObjects.options` object provides the ability to
  /// change some functionality of host objects.
  ///
  /// Options property | Details
  /// ---|---
  /// `forceLocalProperties` | This is an array of host object property names that will be run locally, instead of being called on the native host object. This defaults to `then`, `toJSON`, `Symbol.toString`, and `Symbol.toPrimitive`. You can add other properties to specify that they should be run locally on the javascript host object proxy.
  /// `log` | This is a callback that will be called with debug information. For example, you can set this to `console.log.bind(console)` to have it print debug information to the console to help when troubleshooting host object usage. By default this is null.
  /// `shouldSerializeDates` | By default this is false, and javascript Date objects will be sent to host objects as a string using `JSON.stringify`. You can set this property to true to have Date objects properly serialize as a `VT_DATE` when sending to the native host object, and have `VT_DATE` properties and return values create a javascript Date object.
  /// `defaultSyncProxy` | When calling a method on a synchronous proxy, the result should also be a synchronous proxy. But in some cases, the sync/async context is lost (for example, when providing to native code a reference to a function, and then calling that function in native code). In these cases, the proxy will be asynchronous, unless this property is set.
  /// `forceAsyncMethodMatches ` | This is an array of regular expressions. When calling a method on a synchronous proxy, the method call will be performed asynchronously if the method name matches a string or regular expression in this array. Setting this value to `Async` will make any method that ends with Async be an asynchronous method call. If an async method doesn't match here and isn't forced to be asynchronous, the method will be invoked synchronously, blocking execution of the calling JavaScript and then returning the resolution of the promise, rather than returning a promise.
  /// `ignoreMemberNotFoundError` | By default, an exception is thrown when attempting to get the value of a proxy property that doesn't exist on the corresponding native class. Setting this property to `true` switches the behavior to match Chakra WinRT projection (and general JavaScript) behavior of returning `undefined` with no error.
  ///
  /// Host object proxies additionally have the following methods which run
  /// locally.
  ///
  /// Method name | Details
  /// ---|---
  ///`applyHostFunction`, `getHostProperty`, `setHostProperty` | Perform a method invocation, property get, or property set on the host object. Use the methods to explicitly force a method or property to run remotely if a conflicting local method or property exists.  For instance, `proxy.toString()` runs the local `toString` method on the proxy object. But proxy.applyHostFunction('toString') runs `toString` on the host proxied object instead.
  ///`getLocalProperty`, `setLocalProperty` | Perform property get, or property set locally.  Use the methods to force getting or setting a property on the host object proxy rather than on the host object it represents. For instance, `proxy.unknownProperty` gets the property named `unknownProperty` from the host proxied object.  But proxy.getLocalProperty('unknownProperty') gets the value of the property `unknownProperty` on the proxy object.
  ///`sync` | Asynchronous host object proxies expose a sync method which returns a promise for a synchronous host object proxy for the same host object.  For example, `chrome.webview.hostObjects.sample.methodCall()` returns an asynchronous host object proxy.  Use the `sync` method to obtain a synchronous host object proxy instead: `const syncProxy = await chrome.webview.hostObjects.sample.methodCall().sync()`.
  ///`async` | Synchronous host object proxies expose an async method which blocks and returns an asynchronous host object proxy for the same host object.  For example, `chrome.webview.hostObjects.sync.sample.methodCall()` returns a synchronous host object proxy.  Running the `async` method on this blocks and then returns an asynchronous host object proxy for the same host object: `const asyncProxy = chrome.webview.hostObjects.sync.sample.methodCall().async()`.
  ///`then` | Asynchronous host object proxies have a `then` method.  Allows proxies to be awaitable.  `then` returns a promise that resolves with a representation of the host object.  If the proxy represents a JavaScript literal, a copy of that is returned locally.  If the proxy represents a function, a non-awaitable proxy is returned.  If the proxy represents a JavaScript object with a mix of literal properties and function properties, the a copy of the object is returned with some properties as host object proxies.
  ///
  /// All other property and method invocations (other than the above Remote
  /// object proxy methods, `forceLocalProperties` list, and properties on
  /// Function and Object prototypes) are run remotely.  Asynchronous host
  /// object proxies return a promise representing asynchronous completion of
  /// remotely invoking the method, or getting the property.  The promise
  /// resolves after the remote operations complete and the promises resolve to
  ///  the resulting value of the operation.  Synchronous host object proxies
  /// work similarly, but block running JavaScript and wait for the remote
  /// operation to complete.
  ///
  /// Setting a property on an asynchronous host object proxy works slightly
  /// differently.  The set returns immediately and the return value is the
  /// value that is set.  This is a requirement of the JavaScript Proxy object.
  /// If you need to asynchronously wait for the property set to complete, use
  /// the `setHostProperty` method which returns a promise as described above.
  /// Synchronous object property set property synchronously blocks until the
  /// property is set.
  ///
  /// For example, suppose you have a COM object with the following interface.
  ///
  /// \snippet HostObjectSample.idl AddHostObjectInterface
  ///
  /// Add an instance of this interface into your JavaScript with
  /// `AddHostObjectToScript`.  In this case, name it `sample`.
  ///
  /// \snippet ScenarioAddHostObject.cpp AddHostObjectToScript
  ///
  /// In the HTML document, use the COM object using
  /// `chrome.webview.hostObjects.sample`.
  /// Note that `CoreWebView2.AddHostObjectToScript` only applies to the
  /// top-level document and not to frames. To add host objects to frames use
  /// `CoreWebView2Frame.AddHostObjectToScript`.
  ///
  /// \snippet assets\ScenarioAddHostObject.html HostObjectUsage
  ///
  /// Exposing host objects to script has security risk.  For more information
  /// about best practices, navigate to
  /// [Best practices for developing secure WebView2 applications](/microsoft-edge/webview2/concepts/security).
  HRESULT AddHostObjectToScript(in LPCWSTR name, in VARIANT* object);

  /// Remove the host object specified by the name so that it is no longer
  /// accessible from JavaScript code in the WebView.  While new access
  /// attempts are denied, if the object is already obtained by JavaScript code
  /// in the WebView, the JavaScript code continues to have access to that
  /// object.   Run this method for a name that is already removed or never
  /// added fails.
  HRESULT RemoveHostObjectFromScript(in LPCWSTR name);

  /// Opens the DevTools window for the current document in the WebView. Does
  /// nothing if run when the DevTools window is already open.
  HRESULT OpenDevToolsWindow();

  /// Add an event handler for the `ContainsFullScreenElementChanged` event.
  /// `ContainsFullScreenElementChanged` triggers when the
  /// `ContainsFullScreenElement` property changes.  An HTML element inside the
  /// WebView may enter fullscreen to the size of the WebView or leave
  /// fullscreen.  This event is useful when, for example, a video element
  /// requests to go fullscreen.  The listener of
  /// `ContainsFullScreenElementChanged` may resize the WebView in response.
  ///
  /// \snippet AppWindow.cpp ContainsFullScreenElementChanged
  HRESULT add_ContainsFullScreenElementChanged(
      /+[in]+/ ICoreWebView2ContainsFullScreenElementChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with
  /// `add_ContainsFullScreenElementChanged`.
  HRESULT remove_ContainsFullScreenElementChanged(
      in EventRegistrationToken token);

  /// Indicates if the WebView contains a fullscreen HTML element.
  @(" propget")
	HRESULT get_ContainsFullScreenElement(
      @("out, retval") BOOL* containsFullScreenElement);

  /// Add an event handler for the `WebResourceRequested` event.
  /// `WebResourceRequested` runs when the WebView is performing a URL request
  /// to a matching URL and resource context filter that was added with
  /// `AddWebResourceRequestedFilter`.  At least one filter must be added for
  /// the event to run.
  ///
  /// The web resource requested may be blocked until the event handler returns
  /// if a deferral is not taken on the event args.  If a deferral is taken,
  /// then the web resource requested is blocked until the deferral is
  /// completed.
  ///
  /// If this event is subscribed in the add_NewWindowRequested handler it should be called
  /// after the new window is set. For more details see `ICoreWebView2NewWindowRequestedEventArgs::put_NewWindow`.
  ///
  /// This event is by default raised for file, http, and https URI schemes.
  /// This is also raised for registered custom URI schemes. For more details
  /// see `ICoreWebView2CustomSchemeRegistration`.
  ///
  /// \snippet SettingsComponent.cpp WebResourceRequested0
  /// \snippet SettingsComponent.cpp WebResourceRequested1
  HRESULT add_WebResourceRequested(
    /+[in]+/ ICoreWebView2WebResourceRequestedEventHandler eventHandler,
    @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_WebResourceRequested`.
  HRESULT remove_WebResourceRequested(
      in EventRegistrationToken token);

  /// Adds a URI and resource context filter for the `WebResourceRequested`
  /// event.  A web resource request with a resource context that matches this
  /// filter's resource context and a URI that matches this filter's URI
  /// wildcard string will be raised via the `WebResourceRequested` event.
  ///
  /// The `uri` parameter value is a wildcard string matched against the URI
  /// of the web resource request. This is a glob style
  /// wildcard string in which a `*` matches zero or more characters and a `?`
  /// matches exactly one character.
  /// These wildcard characters can be escaped using a backslash just before
  /// the wildcard character in order to represent the literal `*` or `?`.
  ///
  /// The matching occurs over the URI as a whole string and not limiting
  /// wildcard matches to particular parts of the URI.
  /// The wildcard filter is compared to the URI after the URI has been
  /// normalized, any URI fragment has been removed, and non-ASCII hostnames
  /// have been converted to punycode.
  ///
  /// Specifying a `nullptr` for the uri is equivalent to an empty string which
  /// matches no URIs.
  ///
  /// For more information about resource context filters, navigate to
  /// [COREWEBVIEW2_WEB_RESOURCE_CONTEXT](/microsoft-edge/webview2/reference/win32/webview2-idl#corewebview2_web_resource_context).
  ///
  /// | URI Filter String | Request URI | Match | Notes |
  /// | ---- | ---- | ---- | ---- |
  /// | `*` | `https://contoso.com/a/b/c` | Yes | A single * will match all URIs |
  /// | `*://contoso.com/*` | `https://contoso.com/a/b/c` | Yes | Matches everything in contoso.com across all schemes |
  /// | `*://contoso.com/*` | `https://example.com/?https://contoso.com/` | Yes | But also matches a URI with just the same text anywhere in the URI |
  /// | `example` | `https://contoso.com/example` | No | The filter does not perform partial matches |
  /// | `*example` | `https://contoso.com/example` | Yes | The filter matches across URI parts  |
  /// | `*example` | `https://contoso.com/path/?example` | Yes | The filter matches across URI parts |
  /// | `*example` | `https://contoso.com/path/?query#example` | No | The filter is matched against the URI with no fragment |
  /// | `*example` | `https://example` | No | The URI is normalized before filter matching so the actual URI used for comparison is `https://example/` |
  /// | `*example/` | `https://example` | Yes | Just like above, but this time the filter ends with a / just like the normalized URI |
  /// | `https://xn--qei.example/` | `https://&#x2764;.example/` | Yes | Non-ASCII hostnames are normalized to punycode before wildcard comparison |
  /// | `https://&#x2764;.example/` | `https://xn--qei.example/` | No | Non-ASCII hostnames are normalized to punycode before wildcard comparison |
  HRESULT AddWebResourceRequestedFilter(
    in LPCWSTR /*const*/ uri,
    in COREWEBVIEW2_WEB_RESOURCE_CONTEXT /*const*/ resourceContext);

  /// Removes a matching WebResource filter that was previously added for the
  /// `WebResourceRequested` event.  If the same filter was added multiple
  /// times, then it must be removed as many times as it was added for the
  /// removal to be effective.  Returns `E_INVALIDARG` for a filter that was
  /// never added.
  HRESULT RemoveWebResourceRequestedFilter(
    in LPCWSTR /*const*/ uri,
    in COREWEBVIEW2_WEB_RESOURCE_CONTEXT /*const*/ resourceContext);

  /// Add an event handler for the `WindowCloseRequested` event.
  /// `WindowCloseRequested` triggers when content inside the WebView
  /// requested to close the window, such as after `window.close` is run.  The
  /// app should close the WebView and related app window if that makes sense
  /// to the app.
  ///
  /// \snippet AppWindow.cpp WindowCloseRequested
  HRESULT add_WindowCloseRequested(
      /+[in]+/ ICoreWebView2WindowCloseRequestedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_WindowCloseRequested`.
  HRESULT remove_WindowCloseRequested(
      in EventRegistrationToken token);
}

/// A continuation of the ICoreWebView2 interface.
const GUID IID_ICoreWebView2_2 = ICoreWebView2_2.iid;

interface ICoreWebView2_2 : ICoreWebView2
{
    static const GUID iid = { 0x9E8F0CF8,0xE670,0x4B5E,[ 0xB2,0xBC,0x73,0xE0,0x61,0xE3,0x18,0x4C ] };
  /// Add an event handler for the WebResourceResponseReceived event.
  /// WebResourceResponseReceived is raised when the WebView receives the
  /// response for a request for a web resource (any URI resolution performed by
  /// the WebView; such as HTTP/HTTPS, file and data requests from redirects,
  /// navigations, declarations in HTML, implicit favicon lookups, and fetch API
  /// usage in the document). The host app can use this event to view the actual
  /// request and response for a web resource. There is no guarantee about the
  /// order in which the WebView processes the response and the host app's
  /// handler runs. The app's handler will not block the WebView from processing
  /// the response.
  /// \snippet ScenarioAuthentication.cpp WebResourceResponseReceived
  HRESULT add_WebResourceResponseReceived(
    /+[in]+/ ICoreWebView2WebResourceResponseReceivedEventHandler eventHandler,
    @("out") EventRegistrationToken* token);
  /// Remove an event handler previously added with
  /// add_WebResourceResponseReceived.
  HRESULT remove_WebResourceResponseReceived(
    in EventRegistrationToken token);

  /// Navigates using a constructed WebResourceRequest object. This lets you
  /// provide post data or additional request headers during navigation.
  /// The headers in the WebResourceRequest override headers
  /// added by WebView2 runtime except for Cookie headers.
  /// Method can only be either "GET" or "POST". Provided post data will only
  /// be sent only if the method is "POST" and the uri scheme is HTTP(S).
  /// \snippet ScenarioNavigateWithWebResourceRequest.cpp NavigateWithWebResourceRequest
  HRESULT NavigateWithWebResourceRequest(/+[in]+/ ICoreWebView2WebResourceRequest request);

  /// Add an event handler for the DOMContentLoaded event.
  /// DOMContentLoaded is raised when the initial html document has been parsed.
  /// This aligns with the document's DOMContentLoaded event in html.
  ///
  /// \snippet ScenarioDOMContentLoaded.cpp DOMContentLoaded
  HRESULT add_DOMContentLoaded(
      /+[in]+/ ICoreWebView2DOMContentLoadedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with add_DOMContentLoaded.
  HRESULT remove_DOMContentLoaded(
      in EventRegistrationToken token);

  /// Gets the cookie manager object associated with this ICoreWebView2.
  /// See ICoreWebView2CookieManager.
  ///
  /// \snippet ScenarioCookieManagement.cpp CookieManager
  @(" propget")
	HRESULT get_CookieManager(@("out, retval") ICoreWebView2CookieManager * cookieManager);

  /// Exposes the CoreWebView2Environment used to create this CoreWebView2.
  @(" propget")
	HRESULT get_Environment(@("out, retval") ICoreWebView2Environment * environment);
}

/// A continuation of the ICoreWebView2_2 interface.
const GUID IID_ICoreWebView2_3 = ICoreWebView2_3.iid;

interface ICoreWebView2_3 : ICoreWebView2_2
{
    static const GUID iid = { 0xA0D6DF20,0x3B92,0x416D,[ 0xAA,0x0C,0x43,0x7A,0x9C,0x72,0x78,0x57 ] };
  /// An app may call the `TrySuspend` API to have the WebView2 consume less memory.
  /// This is useful when a Win32 app becomes invisible, or when a Universal Windows
  /// Platform app is being suspended, during the suspended event handler before completing
  /// the suspended event.
  /// The CoreWebView2Controller's IsVisible property must be false when the API is called.
  /// Otherwise, the API fails with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
  /// Suspending is similar to putting a tab to sleep in the Edge browser. Suspending pauses
  /// WebView script timers and animations, minimizes CPU usage for the associated
  /// browser renderer process and allows the operating system to reuse the memory that was
  /// used by the renderer process for other processes.
  /// Note that Suspend is best effort and considered completed successfully once the request
  /// is sent to browser renderer process. If there is a running script, the script will continue
  /// to run and the renderer process will be suspended after that script is done.
  /// See [Sleeping Tabs FAQ](https://techcommunity.microsoft.com/t5/articles/sleeping-tabs-faq/m-p/1705434)
  /// for conditions that might prevent WebView from being suspended. In those situations,
  /// the completed handler will be invoked with isSuccessful as false and errorCode as S_OK.
  /// The WebView will be automatically resumed when it becomes visible. Therefore, the
  /// app normally does not have to call `Resume` explicitly.
  /// The app can call `Resume` and then `TrySuspend` periodically for an invisible WebView so that
  /// the invisible WebView can sync up with latest data and the page ready to show fresh content
  /// when it becomes visible.
  /// All WebView APIs can still be accessed when a WebView is suspended. Some APIs like Navigate
  /// will auto resume the WebView. To avoid unexpected auto resume, check `IsSuspended` property
  /// before calling APIs that might change WebView state.
  ///
  /// \snippet ViewComponent.cpp ToggleIsVisibleOnMinimize
  ///
  /// \snippet ViewComponent.cpp Suspend
  ///
  HRESULT TrySuspend(/+[in]+/ ICoreWebView2TrySuspendCompletedHandler handler);

  /// Resumes the WebView so that it resumes activities on the web page.
  /// This API can be called while the WebView2 controller is invisible.
  /// The app can interact with the WebView immediately after `Resume`.
  /// WebView will be automatically resumed when it becomes visible.
  ///
  /// \snippet ViewComponent.cpp ToggleIsVisibleOnMinimize
  ///
  /// \snippet ViewComponent.cpp Resume
  ///
  HRESULT Resume();

  /// Whether WebView is suspended.
  /// `TRUE` when WebView is suspended, from the time when TrySuspend has completed
  ///  successfully until WebView is resumed.
  @(" propget")
	HRESULT get_IsSuspended(@("out, retval") BOOL* isSuspended);

  /// Sets a mapping between a virtual host name and a folder path to make available to web sites
  /// via that host name.
  ///
  /// After setting the mapping, documents loaded in the WebView can use HTTP or HTTPS URLs at
  /// the specified host name specified by hostName to access files in the local folder specified
  /// by folderPath.
  ///
  /// This mapping applies to both top-level document and iframe navigations as well as subresource
  /// references from a document. This also applies to web workers including dedicated/shared worker
  /// and service worker, for loading either worker scripts or subresources
  /// (importScripts(), fetch(), XHR, etc.) issued from within a worker.
  /// For virtual host mapping to work with service worker, please keep the virtual host name
  /// mappings consistent among all WebViews sharing the same browser instance. As service worker
  /// works independently of WebViews, we merge mappings from all WebViews when resolving virtual
  /// host name, inconsistent mappings between WebViews would lead unexpected behavior.
  ///
  /// Due to a current implementation limitation, media files accessed using virtual host name can be
  /// very slow to load.
  /// As the resource loaders for the current page might have already been created and running,
  /// changes to the mapping might not be applied to the current page and a reload of the page is
  /// needed to apply the new mapping.
  ///
  /// Both absolute and relative paths are supported for folderPath. Relative paths are interpreted
  /// as relative to the folder where the exe of the app is in.
  ///
  /// Note that the folderPath length must not exceed the Windows MAX_PATH limit.
  ///
  /// accessKind specifies the level of access to resources under the virtual host from other sites.
  ///
  /// For example, after calling
  /// ```cpp
  ///    SetVirtualHostNameToFolderMapping(
  ///        L"appassets.example", L"assets",
  ///        COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY);
  /// ```
  /// navigating to `https://appassets.example/my-local-file.html` will
  /// show the content from my-local-file.html in the assets subfolder located on disk under
  /// the same path as the app's executable file.
  ///
  /// DOM elements that want to reference local files will have their host reference virtual host in the source.
  /// If there are multiple folders being used, define one unique virtual host per folder.
  /// For example, you can embed a local image like this
  /// ```cpp
  ///    WCHAR c_navString[] = L"<img src=\"http://appassets.example/wv2.png\"/>";
  ///    m_webView->NavigateToString(c_navString);
  /// ```
  /// The example above shows the image wv2.png by resolving the folder mapping above.
  ///
  /// You should typically choose virtual host names that are never used by real sites.
  /// If you own a domain such as example.com, another option is to use a subdomain reserved for
  /// the app (like my-app.example.com).
  ///
  /// [RFC 6761](https://tools.ietf.org/html/rfc6761) has reserved several special-use domain
  /// names that are guaranteed to not be used by real sites (for example, .example, .test, and
  /// .invalid.)
  ///
  /// Note that using `.local` as the top-level domain name will work but can cause a delay
  /// during navigations. You should avoid using `.local` if you can.
  ///
  /// Apps should use distinct domain names when mapping folder from different sources that
  /// should be isolated from each other. For instance, the app might use app-file.example for
  /// files that ship as part of the app, and book1.example might be used for files containing
  /// books from a less trusted source that were previously downloaded and saved to the disk by
  /// the app.
  ///
  /// The host name used in the APIs is canonicalized using Chromium's host name parsing logic
  /// before being used internally. For more information see [HTML5 2.6 URLs](https://dev.w3.org/html5/spec-LC/urls.html).
  ///
  /// All host names that are canonicalized to the same string are considered identical.
  /// For example, `EXAMPLE.COM` and `example.com` are treated as the same host name.
  /// An international host name and its Punycode-encoded host name are considered the same host
  /// name. There is no DNS resolution for host name and the trailing '.' is not normalized as
  /// part of canonicalization.
  ///
  /// Therefore `example.com` and `example.com.` are treated as different host names. Similarly,
  /// `virtual-host-name` and `virtual-host-name.example.com` are treated as different host names
  /// even if the machine has a DNS suffix of `example.com`.
  ///
  /// Specify the minimal cross-origin access necessary to run the app. If there is not a need to
  /// access local resources from other origins, use COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY.
  ///
  /// \snippet AppWindow.cpp AddVirtualHostNameToFolderMapping
  ///
  /// \snippet AppWindow.cpp LocalUrlUsage
  HRESULT SetVirtualHostNameToFolderMapping(
      in LPCWSTR hostName,
      in LPCWSTR folderPath,
      in COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND accessKind);

  /// Clears a host name mapping for local folder that was added by `SetVirtualHostNameToFolderMapping`.
  HRESULT ClearVirtualHostNameToFolderMapping(
      in LPCWSTR hostName);
}

/// A continuation of the ICoreWebView2_3 interface to support FrameCreated and
/// DownloadStarting events.
const GUID IID_ICoreWebView2_4 = ICoreWebView2_4.iid;

interface ICoreWebView2_4 : ICoreWebView2_3
{
    static const GUID iid = { 0x20d02d59,0x6df2,0x42dc,[ 0xbd,0x06,0xf9,0x8a,0x69,0x4b,0x13,0x02 ] };
  /// Raised when a new iframe is created.
  /// Handle this event to get access to ICoreWebView2Frame objects.
  /// Use ICoreWebView2Frame.add_Destroyed to listen for when this iframe goes
  /// away.
  HRESULT add_FrameCreated(
      /+[in]+/ ICoreWebView2FrameCreatedEventHandler  eventHandler,
      @("out") EventRegistrationToken * token);

  /// Remove an event handler previously added with add_FrameCreated.
  HRESULT remove_FrameCreated(in EventRegistrationToken token);

  /// Add an event handler for the `DownloadStarting` event. This event is
  /// raised when a download has begun, blocking the default download dialog,
  /// but not blocking the progress of the download.
  ///
  /// The host can choose to cancel a download, change the result file path,
  /// and hide the default download dialog.
  /// If the host chooses to cancel the download, the download is not saved, no
  /// dialog is shown, and the state is changed to
  /// COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED with interrupt reason
  /// COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED. Otherwise, the
  /// download is saved to the default path after the event completes,
  /// and default download dialog is shown if the host did not choose to hide it.
  /// The host can change the visibility of the download dialog using the
  /// `Handled` property. If the event is not handled, downloads complete
  /// normally with the default dialog shown.
  ///
  /// \snippet ScenarioCustomDownloadExperience.cpp DownloadStarting
  HRESULT add_DownloadStarting(
    /+[in]+/ ICoreWebView2DownloadStartingEventHandler eventHandler,
    @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_DownloadStarting`.
  HRESULT remove_DownloadStarting(
      in EventRegistrationToken token);
}

/// A continuation of the ICoreWebView2_4 interface to support ClientCertificateRequested
/// event.
const GUID IID_ICoreWebView2_5 = ICoreWebView2_5.iid;

interface ICoreWebView2_5 : ICoreWebView2_4
{
    static const GUID iid = { 0xbedb11b8,0xd63c,0x11eb,[ 0xb8,0xbc,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Add an event handler for the ClientCertificateRequested event.
  /// The ClientCertificateRequested event is raised when the WebView2
  /// is making a request to an HTTP server that needs a client certificate
  /// for HTTP authentication.
  /// Read more about HTTP client certificates at
  /// [RFC 8446 The Transport Layer Security (TLS) Protocol Version 1.3](https://tools.ietf.org/html/rfc8446).
  ///
  /// With this event you have several options for responding to client certificate requests:
  ///
  /// Scenario                                                   | Handled | Cancel | SelectedCertificate
  /// ---------------------------------------------------------- | ------- | ------ | -------------------
  /// Respond to server with a certificate                       | True    | False  | MutuallyTrustedCertificate value
  /// Respond to server without certificate                      | True    | False  | null
  /// Display default client certificate selection dialog prompt | False   | False  | n/a
  /// Cancel the request                                         | n/a     | True   | n/a
  ///
  /// If you don't handle the event, WebView2 will
  /// show the default client certificate selection dialog prompt to user.
  ///
  /// \snippet SettingsComponent.cpp ClientCertificateRequested1
  /// \snippet ScenarioClientCertificateRequested.cpp ClientCertificateRequested2
  HRESULT add_ClientCertificateRequested(
      /+[in]+/ ICoreWebView2ClientCertificateRequestedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with add_ClientCertificateRequested.
  HRESULT remove_ClientCertificateRequested(in EventRegistrationToken token);
}

/// This interface is an extension of `ICoreWebView2_5` that manages opening
/// the browser task manager window.
const GUID IID_ICoreWebView2_6 = ICoreWebView2_6.iid;

interface ICoreWebView2_6 : ICoreWebView2_5
{
    static const GUID iid = { 0x499aadac,0xd92c,0x4589,[ 0x8a,0x75,0x11,0x1b,0xfc,0x16,0x77,0x95 ] };
  /// Opens the Browser Task Manager view as a new window in the foreground.
  /// If the Browser Task Manager is already open, this will bring it into
  /// the foreground. WebView2 currently blocks the Shift+Esc shortcut for
  /// opening the task manager. An end user can open the browser task manager
  /// manually via the `Browser task manager` entry of the DevTools window's
  /// title bar's context menu.
  HRESULT OpenTaskManagerWindow();
}

/// This interface is an extension of `ICoreWebView2_6` that supports printing
/// to PDF.
const GUID IID_ICoreWebView2_7 = ICoreWebView2_7.iid;

interface ICoreWebView2_7 : ICoreWebView2_6
{
    static const GUID iid = { 0x79c24d83,0x09a3,0x45ae,[ 0x94,0x18,0x48,0x7f,0x32,0xa5,0x87,0x40 ] };
  /// Print the current page to PDF asynchronously with the provided settings.
  /// See `ICoreWebView2PrintSettings` for description of settings. Passing
  /// nullptr for `printSettings` results in default print settings used.
  ///
  /// Use `resultFilePath` to specify the path to the PDF file. The host should
  /// provide an absolute path, including file name. If the path
  /// points to an existing file, the file will be overwritten. If the path is
  /// not valid, the method fails with `E_INVALIDARG`.
  ///
  /// The async `PrintToPdf` operation completes when the data has been written
  /// to the PDF file. At this time the
  /// `ICoreWebView2PrintToPdfCompletedHandler` is invoked. If the
  /// application exits before printing is complete, the file is not saved.
  /// Only one `Printing` operation can be in progress at a time. If
  /// `PrintToPdf` is called while a `PrintToPdf` or `PrintToPdfStream` or `Print` or
  /// `ShowPrintUI` job is in progress, the completed handler is immediately invoked
  /// with `isSuccessful` set to FALSE.
  ///
  /// \snippet FileComponent.cpp PrintToPdf
  HRESULT PrintToPdf(
    in LPCWSTR resultFilePath,
    /+[in]+/ ICoreWebView2PrintSettings printSettings,
    /+[in]+/ ICoreWebView2PrintToPdfCompletedHandler handler);
}

/// This interface is an extension of `ICoreWebView2_7` that supports media features.
const GUID IID_ICoreWebView2_8 = ICoreWebView2_8.iid;

interface ICoreWebView2_8 : ICoreWebView2_7
{
    static const GUID iid = { 0xE9632730,0x6E1E,0x43AB,[ 0xB7,0xB8,0x7B,0x2C,0x9E,0x62,0xE0,0x94 ] };
  /// Adds an event handler for the `IsMutedChanged` event.
  /// `IsMutedChanged` is raised when the IsMuted property changes value.
  ///
  /// \snippet AudioComponent.cpp IsMutedChanged
  HRESULT add_IsMutedChanged(
      /+[in]+/ ICoreWebView2IsMutedChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_IsMutedChanged`.
  HRESULT remove_IsMutedChanged(
      in EventRegistrationToken token);

  /// Indicates whether all audio output from this CoreWebView2 is muted or not.
  ///
  /// \snippet AudioComponent.cpp ToggleIsMuted
  @(" propget")
	HRESULT get_IsMuted(@("out, retval") BOOL* value);

  /// Sets the `IsMuted` property.
  ///
  /// \snippet AudioComponent.cpp ToggleIsMuted
  @(" propput")
	HRESULT put_IsMuted(in BOOL value);

  /// Adds an event handler for the `IsDocumentPlayingAudioChanged` event.
  /// `IsDocumentPlayingAudioChanged` is raised when the IsDocumentPlayingAudio property changes value.
  ///
  /// \snippet AudioComponent.cpp IsDocumentPlayingAudioChanged
  HRESULT add_IsDocumentPlayingAudioChanged(
      /+[in]+/ ICoreWebView2IsDocumentPlayingAudioChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_IsDocumentPlayingAudioChanged`.
  HRESULT remove_IsDocumentPlayingAudioChanged(
      in EventRegistrationToken token);

  /// Indicates whether any audio output from this CoreWebView2 is playing.
  /// This property will be true if audio is playing even if IsMuted is true.
  ///
  /// \snippet AudioComponent.cpp IsDocumentPlayingAudio
  @(" propget")
	HRESULT get_IsDocumentPlayingAudio(@("out, retval") BOOL* value);
}

/// This interface is an extension of `ICoreWebView2_8` that default download
/// dialog positioning and anchoring.
const GUID IID_ICoreWebView2_9 = ICoreWebView2_9.iid;

interface ICoreWebView2_9 : ICoreWebView2_8
{
    static const GUID iid = { 0x4d7b2eab,0x9fdc,0x468d,[ 0xb9,0x98,0xa9,0x26,0x0b,0x5e,0xd6,0x51 ] };
  /// Raised when the `IsDefaultDownloadDialogOpen` property changes. This event
  /// comes after the `DownloadStarting` event. Setting the `Handled` property
  /// on the `DownloadStartingEventArgs` disables the default download dialog
  /// and ensures that this event is never raised.
  HRESULT add_IsDefaultDownloadDialogOpenChanged(
      /+[in]+/ ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler handler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with
  /// `add_IsDefaultDownloadDialogOpenChanged`.
  HRESULT remove_IsDefaultDownloadDialogOpenChanged(
      in EventRegistrationToken token);

  /// `TRUE` if the default download dialog is currently open. The value of this
  /// property changes only when the default download dialog is explicitly
  /// opened or closed. Hiding the WebView implicitly hides the dialog, but does
  /// not change the value of this property.
  @(" propget")
	HRESULT get_IsDefaultDownloadDialogOpen(@("out, retval") BOOL* value);

  /// Open the default download dialog. If the dialog is opened before there
  /// are recent downloads, the dialog shows all past downloads for the
  /// current profile. Otherwise, the dialog shows only the recent downloads
  /// with a "See more" button for past downloads. Calling this method raises
  /// the `IsDefaultDownloadDialogOpenChanged` event if the dialog was closed.
  /// No effect if the dialog is already open.
  ///
  /// \snippet ViewComponent.cpp ToggleDefaultDownloadDialog
  HRESULT OpenDefaultDownloadDialog();

  /// Close the default download dialog. Calling this method raises the
  /// `IsDefaultDownloadDialogOpenChanged` event if the dialog was open. No
  /// effect if the dialog is already closed.
  HRESULT CloseDefaultDownloadDialog();

  /// Get the default download dialog corner alignment.
  @(" propget")
	HRESULT get_DefaultDownloadDialogCornerAlignment(
      @("out, retval") COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT* value);

  /// Set the default download dialog corner alignment. The dialog can be
  /// aligned to any of the WebView corners (see
  /// COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT). When the WebView
  /// or dialog changes size, the dialog keeps its position relative to the
  /// corner. The dialog may become partially or completely outside of the
  /// WebView bounds if the WebView is small enough. Set the margin relative to
  /// the corner with the `DefaultDownloadDialogMargin` property. The corner
  /// alignment and margin should be set during initialization to ensure that
  /// they are correctly applied when the layout is first computed, otherwise
  /// they will not take effect until the next time the WebView position or size
  /// is updated.
  ///
  /// \snippet ViewComponent.cpp SetDefaultDownloadDialogPosition
  @(" propput")
	HRESULT put_DefaultDownloadDialogCornerAlignment(
      in COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT value);

  /// Get the default download dialog margin.
  @(" propget")
	HRESULT get_DefaultDownloadDialogMargin(@("out, retval") POINT* value);

  /// Set the default download dialog margin relative to the WebView corner
  /// specified by `DefaultDownloadDialogCornerAlignment`. The margin is a
  /// point that describes the vertical and horizontal distances between the
  /// chosen WebView corner and the default download dialog corner nearest to
  /// it. Positive values move the dialog towards the center of the WebView from
  /// the chosen WebView corner, and negative values move the dialog away from
  /// it. Use (0, 0) to align the dialog to the WebView corner with no margin.
  /// The corner alignment and margin should be set during initialization to
  /// ensure that they are correctly applied when the layout is first computed,
  /// otherwise they will not take effect until the next time the WebView
  /// position or size is updated.
  @(" propput")
	HRESULT put_DefaultDownloadDialogMargin(in POINT value);
}

/// This interface is an extension of `ICoreWebView2_9` that supports
/// BasicAuthenticationRequested event.
const GUID IID_ICoreWebView2_10 = ICoreWebView2_10.iid;

interface ICoreWebView2_10 : ICoreWebView2_9
{
    static const GUID iid = { 0xb1690564,0x6f5a,0x4983,[ 0x8e,0x48,0x31,0xd1,0x14,0x3f,0xec,0xdb ] };
  /// Add an event handler for the BasicAuthenticationRequested event.
  /// BasicAuthenticationRequested event is raised when WebView encounters a
  /// Basic HTTP Authentication request as described in
  /// https://developer.mozilla.org/docs/Web/HTTP/Authentication, a Digest
  /// HTTP Authentication request as described in
  /// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#digest,
  /// an NTLM authentication or a Proxy Authentication request.
  ///
  /// The host can provide a response with credentials for the authentication or
  /// cancel the request. If the host sets the Cancel property to false but does not
  /// provide either UserName or Password properties on the Response property, then
  /// WebView2 will show the default authentication challenge dialog prompt to
  /// the user.
  ///
  /// \snippet ScenarioAuthentication.cpp BasicAuthenticationRequested
  HRESULT add_BasicAuthenticationRequested(
      /+[in]+/ ICoreWebView2BasicAuthenticationRequestedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with add_BasicAuthenticationRequested.
  HRESULT remove_BasicAuthenticationRequested(
      in EventRegistrationToken token);
}

/// This interface is an extension of `ICoreWebView2_10` that supports sessionId
/// for CDP method calls and ContextMenuRequested event.
const GUID IID_ICoreWebView2_11 = ICoreWebView2_11.iid;

interface ICoreWebView2_11 : ICoreWebView2_10
{
    static const GUID iid = { 0x0be78e56,0xc193,0x4051,[ 0xb9,0x43,0x23,0xb4,0x60,0xc0,0x8b,0xdb ] };
  /// Runs an asynchronous `DevToolsProtocol` method for a specific session of
  /// an attached target.
  /// There could be multiple `DevToolsProtocol` targets in a WebView.
  /// Besides the top level page, iframes from different origin and web workers
  /// are also separate targets. Attaching to these targets allows interaction with them.
  /// When the DevToolsProtocol is attached to a target, the connection is identified
  /// by a sessionId.
  /// To use this API, you must set the `flatten` parameter to true when calling
  /// `Target.attachToTarget` or `Target.setAutoAttach` `DevToolsProtocol` method.
  /// Using `Target.setAutoAttach` is recommended as that would allow you to attach
  /// to dedicated worker targets, which are not discoverable via other APIs like
  /// `Target.getTargets`.
  /// For more information about targets and sessions, navigate to
  /// [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/tot/Target).
  /// For more information about available methods, navigate to
  /// [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/tot)
  /// The `sessionId` parameter is the sessionId for an attached target.
  /// nullptr or empty string is treated as the session for the default target for the top page.
  /// The `methodName` parameter is the full name of the method in the
  /// `{domain}.{method}` format.  The `parametersAsJson` parameter is a JSON
  /// formatted string containing the parameters for the corresponding method.
  /// The `Invoke` method of the `handler` is run when the method
  /// asynchronously completes.  `Invoke` is run with the return object of the
  /// method as a JSON string.  This function returns E_INVALIDARG if the `methodName` is
  /// unknown or the `parametersAsJson` has an error.  In the case of such an error, the
  /// `returnObjectAsJson` parameter of the handler will include information
  /// about the error.
  ///
  /// \snippet ScriptComponent.cpp DevToolsProtocolMethodMultiSession
  ///
  /// \snippet ScriptComponent.cpp CallDevToolsProtocolMethodForSession
  HRESULT CallDevToolsProtocolMethodForSession(
      in LPCWSTR sessionId,
      in LPCWSTR methodName,
      in LPCWSTR parametersAsJson,
      /+[in]+/ ICoreWebView2CallDevToolsProtocolMethodCompletedHandler handler);

  /// Add an event handler for the `ContextMenuRequested` event.
  /// `ContextMenuRequested` event is raised when a context menu is requested by the user
  /// and the content inside WebView hasn't disabled context menus.
  /// The host has the option to create their own context menu with the information provided in
  /// the event or can add items to or remove items from WebView context menu.
  /// If the host doesn't handle the event, WebView will display the default context menu.
  ///
  /// \snippet SettingsComponent.cpp EnableCustomMenu
  HRESULT add_ContextMenuRequested(
      /+[in]+/ ICoreWebView2ContextMenuRequestedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_ContextMenuRequested`.
  HRESULT remove_ContextMenuRequested(
      in EventRegistrationToken token);
}

/// This interface is an extension of `ICoreWebView2_11` that supports
/// StatusBarTextChanged event.
const GUID IID_ICoreWebView2_12 = ICoreWebView2_12.iid;

interface ICoreWebView2_12 : ICoreWebView2_11
{
    static const GUID iid = { 0x35D69927,0xBCFA,0x4566,[ 0x93,0x49,0x6B,0x3E,0x0D,0x15,0x4C,0xAC ] };
  /// Add an event handler for the `StatusBarTextChanged` event.
  /// `StatusBarTextChanged` fires when the WebView is showing a status message,
  /// a URL, or an empty string (an indication to hide the status bar).
  /// \snippet SettingsComponent.cpp StatusBarTextChanged
  HRESULT add_StatusBarTextChanged(
      /+[in]+/ ICoreWebView2StatusBarTextChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_StatusBarTextChanged`.
  HRESULT remove_StatusBarTextChanged(in EventRegistrationToken token);

  /// The status message text.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_StatusBarText(@("out, retval") LPWSTR* value);
}

/// This interface is an extension of `ICoreWebView2_12` that supports Profile
/// API.
const GUID IID_ICoreWebView2_13 = ICoreWebView2_13.iid;

interface ICoreWebView2_13 : ICoreWebView2_12
{
    static const GUID iid = { 0xF75F09A8,0x667E,0x4983,[ 0x88,0xD6,0xC8,0x77,0x3F,0x31,0x5E,0x84 ] };
  /// The associated `ICoreWebView2Profile` object. If this CoreWebView2 was created with a
  /// CoreWebView2ControllerOptions, the CoreWebView2Profile will match those specified options.
  /// Otherwise if this CoreWebView2 was created without a CoreWebView2ControllerOptions, then
  /// this will be the default CoreWebView2Profile for the corresponding CoreWebView2Environment.
  ///
  /// \snippet AppWindow.cpp CoreWebView2Profile
  @(" propget")
	HRESULT get_Profile(@("out, retval") ICoreWebView2Profile * value);
}

/// This interface is an extension of `ICoreWebView2_13` that adds
/// ServerCertificate support.
const GUID IID_ICoreWebView2_14 = ICoreWebView2_14.iid;

interface ICoreWebView2_14 : ICoreWebView2_13
{
    static const GUID iid = { 0x6DAA4F10,0x4A90,0x4753,[ 0x88,0x98,0x77,0xC5,0xDF,0x53,0x41,0x65 ] };
  /// Add an event handler for the ServerCertificateErrorDetected event.
  /// The ServerCertificateErrorDetected event is raised when the WebView2
  /// cannot verify server's digital certificate while loading a web page.
  ///
  /// This event will raise for all web resources and follows the `WebResourceRequested` event.
  ///
  /// If you don't handle the event, WebView2 will show the default TLS interstitial error page to the user
  /// for navigations, and for non-navigations the web request is cancelled.
  ///
  /// Note that WebView2 before raising `ServerCertificateErrorDetected` raises a `NavigationCompleted` event
  /// with `IsSuccess` as FALSE and any of the below WebErrorStatuses that indicate a certificate failure.
  ///
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_COMMON_NAME_IS_INCORRECT
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_EXPIRED
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_CLIENT_CERTIFICATE_CONTAINS_ERRORS
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_REVOKED
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_IS_INVALID
  ///
  /// For more details see `ICoreWebView2NavigationCompletedEventArgs::get_IsSuccess` and handle
  /// ServerCertificateErrorDetected event or show the default TLS interstitial error page to the user
  /// according to the app needs.
  ///
  /// WebView2 caches the response when action is `COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_ALWAYS_ALLOW`
  /// for the RequestUri's host and the server certificate in the session and the `ServerCertificateErrorDetected`
  /// event won't be raised again.
  ///
  /// To raise the event again you must clear the cache using `ClearServerCertificateErrorActions`.
  ///
  /// \snippet SettingsComponent.cpp ServerCertificateErrorDetected1
  HRESULT add_ServerCertificateErrorDetected(
      /+[in]+/ ICoreWebView2ServerCertificateErrorDetectedEventHandler
          eventHandler,
      @("out") EventRegistrationToken* token);
  /// Remove an event handler previously added with add_ServerCertificateErrorDetected.
  HRESULT remove_ServerCertificateErrorDetected(in EventRegistrationToken token);

  /// Clears all cached decisions to proceed with TLS certificate errors from the
  /// ServerCertificateErrorDetected event for all WebView2's sharing the same session.
  HRESULT ClearServerCertificateErrorActions(
      /+[in]+/ ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler
      handler);
}

/// Receives `StatusBarTextChanged` events.
const GUID IID_ICoreWebView2StatusBarTextChangedEventHandler = ICoreWebView2StatusBarTextChangedEventHandler.iid;

interface ICoreWebView2StatusBarTextChangedEventHandler : IUnknown
{
    static const GUID iid = { 0xA5E3B0D0,0x10DF,0x4156,[ 0xBF,0xAD,0x3B,0x43,0x86,0x7A,0xCA,0xC6 ] };
  /// Called to provide the implementer with the event args for the
  /// corresponding event. No event args exist and the `args`
  /// parameter is set to `null`.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ IUnknown args);
}

/// This interface is an extension of `ICoreWebView2_14` that supports status Favicons.
const GUID IID_ICoreWebView2_15 = ICoreWebView2_15.iid;

interface ICoreWebView2_15 : ICoreWebView2_14
{
    static const GUID iid = { 0x517B2D1D,0x7DAE,0x4A66,[ 0xA4,0xF4,0x10,0x35,0x2F,0xFB,0x95,0x18 ] };
  /// Add an event handler for the `FaviconChanged` event.
  /// The `FaviconChanged` event is raised when the
  /// [favicon](https://developer.mozilla.org/docs/Glossary/Favicon)
  /// had a different URL then the previous URL.
  /// The FaviconChanged event will be raised for first navigating to a new
  /// document, whether or not a document declares a Favicon in HTML if the
  /// favicon is different from the previous fav icon. The event will
  /// be raised again if a favicon is declared in its HTML or has script
  /// to set its favicon. The favicon information can then be retrieved with
  /// `GetFavicon` and `FaviconUri`.
  HRESULT add_FaviconChanged(
      /+[in]+/ ICoreWebView2FaviconChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove the event handler for `FaviconChanged` event.
  HRESULT remove_FaviconChanged(
      in EventRegistrationToken token);

  /// Get the current Uri of the favicon as a string.
  /// If the value is null, then the return value is `E_POINTER`, otherwise it is `S_OK`.
  /// If a page has no favicon then the value is an empty string.
  @(" propget")
	HRESULT get_FaviconUri(@("out, retval") LPWSTR* value);

  /// Async function for getting the actual image data of the favicon.
  /// The image is copied to the `imageStream` object in `ICoreWebView2GetFaviconCompletedHandler`.
  /// If there is no image then no data would be copied into the imageStream.
  /// The `format` is the file format to return the image stream.
  /// `completedHandler` is executed at the end of the operation.
  ///
  /// \snippet SettingsComponent.cpp FaviconChanged
  HRESULT GetFavicon(
        in COREWEBVIEW2_FAVICON_IMAGE_FORMAT format,
        /+[in]+/ ICoreWebView2GetFaviconCompletedHandler completedHandler);
}

/// A continuation of the `ICoreWebView2` interface to support printing.
const GUID IID_ICoreWebView2_16 = ICoreWebView2_16.iid;

interface ICoreWebView2_16 : ICoreWebView2_15
{
    static const GUID iid = { 0x0EB34DC9,0x9F91,0x41E1,[ 0x86,0x39,0x95,0xCD,0x59,0x43,0x90,0x6B ] };
  /// Print the current web page asynchronously to the specified printer with the provided settings.
  /// See `ICoreWebView2PrintSettings` for description of settings. Passing
  /// nullptr for `printSettings` results in default print settings used.
  ///
  /// The handler will return `errorCode` as `S_OK` and `printStatus` as COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE
  /// if `printerName` doesn't match with the name of any installed printers on the user OS. The handler
  /// will return `errorCode` as `E_INVALIDARG` and `printStatus` as COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR
  /// if the caller provides invalid settings for a given printer.
  ///
  /// The async `Print` operation completes when it finishes printing to the printer.
  /// At this time the `ICoreWebView2PrintCompletedHandler` is invoked.
  /// Only one `Printing` operation can be in progress at a time. If `Print` is called while a `Print` or `PrintToPdf`
  /// or `PrintToPdfStream` or `ShowPrintUI` job is in progress, the completed handler is immediately invoked
  /// with `E_ABORT` and `printStatus` is COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR.
  /// This is only for printing operation on one webview.
  ///
  /// |       errorCode     |      printStatus                              |               Notes                                                                           |
  /// | --- | --- | --- |
  /// |        S_OK         | COREWEBVIEW2_PRINT_STATUS_SUCCEEDED           | Print operation succeeded.                                                                    |
  /// |        S_OK         | COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE | If specified printer is not found or printer status is not available, offline or error state. |
  /// |        S_OK         | COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR         | Print operation is failed.                                                                    |
  /// |     E_INVALIDARG    | COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR         | If the caller provides invalid settings for the specified printer.                            |
  /// |       E_ABORT       | COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR         | Print operation is failed as printing job already in progress.                                |
  ///
  /// \snippet AppWindow.cpp PrintToPrinter
  HRESULT Print(
    /+[in]+/ ICoreWebView2PrintSettings printSettings,
    /+[in]+/ ICoreWebView2PrintCompletedHandler handler);

  /// Opens the print dialog to print the current web page. See `COREWEBVIEW2_PRINT_DIALOG_KIND`
  /// for descriptions of print dialog kinds.
  ///
  /// Invoking browser or system print dialog doesn't open new print dialog if
  /// it is already open.
  ///
  /// \snippet AppWindow.cpp ShowPrintUI
  HRESULT ShowPrintUI(in COREWEBVIEW2_PRINT_DIALOG_KIND printDialogKind);

  /// Provides the Pdf data of current web page asynchronously for the provided settings.
  /// Stream will be rewound to the start of the pdf data.
  ///
  /// See `ICoreWebView2PrintSettings` for description of settings. Passing
  /// nullptr for `printSettings` results in default print settings used.
  ///
  /// The async `PrintToPdfStream` operation completes when it finishes
  /// writing to the stream. At this time the `ICoreWebView2PrintToPdfStreamCompletedHandler`
  /// is invoked. Only one `Printing` operation can be in progress at a time. If
  /// `PrintToPdfStream` is called while a `PrintToPdfStream` or `PrintToPdf` or `Print`
  /// or `ShowPrintUI` job is in progress, the completed handler is immediately invoked with `E_ABORT`.
  /// This is only for printing operation on one webview.
  ///
  /// \snippet AppWindow.cpp PrintToPdfStream
  HRESULT PrintToPdfStream(/+[in]+/ ICoreWebView2PrintSettings printSettings,
                           /+[in]+/ ICoreWebView2PrintToPdfStreamCompletedHandler handler);
}

/// Receives the result of the `Print` method.
const GUID IID_ICoreWebView2PrintCompletedHandler = ICoreWebView2PrintCompletedHandler.iid;

interface ICoreWebView2PrintCompletedHandler : IUnknown
{
    static const GUID iid = { 0x8FD80075,0xED08,0x42DB,[ 0x85,0x70,0xF5,0xD1,0x49,0x77,0x46,0x1E ] };
  /// Provides the result of the corresponding asynchronous method.
  HRESULT Invoke(in HRESULT errorCode, in COREWEBVIEW2_PRINT_STATUS printStatus);
}

/// This interface is an extension of `ICoreWebView2_16` that supports shared buffer based on file mapping.
const GUID IID_ICoreWebView2_17 = ICoreWebView2_17.iid;

interface ICoreWebView2_17 : ICoreWebView2_16
{
    static const GUID iid = { 0x702E75D4,0xFD44,0x434D,[ 0x9D,0x70,0x1A,0x68,0xA6,0xB1,0x19,0x2A ] };
  /// Share a shared buffer object with script of the main frame in the WebView.
  /// The script will receive a `sharedbufferreceived` event from chrome.webview.
  /// The event arg for that event will have the following methods and properties:
  ///   `getBuffer()`: return an ArrayBuffer object with the backing content from the shared buffer.
  ///   `additionalData`: an object as the result of parsing `additionalDataAsJson` as JSON string.
  ///           This property will be `undefined` if `additionalDataAsJson` is nullptr or empty string.
  ///   `source`: with a value set as `chrome.webview` object.
  /// If a string is provided as `additionalDataAsJson` but it is not a valid JSON string,
  /// the API will fail with `E_INVALIDARG`.
  /// If `access` is COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_ONLY, the script will only have read access to the buffer.
  /// If the script tries to modify the content in a read only buffer, it will cause an access
  /// violation in WebView renderer process and crash the renderer process.
  /// If the shared buffer is already closed, the API will fail with `RO_E_CLOSED`.
  ///
  /// The script code should call `chrome.webview.releaseBuffer` with
  /// the shared buffer as the parameter to release underlying resources as soon
  /// as it does not need access to the shared buffer any more.
  ///
  /// The application can post the same shared buffer object to multiple web pages or iframes, or
  /// post to the same web page or iframe multiple times. Each `PostSharedBufferToScript` will
  /// create a separate ArrayBuffer object with its own view of the memory and is separately
  /// released. The underlying shared memory will be released when all the views are released.
  ///
  /// For example, if we want to send data to script for one time read only consumption.
  ///
  /// \snippet ScenarioSharedBuffer.cpp OneTimeShareBuffer
  ///
  /// In the HTML document,
  ///
  /// \snippet assets\ScenarioSharedBuffer.html ShareBufferScriptCode_1
  ///
  /// \snippet assets\ScenarioSharedBuffer.html ShareBufferScriptCode_2
  ///
  /// Sharing a buffer to script has security risk. You should only share buffer with trusted site.
  /// If a buffer is shared to a untrusted site, possible sensitive information could be leaked.
  /// If a buffer is shared as modifiable by the script and the script modifies it in an unexpected way,
  /// it could result in corrupted data that might even crash the application.
  ///
  HRESULT PostSharedBufferToScript(
    /+[in]+/ ICoreWebView2SharedBuffer sharedBuffer,
    in COREWEBVIEW2_SHARED_BUFFER_ACCESS access,
    in LPCWSTR additionalDataAsJson);
}

/// Receives the result of the `PrintToPdfStream` method.
/// `errorCode` returns S_OK if the PrintToPdfStream operation succeeded.
/// The printable pdf data is returned in the `pdfStream` object.
const GUID IID_ICoreWebView2PrintToPdfStreamCompletedHandler = ICoreWebView2PrintToPdfStreamCompletedHandler.iid;

interface ICoreWebView2PrintToPdfStreamCompletedHandler : IUnknown
{
    static const GUID iid = { 0x4C9F8229,0x8F93,0x444F,[ 0xA7,0x11,0x2C,0x0D,0xFD,0x63,0x59,0xD5 ] };
  /// Provides the result of the corresponding asynchronous method.
  HRESULT Invoke(in HRESULT errorCode, in IStream* pdfStream);
}

/// Settings used by the `Print` method.
const GUID IID_ICoreWebView2PrintSettings2 = ICoreWebView2PrintSettings2.iid;

interface ICoreWebView2PrintSettings2 : ICoreWebView2PrintSettings
{
    static const GUID iid = { 0xCA7F0E1F,0x3484,0x41D1,[ 0x8C,0x1A,0x65,0xCD,0x44,0xA6,0x3F,0x8D ] };
  /// Page range to print. Defaults to empty string, which means print all pages.
  /// If the Page range is empty string or null, then it applies the default.
  ///
  /// The PageRanges property is a list of page ranges specifying one or more pages that
  /// should be printed separated by commas. Any whitespace between page ranges is ignored.
  /// A valid page range is either a single integer identifying the page to print, or a range
  /// in the form `[start page]-[last page]` where `start page` and `last page` are integers
  /// identifying the first and last inclusive pages respectively to print.
  /// Every page identifier is an integer greater than 0 unless wildcards are used (see below examples).
  /// The first page is 1.
  ///
  /// In a page range of the form `[start page]-[last page]` the start page number must be
  /// larger than 0 and less than or equal to the document's total page count.
  /// If the `start page` is not present, then 1 is used as the `start page`.
  /// The `last page` must be larger than the `start page`.
  /// If the `last page` is not present, then the document total page count is used as the `last page`.
  ///
  /// Repeating a page does not print it multiple times. To print multiple times, use the `Copies` property.
  ///
  /// The pages are always printed in ascending order, even if specified in non-ascending order.
  ///
  /// If page range is not valid or if a page is greater than document total page count,
  /// `ICoreWebView2PrintCompletedHandler` or `ICoreWebView2PrintToPdfStreamCompletedHandler`
  /// handler will return `E_INVALIDARG`.
  ///
  /// The following examples assume a document with 20 total pages.
  ///
  /// |       Example         |       Result      |               Notes                                              |
  /// | --- | --- | --- |
  /// | "2"                   |  Page 2           |                                                                  |
  /// | "1-4, 9, 3-6, 10, 11" |  Pages 1-6, 9-11  |                                                                  |
  /// | "1-4, -6"             |  Pages 1-6        | The "-6" is interpreted as "1-6".                                |
  /// | "2-"                  |  Pages 2-20       | The "2-" is interpreted as "pages 2 to the end of the document". |
  /// | "4-2, 11, -6"         |  Invalid          | "4-2" is an invalid range.                                       |
  /// | "-"                   |  Pages 1-20       | The "-" is interpreted as "page 1 to the end of the document".   |
  /// | "1-4dsf, 11"          |  Invalid          |                                                                  |
  /// | "2-2"                 |  Page 2           |                                                                  |
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings)
  @(" propget")
	HRESULT get_PageRanges(@("out, retval") LPWSTR* value);

  /// Set the `PageRanges` property.
  @(" propput")
	HRESULT put_PageRanges(in LPCWSTR value);

  /// Prints multiple pages of a document on a single piece of paper. Choose from 1, 2, 4, 6, 9 or 16.
  /// The default value is 1.
  @(" propget")
	HRESULT get_PagesPerSide(@("out, retval") INT32* value);

  /// Set the `PagesPerSide` property. Returns `E_INVALIDARG` if an invalid value is
  /// provided, and the current value is not changed.
  ///
  /// Below examples shows print output for PagesPerSide and Duplex.
  ///
  /// |  PagesPerSide   |    Total pages   | Two-sided printing |              Result                                               |
  /// | --- | --- | --- | --- |
  /// |      1          |      1           |        -           | 1 page on the front side.                                         |
  /// |      2          |      1           |        Yes         | 1 page on the front side.                                         |
  /// |      2          |      4           |        -           | 2 pages on the first paper and 2 pages on the next paper.         |
  /// |      2          |      4           |        Yes         | 2 pages on the front side and 2 pages on back side.               |
  /// |      4          |      4           |        Yes         | 4 pages on the front side.                                        |
  /// |      4          |      8           |        Yes         | 4 pages on the front side and 4 pages on the back side.           |
  @(" propput")
	HRESULT put_PagesPerSide(in INT32 value);

  /// Number of copies to print. Minimum value is `1` and the maximum copies count is `999`.
  /// The default value is 1.
  ///
  /// This value is ignored in PrintToPdfStream method.
  @(" propget")
	HRESULT get_Copies(@("out, retval") INT32* value);

  /// Set the `Copies` property. Returns `E_INVALIDARG` if an invalid value is provided
  /// and the current value is not changed.
  @(" propput")
	HRESULT put_Copies(in INT32 value);

  /// Printer collation. See `COREWEBVIEW2_PRINT_COLLATION` for descriptions of
  /// collation. The default value is `COREWEBVIEW2_PRINT_COLLATION_DEFAULT`.
  ///
  /// Printing uses default value of printer's collation if an invalid value is provided
  /// for the specific printer.
  ///
  /// This value is ignored in PrintToPdfStream method.
  @(" propget")
	HRESULT get_Collation(@("out, retval") COREWEBVIEW2_PRINT_COLLATION* value);

  /// Set the `Collation` property.
  @(" propput")
	HRESULT put_Collation(in COREWEBVIEW2_PRINT_COLLATION value);

  /// Printer color mode. See `COREWEBVIEW2_PRINT_COLOR_MODE` for descriptions
  /// of color modes. The default value is `COREWEBVIEW2_PRINT_COLOR_MODE_DEFAULT`.
  ///
  /// Printing uses default value of printer supported color if an invalid value is provided
  /// for the specific printer.
  @(" propget")
	HRESULT get_ColorMode(@("out, retval") COREWEBVIEW2_PRINT_COLOR_MODE* value);

  /// Set the `ColorMode` property.
  @(" propput")
	HRESULT put_ColorMode(in COREWEBVIEW2_PRINT_COLOR_MODE value);

  /// Printer duplex settings. See `COREWEBVIEW2_PRINT_DUPLEX` for descriptions of duplex.
  /// The default value is `COREWEBVIEW2_PRINT_DUPLEX_DEFAULT`.
  ///
  /// Printing uses default value of printer's duplex if an invalid value is provided
  /// for the specific printer.
  ///
  /// This value is ignored in PrintToPdfStream method.
  @(" propget")
	HRESULT get_Duplex(@("out, retval") COREWEBVIEW2_PRINT_DUPLEX* value);

  /// Set the `Duplex` property.
  @(" propput")
	HRESULT put_Duplex(in COREWEBVIEW2_PRINT_DUPLEX value);

  /// Printer media size. See `COREWEBVIEW2_PRINT_MEDIA_SIZE` for descriptions of media size.
  /// The default value is `COREWEBVIEW2_PRINT_MEDIA_SIZE_DEFAULT`.
  ///
  /// If media size is `COREWEBVIEW2_PRINT_MEDIA_SIZE_CUSTOM`, you should set the `PageWidth`
  /// and `PageHeight`.
  ///
  /// Printing uses default value of printer supported media size if an invalid value is provided
  /// for the specific printer.
  ///
  /// This value is ignored in PrintToPdfStream method.
  @(" propget")
	HRESULT get_MediaSize(@("out, retval") COREWEBVIEW2_PRINT_MEDIA_SIZE* value);

  /// Set the `MediaSize` property.
  @(" propput")
	HRESULT put_MediaSize(in COREWEBVIEW2_PRINT_MEDIA_SIZE value);

  /// The name of the printer to use. Defaults to empty string.
  /// If the printer name is empty string or null, then it prints to the default
  /// printer on the user OS.
  ///
  /// This value is ignored in PrintToPdfStream method.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings)
  @(" propget")
	HRESULT get_PrinterName(@("out, retval") LPWSTR* value);

  /// Set the `PrinterName` property. If provided printer name doesn't match
  /// with the name of any installed printers on the user OS,
  /// `ICoreWebView2PrintCompletedHandler` handler will return `errorCode` as
  /// `S_OK` and `printStatus` as COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE.
  ///
  /// Use [Enum Printers](/windows/win32/printdocs/enumprinters)
  /// to enumerate available printers.
  @(" propput")
	HRESULT put_PrinterName(in LPCWSTR value);
}

/// This interface is an extension of `ICoreWebView2_17` that manages
/// navigation requests to URI schemes registered with the OS.
const GUID IID_ICoreWebView2_18 = ICoreWebView2_18.iid;

interface ICoreWebView2_18 : ICoreWebView2_17
{
    static const GUID iid = { 0x7A626017,0x28BE,0x49B2,[ 0xB8,0x65,0x3B,0xA2,0xB3,0x52,0x2D,0x90 ] };
  /// Add an event handler for the `LaunchingExternalUriScheme` event.
  /// The `LaunchingExternalUriScheme` event is raised when a navigation request is made to
  /// a URI scheme that is registered with the OS.
  /// The `LaunchingExternalUriScheme` event handler may suppress the default dialog
  /// or replace the default dialog with a custom dialog.
  ///
  /// If a deferral is not taken on the event args, the external URI scheme launch is
  /// blocked until the event handler returns.  If a deferral is taken, the
  /// external URI scheme launch is blocked until the deferral is completed.
  /// The host also has the option to cancel the URI scheme launch.
  ///
  /// The `NavigationStarting` and `NavigationCompleted` events will be raised,
  /// regardless of whether the `Cancel` property is set to `TRUE` or
  /// `FALSE`. The `NavigationCompleted` event will be raised with the `IsSuccess` property
  /// set to `FALSE` and the `WebErrorStatus` property set to `ConnectionAborted` regardless of
  /// whether the host sets the `Cancel` property on the
  /// `ICoreWebView2LaunchingExternalUriSchemeEventArgs`. The `SourceChanged`, `ContentLoading`,
  /// and `HistoryChanged` events will not be raised for this navigation to the external URI
  /// scheme regardless of the `Cancel` property.
  /// The `LaunchingExternalUriScheme` event will be raised after the
  /// `NavigationStarting` event and before the `NavigationCompleted` event.
  /// The default `CoreWebView2Settings` will also be updated upon navigation to an external
  /// URI scheme. If a setting on the `CoreWebView2Settings` interface has been changed,
  /// navigating to an external URI scheme will trigger the `CoreWebView2Settings` to update.
  ///
  /// The WebView2 may not display the default dialog based on user settings, browser settings,
  /// and whether the origin is determined as a
  /// [trustworthy origin](https://w3c.github.io/webappsec-secure-contexts#
  /// potentially-trustworthy-origin); however, the event will still be raised.
  ///
  /// If the request is initiated by a cross-origin frame without a user gesture,
  /// the request will be blocked and the `LaunchingExternalUriScheme` event will not
  /// be raised.
  /// \snippet SettingsComponent.cpp ToggleLaunchingExternalUriScheme
  HRESULT add_LaunchingExternalUriScheme(
      /+[in]+/ ICoreWebView2LaunchingExternalUriSchemeEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with
  /// `add_LaunchingExternalUriScheme`.
  HRESULT remove_LaunchingExternalUriScheme(
      in EventRegistrationToken token);
}

/// This interface is an extension of `ICoreWebView2_18` that manages memory usage
/// target level.
const GUID IID_ICoreWebView2_19 = ICoreWebView2_19.iid;

interface ICoreWebView2_19 : ICoreWebView2_18
{
    static const GUID iid = { 0x6921F954,0x79B0,0x437F,[ 0xA9,0x97,0xC8,0x58,0x11,0x89,0x7C,0x68 ] };

  /// `MemoryUsageTargetLevel` indicates desired memory consumption level of
  /// WebView.
  @(" propget")
	HRESULT get_MemoryUsageTargetLevel(
      @("out, retval") COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL* level);

  /// An app may set `MemoryUsageTargetLevel` to indicate desired memory
  /// consumption level of WebView. Scripts will not be impacted and continue
  /// to run. This is useful for inactive apps that still want to run scripts
  /// and/or keep network connections alive and therefore could not call
  /// `TrySuspend` and `Resume` to reduce memory consumption. These apps can
  /// set memory usage target level to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW`
  /// when the app becomes inactive, and set back to
  /// `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL` when the app becomes
  /// active. It is not necessary to set CoreWebView2Controller's IsVisible
  /// property to false when setting the property.
  /// It is a best effort operation to change memory usage level, and the
  /// API will return before the operation completes.
  /// Setting the level to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW`
  /// could potentially cause memory for some WebView browser processes to be
  /// swapped out to disk in some circumstances.
  /// It is a best effort to reduce memory usage as much as possible. If a script
  /// runs after its related memory has been swapped out, the memory will be swapped
  /// back in to ensure the script can still run, but performance might be impacted.
  /// Therefore, the app should set the level back to
  /// `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL` when the app becomes
  /// active again. Setting memory usage target level back to normal will not happen
  /// automatically.
  /// An app should choose to use either the combination of `TrySuspend` and `Resume`
  /// or the combination of setting MemoryUsageTargetLevel to low and normal. It is
  /// not advisable to mix them.
  /// Trying to set `MemoryUsageTargetLevel` while suspended will be ignored.
  /// The `TrySuspend` and `Resume` methods will change the `MemoryUsageTargetLevel`.
  /// `TrySuspend` will automatically set `MemoryUsageTargetLevel` to low while
  /// `Resume` on suspended WebView will automatically set `MemoryUsageTargetLevel`
  /// to normal. Calling `Resume` when the WebView is not suspended would not change
  /// `MemoryUsageTargetLevel`.
  ///
  /// \snippet ViewComponent.cpp MemoryUsageTargetLevel
  @(" propput")
	HRESULT put_MemoryUsageTargetLevel(
      in COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL level);
}

/// This interface is an extension of `ICoreWebView2_19` that provides the `FrameId` property.
const GUID IID_ICoreWebView2_20 = ICoreWebView2_20.iid;

interface ICoreWebView2_20 : ICoreWebView2_19
{
    static const GUID iid = { 0xb4bc1926,0x7305,0x11ee,[ 0xb9,0x62,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// The unique identifier of the main frame. It's the same kind of ID as
  /// with the `FrameId` in `CoreWebView2Frame` and via `CoreWebView2FrameInfo`.
  /// Note that `FrameId` may not be valid if `CoreWebView2` has not done
  /// any navigation. It's safe to get this value during or after the first
  /// `ContentLoading` event. Otherwise, it could return the invalid frame Id 0.
  @(" propget")
	HRESULT get_FrameId(@("out, retval") UINT32* id);
}

/// Event handler for the `LaunchingExternalUriScheme` event.
const GUID IID_ICoreWebView2LaunchingExternalUriSchemeEventHandler = ICoreWebView2LaunchingExternalUriSchemeEventHandler.iid;

interface ICoreWebView2LaunchingExternalUriSchemeEventHandler : IUnknown
{
    static const GUID iid = { 0x74F712E0,0x8165,0x43A9,[ 0xA1,0x3F,0x0C,0xCE,0x59,0x7E,0x75,0xDF ] };
  /// Receives the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2LaunchingExternalUriSchemeEventArgs args);
}

/// Event args for `LaunchingExternalUriScheme` event.
const GUID IID_ICoreWebView2LaunchingExternalUriSchemeEventArgs = ICoreWebView2LaunchingExternalUriSchemeEventArgs.iid;

interface ICoreWebView2LaunchingExternalUriSchemeEventArgs : IUnknown
{
    static const GUID iid = { 0x07D1A6C3,0x7175,0x4BA1,[ 0x93,0x06,0xE5,0x93,0xCA,0x07,0xE4,0x6C ] };
  /// The URI with the external URI scheme to be launched.

  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* value);

  /// The origin initiating the external URI scheme launch.
  /// The origin will be an empty string if the request is initiated by calling
  /// `CoreWebView2.Navigate` on the external URI scheme. If a script initiates
  /// the navigation, the `InitiatingOrigin` will be the top-level document's
  /// `Source`, for example, if `window.location` is set to `"calculator://", the
  /// `InitiatingOrigin` will be set to `calculator://`. If the request is initiated
  ///  from a child frame, the `InitiatingOrigin` will be the source of that child frame.

  @(" propget")
	HRESULT get_InitiatingOrigin(@("out, retval") LPWSTR* value);

  /// `TRUE` when the external URI scheme request was initiated through a user gesture.
  ///
  /// \> [!NOTE]\n\> Being initiated through a user gesture does not mean that user intended
  /// to access the associated resource.

  @(" propget")
	HRESULT get_IsUserInitiated(@("out, retval") BOOL* value);

  /// The event handler may set this property to `TRUE` to cancel the external URI scheme
  /// launch. If set to `TRUE`, the external URI scheme will not be launched, and the default
  /// dialog is not displayed. This property can be used to replace the normal
  /// handling of launching an external URI scheme.
  /// The initial value of the `Cancel` property is `FALSE`.

  @(" propget")
	HRESULT get_Cancel(@("out, retval") BOOL* value);

  /// Sets the `Cancel` property.

  @(" propput")
	HRESULT put_Cancel(in BOOL value);

  /// Returns an `ICoreWebView2Deferral` object.  Use this operation to
  /// complete the event at a later time.

  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * value);
}

/// The caller implements this interface to handle the BasicAuthenticationRequested event.
const GUID IID_ICoreWebView2BasicAuthenticationRequestedEventHandler = ICoreWebView2BasicAuthenticationRequestedEventHandler.iid;

interface ICoreWebView2BasicAuthenticationRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0x58b4d6c2,0x18d4,0x497e,[ 0xb3,0x9b,0x9a,0x96,0x53,0x3f,0xa2,0x78 ] };
  /// Called to provide the implementer with the event args for the
  /// corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2BasicAuthenticationRequestedEventArgs args);
}

/// Implements the interface to receive `IsDefaultDownloadDialogOpenChanged`
/// events.
const GUID IID_ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler = ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler.iid;

interface ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x3117da26,0xae13,0x438d,[ 0xbd,0x46,0xed,0xbe,0xb2,0xc4,0xce,0x81 ] };
  /// Provides the event args for the corresponding event. No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender,
                 /+[in]+/ IUnknown args);
}

/// Receives the result of the `PrintToPdf` method. If the print to PDF
/// operation succeeds, `isSuccessful` is true. Otherwise, if the operation
/// failed, `isSuccessful` is set to false. An invalid path returns
/// `E_INVALIDARG`.
const GUID IID_ICoreWebView2PrintToPdfCompletedHandler = ICoreWebView2PrintToPdfCompletedHandler.iid;

interface ICoreWebView2PrintToPdfCompletedHandler : IUnknown
{
    static const GUID iid = { 0xccf1ef04,0xfd8e,0x4d5f,[ 0xb2,0xde,0x09,0x83,0xe4,0x1b,0x8c,0x36 ] };

  /// Provides the result of the corresponding asynchronous method.
  HRESULT Invoke(in HRESULT errorCode, BOOL isSuccessful);
}

/// Settings used by the `PrintToPdf` method.
const GUID IID_ICoreWebView2PrintSettings = ICoreWebView2PrintSettings.iid;

interface ICoreWebView2PrintSettings : IUnknown
{
    static const GUID iid = { 0x377f3721,0xc74e,0x48ca,[ 0x8d,0xb1,0xdf,0x68,0xe5,0x1d,0x60,0xe2 ] };

  /// The orientation can be portrait or landscape. The default orientation is
  /// portrait. See `COREWEBVIEW2_PRINT_ORIENTATION`.
  @(" propget")
	HRESULT get_Orientation(
    @("out, retval") COREWEBVIEW2_PRINT_ORIENTATION* orientation);

  /// Sets the `Orientation` property.
  @(" propput")
	HRESULT put_Orientation(
      in COREWEBVIEW2_PRINT_ORIENTATION orientation);

  /// The scale factor is a value between 0.1 and 2.0. The default is 1.0.
  @(" propget")
	HRESULT get_ScaleFactor(@("out, retval") double* scaleFactor);

  /// Sets the `ScaleFactor` property. Returns `E_INVALIDARG` if an invalid
  /// value is provided, and the current value is not changed.
  @(" propput")
	HRESULT put_ScaleFactor(in double scaleFactor);

  /// The page width in inches. The default width is 8.5 inches.
  @(" propget")
	HRESULT get_PageWidth(@("out, retval") double* pageWidth);

  /// Sets the `PageWidth` property. Returns `E_INVALIDARG` if the page width is
  /// less than or equal to zero, and the current value is not changed.
  @(" propput")
	HRESULT put_PageWidth(in double pageWidth);

  /// The page height in inches. The default height is 11 inches.
  @(" propget")
	HRESULT get_PageHeight(@("out, retval") double* pageHeight);

  /// Sets the `PageHeight` property. Returns `E_INVALIDARG` if the page height
  /// is less than or equal to zero, and the current value is not changed.
  @(" propput")
	HRESULT put_PageHeight(in double pageHeight);

  /// The top margin in inches. The default is 1 cm, or ~0.4 inches.
  @(" propget")
	HRESULT get_MarginTop(@("out, retval") double* marginTop);

  /// Sets the `MarginTop` property. A margin cannot be less than zero.
  /// Returns `E_INVALIDARG` if an invalid value is provided, and the current
  /// value is not changed.
  @(" propput")
	HRESULT put_MarginTop(in double marginTop);

  /// The bottom margin in inches. The default is 1 cm, or ~0.4 inches.
  @(" propget")
	HRESULT get_MarginBottom(@("out, retval") double* marginBottom);

  /// Sets the `MarginBottom` property. A margin cannot be less than zero.
  /// Returns `E_INVALIDARG` if an invalid value is provided, and the current
  /// value is not changed.
  @(" propput")
	HRESULT put_MarginBottom(in double marginBottom);

  /// The left margin in inches. The default is 1 cm, or ~0.4 inches.
  @(" propget")
	HRESULT get_MarginLeft(@("out, retval") double* marginLeft);

  /// Sets the `MarginLeft` property. A margin cannot be less than zero.
  /// Returns `E_INVALIDARG` if an invalid value is provided, and the current
  /// value is not changed.
  @(" propput")
	HRESULT put_MarginLeft(in double marginLeft);

  /// The right margin in inches. The default is 1 cm, or ~0.4 inches.
  @(" propget")
	HRESULT get_MarginRight(@("out, retval") double* marginRight);

  /// Set the `MarginRight` property.A margin cannot be less than zero.
  /// Returns `E_INVALIDARG` if an invalid value is provided, and the current
  /// value is not changed.
  @(" propput")
	HRESULT put_MarginRight(in double marginRight);

  /// `TRUE` if background colors and images should be printed. The default value
  /// is `FALSE`.
  @(" propget")
	HRESULT get_ShouldPrintBackgrounds(
      @("out, retval") BOOL* shouldPrintBackgrounds);

  /// Set the `ShouldPrintBackgrounds` property.
  @(" propput")
	HRESULT put_ShouldPrintBackgrounds(in BOOL shouldPrintBackgrounds);

  /// `TRUE` if only the current end user's selection of HTML in the document
  /// should be printed. The default value is `FALSE`.
  @(" propget")
	HRESULT get_ShouldPrintSelectionOnly(
      @("out, retval") BOOL* shouldPrintSelectionOnly);

  /// Set the `ShouldPrintSelectionOnly` property.
  @(" propput")
	HRESULT put_ShouldPrintSelectionOnly(
      in BOOL shouldPrintSelectionOnly);

  /// `TRUE` if header and footer should be printed. The default value is `FALSE`.
  /// The header consists of the date and time of printing, and the title of the
  /// page. The footer consists of the URI and page number. The height of the
  /// header and footer is 0.5 cm, or ~0.2 inches.
  @(" propget")
	HRESULT get_ShouldPrintHeaderAndFooter(
      @("out, retval") BOOL* shouldPrintHeaderAndFooter);

  /// Set the `ShouldPrintHeaderAndFooter` property.
  @(" propput")
	HRESULT put_ShouldPrintHeaderAndFooter(
      in BOOL shouldPrintHeaderAndFooter);

  /// The title in the header if `ShouldPrintHeaderAndFooter` is `TRUE`. The
  /// default value is the title of the current document.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_HeaderTitle(@("out, retval") LPWSTR* headerTitle);

  /// Set the `HeaderTitle` property. If an empty string or null value is
  /// provided, no title is shown in the header.
  @(" propput")
	HRESULT put_HeaderTitle(in LPCWSTR headerTitle);

  /// The URI in the footer if `ShouldPrintHeaderAndFooter` is `TRUE`. The
  /// default value is the current URI.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_FooterUri(@("out, retval") LPWSTR* footerUri);

  /// Set the `FooterUri` property. If an empty string or null value is
  /// provided, no URI is shown in the footer.
  @(" propput")
	HRESULT put_FooterUri(in LPCWSTR footerUri);
}

/// The caller implements this interface to receive the TrySuspend result.
const GUID IID_ICoreWebView2TrySuspendCompletedHandler = ICoreWebView2TrySuspendCompletedHandler.iid;

interface ICoreWebView2TrySuspendCompletedHandler : IUnknown
{
    static const GUID iid = { 0x00F206A7,0x9D17,0x4605,[ 0x91,0xF6,0x4E,0x8E,0x4D,0xE1,0x92,0xE3 ] };

  /// Provides the result of the TrySuspend operation.
  /// See [Sleeping Tabs FAQ](https://techcommunity.microsoft.com/t5/articles/sleeping-tabs-faq/m-p/1705434)
  /// for conditions that might prevent WebView from being suspended. In those situations,
  /// isSuccessful will be false and errorCode is S_OK.
  HRESULT Invoke(in HRESULT errorCode, in BOOL isSuccessful);
}

/// The owner of the `CoreWebView2` object that provides support for resizing,
/// showing and hiding, focusing, and other functionality related to
/// windowing and composition.  The `CoreWebView2Controller` owns the
/// `CoreWebView2`, and if all references to the `CoreWebView2Controller` go
/// away, the WebView is closed.
const GUID IID_ICoreWebView2Controller = ICoreWebView2Controller.iid;

interface ICoreWebView2Controller : IUnknown
{
    static const GUID iid = { 0x4d00c0d1,0x9434,0x4eb6,[ 0x80,0x78,0x86,0x97,0xa5,0x60,0x33,0x4f ] };

  /// The `IsVisible` property determines whether to show or hide the WebView2.
  ///   If `IsVisible` is set to `FALSE`, the WebView2 is transparent and is
  /// not rendered.   However, this does not affect the window containing the
  /// WebView2 (the `HWND` parameter that was passed to
  /// `CreateCoreWebView2Controller`).  If you want that window to disappear
  /// too, run `ShowWindow` on it directly in addition to modifying the
  /// `IsVisible` property.  WebView2 as a child window does not get window
  /// messages when the top window is minimized or restored.  For performance
  /// reasons, developers should set the `IsVisible` property of the WebView to
  /// `FALSE` when the app window is minimized and back to `TRUE` when the app
  /// window is restored. The app window does this by handling
  /// `SIZE_MINIMIZED and SIZE_RESTORED` command upon receiving `WM_SIZE`
  /// message.
  ///
  /// There are CPU and memory benefits when the page is hidden. For instance,
  /// Chromium has code that throttles activities on the page like animations
  /// and some tasks are run less frequently. Similarly, WebView2 will
  /// purge some caches to reduce memory usage.
  ///
  /// \snippet ViewComponent.cpp ToggleIsVisible
  @(" propget")
	HRESULT get_IsVisible(@("out, retval") BOOL* isVisible);

  /// Sets the `IsVisible` property.
  ///
  /// \snippet ViewComponent.cpp ToggleIsVisibleOnMinimize
  @(" propput")
	HRESULT put_IsVisible(in BOOL isVisible);

  /// The WebView bounds. Bounds are relative to the parent `HWND`.  The app
  /// has two ways to position a WebView.
  ///
  /// *   Create a child `HWND` that is the WebView parent `HWND`.  Position
  ///     the window where the WebView should be.  Use `(0, 0)` for the
  ///     top-left corner (the offset) of the `Bounds` of the WebView.
  /// *   Use the top-most window of the app as the WebView parent HWND.  For
  ///     example, to position WebView correctly in the app, set the top-left
  ///     corner of the Bound of the WebView.
  ///
  /// The values of `Bounds` are limited by the coordinate space of the host.

  @(" propget")
	HRESULT get_Bounds(@("out, retval") RECT* bounds);

  /// Sets the `Bounds` property.
  ///
  /// \snippet ViewComponent.cpp ResizeWebView

  @(" propput")
	HRESULT put_Bounds(in RECT bounds);

  /// The zoom factor for the WebView.
  ///
  /// \> [!NOTE]\n\> Changing zoom factor may cause `window.innerWidth`,
  /// `window.innerHeight`, both, and page layout to change.  A zoom factor
  /// that is applied by the host by running `ZoomFactor` becomes the new
  /// default zoom for the WebView.  The zoom factor applies across navigations
  /// and is the zoom factor WebView is returned to when the user chooses
  /// Ctrl+0.  When the zoom factor is changed by the user (resulting in
  /// the app receiving `ZoomFactorChanged`), that zoom applies only for the
  /// current page.  Any user applied zoom is only for the current page and is
  /// reset on a navigation.  Specifying a `zoomFactor` less than or equal to
  /// `0` is not allowed.  WebView also has an internal supported zoom factor
  /// range.  When a specified zoom factor is out of that range, it is
  /// normalized to be within the range, and a `ZoomFactorChanged` event is
  /// triggered for the real applied zoom factor.  When the range normalization
  /// happens, the `ZoomFactor` property reports the zoom factor specified
  /// during the previous modification of the `ZoomFactor` property until the
  /// `ZoomFactorChanged` event is received after WebView applies the
  /// normalized zoom factor.

  @(" propget")
	HRESULT get_ZoomFactor(@("out, retval") double* zoomFactor);

  /// Sets the `ZoomFactor` property.

  @(" propput")
	HRESULT put_ZoomFactor(in double zoomFactor);

  /// Adds an event handler for the `ZoomFactorChanged` event.
  /// `ZoomFactorChanged` runs when the `ZoomFactor` property of the WebView
  /// changes.  The event may run because the `ZoomFactor` property was
  /// modified, or due to the user manually modifying the zoom.  When it is
  /// modified using the `ZoomFactor` property, the internal zoom factor is
  /// updated immediately and no `ZoomFactorChanged` event is triggered.
  /// WebView associates the last used zoom factor for each site.  It is
  /// possible for the zoom factor to change when navigating to a different
  /// page.  When the zoom factor changes due to a navigation change, the
  /// `ZoomFactorChanged` event runs right after the `ContentLoading` event.
  ///
  /// \snippet ViewComponent.cpp ZoomFactorChanged

  HRESULT add_ZoomFactorChanged(
      /+[in]+/ ICoreWebView2ZoomFactorChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_ZoomFactorChanged`.

  HRESULT remove_ZoomFactorChanged(
      in EventRegistrationToken token);

  /// Updates `Bounds` and `ZoomFactor` properties at the same time.  This
  /// operation is atomic from the perspective of the host.  After returning
  /// from this function, the `Bounds` and `ZoomFactor` properties are both
  /// updated if the function is successful, or neither is updated if the
  /// function fails.  If `Bounds` and `ZoomFactor` are both updated by the
  /// same scale (for example, `Bounds` and `ZoomFactor` are both doubled),
  /// then the page does not display a change in `window.innerWidth` or
  /// `window.innerHeight` and the WebView renders the content at the new size
  /// and zoom without intermediate renderings.  This function also updates
  /// just one of `ZoomFactor` or `Bounds` by passing in the new value for one
  /// and the current value for the other.
  ///
  /// \snippet ViewComponent.cpp SetBoundsAndZoomFactor

  HRESULT SetBoundsAndZoomFactor(in RECT bounds, in double zoomFactor);

  /// Moves focus into WebView.  WebView gets focus and focus is set to
  /// correspondent element in the page hosted in the WebView.  For
  /// Programmatic reason, focus is set to previously focused element or the
  /// default element if no previously focused element exists.  For `Next`
  /// reason, focus is set to the first element.  For `Previous` reason, focus
  /// is set to the last element.  WebView changes focus through user
  /// interaction including selecting into a WebView or Tab into it.  For
  /// tabbing, the app runs MoveFocus with Next or Previous to align with Tab
  /// and Shift+Tab respectively when it decides the WebView is the next
  /// element that may exist in a tab.  Or, the app runs `IsDialogMessage`
  /// as part of the associated message loop to allow the platform to auto
  /// handle tabbing.  The platform rotates through all windows with
  /// `WS_TABSTOP`.  When the WebView gets focus from `IsDialogMessage`, it is
  /// internally put the focus on the first or last element for tab and
  /// Shift+Tab respectively.
  ///
  /// \snippet App.cpp MoveFocus0
  ///
  /// \snippet ControlComponent.cpp MoveFocus1
  ///
  /// \snippet ControlComponent.cpp MoveFocus2

  HRESULT MoveFocus(in COREWEBVIEW2_MOVE_FOCUS_REASON reason);

  /// Adds an event handler for the `MoveFocusRequested` event.
  /// `MoveFocusRequested` runs when user tries to tab out of the WebView.  The
  /// focus of the WebView has not changed when this event is run.
  ///
  /// \snippet ControlComponent.cpp MoveFocusRequested

  HRESULT add_MoveFocusRequested(
      /+[in]+/ ICoreWebView2MoveFocusRequestedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Removes an event handler previously added with `add_MoveFocusRequested`.

  HRESULT remove_MoveFocusRequested(
      in EventRegistrationToken token);

  /// Adds an event handler for the `GotFocus` event.  `GotFocus` runs when
  /// WebView has focus.

  HRESULT add_GotFocus(
      /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Removes an event handler previously added with `add_GotFocus`.

  HRESULT remove_GotFocus(
      in EventRegistrationToken token);

  /// Adds an event handler for the `LostFocus` event.  `LostFocus` runs when
  /// WebView loses focus.  In the case where `MoveFocusRequested` event is
  /// run, the focus is still on WebView when `MoveFocusRequested` event runs.
  /// `LostFocus` only runs afterwards when code of the app or default action
  /// of `MoveFocusRequested` event set focus away from WebView.

  HRESULT add_LostFocus(
      /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Removes an event handler previously added with `add_LostFocus`.

  HRESULT remove_LostFocus(
      in EventRegistrationToken token);

  /// Adds an event handler for the `AcceleratorKeyPressed` event.
  /// `AcceleratorKeyPressed` runs when an accelerator key or key combo is
  /// pressed or released while the WebView is focused.  A key is considered an
  ///  accelerator if either of the following conditions are true.
  ///
  /// *   Ctrl or Alt is currently being held.
  /// *   The pressed key does not map to a character.
  ///
  /// A few specific keys are never considered accelerators, such as Shift.
  /// The `Escape` key is always considered an accelerator.
  ///
  /// Auto-repeated key events caused by holding the key down also triggers
  /// this event.  Filter out the auto-repeated key events by verifying the
  /// `KeyEventLParam` or `PhysicalKeyStatus` event args.
  ///
  /// In windowed mode, the event handler is run synchronously.  Until you
  /// run `Handled()` on the event args or the event handler returns, the
  /// browser process is blocked and outgoing cross-process COM requests fail
  /// with `RPC_E_CANTCALLOUT_ININPUTSYNCCALL`.  All `CoreWebView2` API methods
  /// work, however.
  ///
  /// In windowless mode, the event handler is run asynchronously.  Further
  /// input do not reach the browser until the event handler returns or
  /// `Handled()` is run, but the browser process is not blocked, and outgoing
  /// COM requests work normally.
  ///
  /// It is recommended to run `Handled(TRUE)` as early as are able to know
  /// that you want to handle the accelerator key.
  ///
  /// \snippet ControlComponent.cpp AcceleratorKeyPressed

  HRESULT add_AcceleratorKeyPressed(
    /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventHandler eventHandler,
    @("out") EventRegistrationToken* token);

  /// Removes an event handler previously added with
  /// `add_AcceleratorKeyPressed`.

  HRESULT remove_AcceleratorKeyPressed(
    in EventRegistrationToken token);

  /// The parent window provided by the app that this WebView is using to
  /// render content.  This API initially returns the window passed into
  /// `CreateCoreWebView2Controller`.

  @(" propget")
	HRESULT get_ParentWindow(@("out, retval") HWND* parentWindow);

  /// Sets the parent window for the WebView.  This causes the WebView to
  /// re-parent the main WebView window to the newly provided window.

  @(" propput")
	HRESULT put_ParentWindow(in HWND parentWindow);

  /// This is a notification separate from `Bounds` that tells WebView that the
  ///  main WebView parent (or any ancestor) `HWND` moved.  This is needed
  /// for accessibility and certain dialogs in WebView to work correctly.
  ///
  /// \snippet ViewComponent.cpp NotifyParentWindowPositionChanged

  HRESULT NotifyParentWindowPositionChanged();

  /// Closes the WebView and cleans up the underlying browser instance.
  /// Cleaning up the browser instance releases the resources powering the
  /// WebView.  The browser instance is shut down if no other WebViews are
  /// using it.
  ///
  /// After running `Close`, most methods will fail and event handlers stop
  /// running.  Specifically, the WebView releases the associated references to
  /// any associated event handlers when `Close` is run.
  ///
  /// `Close` is implicitly run when the `CoreWebView2Controller` loses the
  /// final reference and is destructed.  But it is best practice to
  /// explicitly run `Close` to avoid any accidental cycle of references
  /// between the WebView and the app code.  Specifically, if you capture a
  /// reference to the WebView in an event handler you create a reference cycle
  /// between the WebView and the event handler.  Run `Close` to break the
  /// cycle by releasing all event handlers.  But to avoid the situation, it is
  /// best to both explicitly run `Close` on the WebView and to not capture a
  /// reference to the WebView to ensure the WebView is cleaned up correctly.
  /// `Close` is synchronous and won't trigger the `beforeunload` event.
  ///
  /// \snippet AppWindow.cpp Close
  HRESULT Close();

  /// Gets the `CoreWebView2` associated with this `CoreWebView2Controller`.

  @(" propget")
	HRESULT get_CoreWebView2(@("out, retval") ICoreWebView2 * coreWebView2);
}

/// A continuation of the ICoreWebView2Controller interface.
const GUID IID_ICoreWebView2Controller2 = ICoreWebView2Controller2.iid;

interface ICoreWebView2Controller2 : ICoreWebView2Controller
{
    static const GUID iid = { 0xc979903e,0xd4ca,0x4228,[ 0x92,0xeb,0x47,0xee,0x3f,0xa9,0x6e,0xab ] };
  /// The `DefaultBackgroundColor` property is the color WebView renders
  /// underneath all web content. This means WebView renders this color when
  /// there is no web content loaded such as before the initial navigation or
  /// between navigations. This also means web pages with undefined css
  /// background properties or background properties containing transparent
  /// pixels will render their contents over this color. Web pages with defined
  /// and opaque background properties that span the page will obscure the
  /// `DefaultBackgroundColor` and display normally. The default value for this
  /// property is white to resemble the native browser experience.
  ///
  /// The Color is specified by the COREWEBVIEW2_COLOR that represents an RGBA
  /// value. The `A` represents an Alpha value, meaning
  /// `DefaultBackgroundColor` can be transparent. In the case of a transparent
  /// `DefaultBackgroundColor` WebView will render hosting app content as the
  /// background. This Alpha value is not supported on Windows 7. Any `A` value
  /// other than 255 will result in E_INVALIDARG on Windows 7.
  /// It is supported on all other WebView compatible platforms.
  ///
  /// Semi-transparent colors are not currently supported by this API and
  /// setting `DefaultBackgroundColor` to a semi-transparent color will fail
  /// with E_INVALIDARG. The only supported alpha values are 0 and 255, all
  /// other values will result in E_INVALIDARG.
  /// `DefaultBackgroundColor` can only be an opaque color or transparent.
  ///
  /// This value may also be set by using the
  /// `WEBVIEW2_DEFAULT_BACKGROUND_COLOR` environment variable. There is a
  /// known issue with background color where setting the color by API can
  /// still leave the app with a white flicker before the
  /// `DefaultBackgroundColor` takes effect. Setting the color via environment
  /// variable solves this issue. The value must be a hex value that can
  /// optionally prepend a 0x. The value must account for the alpha value
  /// which is represented by the first 2 digits. So any hex value fewer than 8
  /// digits will assume a prepended 00 to the hex value and result in a
  /// transparent color.
  /// `get_DefaultBackgroundColor` will return the result of this environment
  /// variable if used. This environment variable can only set the
  /// `DefaultBackgroundColor` once. Subsequent updates to background color
  /// must be done through API call.
  ///
  /// \snippet ViewComponent.cpp DefaultBackgroundColor
  @(" propget")
	HRESULT get_DefaultBackgroundColor(
    @("out, retval") COREWEBVIEW2_COLOR* backgroundColor);

  /// Sets the `DefaultBackgroundColor` property.
  @(" propput")
	HRESULT put_DefaultBackgroundColor(
    in COREWEBVIEW2_COLOR backgroundColor);
}

/// A continuation of the ICoreWebView2Controller2 interface.
const GUID IID_ICoreWebView2Controller3 = ICoreWebView2Controller3.iid;

interface ICoreWebView2Controller3 : ICoreWebView2Controller2
{
    static const GUID iid = { 0xf9614724,0x5d2b,0x41dc,[ 0xae,0xf7,0x73,0xd6,0x2b,0x51,0x54,0x3b ] };
  /// The rasterization scale for the WebView. The rasterization scale is the
  /// combination of the monitor DPI scale and text scaling set by the user.
  /// This value should be updated when the DPI scale of the app's top level
  /// window changes (i.e. monitor DPI scale changes or window changes monitor)
  /// or when the text scale factor of the system changes.
  ///
  /// \snippet AppWindow.cpp DPIChanged
  ///
  /// \snippet AppWindow.cpp TextScaleChanged1
  ///
  /// \snippet AppWindow.cpp TextScaleChanged2
  ///
  /// Rasterization scale applies to the WebView content, as well as
  /// popups, context menus, scroll bars, and so on. Normal app scaling
  /// scenarios should use the ZoomFactor property or SetBoundsAndZoomFactor
  /// API which only scale the rendered HTML content and not popups, context
  /// menus, scroll bars, and so on.
  ///
  /// \snippet ViewComponent.cpp RasterizationScale
  @(" propget")
	HRESULT get_RasterizationScale(@("out, retval") double* scale);
  /// Set the rasterization scale property.
  @(" propput")
	HRESULT put_RasterizationScale(in double scale);

  /// ShouldDetectMonitorScaleChanges property determines whether the WebView
  /// attempts to track monitor DPI scale changes. When true, the WebView will
  /// track monitor DPI scale changes, update the RasterizationScale property,
  /// and raises RasterizationScaleChanged event. When false, the WebView will
  /// not track monitor DPI scale changes, and the app must update the
  /// RasterizationScale property itself. RasterizationScaleChanged event will
  /// never raise when ShouldDetectMonitorScaleChanges is false. Apps that want
  /// to set their own rasterization scale should set this property to false to
  /// avoid the WebView2 updating the RasterizationScale property to match the
  /// monitor DPI scale.
  @(" propget")
	HRESULT get_ShouldDetectMonitorScaleChanges(@("out, retval") BOOL* value);
  /// Set the ShouldDetectMonitorScaleChanges property.
  @(" propput")
	HRESULT put_ShouldDetectMonitorScaleChanges(in BOOL value);

  /// Add an event handler for the RasterizationScaleChanged event.
  /// The event is raised when the WebView detects that the monitor DPI scale
  /// has changed, ShouldDetectMonitorScaleChanges is true, and the WebView has
  /// changed the RasterizationScale property.
  ///
  /// \snippet ViewComponent.cpp RasterizationScaleChanged
  HRESULT add_RasterizationScaleChanged(
    /+[in]+/ ICoreWebView2RasterizationScaleChangedEventHandler eventHandler,
    @("out") EventRegistrationToken* token);
  /// Remove an event handler previously added with
  /// add_RasterizationScaleChanged.
  HRESULT remove_RasterizationScaleChanged(
    in EventRegistrationToken token);

  /// BoundsMode affects how setting the Bounds and RasterizationScale
  /// properties work. Bounds mode can either be in COREWEBVIEW2_BOUNDS_MODE_USE_RAW_PIXELS
  /// mode or COREWEBVIEW2_BOUNDS_MODE_USE_RASTERIZATION_SCALE mode.
  ///
  /// When the mode is in COREWEBVIEW2_BOUNDS_MODE_USE_RAW_PIXELS, setting the bounds
  /// property will set the size of the WebView in raw screen pixels. Changing
  /// the rasterization scale in this mode won't change the raw pixel size of
  /// the WebView and will only change the rasterization scale.
  ///
  /// When the mode is in COREWEBVIEW2_BOUNDS_MODE_USE_RASTERIZATION_SCALE, setting the
  /// bounds property will change the logical size of the WebView which can be
  /// described by the following equation:
  /// ```text
  /// Logical size * rasterization scale = Raw Pixel size
  /// ```
  /// In this case, changing the rasterization scale will keep the logical size
  /// the same and change the raw pixel size.
  ///
  /// \snippet ViewComponent.cpp BoundsMode
  @(" propget")
	HRESULT get_BoundsMode(
    @("out, retval") COREWEBVIEW2_BOUNDS_MODE* boundsMode);
  /// Set the BoundsMode property.
  @(" propput")
	HRESULT put_BoundsMode(in COREWEBVIEW2_BOUNDS_MODE boundsMode);
}

/// This is the ICoreWebView2Controller4 interface.
/// The ICoreWebView2Controller4 provides interface to enable/disable external drop.
const GUID IID_ICoreWebView2Controller4 = ICoreWebView2Controller4.iid;

interface ICoreWebView2Controller4 : ICoreWebView2Controller3
{
    static const GUID iid = { 0x97d418d5,0xa426,0x4e49,[ 0xa1,0x51,0xe1,0xa1,0x0f,0x32,0x7d,0x9e ] };
  /// Gets the `AllowExternalDrop` property which is used to configure the
  /// capability that dragging objects from outside the bounds of webview2 and
  /// dropping into webview2 is allowed or disallowed. The default value is
  /// TRUE.
  ///
  /// \snippet SettingsComponent.cpp ToggleAllowExternalDrop
  @(" propget")
	HRESULT get_AllowExternalDrop(@(" out, retval ") BOOL * value);
  /// Sets the `AllowExternalDrop` property which is used to configure the
  /// capability that dragging objects from outside the bounds of webview2 and
  /// dropping into webview2 is allowed or disallowed.
  ///
  /// \snippet SettingsComponent.cpp ToggleAllowExternalDrop
  @(" propput")
	HRESULT put_AllowExternalDrop(in BOOL value);
}

/// This interface is an extension of the ICoreWebView2Controller interface to
/// support visual hosting. An object implementing the
/// ICoreWebView2CompositionController interface will also implement
/// ICoreWebView2Controller. Callers are expected to use
/// ICoreWebView2Controller for resizing, visibility, focus, and so on, and
/// then use ICoreWebView2CompositionController to connect to a composition
/// tree and provide input meant for the WebView.
const GUID IID_ICoreWebView2CompositionController = ICoreWebView2CompositionController.iid;

interface ICoreWebView2CompositionController : IUnknown
{
    static const GUID iid = { 0x3df9b733,0xb9ae,0x4a15,[ 0x86,0xb4,0xeb,0x9e,0xe9,0x82,0x64,0x69 ] };
  /// The RootVisualTarget is a visual in the hosting app's visual tree. This
  /// visual is where the WebView will connect its visual tree. The app uses
  /// this visual to position the WebView within the app. The app still needs
  /// to use the Bounds property to size the WebView. The RootVisualTarget
  /// property can be an IDCompositionVisual or a
  /// Windows::UI::Composition::ContainerVisual. WebView will connect its visual
  /// tree to the provided visual before returning from the property setter. The
  /// app needs to commit on its device setting the RootVisualTarget property.
  /// The RootVisualTarget property supports being set to nullptr to disconnect
  /// the WebView from the app's visual tree.
  /// \snippet ViewComponent.cpp SetRootVisualTarget
  /// \snippet ViewComponent.cpp BuildDCompTree
  @(" propget")
	HRESULT get_RootVisualTarget(@("out, retval") IUnknown * target);
  /// Set the RootVisualTarget property.
  @(" propput")
	HRESULT put_RootVisualTarget(/+[in]+/ IUnknown target);

  /// If eventKind is COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL or
  /// COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL, then mouseData specifies the amount of
  /// wheel movement. A positive value indicates that the wheel was rotated
  /// forward, away from the user; a negative value indicates that the wheel was
  /// rotated backward, toward the user. One wheel click is defined as
  /// WHEEL_DELTA, which is 120.
  /// If eventKind is COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOUBLE_CLICK
  /// COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOWN, or
  /// COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_UP, then mouseData specifies which X
  /// buttons were pressed or released. This value should be 1 if the first X
  /// button is pressed/released and 2 if the second X button is
  /// pressed/released.
  /// If eventKind is COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE, then virtualKeys,
  /// mouseData, and point should all be zero.
  /// If eventKind is any other value, then mouseData should be zero.
  /// Point is expected to be in the client coordinate space of the WebView.
  /// To track mouse events that start in the WebView and can potentially move
  /// outside of the WebView and host application, calling SetCapture and
  /// ReleaseCapture is recommended.
  /// To dismiss hover popups, it is also recommended to send
  /// COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE messages.
  /// \snippet ViewComponent.cpp SendMouseInput
  HRESULT SendMouseInput(
    in COREWEBVIEW2_MOUSE_EVENT_KIND eventKind,
    in COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS virtualKeys,
    in UINT32 mouseData,
    in POINT point);

  /// SendPointerInput accepts touch or pen pointer input of types defined in
  /// COREWEBVIEW2_POINTER_EVENT_KIND. Any pointer input from the system must be
  /// converted into an ICoreWebView2PointerInfo first.
  HRESULT SendPointerInput(
    in COREWEBVIEW2_POINTER_EVENT_KIND eventKind,
    /+[in]+/ ICoreWebView2PointerInfo pointerInfo);

  /// The current cursor that WebView thinks it should be. The cursor should be
  /// set in WM_SETCURSOR through \::SetCursor or set on the corresponding
  /// parent/ancestor HWND of the WebView through \::SetClassLongPtr. The HCURSOR
  /// can be freed so CopyCursor/DestroyCursor is recommended to keep your own
  /// copy if you are doing more than immediately setting the cursor.
  @(" propget")
	HRESULT get_Cursor(@("out, retval") HCURSOR* cursor);

  /// The current system cursor ID reported by the underlying rendering engine
  /// for WebView. For example, most of the time, when the cursor is over text,
  /// this will return the int value for IDC_IBEAM. The systemCursorId is only
  /// valid if the rendering engine reports a default Windows cursor resource
  /// value. Navigate to
  /// [LoadCursorW](/windows/win32/api/winuser/nf-winuser-loadcursorw) for more
  /// details. Otherwise, if custom CSS cursors are being used, this will return
  /// 0. To actually use systemCursorId in LoadCursor or LoadImage,
  /// MAKEINTRESOURCE must be called on it first.
  ///
  /// \snippet ViewComponent.cpp SystemCursorId
  @(" propget")
	HRESULT get_SystemCursorId(@("out, retval") UINT32* systemCursorId);

  /// Add an event handler for the CursorChanged event.
  /// The event is raised when WebView thinks the cursor should be changed. For
  /// example, when the mouse cursor is currently the default cursor but is then
  /// moved over text, it may try to change to the IBeam cursor.
  ///
  /// It is expected for the developer to send
  /// COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE messages (in addition to
  /// COREWEBVIEW2_MOUSE_EVENT_KIND_MOVE messages) through the SendMouseInput
  /// API. This is to ensure that the mouse is actually within the WebView that
  /// sends out CursorChanged events.
  ///
  /// \snippet ViewComponent.cpp CursorChanged
  HRESULT add_CursorChanged(
      /+[in]+/ ICoreWebView2CursorChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);
  /// Remove an event handler previously added with add_CursorChanged.
  HRESULT remove_CursorChanged(
      in EventRegistrationToken token);
}

/// A continuation of the ICoreWebView2CompositionController interface.
const GUID IID_ICoreWebView2CompositionController2 = ICoreWebView2CompositionController2.iid;

interface ICoreWebView2CompositionController2 : ICoreWebView2CompositionController
{
    static const GUID iid = { 0x0b6a3d24,0x49cb,0x4806,[ 0xba,0x20,0xb5,0xe0,0x73,0x4a,0x7b,0x26 ] };
  /// Returns the Automation Provider for the WebView. This object implements
  /// IRawElementProviderSimple.
  @(" propget")
	HRESULT get_AutomationProvider(@("out, retval") IUnknown * provider);
}

/// This interface is the continuation of the
/// ICoreWebView2CompositionController2 interface to manage drag and drop.
const GUID IID_ICoreWebView2CompositionController3 = ICoreWebView2CompositionController3.iid;

interface ICoreWebView2CompositionController3 : ICoreWebView2CompositionController2
{
    static const GUID iid = { 0x9570570e,0x4d76,0x4361,[ 0x9e,0xe1,0xf0,0x4d,0x0d,0xbd,0xfb,0x1e ] };
  /// This function corresponds to [IDropTarget::DragEnter](/windows/win32/api/oleidl/nf-oleidl-idroptarget-dragenter).
  ///
  /// This function has a dependency on AllowExternalDrop property of
  /// CoreWebView2Controller and return E_FAIL to callers to indicate this
  /// operation is not allowed if AllowExternalDrop property is set to false.
  ///
  /// The hosting application must register as an IDropTarget and implement
  /// and forward DragEnter calls to this function.
  ///
  /// point parameter must be modified to include the WebView's offset and be in
  /// the WebView's client coordinates (Similar to how SendMouseInput works).
  ///
  /// \snippet DropTarget.cpp DragEnter
  HRESULT DragEnter(
      in IDataObject* dataObject,
      in DWORD keyState,
      in POINT point,
      @("out, retval") DWORD* effect);

  /// This function corresponds to [IDropTarget::DragLeave](/windows/win32/api/oleidl/nf-oleidl-idroptarget-dragleave).
  ///
  /// This function has a dependency on AllowExternalDrop property of
  /// CoreWebView2Controller and return E_FAIL to callers to indicate this
  /// operation is not allowed if AllowExternalDrop property is set to false.
  ///
  /// The hosting application must register as an IDropTarget and implement
  /// and forward DragLeave calls to this function.
  ///
  /// \snippet DropTarget.cpp DragLeave
  HRESULT DragLeave();

  /// This function corresponds to [IDropTarget::DragOver](/windows/win32/api/oleidl/nf-oleidl-idroptarget-dragover).
  ///
  /// This function has a dependency on AllowExternalDrop property of
  /// CoreWebView2Controller and return E_FAIL to callers to indicate this
  /// operation is not allowed if AllowExternalDrop property is set to false.
  ///
  /// The hosting application must register as an IDropTarget and implement
  /// and forward DragOver calls to this function.
  ///
  /// point parameter must be modified to include the WebView's offset and be in
  /// the WebView's client coordinates (Similar to how SendMouseInput works).
  ///
  /// \snippet DropTarget.cpp DragOver
  HRESULT DragOver(
      in DWORD keyState,
      in POINT point,
      @("out, retval") DWORD* effect);

  /// This function corresponds to [IDropTarget::Drop](/windows/win32/api/oleidl/nf-oleidl-idroptarget-drop).
  ///
  /// This function has a dependency on AllowExternalDrop property of
  /// CoreWebView2Controller and return E_FAIL to callers to indicate this
  /// operation is not allowed if AllowExternalDrop property is set to false.
  ///
  /// The hosting application must register as an IDropTarget and implement
  /// and forward Drop calls to this function.
  ///
  /// point parameter must be modified to include the WebView's offset and be in
  /// the WebView's client coordinates (Similar to how SendMouseInput works).
  ///
  /// \snippet DropTarget.cpp Drop
  HRESULT Drop(
      in IDataObject* dataObject,
      in DWORD keyState,
      in POINT point,
      @("out, retval") DWORD* effect);
}

/// This interface is used to complete deferrals on event args that support
/// getting deferrals using the `GetDeferral` method.

const GUID IID_ICoreWebView2Deferral = ICoreWebView2Deferral.iid;

interface ICoreWebView2Deferral : IUnknown
{
    static const GUID iid = { 0xc10e7f7b,0xb585,0x46f0,[ 0xa6,0x23,0x8b,0xef,0xbf,0x3e,0x4e,0xe0 ] };

  /// Completes the associated deferred event.  Complete should only be run
  /// once for each deferral taken.

  HRESULT Complete();
}

/// Defines properties that enable, disable, or modify WebView features.
/// Changes to `IsGeneralAutofillEnabled` and `IsPasswordAutosaveEnabled`
/// apply immediately, while other setting changes made after `NavigationStarting`
/// event do not apply until the next top-level navigation.

const GUID IID_ICoreWebView2Settings = ICoreWebView2Settings.iid;

interface ICoreWebView2Settings : IUnknown
{
    static const GUID iid = { 0xe562e4f0,0xd7fa,0x43ac,[ 0x8d,0x71,0xc0,0x51,0x50,0x49,0x9f,0x00 ] };

  /// Controls if running JavaScript is enabled in all future navigations in
  /// the WebView.  This only affects scripts in the document.  Scripts
  /// injected with `ExecuteScript` runs even if script is disabled.
  /// The default value is `TRUE`.
  ///
  /// \snippet SettingsComponent.cpp IsScriptEnabled
  @(" propget")
	HRESULT get_IsScriptEnabled(
      @("out, retval") BOOL* isScriptEnabled);

  /// Sets the `IsScriptEnabled` property.
  @(" propput")
	HRESULT put_IsScriptEnabled(in BOOL isScriptEnabled);

  /// The `IsWebMessageEnabled` property is used when loading a new HTML
  /// document.  If set to `TRUE`, communication from the host to the top-level
  ///  HTML document of the WebView is allowed using `PostWebMessageAsJson`,
  /// `PostWebMessageAsString`, and message event of `window.chrome.webview`.
  /// For more information, navigate to PostWebMessageAsJson.  Communication
  /// from the top-level HTML document of the WebView to the host is allowed
  /// using the postMessage function of `window.chrome.webview` and
  /// `add_WebMessageReceived` method.  For more information, navigate to
  /// [add_WebMessageReceived](/microsoft-edge/webview2/reference/win32/icorewebview2#add_webmessagereceived).
  /// If set to false, then communication is disallowed.  `PostWebMessageAsJson`
  /// and `PostWebMessageAsString` fails with `E_ACCESSDENIED` and
  /// `window.chrome.webview.postMessage` fails by throwing an instance of an
  /// `Error` object. The default value is `TRUE`.
  ///
  /// \snippet ScenarioWebMessage.cpp IsWebMessageEnabled
  @(" propget")
	HRESULT get_IsWebMessageEnabled(
      @("out, retval") BOOL* isWebMessageEnabled);

  /// Sets the `IsWebMessageEnabled` property.
  @(" propput")
	HRESULT put_IsWebMessageEnabled(in BOOL isWebMessageEnabled);

  /// `AreDefaultScriptDialogsEnabled` is used when loading a new HTML
  /// document.  If set to `FALSE`, WebView2 does not render the default JavaScript
  /// dialog box (Specifically those displayed by the JavaScript alert,
  /// confirm, prompt functions and `beforeunload` event).  Instead, if an
  /// event handler is set using `add_ScriptDialogOpening`, WebView sends an
  /// event that contains all of the information for the dialog and allow the
  /// host app to show a custom UI.
  /// The default value is `TRUE`.
  @(" propget")
	HRESULT get_AreDefaultScriptDialogsEnabled(
      @("out, retval") BOOL* areDefaultScriptDialogsEnabled);

  /// Sets the `AreDefaultScriptDialogsEnabled` property.
  @(" propput")
	HRESULT put_AreDefaultScriptDialogsEnabled(
      in BOOL areDefaultScriptDialogsEnabled);

  /// `IsStatusBarEnabled` controls whether the status bar is displayed.  The
  /// status bar is usually displayed in the lower left of the WebView and
  /// shows things such as the URI of a link when the user hovers over it and
  /// other information.
  /// The default value is `TRUE`.
  /// The status bar UI can be altered by web content and should not be considered secure.
  @(" propget")
	HRESULT get_IsStatusBarEnabled(@("out, retval") BOOL* isStatusBarEnabled);

  /// Sets the `IsStatusBarEnabled` property.
  @(" propput")
	HRESULT put_IsStatusBarEnabled(in BOOL isStatusBarEnabled);

  /// `AreDevToolsEnabled` controls whether the user is able to use the context
  /// menu or keyboard shortcuts to open the DevTools window.
  /// The default value is `TRUE`.
  @(" propget")
	HRESULT get_AreDevToolsEnabled(@("out, retval") BOOL* areDevToolsEnabled);

  /// Sets the `AreDevToolsEnabled` property.
  @(" propput")
	HRESULT put_AreDevToolsEnabled(in BOOL areDevToolsEnabled);

  /// The `AreDefaultContextMenusEnabled` property is used to prevent default
  /// context menus from being shown to user in WebView.
  /// The default value is `TRUE`.
  ///
  /// \snippet SettingsComponent.cpp DisableContextMenu
  @(" propget")
	HRESULT get_AreDefaultContextMenusEnabled(@("out, retval") BOOL* enabled);

  /// Sets the `AreDefaultContextMenusEnabled` property.
  @(" propput")
	HRESULT put_AreDefaultContextMenusEnabled(in BOOL enabled);

  /// The `AreHostObjectsAllowed` property is used to control whether host
  /// objects are accessible from the page in WebView.
  /// The default value is `TRUE`.
  ///
  /// \snippet SettingsComponent.cpp HostObjectsAccess
  @(" propget")
	HRESULT get_AreHostObjectsAllowed(@("out, retval") BOOL* allowed);

  /// Sets the `AreHostObjectsAllowed` property.

  @(" propput")
	HRESULT put_AreHostObjectsAllowed(in BOOL allowed);

  /// The `IsZoomControlEnabled` property is used to prevent the user from
  /// impacting the zoom of the WebView.  When disabled, the user is not able
  /// to zoom using Ctrl++, Ctrl+-, or Ctrl+mouse wheel, but the zoom
  /// is set using `ZoomFactor` API.  The default value is `TRUE`.
  ///
  /// \snippet SettingsComponent.cpp DisableZoomControl

  @(" propget")
	HRESULT get_IsZoomControlEnabled(@("out, retval") BOOL* enabled);

  /// Sets the `IsZoomControlEnabled` property.

  @(" propput")
	HRESULT put_IsZoomControlEnabled(in BOOL enabled);

  /// The `IsBuiltInErrorPageEnabled` property is used to disable built in
  /// error page for navigation failure and render process failure.  When
  /// disabled, a blank page is displayed when the related error happens.
  /// The default value is `TRUE`.
  ///
  /// \snippet SettingsComponent.cpp BuiltInErrorPageEnabled
  @(" propget")
	HRESULT get_IsBuiltInErrorPageEnabled(@("out, retval") BOOL* enabled);

  /// Sets the `IsBuiltInErrorPageEnabled` property.
  @(" propput")
	HRESULT put_IsBuiltInErrorPageEnabled(in BOOL enabled);
}

/// A continuation of the ICoreWebView2Settings interface that manages the user agent.

const GUID IID_ICoreWebView2Settings2 = ICoreWebView2Settings2.iid;

interface ICoreWebView2Settings2 : ICoreWebView2Settings
{
    static const GUID iid = { 0xee9a0f68,0xf46c,0x4e32,[ 0xac,0x23,0xef,0x8c,0xac,0x22,0x4d,0x2a ] };
  /// Returns the User Agent. The default value is the default User Agent of the
  /// Microsoft Edge browser.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  ///
  /// \snippet SettingsComponent.cpp UserAgent
  @(" propget")
	HRESULT get_UserAgent(@("out, retval") LPWSTR* userAgent);
  /// Sets the `UserAgent` property. This property may be overridden if
  /// the User-Agent header is set in a request. If the parameter is empty
  /// the User Agent will not be updated and the current User Agent will remain.
  /// Returns `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)` if the owning WebView is
  /// closed.
  @(" propput")
	HRESULT put_UserAgent(in LPCWSTR userAgent);
}

/// A continuation of the ICoreWebView2Settings interface that manages whether
/// browser accelerator keys are enabled.
const GUID IID_ICoreWebView2Settings3 = ICoreWebView2Settings3.iid;

interface ICoreWebView2Settings3 : ICoreWebView2Settings2
{
    static const GUID iid = { 0xfdb5ab74,0xaf33,0x4854,[ 0x84,0xf0,0x0a,0x63,0x1d,0xeb,0x5e,0xba ] };
  /// When this setting is set to FALSE, it disables all accelerator keys that
  /// access features specific to a web browser, including but not limited to:
  ///  - Ctrl-F and F3 for Find on Page
  ///  - Ctrl-P for Print
  ///  - Ctrl-R and F5 for Reload
  ///  - Ctrl-Plus and Ctrl-Minus for zooming
  ///  - Ctrl-Shift-C and F12 for DevTools
  ///  - Special keys for browser functions, such as Back, Forward, and Search
  ///
  /// It does not disable accelerator keys related to movement and text editing,
  /// such as:
  ///  - Home, End, Page Up, and Page Down
  ///  - Ctrl-X, Ctrl-C, Ctrl-V
  ///  - Ctrl-A for Select All
  ///  - Ctrl-Z for Undo
  ///
  /// Those accelerator keys will always be enabled unless they are handled in
  /// the `AcceleratorKeyPressed` event.
  ///
  /// This setting has no effect on the `AcceleratorKeyPressed` event.  The event
  /// will be fired for all accelerator keys, whether they are enabled or not.
  ///
  /// The default value for `AreBrowserAcceleratorKeysEnabled` is TRUE.
  ///
  /// \snippet SettingsComponent.cpp AreBrowserAcceleratorKeysEnabled
  @(" propget")
	HRESULT get_AreBrowserAcceleratorKeysEnabled(
      @("out, retval") BOOL* areBrowserAcceleratorKeysEnabled);

  /// Sets the `AreBrowserAcceleratorKeysEnabled` property.
  @(" propput")
	HRESULT put_AreBrowserAcceleratorKeysEnabled(
      in BOOL areBrowserAcceleratorKeysEnabled);
}

/// A continuation of the ICoreWebView2Settings interface to manage autofill.
const GUID IID_ICoreWebView2Settings4 = ICoreWebView2Settings4.iid;

interface ICoreWebView2Settings4 : ICoreWebView2Settings3
{
    static const GUID iid = { 0xcb56846c,0x4168,0x4d53,[ 0xb0,0x4f,0x03,0xb6,0xd6,0x79,0x6f,0xf2 ] };
  /// IsPasswordAutosaveEnabled controls whether autosave for password
  /// information is enabled. The IsPasswordAutosaveEnabled property behaves
  /// independently of the IsGeneralAutofillEnabled property. When IsPasswordAutosaveEnabled is
  /// false, no new password data is saved and no Save/Update Password prompts are displayed.
  /// However, if there was password data already saved before disabling this setting,
  /// then that password information is auto-populated, suggestions are shown and clicking on
  /// one will populate the fields.
  /// When IsPasswordAutosaveEnabled is true, password information is auto-populated,
  /// suggestions are shown and clicking on one will populate the fields, new data
  /// is saved, and a Save/Update Password prompt is displayed.
  /// It will take effect immediately after setting.
  /// The default value is `FALSE`.
  /// This property has the same value as
  /// `CoreWebView2Profile.IsPasswordAutosaveEnabled`, and changing one will
  /// change the other. All `CoreWebView2`s with the same `CoreWebView2Profile`
  /// will share the same value for this property, so for the `CoreWebView2`s
  /// with the same profile, their
  /// `CoreWebView2Settings.IsPasswordAutosaveEnabled` and
  /// `CoreWebView2Profile.IsPasswordAutosaveEnabled` will always have the same
  /// value.
  ///
  /// \snippet SettingsComponent.cpp PasswordAutosaveEnabled
  @(" propget")
	HRESULT get_IsPasswordAutosaveEnabled(@("out, retval") BOOL* value);

  /// Set the IsPasswordAutosaveEnabled property.
  @(" propput")
	HRESULT put_IsPasswordAutosaveEnabled(in BOOL value);

  /// IsGeneralAutofillEnabled controls whether autofill for information
  /// like names, street and email addresses, phone numbers, and arbitrary input
  /// is enabled. This excludes password and credit card information. When
  /// IsGeneralAutofillEnabled is false, no suggestions appear, and no new information
  /// is saved. When IsGeneralAutofillEnabled is true, information is saved, suggestions
  /// appear and clicking on one will populate the form fields.
  /// It will take effect immediately after setting.
  /// The default value is `TRUE`.
  /// This property has the same value as
  /// `CoreWebView2Profile.IsGeneralAutofillEnabled`, and changing one will
  /// change the other. All `CoreWebView2`s with the same `CoreWebView2Profile`
  /// will share the same value for this property, so for the `CoreWebView2`s
  /// with the same profile, their
  /// `CoreWebView2Settings.IsGeneralAutofillEnabled` and
  /// `CoreWebView2Profile.IsGeneralAutofillEnabled` will always have the same
  /// value.
  ///
  /// \snippet SettingsComponent.cpp GeneralAutofillEnabled
  @(" propget")
	HRESULT get_IsGeneralAutofillEnabled(@("out, retval") BOOL* value);

  /// Set the IsGeneralAutofillEnabled property.
  @(" propput")
	HRESULT put_IsGeneralAutofillEnabled(in BOOL value);
}

/// A continuation of the ICoreWebView2Settings interface to manage pinch zoom.
const GUID IID_ICoreWebView2Settings5 = ICoreWebView2Settings5.iid;

interface ICoreWebView2Settings5 : ICoreWebView2Settings4
{
    static const GUID iid = { 0x183e7052,0x1d03,0x43a0,[ 0xab,0x99,0x98,0xe0,0x43,0xb6,0x6b,0x39 ] };
  /// Pinch-zoom, referred to as "Page Scale" zoom, is performed as a post-rendering step,
  /// it changes the page scale factor property and scales the surface the web page is
  /// rendered onto when user performs a pinch zooming action. It does not change the layout
  /// but rather changes the viewport and clips the web content, the content outside of the
  /// viewport isn't visible onscreen and users can't reach this content using mouse.
  ///
  /// The `IsPinchZoomEnabled` property enables or disables the ability of
  /// the end user to use a pinching motion on touch input enabled devices
  /// to scale the web content in the WebView2. It defaults to `TRUE`.
  /// When set to `FALSE`, the end user cannot pinch zoom after the next navigation.
  /// Disabling/Enabling `IsPinchZoomEnabled` only affects the end user's ability to use
  /// pinch motions and does not change the page scale factor.
  /// This API only affects the Page Scale zoom and has no effect on the
  /// existing browser zoom properties (`IsZoomControlEnabled` and `ZoomFactor`)
  /// or other end user mechanisms for zooming.
  ///
  /// \snippet SettingsComponent.cpp TogglePinchZoomEnabled
  @(" propget")
	HRESULT get_IsPinchZoomEnabled(@("out, retval") BOOL* enabled);
  /// Set the `IsPinchZoomEnabled` property
  @(" propput")
	HRESULT put_IsPinchZoomEnabled(in BOOL enabled);
}

/// A continuation of the ICoreWebView2Settings interface to manage swipe navigation.
const GUID IID_ICoreWebView2Settings6 = ICoreWebView2Settings6.iid;

interface ICoreWebView2Settings6 : ICoreWebView2Settings5
{
    static const GUID iid = { 0x11cb3acd,0x9bc8,0x43b8,[ 0x83,0xbf,0xf4,0x07,0x53,0x71,0x4f,0x87 ] };
  /// The `IsSwipeNavigationEnabled` property enables or disables the ability of the
  /// end user to use swiping gesture on touch input enabled devices to
  /// navigate in WebView2. It defaults to `TRUE`.
  ///
  /// When this property is `TRUE`, then all configured navigation gestures are enabled:
  /// 1. Swiping left and right to navigate forward and backward is always configured.
  /// 2. Swiping down to refresh is off by default and not exposed via our API currently,
  /// it requires the "--pull-to-refresh" option to be included in the additional browser
  /// arguments to be configured. (See put_AdditionalBrowserArguments.)
  ///
  /// When set to `FALSE`, the end user cannot swipe to navigate or pull to refresh.
  /// This API only affects the overscrolling navigation functionality and has no
  /// effect on the scrolling interaction used to explore the web content shown
  /// in WebView2.
  ///
  /// Disabling/Enabling IsSwipeNavigationEnabled takes effect after the
  /// next navigation.
  ///
  /// \snippet SettingsComponent.cpp ToggleSwipeNavigationEnabled
  @(" propget")
	HRESULT get_IsSwipeNavigationEnabled(@("out, retval") BOOL* enabled);
  /// Set the `IsSwipeNavigationEnabled` property
  @(" propput")
	HRESULT put_IsSwipeNavigationEnabled(in BOOL enabled);
}

/// A continuation of the ICoreWebView2Settings interface to hide Pdf toolbar items.
const GUID IID_ICoreWebView2Settings7 = ICoreWebView2Settings7.iid;

interface ICoreWebView2Settings7 : ICoreWebView2Settings6
{
    static const GUID iid = { 0x488dc902,0x35ef,0x42d2,[ 0xbc,0x7d,0x94,0xb6,0x5c,0x4b,0xc4,0x9c ] };
  /// `HiddenPdfToolbarItems` is used to customize the PDF toolbar items. By default, it is COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE and so it displays all of the items.
  /// Changes to this property apply to all CoreWebView2s in the same environment and using the same profile.
  /// Changes to this setting apply only after the next navigation.
  /// \snippet SettingsComponent.cpp ToggleHidePdfToolbarItems
  @(" propget")
	HRESULT get_HiddenPdfToolbarItems(@("out, retval") COREWEBVIEW2_PDF_TOOLBAR_ITEMS* hidden_pdf_toolbar_items);

  /// Set the `HiddenPdfToolbarItems` property.
  @(" propput")
	HRESULT put_HiddenPdfToolbarItems(in COREWEBVIEW2_PDF_TOOLBAR_ITEMS hidden_pdf_toolbar_items);
}

/// A continuation of the ICoreWebView2Settings interface to manage smartscreen.
const GUID IID_ICoreWebView2Settings8 = ICoreWebView2Settings8.iid;

interface ICoreWebView2Settings8 : ICoreWebView2Settings7
{
    static const GUID iid = { 0x9e6b0e8f,0x86ad,0x4e81,[ 0x81,0x47,0xa9,0xb5,0xed,0xb6,0x86,0x50 ] };
  /// SmartScreen helps webviews identify reported phishing and malware websites
  /// and also helps users make informed decisions about downloads.
  /// `IsReputationCheckingRequired` is used to control whether SmartScreen
  /// enabled or not. SmartScreen is enabled or disabled for all CoreWebView2s
  /// using the same user data folder. If
  /// CoreWebView2Setting.IsReputationCheckingRequired is true for any
  /// CoreWebView2 using the same user data folder, then SmartScreen is enabled.
  /// If CoreWebView2Setting.IsReputationCheckingRequired is false for all
  /// CoreWebView2 using the same user data folder, then SmartScreen is
  /// disabled. When it is changed, the change will be applied to all WebViews
  /// using the same user data folder on the next navigation or download. The
  /// default value for `IsReputationCheckingRequired` is true. If the newly
  /// created CoreWebview2 does not set SmartScreen to false, when
  /// navigating(Such as Navigate(), LoadDataUrl(), ExecuteScript(), etc.), the
  /// default value will be applied to all CoreWebview2 using the same user data
  /// folder.
  /// SmartScreen of WebView2 apps can be controlled by Windows system setting
  /// "SmartScreen for Microsoft Edge", specially, for WebView2 in Windows
  /// Store apps, SmartScreen is controlled by another Windows system setting
  /// "SmartScreen for Microsoft Store apps". When the Windows setting is enabled, the
  /// SmartScreen operates under the control of the `IsReputationCheckingRequired`.
  /// When the Windows setting is disabled, the SmartScreen will be disabled
  /// regardless of the `IsReputationCheckingRequired` value set in WebView2 apps.
  /// In other words, under this circumstance the value of
  /// `IsReputationCheckingRequired` will be saved but overridden by system setting.
  /// Upon re-enabling the Windows setting, the CoreWebview2 will reference the
  /// `IsReputationCheckingRequired` to determine the SmartScreen status.
  /// \snippet SettingsComponent.cpp ToggleSmartScreen
  @(" propget")
	HRESULT get_IsReputationCheckingRequired(@("out, retval") BOOL* value);

  /// Sets whether this webview2 instance needs SmartScreen protection for its content.
  /// Set the `IsReputationCheckingRequired` property.
  @(" propput")
	HRESULT put_IsReputationCheckingRequired(in BOOL value);
}

/// Event args for the `ProcessFailed` event.
const GUID IID_ICoreWebView2ProcessFailedEventArgs = ICoreWebView2ProcessFailedEventArgs.iid;

interface ICoreWebView2ProcessFailedEventArgs : IUnknown
{
    static const GUID iid = { 0x8155a9a4,0x1474,0x4a86,[ 0x8c,0xae,0x15,0x1b,0x0f,0xa6,0xb8,0xca ] };

  /// The kind of process failure that has occurred. This is a combination of
  /// process kind (for example, browser, renderer, gpu) and failure (exit,
  /// unresponsiveness). Renderer processes are further divided in _main frame_
  /// renderer (`RenderProcessExited`, `RenderProcessUnresponsive`) and
  /// _subframe_ renderer (`FrameRenderProcessExited`). To learn about the
  /// conditions under which each failure kind occurs, see
  /// `COREWEBVIEW2_PROCESS_FAILED_KIND`.
  @(" propget")
	HRESULT get_ProcessFailedKind(
      @("out, retval") COREWEBVIEW2_PROCESS_FAILED_KIND* processFailedKind);
}

/// Receives `ProcessFailed` events.
const GUID IID_ICoreWebView2ProcessFailedEventHandler = ICoreWebView2ProcessFailedEventHandler.iid;

interface ICoreWebView2ProcessFailedEventHandler : IUnknown
{
    static const GUID iid = { 0x79e0aea4,0x990b,0x42d9,[ 0xaa,0x1d,0x0f,0xcc,0x2e,0x5b,0xc7,0xf1 ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2ProcessFailedEventArgs args);
}

/// Implements the interface to receive `ZoomFactorChanged` events.  Use the
/// `ICoreWebView2Controller.ZoomFactor` property to get the modified zoom
/// factor.

const GUID IID_ICoreWebView2ZoomFactorChangedEventHandler = ICoreWebView2ZoomFactorChangedEventHandler.iid;

interface ICoreWebView2ZoomFactorChangedEventHandler : IUnknown
{
    static const GUID iid = { 0xb52d71d6,0xc4df,0x4543,[ 0xa9,0x0c,0x64,0xa3,0xe6,0x0f,0x38,0xcb ] };

  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.

  HRESULT Invoke(/+[in]+/ ICoreWebView2Controller sender, /+[in]+/ IUnknown args);
}

/// Iterator for a collection of HTTP headers.  For more information, navigate
/// to ICoreWebView2HttpRequestHeaders and ICoreWebView2HttpResponseHeaders.
///
/// \snippet ScenarioWebViewEventMonitor.cpp HttpRequestHeaderIterator
const GUID IID_ICoreWebView2HttpHeadersCollectionIterator = ICoreWebView2HttpHeadersCollectionIterator.iid;

interface ICoreWebView2HttpHeadersCollectionIterator : IUnknown
{
    static const GUID iid = { 0x0702fc30,0xf43b,0x47bb,[ 0xab,0x52,0xa4,0x2c,0xb5,0x52,0xad,0x9f ] };

  /// Get the name and value of the current HTTP header of the iterator.  If
  /// the previous `MoveNext` operation set the `hasNext` parameter to `FALSE`,
  /// this method fails.
  ///
  /// The caller must free the returned strings with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  HRESULT GetCurrentHeader(@("out") LPWSTR* name,
		@("out") LPWSTR* value);

  /// `TRUE` when the iterator has not run out of headers.  If the collection
  /// over which the iterator is iterating is empty or if the iterator has gone
  ///  past the end of the collection then this is `FALSE`.

  @(" propget")
	HRESULT get_HasCurrentHeader(@("out, retval") BOOL* hasCurrent);

  /// Move the iterator to the next HTTP header in the collection.
  ///
  /// \> [!NOTE]\n \> If no more HTTP headers exist, the `hasNext` parameter is set to
  /// `FALSE`.  After this occurs the `GetCurrentHeader` method fails.

  HRESULT MoveNext(@("out, retval") BOOL* hasNext);
}

/// HTTP request headers.  Used to inspect the HTTP request on
/// `WebResourceRequested` event and `NavigationStarting` event.
///
/// \> [!NOTE]\n\> It is possible to modify the HTTP request from a `WebResourceRequested`
/// event, but not from a `NavigationStarting` event.
const GUID IID_ICoreWebView2HttpRequestHeaders = ICoreWebView2HttpRequestHeaders.iid;

interface ICoreWebView2HttpRequestHeaders : IUnknown
{
    static const GUID iid = { 0xe86cac0e,0x5523,0x465c,[ 0xb5,0x36,0x8f,0xb9,0xfc,0x8c,0x8c,0x60 ] };

  /// Gets the header value matching the name.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  HRESULT GetHeader(in LPCWSTR name,
		@("out, retval") LPWSTR* value);

  /// Gets the header value matching the name using an iterator.

  HRESULT GetHeaders(in LPCWSTR name,
		@("out, retval") ICoreWebView2HttpHeadersCollectionIterator * iterator);

  /// Verifies that the headers contain an entry that matches the header name.

  HRESULT Contains(in LPCWSTR name,
		@("out, retval") BOOL* contains);

  /// Adds or updates header that matches the name.

  HRESULT SetHeader(in LPCWSTR name, in LPCWSTR value);

  /// Removes header that matches the name.

  HRESULT RemoveHeader(in LPCWSTR name);

  /// Gets an iterator over the collection of request headers.

  HRESULT GetIterator(
      @("out, retval") ICoreWebView2HttpHeadersCollectionIterator * iterator);
}

/// HTTP response headers.  Used to construct a `WebResourceResponse` for the
/// `WebResourceRequested` event.
const GUID IID_ICoreWebView2HttpResponseHeaders = ICoreWebView2HttpResponseHeaders.iid;

interface ICoreWebView2HttpResponseHeaders : IUnknown
{
    static const GUID iid = { 0x03c5ff5a,0x9b45,0x4a88,[ 0x88,0x1c,0x89,0xa9,0xf3,0x28,0x61,0x9c ] };

  /// Appends header line with name and value.

  HRESULT AppendHeader(in LPCWSTR name, in LPCWSTR value);

  /// Verifies that the headers contain entries that match the header name.

  HRESULT Contains(in LPCWSTR name,
		@("out, retval") BOOL* contains);

  /// Gets the first header value in the collection matching the name.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  HRESULT GetHeader(in LPCWSTR name,
		@("out, retval") LPWSTR* value);

  /// Gets the header values matching the name.

  HRESULT GetHeaders(in LPCWSTR name,
		@("out, retval") ICoreWebView2HttpHeadersCollectionIterator * iterator);

  /// Gets an iterator over the collection of entire response headers.

  HRESULT GetIterator(
  @("out, retval") ICoreWebView2HttpHeadersCollectionIterator * iterator);
}

/// An HTTP request used with the `WebResourceRequested` event.
const GUID IID_ICoreWebView2WebResourceRequest = ICoreWebView2WebResourceRequest.iid;

interface ICoreWebView2WebResourceRequest : IUnknown
{
    static const GUID iid = { 0x97055cd4,0x512c,0x4264,[ 0x8b,0x5f,0xe3,0xf4,0x46,0xce,0xa6,0xa5 ] };

  /// The request URI.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* uri);

  /// Sets the `Uri` property.

  @(" propput")
	HRESULT put_Uri(in LPCWSTR uri);

  /// The HTTP request method.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Method(@("out, retval") LPWSTR* method);

  /// Sets the `Method` property.

  @(" propput")
	HRESULT put_Method(in LPCWSTR method);

  /// The HTTP request message body as stream.  POST data should be here.  If a
  /// stream is set, which overrides the message body, the stream must have
  /// all the content data available by the time the `WebResourceRequested`
  /// event deferral of this response is completed.  Stream should be agile or
  /// be created from a background STA to prevent performance impact to the UI
  /// thread.  `Null` means no content data.  `IStream` semantics apply
  /// (return `S_OK` to `Read` runs until all data is exhausted).

  @(" propget")
	HRESULT get_Content(@("out, retval") IStream** content);

  /// Sets the `Content` property.

  @(" propput")
	HRESULT put_Content(in IStream* content);

  /// The mutable HTTP request headers

  @(" propget")
	HRESULT get_Headers(@("out, retval") ICoreWebView2HttpRequestHeaders * headers);
}

/// An HTTP response used with the `WebResourceRequested` event.
const GUID IID_ICoreWebView2WebResourceResponse = ICoreWebView2WebResourceResponse.iid;

interface ICoreWebView2WebResourceResponse : IUnknown
{
    static const GUID iid = { 0xaafcc94f,0xfa27,0x48fd,[ 0x97,0xdf,0x83,0x0e,0xf7,0x5a,0xae,0xc9 ] };

  /// HTTP response content as stream.  Stream must have all the content data
  /// available by the time the `WebResourceRequested` event deferral of this
  /// response is completed.  Stream should be agile or be created from a
  /// background thread to prevent performance impact to the UI thread.  `Null`
  ///  means no content data.  `IStream` semantics apply (return `S_OK` to
  /// `Read` runs until all data is exhausted).
  /// When providing the response data, you should consider relevant HTTP
  /// request headers just like an HTTP server would do. For example, if the
  /// request was for a video resource in a HTML video element, the request may
  /// contain the [Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range)
  /// header to request only a part of the video that is streaming. In this
  /// case, your response stream should be only the portion of the video
  /// specified by the range HTTP request headers and you should set the
  /// appropriate
  /// [Content-Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
  /// header in the response.

  @(" propget")
	HRESULT get_Content(@("out, retval") IStream** content);

  /// Sets the `Content` property.

  @(" propput")
	HRESULT put_Content(in IStream* content);

  /// Overridden HTTP response headers.

  @(" propget")
	HRESULT get_Headers(@("out, retval") ICoreWebView2HttpResponseHeaders * headers);

  /// The HTTP response status code.

  @(" propget")
	HRESULT get_StatusCode(@("out, retval") int* statusCode);

  /// Sets the `StatusCode` property.

  @(" propput")
	HRESULT put_StatusCode(in int statusCode);

  /// The HTTP response reason phrase.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_ReasonPhrase(@("out, retval") LPWSTR* reasonPhrase);

  /// Sets the `ReasonPhrase` property.

  @(" propput")
	HRESULT put_ReasonPhrase(in LPCWSTR reasonPhrase);
}

/// Event args for the `NavigationStarting` event.
const GUID IID_ICoreWebView2NavigationStartingEventArgs = ICoreWebView2NavigationStartingEventArgs.iid;

interface ICoreWebView2NavigationStartingEventArgs : IUnknown
{
    static const GUID iid = { 0x5b495469,0xe119,0x438a,[ 0x9b,0x18,0x76,0x04,0xf2,0x5f,0x2e,0x49 ] };

  /// The uri of the requested navigation.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* uri);

  /// `TRUE` when the navigation was initiated through a user gesture as
  /// opposed to programmatic navigation by page script. Navigations initiated
  /// via WebView2 APIs are considered as user initiated.

  @(" propget")
	HRESULT get_IsUserInitiated(@("out, retval") BOOL* isUserInitiated);

  /// `TRUE` when the navigation is redirected.

  @(" propget")
	HRESULT get_IsRedirected(@("out, retval") BOOL* isRedirected);

  /// The HTTP request headers for the navigation.
  ///
  /// \> [!NOTE]\n\> You are not able to modify the HTTP request headers in a
  /// `NavigationStarting` event.

  @(" propget")
	HRESULT get_RequestHeaders(@("out, retval") ICoreWebView2HttpRequestHeaders * requestHeaders);

  /// The host may set this flag to cancel the navigation.  If set, the
  /// navigation is not longer present and the content of the current page is
  /// intact.  For performance reasons, `GET` HTTP requests may happen, while
  /// the host is responding.  You may set cookies and use part of a request
  /// for the navigation.  Cancellation for navigation to `about:blank` or
  /// frame navigation to `srcdoc` is not supported.  Such attempts are
  /// ignored.  A cancelled navigation will fire a `NavigationCompleted` event
  /// with a `WebErrorStatus` of
  /// `COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED`.

  @(" propget")
	HRESULT get_Cancel(@("out, retval") BOOL* cancel);

  /// Sets the `Cancel` property.

  @(" propput")
	HRESULT put_Cancel(in BOOL cancel);

  /// The ID of the navigation.

  @(" propget")
	HRESULT get_NavigationId(@("out, retval") UINT64* navigationId);
}

/// The AdditionalAllowedFrameAncestors API that enable developers to provide additional allowed frame ancestors.
const GUID IID_ICoreWebView2NavigationStartingEventArgs2 = ICoreWebView2NavigationStartingEventArgs2.iid;

interface ICoreWebView2NavigationStartingEventArgs2 : ICoreWebView2NavigationStartingEventArgs
{
    static const GUID iid = { 0x9086BE93,0x91AA,0x472D,[ 0xA7,0xE0,0x57,0x9F,0x2B,0xA0,0x06,0xAD ] };

  /// Get additional allowed frame ancestors set by the host app.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_AdditionalAllowedFrameAncestors(@("out, retval") LPWSTR* value);

  /// The app may set this property to allow a frame to be embedded by additional ancestors besides what is allowed by
  /// http header [X-Frame-Options](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Frame-Options)
  /// and [Content-Security-Policy frame-ancestors directive](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors).
  /// If set, a frame ancestor is allowed if it is allowed by the additional allowed frame
  /// ancestors or original http header from the site.
  /// Whether an ancestor is allowed by the additional allowed frame ancestors is done the same way as if the site provided
  /// it as the source list of the Content-Security-Policy frame-ancestors directive.
  /// For example, if `https://example.com` and `https://www.example.com` are the origins of the top
  /// page and intermediate iframes that embed a nested site-embedding iframe, and you fully trust
  /// those origins, you should set this property to `https://example.com https://www.example.com`.
  /// This property gives the app the ability to use iframe to embed sites that otherwise
  /// could not be embedded in an iframe in trusted app pages.
  /// This could potentially subject the embedded sites to [Clickjacking](https://en.wikipedia.org/wiki/Clickjacking)
  /// attack from the code running in the embedding web page. Therefore, you should only
  /// set this property with origins of fully trusted embedding page and any intermediate iframes.
  /// Whenever possible, you should use the list of specific origins of the top and intermediate
  /// frames instead of wildcard characters for this property.
  /// This API is to provide limited support for app scenarios that used to be supported by
  /// `<webview>` element in other solutions like JavaScript UWP apps and Electron.
  /// You should limit the usage of this property to trusted pages, and specific navigation
  /// target url, by checking the `Source` of the WebView2, and `Uri` of the event args.
  ///
  /// This property is ignored for top level document navigation.
  ///
  /// \snippet ScriptComponent.cpp AdditionalAllowedFrameAncestors_1
  ///
  /// \snippet ScriptComponent.cpp AdditionalAllowedFrameAncestors_2
  @(" propput")
	HRESULT put_AdditionalAllowedFrameAncestors(in LPCWSTR value);
}

/// The NavigationKind API that enables developers to get more information about
/// navigation type.
const GUID IID_ICoreWebView2NavigationStartingEventArgs3 = ICoreWebView2NavigationStartingEventArgs3.iid;

interface ICoreWebView2NavigationStartingEventArgs3 : ICoreWebView2NavigationStartingEventArgs2
{
    static const GUID iid = { 0xDDFFE494,0x4942,0x4BD2,[ 0xAB,0x73,0x35,0xB8,0xFF,0x40,0xE1,0x9F ] };

  /// Get the navigation kind of this navigation.
  ///
  @(" propget")
	HRESULT get_NavigationKind(@("out, retval") COREWEBVIEW2_NAVIGATION_KIND* navigation_kind);
}

/// Receives `NavigationStarting` events.
const GUID IID_ICoreWebView2NavigationStartingEventHandler = ICoreWebView2NavigationStartingEventHandler.iid;

interface ICoreWebView2NavigationStartingEventHandler : IUnknown
{
    static const GUID iid = { 0x9adbe429,0xf36d,0x432b,[ 0x9d,0xdc,0xf8,0x88,0x1f,0xbd,0x76,0xe3 ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2NavigationStartingEventArgs args);
}

/// Event args for the `ContentLoading` event.
const GUID IID_ICoreWebView2ContentLoadingEventArgs = ICoreWebView2ContentLoadingEventArgs.iid;

interface ICoreWebView2ContentLoadingEventArgs : IUnknown
{
    static const GUID iid = { 0x0c8a1275,0x9b6b,0x4901,[ 0x87,0xad,0x70,0xdf,0x25,0xba,0xfa,0x6e ] };

  /// `TRUE` if the loaded content is an error page.

  @(" propget")
	HRESULT get_IsErrorPage(@("out, retval") BOOL* isErrorPage);

  /// The ID of the navigation.

  @(" propget")
	HRESULT get_NavigationId(@("out, retval") UINT64* navigationId);
}

/// Receives `ContentLoading` events.
const GUID IID_ICoreWebView2ContentLoadingEventHandler = ICoreWebView2ContentLoadingEventHandler.iid;

interface ICoreWebView2ContentLoadingEventHandler : IUnknown
{
    static const GUID iid = { 0x364471e7,0xf2be,0x4910,[ 0xbd,0xba,0xd7,0x20,0x77,0xd5,0x1c,0x4b ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2ContentLoadingEventArgs args);
}

/// Event args for the `SourceChanged` event.
const GUID IID_ICoreWebView2SourceChangedEventArgs = ICoreWebView2SourceChangedEventArgs.iid;

interface ICoreWebView2SourceChangedEventArgs : IUnknown
{
    static const GUID iid = { 0x31e0e545,0x1dba,0x4266,[ 0x89,0x14,0xf6,0x38,0x48,0xa1,0xf7,0xd7 ] };

  /// `TRUE` if the page being navigated to is a new document.

  @(" propget")
	HRESULT get_IsNewDocument(@("out, retval") BOOL* isNewDocument);
}

/// Receives `SourceChanged` events.
const GUID IID_ICoreWebView2SourceChangedEventHandler = ICoreWebView2SourceChangedEventHandler.iid;

interface ICoreWebView2SourceChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x3c067f9f,0x5388,0x4772,[ 0x8b,0x48,0x79,0xf7,0xef,0x1a,0xb3,0x7c ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2SourceChangedEventArgs args);
}

/// Receives `HistoryChanged` events.
const GUID IID_ICoreWebView2HistoryChangedEventHandler = ICoreWebView2HistoryChangedEventHandler.iid;

interface ICoreWebView2HistoryChangedEventHandler : IUnknown
{
    static const GUID iid = { 0xc79a420c,0xefd9,0x4058,[ 0x92,0x95,0x3e,0x8b,0x4b,0xca,0xb6,0x45 ] };

  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.

  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
}

/// Event args for the `ScriptDialogOpening` event.
const GUID IID_ICoreWebView2ScriptDialogOpeningEventArgs = ICoreWebView2ScriptDialogOpeningEventArgs.iid;

interface ICoreWebView2ScriptDialogOpeningEventArgs : IUnknown
{
    static const GUID iid = { 0x7390bb70,0xabe0,0x4843,[ 0x95,0x29,0xf1,0x43,0xb3,0x1b,0x03,0xd6 ] };

  /// The URI of the page that requested the dialog box.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* uri);

  /// The kind of JavaScript dialog box.  `alert`, `confirm`, `prompt`, or
  /// `beforeunload`.

  @(" propget")
	HRESULT get_Kind(@("out, retval") COREWEBVIEW2_SCRIPT_DIALOG_KIND* kind);

  /// The message of the dialog box.  From JavaScript this is the first
  /// parameter passed to `alert`, `confirm`, and `prompt` and is empty for
  /// `beforeunload`.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Message(@("out, retval") LPWSTR* message);

  /// The host may run this to respond with **OK** to `confirm`, `prompt`, and
  /// `beforeunload` dialogs.  Do not run this method to indicate cancel.
  /// From JavaScript, this means that the `confirm` and `beforeunload` function
  /// returns `TRUE` if `Accept` is run.  And for the prompt function it returns
  /// the value of `ResultText` if `Accept` is run and otherwise returns
  /// `FALSE`.

  HRESULT Accept();

  /// The second parameter passed to the JavaScript prompt dialog.
  /// The result of the prompt JavaScript function uses this value as the
  /// default value.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_DefaultText(@("out, retval") LPWSTR* defaultText);

  /// The return value from the JavaScript prompt function if `Accept` is run.
  ///  This value is ignored for dialog kinds other than prompt.  If `Accept`
  /// is not run, this value is ignored and `FALSE` is returned from prompt.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_ResultText(@("out, retval") LPWSTR* resultText);

  /// Sets the `ResultText` property.

  @(" propput")
	HRESULT put_ResultText(in LPCWSTR resultText);

  /// Returns an `ICoreWebView2Deferral` object.  Use this operation to
  /// complete the event at a later time.

  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);
}

/// Receives `ScriptDialogOpening` events.
const GUID IID_ICoreWebView2ScriptDialogOpeningEventHandler = ICoreWebView2ScriptDialogOpeningEventHandler.iid;

interface ICoreWebView2ScriptDialogOpeningEventHandler : IUnknown
{
    static const GUID iid = { 0xef381bf9,0xafa8,0x4e37,[ 0x91,0xc4,0x8a,0xc4,0x85,0x24,0xbd,0xfb ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2ScriptDialogOpeningEventArgs args);
}

/// Event args for the `NavigationCompleted` event.
const GUID IID_ICoreWebView2NavigationCompletedEventArgs = ICoreWebView2NavigationCompletedEventArgs.iid;

interface ICoreWebView2NavigationCompletedEventArgs : IUnknown
{
    static const GUID iid = { 0x30d68b7d,0x20d9,0x4752,[ 0xa9,0xca,0xec,0x84,0x48,0xfb,0xb5,0xc1 ] };

  /// `TRUE` when the navigation is successful.  `FALSE` for a navigation that
  /// ended up in an error page (failures due to no network, DNS lookup
  /// failure, HTTP server responds with 4xx), but may also be `FALSE` for
  /// additional scenarios such as `window.stop()` run on navigated page.
  /// Note that WebView2 will report the navigation as 'unsuccessful' if the load
  /// for the navigation did not reach the expected completion for any reason. Such
  /// reasons include potentially catastrophic issues such network and certificate
  /// issues, but can also be the result of intended actions such as the app canceling a navigation or
  /// navigating away before the original navigation completed. Applications should not
  /// just rely on this flag, but also consider the reported WebErrorStatus to
  /// determine whether the failure is indeed catastrophic in their context.
  /// WebErrorStatuses that may indicate a non-catastrophic failure include:
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_VALID_AUTHENTICATION_CREDENTIALS_REQUIRED
  /// - COREWEBVIEW2_WEB_ERROR_STATUS_VALID_PROXY_AUTHENTICATION_REQUIRED

  @(" propget")
	HRESULT get_IsSuccess(@("out, retval") BOOL* isSuccess);

  /// The error code if the navigation failed.

  @(" propget")
	HRESULT get_WebErrorStatus(@("out, retval") COREWEBVIEW2_WEB_ERROR_STATUS*
      webErrorStatus);

  /// The ID of the navigation.

  @(" propget")
	HRESULT get_NavigationId(@("out, retval") UINT64* navigationId);
}

/// This is an interface for the StatusCode property of
/// ICoreWebView2NavigationCompletedEventArgs
const GUID IID_ICoreWebView2NavigationCompletedEventArgs2 = ICoreWebView2NavigationCompletedEventArgs2.iid;

interface ICoreWebView2NavigationCompletedEventArgs2 : ICoreWebView2NavigationCompletedEventArgs
{
    static const GUID iid = { 0xFDF8B738,0xEE1E,0x4DB2,[ 0xA3,0x29,0x8D,0x7D,0x7B,0x74,0xD7,0x92 ] };
  /// The HTTP status code of the navigation if it involved an HTTP request.
  /// For instance, this will usually be 200 if the request was successful, 404
  /// if a page was not found, etc.  See
  /// https://developer.mozilla.org/docs/Web/HTTP/Status for a list of
  /// common status codes.
  ///
  /// The `HttpStatusCode` property will be 0 in the following cases:
  /// * The navigation did not involve an HTTP request.  For instance, if it was
  ///   a navigation to a file:// URL, or if it was a same-document navigation.
  /// * The navigation failed before a response was received.  For instance, if
  ///   the hostname was not found, or if there was a network error.
  ///
  /// In those cases, you can get more information from the `IsSuccess` and
  /// `WebErrorStatus` properties.
  ///
  /// If the navigation receives a successful HTTP response, but the navigated
  /// page calls `window.stop()` before it finishes loading, then
  /// `HttpStatusCode` may contain a success code like 200, but `IsSuccess` will
  /// be FALSE and `WebErrorStatus` will be
  /// `COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED`.
  ///
  /// Since WebView2 handles HTTP continuations and redirects automatically, it
  /// is unlikely for `HttpStatusCode` to ever be in the 1xx or 3xx ranges.
  @(" propget")
	HRESULT get_HttpStatusCode(@("out, retval") int* http_status_code);
}

/// Receives `NavigationCompleted` events.
const GUID IID_ICoreWebView2NavigationCompletedEventHandler = ICoreWebView2NavigationCompletedEventHandler.iid;

interface ICoreWebView2NavigationCompletedEventHandler : IUnknown
{
    static const GUID iid = { 0xd33a35bf,0x1c49,0x4f98,[ 0x93,0xab,0x00,0x6e,0x05,0x33,0xfe,0x1c ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2NavigationCompletedEventArgs args);
}

/// Event args for the `PermissionRequested` event.
const GUID IID_ICoreWebView2PermissionRequestedEventArgs = ICoreWebView2PermissionRequestedEventArgs.iid;

interface ICoreWebView2PermissionRequestedEventArgs : IUnknown
{
    static const GUID iid = { 0x973ae2ef,0xff18,0x4894,[ 0x8f,0xb2,0x3c,0x75,0x8f,0x04,0x68,0x10 ] };

  /// The origin of the web content that requests the permission.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* uri);

  /// The type of the permission that is requested.

  @(" propget")
	HRESULT get_PermissionKind(@("out, retval") COREWEBVIEW2_PERMISSION_KIND* permissionKind);

  /// `TRUE` when the permission request was initiated through a user gesture.
  ///
  /// \> [!NOTE]\n\> Being initiated through a user gesture does not mean that user intended
  /// to access the associated resource.

  @(" propget")
	HRESULT get_IsUserInitiated(@("out, retval") BOOL* isUserInitiated);

  /// The status of a permission request, (for example is the request is granted).
  /// The default value is `COREWEBVIEW2_PERMISSION_STATE_DEFAULT`.

  @(" propget")
	HRESULT get_State(@("out, retval") COREWEBVIEW2_PERMISSION_STATE* state);

  /// Sets the `State` property.

  @(" propput")
	HRESULT put_State(in COREWEBVIEW2_PERMISSION_STATE state);

  /// Gets an `ICoreWebView2Deferral` object.  Use the deferral object to make
  /// the permission decision at a later time. The deferral only applies to the
  /// current request, and does not prevent the `PermissionRequested` event from
  /// getting raised for new requests. However, for some permission kinds the
  /// WebView will avoid creating a new request if there is a pending request of
  /// the same kind.

  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);
}

/// Receives `PermissionRequested` events.
const GUID IID_ICoreWebView2PermissionRequestedEventHandler = ICoreWebView2PermissionRequestedEventHandler.iid;

interface ICoreWebView2PermissionRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0x15e1c6a3,0xc72a,0x4df3,[ 0x91,0xd7,0xd0,0x97,0xfb,0xec,0x6b,0xfd ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2PermissionRequestedEventArgs args);
}

/// Receives the result of the `AddScriptToExecuteOnDocumentCreated` method.
const GUID IID_ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler = ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler.iid;

interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler : IUnknown
{
    static const GUID iid = { 0xb99369f3,0x9b11,0x47b5,[ 0xbc,0x6f,0x8e,0x78,0x95,0xfc,0xea,0x17 ] };

  /// Provide the completion status and result of the corresponding
  /// asynchronous method.

  HRESULT Invoke(in HRESULT errorCode, in LPCWSTR id);
}

/// Receives the result of the `ExecuteScript` method.
const GUID IID_ICoreWebView2ExecuteScriptCompletedHandler = ICoreWebView2ExecuteScriptCompletedHandler.iid;

interface ICoreWebView2ExecuteScriptCompletedHandler : IUnknown
{
    static const GUID iid = { 0x49511172,0xcc67,0x4bca,[ 0x99,0x23,0x13,0x71,0x12,0xf4,0xc4,0xcc ] };

  /// Provide the implementer with the completion status and result of the
  /// corresponding asynchronous method.

  HRESULT Invoke(in HRESULT errorCode, in LPCWSTR resultObjectAsJson);
}

/// Event args for the `WebResourceRequested` event.
const GUID IID_ICoreWebView2WebResourceRequestedEventArgs = ICoreWebView2WebResourceRequestedEventArgs.iid;

interface ICoreWebView2WebResourceRequestedEventArgs : IUnknown
{
    static const GUID iid = { 0x453e667f,0x12c7,0x49d4,[ 0xbe,0x6d,0xdd,0xbe,0x79,0x56,0xf5,0x7a ] };

  /// The Web resource request.  The request object may be missing some headers
  /// that are added by network stack at a later time.

  @(" propget")
	HRESULT get_Request(@("out, retval") ICoreWebView2WebResourceRequest * request);

  /// A placeholder for the web resource response object.  If this object is
  /// set, the web resource request is completed with the specified response.

  @(" propget")
	HRESULT get_Response(@("out, retval") ICoreWebView2WebResourceResponse * response);

  /// Sets the `Response` property.  Create an empty web resource response
  /// object with `CreateWebResourceResponse` and then modify it to construct
  /// the response.

  @(" propput")
	HRESULT put_Response(/+[in]+/ ICoreWebView2WebResourceResponse response);

  /// Obtain an `ICoreWebView2Deferral` object and put the event into a
  /// deferred state.  Use the `ICoreWebView2Deferral` object to complete the
  /// request at a later time.

  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);

  /// The web resource request context.

  @(" propget")
	HRESULT get_ResourceContext(@("out, retval") COREWEBVIEW2_WEB_RESOURCE_CONTEXT* context);
}

/// Runs when a URL request (through network, file, and so on) is made in
/// the webview for a Web resource matching resource context filter and URL
/// specified in `AddWebResourceRequestedFilter`.  The host views and modifies
/// the request or provide a response in a similar pattern to HTTP, in which
/// case the request immediately completed.  This may not contain any request
/// headers that are added by the network stack, such as an `Authorization`
/// header.
const GUID IID_ICoreWebView2WebResourceRequestedEventHandler = ICoreWebView2WebResourceRequestedEventHandler.iid;

interface ICoreWebView2WebResourceRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0xab00b74c,0x15f1,0x4646,[ 0x80,0xe8,0xe7,0x63,0x41,0xd2,0x5d,0x71 ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2WebResourceRequestedEventArgs args);
}

/// Receives the result of the `CapturePreview` method.  The result is written
/// to the stream provided in the `CapturePreview` method.

const GUID IID_ICoreWebView2CapturePreviewCompletedHandler = ICoreWebView2CapturePreviewCompletedHandler.iid;

interface ICoreWebView2CapturePreviewCompletedHandler : IUnknown
{
    static const GUID iid = { 0x697e05e9,0x3d8f,0x45fa,[ 0x96,0xf4,0x8f,0xfe,0x1e,0xde,0xda,0xf5 ] };

  /// Provides the completion status of the corresponding asynchronous method.

  HRESULT Invoke(in HRESULT errorCode);
}

/// Receives `GotFocus` and `LostFocus` events.

const GUID IID_ICoreWebView2FocusChangedEventHandler = ICoreWebView2FocusChangedEventHandler.iid;

interface ICoreWebView2FocusChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x05ea24bd,0x6452,0x4926,[ 0x90,0x14,0x4b,0x82,0xb4,0x98,0x13,0x5d ] };

  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Controller sender,
      /+[in]+/ IUnknown args);
}

/// Event args for the `MoveFocusRequested` event.

const GUID IID_ICoreWebView2MoveFocusRequestedEventArgs = ICoreWebView2MoveFocusRequestedEventArgs.iid;

interface ICoreWebView2MoveFocusRequestedEventArgs : IUnknown
{
    static const GUID iid = { 0x2d6aa13b,0x3839,0x4a15,[ 0x92,0xfc,0xd8,0x8b,0x3c,0x0d,0x9c,0x9d ] };

  /// The reason for WebView to run the `MoveFocusRequested` event.

  @(" propget")
	HRESULT get_Reason(@("out, retval") COREWEBVIEW2_MOVE_FOCUS_REASON* reason);

  /// Indicates whether the event has been handled by the app.  If the app has
  /// moved the focus to another desired location, it should set the `Handled`
  /// property to `TRUE`.  When the `Handled` property is `FALSE` after the
  /// event handler returns, default action is taken.  The default action is to
  /// try to find the next tab stop child window in the app and try to move
  /// focus to that window.  If no other window exists to move focus, focus is
  /// cycled within the web content of the WebView.

  @(" propget")
	HRESULT get_Handled(@("out, retval") BOOL* value);

  /// Sets the `Handled` property.

  @(" propput")
	HRESULT put_Handled(in BOOL value);
}

/// Receives `MoveFocusRequested` events.

const GUID IID_ICoreWebView2MoveFocusRequestedEventHandler = ICoreWebView2MoveFocusRequestedEventHandler.iid;

interface ICoreWebView2MoveFocusRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0x69035451,0x6dc7,0x4cb8,[ 0x9b,0xce,0xb2,0xbd,0x70,0xad,0x28,0x9f ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Controller sender,
      /+[in]+/ ICoreWebView2MoveFocusRequestedEventArgs args);
}

/// Event args for the `WebMessageReceived` event.
const GUID IID_ICoreWebView2WebMessageReceivedEventArgs = ICoreWebView2WebMessageReceivedEventArgs.iid;

interface ICoreWebView2WebMessageReceivedEventArgs : IUnknown
{
    static const GUID iid = { 0x0f99a40c,0xe962,0x4207,[ 0x9e,0x92,0xe3,0xd5,0x42,0xef,0xf8,0x49 ] };

  /// The URI of the document that sent this web message.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Source(@("out, retval") LPWSTR* source);

  /// The message posted from the WebView content to the host converted to a
  /// JSON string.  Run this operation to communicate using JavaScript objects.
  ///
  /// For example, the following `postMessage` runs result in the following
  /// `WebMessageAsJson` values.
  ///
  /// ```json
  /// postMessage({'a': 'b'})      L"{\"a\": \"b\"}"
  /// postMessage(1.2)             L"1.2"
  /// postMessage('example')       L"\"example\""
  /// ```
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_WebMessageAsJson(@("out, retval") LPWSTR* webMessageAsJson);

  /// If the message posted from the WebView content to the host is a string
  /// type, this method returns the value of that string.  If the message
  /// posted is some other kind of JavaScript type this method fails with the
  /// following error.
  ///
  /// ```text
  /// E_INVALIDARG
  /// ```
  ///
  /// Run this operation to communicate using simple strings.
  ///
  /// For example, the following `postMessage` runs result in the following
  /// `WebMessageAsString` values.
  ///
  /// ```json
  /// postMessage({'a': 'b'})      E_INVALIDARG
  /// postMessage(1.2)             E_INVALIDARG
  /// postMessage('example')       L"example"
  /// ```
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  HRESULT TryGetWebMessageAsString(@("out, retval") LPWSTR* webMessageAsString);
}

/// Receives `WebMessageReceived` events.
const GUID IID_ICoreWebView2WebMessageReceivedEventHandler = ICoreWebView2WebMessageReceivedEventHandler.iid;

interface ICoreWebView2WebMessageReceivedEventHandler : IUnknown
{
    static const GUID iid = { 0x57213f19,0x00e6,0x49fa,[ 0x8e,0x07,0x89,0x8e,0xa0,0x1e,0xcb,0xd2 ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2WebMessageReceivedEventArgs args);
}

/// Event args for the `DevToolsProtocolEventReceived` event.
const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventArgs = ICoreWebView2DevToolsProtocolEventReceivedEventArgs.iid;

interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs : IUnknown
{
    static const GUID iid = { 0x653c2959,0xbb3a,0x4377,[ 0x86,0x32,0xb5,0x8a,0xda,0x4e,0x66,0xc4 ] };

  /// The parameter object of the corresponding `DevToolsProtocol` event
  /// represented as a JSON string.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_ParameterObjectAsJson(@("out, retval") LPWSTR*
                                    parameterObjectAsJson);
}

/// This is a continuation of the `ICoreWebView2DevToolsProtocolEventReceivedEventArgs`
/// interface that provides the session ID of the target where the event originates from.
const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventArgs2 = ICoreWebView2DevToolsProtocolEventReceivedEventArgs2.iid;

interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs2 : ICoreWebView2DevToolsProtocolEventReceivedEventArgs
{
    static const GUID iid = { 0x2DC4959D,0x1494,0x4393,[ 0x95,0xBA,0xBE,0xA4,0xCB,0x9E,0xBD,0x1B ] };

  /// The sessionId of the target where the event originates from.
  /// Empty string is returned as sessionId if the event comes from the default
  /// session for the top page.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  ///
  /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceivedSessionId
  @(" propget")
	HRESULT get_SessionId(@("out, retval") LPWSTR* sessionId);
}

/// Receives `DevToolsProtocolEventReceived` events from the WebView.
const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventHandler = ICoreWebView2DevToolsProtocolEventReceivedEventHandler.iid;

interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler : IUnknown
{
    static const GUID iid = { 0xe2fda4be,0x5456,0x406c,[ 0xa2,0x61,0x3d,0x45,0x21,0x38,0x36,0x2c ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventArgs args);
}

/// Receives `CallDevToolsProtocolMethod` completion results.
const GUID IID_ICoreWebView2CallDevToolsProtocolMethodCompletedHandler = ICoreWebView2CallDevToolsProtocolMethodCompletedHandler.iid;

interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler : IUnknown
{
    static const GUID iid = { 0x5c4889f0,0x5ef6,0x4c5a,[ 0x95,0x2c,0xd8,0xf1,0xb9,0x2d,0x05,0x74 ] };

  /// Provides the completion status and result of the corresponding
  /// asynchronous method.

  HRESULT Invoke(in HRESULT errorCode, in LPCWSTR returnObjectAsJson);
}

/// Receives the `CoreWebView2Controller` created using `CreateCoreWebView2Controller`.

const GUID IID_ICoreWebView2CreateCoreWebView2ControllerCompletedHandler = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.iid;

interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler : IUnknown
{
    static const GUID iid = { 0x6c4819f3,0xc9b7,0x4260,[ 0x81,0x27,0xc9,0xf5,0xbd,0xe7,0xf6,0x8c ] };

  /// Provides the completion status and result of the corresponding
  /// asynchronous method.

  HRESULT Invoke(HRESULT errorCode, ICoreWebView2Controller createdController);
}

/// The caller implements this interface to receive the CoreWebView2Controller
/// created via CreateCoreWebView2CompositionController.
const GUID IID_ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler = ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler.iid;

interface ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler : IUnknown
{
    static const GUID iid = { 0x02fab84b,0x1428,0x4fb7,[ 0xad,0x45,0x1b,0x2e,0x64,0x73,0x61,0x84 ] };
  /// Called to provide the implementer with the completion status and result
  /// of the corresponding asynchronous method call.
  HRESULT Invoke(
      HRESULT errorCode,
      ICoreWebView2CompositionController webView);
}

/// Event args for the `NewWindowRequested` event.  The event is run when
/// content inside webview requested to a open a new window (through
/// `window.open()` and so on).
const GUID IID_ICoreWebView2NewWindowRequestedEventArgs = ICoreWebView2NewWindowRequestedEventArgs.iid;

interface ICoreWebView2NewWindowRequestedEventArgs : IUnknown
{
    static const GUID iid = { 0x34acb11c,0xfc37,0x4418,[ 0x91,0x32,0xf9,0xc2,0x1d,0x1e,0xaf,0xb9 ] };

  /// The target uri of the new window requested.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* uri);

  /// Sets a CoreWebView2 as a result of the NewWindowRequested event. Provides
  /// a WebView as the target for a `window.open()` from inside the
  /// requesting WebView. If this is set, the top-level window of this WebView
  /// is returned as the opened
  /// [WindowProxy](https://developer.mozilla.org/en-US/docs/glossary/windowproxy)
  /// to the opener script. If this is not set, then `Handled` is checked to
  /// determine behavior for NewWindowRequested event.
  /// CoreWebView2 provided in the `NewWindow` property must be on the same
  /// Environment as the opener WebView and should not have been navigated
  /// previously. Don't use methods that cause navigation or interact with the
  /// DOM on this CoreWebView2 until the target content has loaded. Setting event
  /// handlers, changing Settings properties, or other methods are fine to call.
  /// Changes to settings should be made before `put_NewWindow` is called to
  /// ensure that those settings take effect for the newly setup WebView. Once the
  /// NewWindow is set the underlying web contents of this CoreWebView2 will be
  /// replaced and navigated as appropriate for the new window. After setting
  /// new window it cannot be changed and error will be return otherwise.
  ///
  /// The methods which should affect the new web contents like
  /// AddScriptToExecuteOnDocumentCreated has to be called and completed before setting NewWindow.
  /// Other methods which should affect the new web contents like add_WebResourceRequested have to be called after setting NewWindow.
  /// It is best not to use RemoveScriptToExecuteOnDocumentCreated before setting NewWindow, otherwise it may not work for later added scripts.
  ///
  /// The new WebView must have the same profile as the opener WebView.

  @(" propput")
	HRESULT put_NewWindow(/+[in]+/ ICoreWebView2 newWindow);

  /// Gets the new window.

  @(" propget")
	HRESULT get_NewWindow(@("out, retval") ICoreWebView2 * newWindow);

  /// Sets whether the `NewWindowRequested` event is handled by host.  If this
  /// is `FALSE` and no `NewWindow` is set, the WebView opens a popup window
  /// and it returns as opened `WindowProxy`.  If set to `TRUE` and no
  /// `NewWindow` is set for `window.open`, the opened `WindowProxy` is for an
  /// testing window object and no window loads.
  /// The default value is `FALSE`.

  @(" propput")
	HRESULT put_Handled(in BOOL handled);

  /// Gets whether the `NewWindowRequested` event is handled by host.

  @(" propget")
	HRESULT get_Handled(@("out, retval") BOOL* handled);

  /// `TRUE` when the new window request was initiated through a user gesture.
  /// Examples of user initiated requests are:
  ///
  /// - Selecting an anchor tag with target
  /// - Programmatic window open from a script that directly run as a result of
  /// user interaction such as via onclick handlers.
  ///
  /// Non-user initiated requests are programmatic window opens from a script
  /// that are not directly triggered by user interaction, such as those that
  /// run while loading a new page or via timers.
  /// The Microsoft Edge popup blocker is disabled for WebView so the app is
  /// able to use this flag to block non-user initiated popups.

  @(" propget")
	HRESULT get_IsUserInitiated(@("out, retval") BOOL* isUserInitiated);

  /// Obtain an `ICoreWebView2Deferral` object and put the event into a
  /// deferred state.  Use the `ICoreWebView2Deferral` object to complete the
  /// window open request at a later time.  While this event is deferred the
  /// opener window returns a `WindowProxy` to an un-navigated window, which
  /// navigates when the deferral is complete.

  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);

  /// Window features specified by the `window.open`.  The features should be
  /// considered for positioning and sizing of new webview windows.

  @(" propget")
	HRESULT get_WindowFeatures(@("out, retval") ICoreWebView2WindowFeatures * value);
}

/// This is a continuation of the `ICoreWebView2NewWindowRequestedEventArgs` interface.
const GUID IID_ICoreWebView2NewWindowRequestedEventArgs2 = ICoreWebView2NewWindowRequestedEventArgs2.iid;

interface ICoreWebView2NewWindowRequestedEventArgs2 : ICoreWebView2NewWindowRequestedEventArgs
{
    static const GUID iid = { 0xbbc7baed,0x74c6,0x4c92,[ 0xb6,0x3a,0x7f,0x5a,0xea,0xe0,0x3d,0xe3 ] };
  /// Gets the name of the new window. This window can be created via `window.open(url, windowName)`,
  /// where the windowName parameter corresponds to `Name` property.
  /// If no windowName is passed to `window.open`, then the `Name` property
  /// will be set to an empty string. Additionally, if window is opened through other means,
  /// such as `<a target="windowName">...</a>` or `<iframe name="windowName">...</iframe>`,
  /// then the `Name` property will be set accordingly. In the case of target=_blank,
  /// the `Name` property will be an empty string.
  /// Opening a window via ctrl+clicking a link would result in the `Name` property
  /// being set to an empty string.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Name(@("out, retval") LPWSTR* value);
}

/// The window features for a WebView popup window.  The fields match the
/// `windowFeatures` passed to `window.open` as specified in
/// [Window features](https://developer.mozilla.org/docs/Web/API/Window/open#Window_features)
/// on MDN.
///
/// There is no requirement for you to respect the values.  If your app does
/// not have corresponding UI features (for example, no toolbar) or if all
/// instance of WebView are opened in tabs and do not have distinct size or
/// positions, then your app does not respect the values.  You may want to
/// respect values, but perhaps only some apply to the UI of you app.
/// Accordingly, you may respect all, some, or none of the properties as
/// appropriate for your app.  For all numeric properties, if the value that is
/// passed to `window.open` is outside the range of an unsigned 32bit int, the
/// resulting value is the absolute value of the maximum for unsigned 32bit
/// integer.  If you are not able to parse the value an integer, it is
/// considered `0`.  If the value is a floating point value, it is rounded down
/// to an integer.
///
/// In runtime versions 98 or later, the values of `ShouldDisplayMenuBar`,
/// `ShouldDisplayStatus`, `ShouldDisplayToolbar`, and `ShouldDisplayScrollBars`
/// will not directly depend on the equivalent fields in the `windowFeatures`
/// string.  Instead, they will all be false if the window is expected to be a
/// popup, and true if it is not.
const GUID IID_ICoreWebView2WindowFeatures = ICoreWebView2WindowFeatures.iid;

interface ICoreWebView2WindowFeatures : IUnknown
{
    static const GUID iid = { 0x5eaf559f,0xb46e,0x4397,[ 0x88,0x60,0xe4,0x22,0xf2,0x87,0xff,0x1e ] };

  /// Specifies left and top values.

  @(" propget")
	HRESULT get_HasPosition(@("out, retval") BOOL* value);

  /// Specifies height and width values.

  @(" propget")
	HRESULT get_HasSize(@("out, retval") BOOL* value);

  /// Specifies the left position of the window.   If `HasPosition` is set to
  /// `FALSE`, this field is ignored.

  @(" propget")
	HRESULT get_Left(@("out, retval") UINT32* value);

  /// Specifies the top position of the window.   If `HasPosition` is set to
  /// `FALSE`, this field is ignored.

  @(" propget")
	HRESULT get_Top(@("out, retval") UINT32* value);

  /// Specifies the height of the window.  Minimum value is `100`.  If
  /// `HasSize` is set to `FALSE`, this field is ignored.

  @(" propget")
	HRESULT get_Height(@("out, retval") UINT32* value);

  /// Specifies the width of the window.  Minimum value is `100`.  If `HasSize`
  /// is set to `FALSE`, this field is ignored.

  @(" propget")
	HRESULT get_Width(@("out, retval") UINT32* value);

  /// Indicates that the menu bar is displayed.

  @(" propget")
	HRESULT get_ShouldDisplayMenuBar(@("out, retval") BOOL* value);

  /// Indicates that the status bar is displayed.

  @(" propget")
	HRESULT get_ShouldDisplayStatus(@("out, retval") BOOL* value);

  /// Indicates that the browser toolbar is displayed.

  @(" propget")
	HRESULT get_ShouldDisplayToolbar(@("out, retval") BOOL* value);

  /// Indicates that the scroll bars are displayed.

  @(" propget")
	HRESULT get_ShouldDisplayScrollBars(@("out, retval") BOOL* value);
}

/// Receives `NewWindowRequested` events.
const GUID IID_ICoreWebView2NewWindowRequestedEventHandler = ICoreWebView2NewWindowRequestedEventHandler.iid;

interface ICoreWebView2NewWindowRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0xd4c185fe,0xc81c,0x4989,[ 0x97,0xaf,0x2d,0x3f,0xa7,0xab,0x56,0x51 ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2NewWindowRequestedEventArgs args);
}

/// Receives `DocumentTitleChanged` events.  Use the `DocumentTitle` property
/// to get the modified title.

const GUID IID_ICoreWebView2DocumentTitleChangedEventHandler = ICoreWebView2DocumentTitleChangedEventHandler.iid;

interface ICoreWebView2DocumentTitleChangedEventHandler : IUnknown
{
    static const GUID iid = { 0xf5f2b923,0x953e,0x4042,[ 0x9f,0x95,0xf3,0xa1,0x18,0xe1,0xaf,0xd4 ] };

  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.

  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
}

/// Event args for the `AcceleratorKeyPressed` event.

const GUID IID_ICoreWebView2AcceleratorKeyPressedEventArgs = ICoreWebView2AcceleratorKeyPressedEventArgs.iid;

interface ICoreWebView2AcceleratorKeyPressedEventArgs : IUnknown
{
    static const GUID iid = { 0x9f760f8a,0xfb79,0x42be,[ 0x99,0x90,0x7b,0x56,0x90,0x0f,0xa9,0xc7 ] };

  /// The key event type that caused the event to run.

  @(" propget")
	HRESULT get_KeyEventKind(@("out, retval") COREWEBVIEW2_KEY_EVENT_KIND* keyEventKind);

  /// The Win32 virtual key code of the key that was pressed or released.  It
  /// is one of the Win32 virtual key constants such as `VK_RETURN` or an
  /// (uppercase) ASCII value such as `A`.  Verify whether Ctrl or Alt
  /// are pressed by running `GetKeyState(VK_CONTROL)` or
  /// `GetKeyState(VK_MENU)`.

  @(" propget")
	HRESULT get_VirtualKey(@("out, retval") UINT* virtualKey);

  /// The `LPARAM` value that accompanied the window message.  For more
  /// information, navigate to [WM_KEYDOWN](/windows/win32/inputdev/wm-keydown)
  /// and [WM_KEYUP](/windows/win32/inputdev/wm-keyup).

  @(" propget")
	HRESULT get_KeyEventLParam(@("out, retval") INT* lParam);

  /// A structure representing the information passed in the `LPARAM` of the
  /// window message.

  @(" propget")
	HRESULT get_PhysicalKeyStatus(
      @("out, retval") COREWEBVIEW2_PHYSICAL_KEY_STATUS* physicalKeyStatus);

  /// During `AcceleratorKeyPressedEvent` handler invocation the WebView is
  /// blocked waiting for the decision of if the accelerator is handled by the
  /// host (or not).  If the `Handled` property is set to `TRUE` then this
  /// prevents the WebView from performing the default action for this
  /// accelerator key.  Otherwise the WebView performs the default action for
  /// the accelerator key.

  @(" propget")
	HRESULT get_Handled(@("out, retval") BOOL* handled);

  /// Sets the `Handled` property.

  @(" propput")
	HRESULT put_Handled(in BOOL handled);
}

/// This is This is a continuation of the ICoreWebView2AcceleratorKeyPressedEventArgs interface.
const GUID IID_ICoreWebView2AcceleratorKeyPressedEventArgs2 = ICoreWebView2AcceleratorKeyPressedEventArgs2.iid;

interface ICoreWebView2AcceleratorKeyPressedEventArgs2 : ICoreWebView2AcceleratorKeyPressedEventArgs
{
    static const GUID iid = { 0x03b2c8c8,0x7799,0x4e34,[ 0xbd,0x66,0xed,0x26,0xaa,0x85,0xf2,0xbf ] };
  /// This property allows developers to enable or disable the browser from handling a specific
  /// browser accelerator key such as Ctrl+P or F3, etc.
  ///
  /// Browser accelerator keys are the keys/key combinations that access features specific to
  /// a web browser, including but not limited to:
  ///  - Ctrl-F and F3 for Find on Page
  ///  - Ctrl-P for Print
  ///  - Ctrl-R and F5 for Reload
  ///  - Ctrl-Plus and Ctrl-Minus for zooming
  ///  - Ctrl-Shift-C and F12 for DevTools
  ///  - Special keys for browser functions, such as Back, Forward, and Search
  ///
  /// This property does not disable accelerator keys related to movement and text editing,
  /// such as:
  ///  - Home, End, Page Up, and Page Down
  ///  - Ctrl-X, Ctrl-C, Ctrl-V
  ///  - Ctrl-A for Select All
  ///  - Ctrl-Z for Undo
  ///
  /// The `CoreWebView2Settings.AreBrowserAcceleratorKeysEnabled` API is a convenient setting
  /// for developers to disable all the browser accelerator keys together, and sets the default
  /// value for the `IsBrowserAcceleratorKeyEnabled` property.
  /// By default, `CoreWebView2Settings.AreBrowserAcceleratorKeysEnabled` is `TRUE` and
  /// `IsBrowserAcceleratorKeyEnabled` is `TRUE`.
  /// When developers change `CoreWebView2Settings.AreBrowserAcceleratorKeysEnabled` setting to `FALSE`,
  /// this will change default value for `IsBrowserAcceleratorKeyEnabled` to `FALSE`.
  /// If developers want specific keys to be handled by the browser after changing the
  /// `CoreWebView2Settings.AreBrowserAcceleratorKeysEnabled` setting to `FALSE`, they need to enable
  /// these keys by setting `IsBrowserAcceleratorKeyEnabled` to `TRUE`.
  /// This API will give the event arg higher priority over the
  /// `CoreWebView2Settings.AreBrowserAcceleratorKeysEnabled` setting when we handle the keys.
  ///
  /// For browser accelerator keys, when an accelerator key is pressed, the propagation and
  /// processing order is:
  /// 1. A CoreWebView2Controller.AcceleratorKeyPressed event is raised
  /// 2. WebView2 browser feature accelerator key handling
  /// 3. Web Content Handling: If the key combination isn't reserved for browser actions,
  /// the key event propagates to the web content, where JavaScript event listeners can
  /// capture and respond to it.
  ///
  /// `ICoreWebView2AcceleratorKeyPressedEventArgs` has a `Handled` property, that developers
  /// can use to mark a key as handled. When the key is marked as handled anywhere along
  /// the path, the event propagation stops, and web content will not receive the key.
  /// With `IsBrowserAcceleratorKeyEnabled` property, if developers mark
  /// `IsBrowserAcceleratorKeyEnabled` as `FALSE`, the browser will skip the WebView2
  /// browser feature accelerator key handling process, but the event propagation
  /// continues, and web content will receive the key combination.
  ///
  /// \snippet ScenarioAcceleratorKeyPressed.cpp IsBrowserAcceleratorKeyEnabled
  /// Gets the `IsBrowserAcceleratorKeyEnabled` property.
  @(" propget")
	HRESULT get_IsBrowserAcceleratorKeyEnabled(@("out, retval") BOOL* value);

  /// Sets the `IsBrowserAcceleratorKeyEnabled` property.
  @(" propput")
	HRESULT put_IsBrowserAcceleratorKeyEnabled(in BOOL value);
}

/// Receives `AcceleratorKeyPressed` events.

const GUID IID_ICoreWebView2AcceleratorKeyPressedEventHandler = ICoreWebView2AcceleratorKeyPressedEventHandler.iid;

interface ICoreWebView2AcceleratorKeyPressedEventHandler : IUnknown
{
    static const GUID iid = { 0xb29c7e28,0xfa79,0x41a8,[ 0x8e,0x44,0x65,0x81,0x1c,0x76,0xdc,0xb2 ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Controller sender,
      /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventArgs args);
}

/// Receives `NewBrowserVersionAvailable` events.
const GUID IID_ICoreWebView2NewBrowserVersionAvailableEventHandler = ICoreWebView2NewBrowserVersionAvailableEventHandler.iid;

interface ICoreWebView2NewBrowserVersionAvailableEventHandler : IUnknown
{
    static const GUID iid = { 0xf9a2976e,0xd34e,0x44fc,[ 0xad,0xee,0x81,0xb6,0xb5,0x7c,0xa9,0x14 ] };

  /// Provides the event args for the corresponding event.

  HRESULT Invoke(/+[in]+/ ICoreWebView2Environment sender,
                 /+[in]+/ IUnknown args);
}

/// Receives `BrowserProcessExited` events.
const GUID IID_ICoreWebView2BrowserProcessExitedEventHandler = ICoreWebView2BrowserProcessExitedEventHandler.iid;

interface ICoreWebView2BrowserProcessExitedEventHandler : IUnknown
{
    static const GUID iid = { 0xfa504257,0xa216,0x4911,[ 0xa8,0x60,0xfe,0x88,0x25,0x71,0x28,0x61 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Environment sender,
      /+[in]+/ ICoreWebView2BrowserProcessExitedEventArgs args);
}

/// Receives `ContainsFullScreenElementChanged` events.

const GUID IID_ICoreWebView2ContainsFullScreenElementChangedEventHandler = ICoreWebView2ContainsFullScreenElementChangedEventHandler.iid;

interface ICoreWebView2ContainsFullScreenElementChangedEventHandler : IUnknown
{
    static const GUID iid = { 0xe45d98b1,0xafef,0x45be,[ 0x8b,0xaf,0x6c,0x77,0x28,0x86,0x7f,0x73 ] };

  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.

  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
}

/// Receives `WindowCloseRequested` events.
const GUID IID_ICoreWebView2WindowCloseRequestedEventHandler = ICoreWebView2WindowCloseRequestedEventHandler.iid;

interface ICoreWebView2WindowCloseRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0x5c19e9e0,0x092f,0x486b,[ 0xaf,0xfa,0xca,0x82,0x31,0x91,0x30,0x39 ] };

  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.

  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
}

/// Receives `WebResourceResponseReceived` events.
const GUID IID_ICoreWebView2WebResourceResponseReceivedEventHandler = ICoreWebView2WebResourceResponseReceivedEventHandler.iid;

interface ICoreWebView2WebResourceResponseReceivedEventHandler : IUnknown
{
    static const GUID iid = { 0x7DE9898A,0x24F5,0x40C3,[ 0xA2,0xDE,0xD4,0xF4,0x58,0xE6,0x98,0x28 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2WebResourceResponseReceivedEventArgs args);
}

/// Event args for the `BrowserProcessExited` event.
const GUID IID_ICoreWebView2BrowserProcessExitedEventArgs = ICoreWebView2BrowserProcessExitedEventArgs.iid;

interface ICoreWebView2BrowserProcessExitedEventArgs : IUnknown
{
    static const GUID iid = { 0x1f00663f,0xaf8c,0x4782,[ 0x9c,0xdd,0xdd,0x01,0xc5,0x2e,0x34,0xcb ] };
  /// The kind of browser process exit that has occurred.
  @(" propget")
	HRESULT get_BrowserProcessExitKind(
      @("out, retval") COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND* browserProcessExitKind);

  /// The process ID of the browser process that has exited.
  @(" propget")
	HRESULT get_BrowserProcessId(@("out, retval") UINT32* value);
}

/// Event args for the WebResourceResponseReceived event.
const GUID IID_ICoreWebView2WebResourceResponseReceivedEventArgs = ICoreWebView2WebResourceResponseReceivedEventArgs.iid;

interface ICoreWebView2WebResourceResponseReceivedEventArgs : IUnknown
{
    static const GUID iid = { 0xD1DB483D,0x6796,0x4B8B,[ 0x80,0xFC,0x13,0x71,0x2B,0xB7,0x16,0xF4 ] };
  /// The request object for the web resource, as committed. This includes
  /// headers added by the network stack that were not be included during the
  /// associated WebResourceRequested event, such as Authentication headers.
  /// Modifications to this object have no effect on how the request is
  /// processed as it has already been sent.
  @(" propget")
	HRESULT get_Request(@("out, retval") ICoreWebView2WebResourceRequest * request);
  /// View of the response object received for the web resource.
  @(" propget")
	HRESULT get_Response(@("out, retval") ICoreWebView2WebResourceResponseView * response);
}

/// View of the HTTP representation for a web resource response. The properties
/// of this object are not mutable. This response view is used with the
/// WebResourceResponseReceived event.
const GUID IID_ICoreWebView2WebResourceResponseView = ICoreWebView2WebResourceResponseView.iid;

interface ICoreWebView2WebResourceResponseView : IUnknown
{
    static const GUID iid = { 0x79701053,0x7759,0x4162,[ 0x8F,0x7D,0xF1,0xB3,0xF0,0x84,0x92,0x8D ] };
  /// The HTTP response headers as received.
  @(" propget")
	HRESULT get_Headers(
      @("out, retval") ICoreWebView2HttpResponseHeaders * headers);
  /// The HTTP response status code.
  @(" propget")
	HRESULT get_StatusCode(@("out, retval") int* statusCode);
  /// The HTTP response reason phrase.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ReasonPhrase(@("out, retval") LPWSTR* reasonPhrase);

  /// Get the response content asynchronously. The handler will receive the
  /// response content stream.
  ///
  /// This method returns null if content size is more than 123MB or for navigations that become downloads
  /// or if response is downloadable content type (e.g., application/octet-stream).
  /// See `add_DownloadStarting` event to handle the response.
  ///
  /// If this method is being called again before a first call has completed,
  /// the handler will be invoked at the same time the handlers from prior calls
  /// are invoked.
  /// If this method is being called after a first call has completed, the
  /// handler will be invoked immediately.
  /// \snippet ScenarioWebViewEventMonitor.cpp GetContent
  HRESULT GetContent(
      /+[in]+/ ICoreWebView2WebResourceResponseViewGetContentCompletedHandler handler);
}

/// Receives the result of the
/// `ICoreWebView2WebResourceResponseView::GetContent` method.
const GUID IID_ICoreWebView2WebResourceResponseViewGetContentCompletedHandler = ICoreWebView2WebResourceResponseViewGetContentCompletedHandler.iid;

interface ICoreWebView2WebResourceResponseViewGetContentCompletedHandler : IUnknown
{
    static const GUID iid = { 0x875738E1,0x9FA2,0x40E3,[ 0x8B,0x74,0x2E,0x89,0x72,0xDD,0x6F,0xE7 ] };
  /// Provides the completion status and result of the corresponding
  /// asynchronous method call. A failure `errorCode` will be passed if the
  /// content failed to load. `E_ABORT` means the response loading was blocked
  /// (e.g., by CORS policy); `ERROR_CANCELLED` means the response loading was
  /// cancelled. `ERROR_NO_DATA` means the response has no content data,
  /// `content` is `null` in this case. Note content (if any) is ignored for
  /// redirects, 204 No Content, 205 Reset Content, and HEAD-request responses.
  HRESULT Invoke(in HRESULT errorCode, in IStream* content);
}

/// Event args for the DOMContentLoaded event.
const GUID IID_ICoreWebView2DOMContentLoadedEventArgs = ICoreWebView2DOMContentLoadedEventArgs.iid;

interface ICoreWebView2DOMContentLoadedEventArgs : IUnknown
{
    static const GUID iid = { 0x16B1E21A,0xC503,0x44F2,[ 0x84,0xC9,0x70,0xAB,0xA5,0x03,0x12,0x83 ] };
  /// The ID of the navigation which corresponds to other navigation ID properties on other navigation events.
  @(" propget")
	HRESULT get_NavigationId(@("out, retval") UINT64* navigationId);
}

/// Receives `DOMContentLoaded` events.
const GUID IID_ICoreWebView2DOMContentLoadedEventHandler = ICoreWebView2DOMContentLoadedEventHandler.iid;

interface ICoreWebView2DOMContentLoadedEventHandler : IUnknown
{
    static const GUID iid = { 0x4BAC7E9C,0x199E,0x49ED,[ 0x87,0xED,0x24,0x93,0x03,0xAC,0xF0,0x19 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2DOMContentLoadedEventArgs args);
}

/// Provides a set of properties that are used to manage an
/// ICoreWebView2Cookie.
///
/// \snippet ScenarioCookieManagement.cpp CookieObject
const GUID IID_ICoreWebView2Cookie = ICoreWebView2Cookie.iid;

interface ICoreWebView2Cookie : IUnknown
{
    static const GUID iid = { 0xAD26D6BE,0x1486,0x43E6,[ 0xBF,0x87,0xA2,0x03,0x40,0x06,0xCA,0x21 ] };
  /// Cookie name.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Name(@("out, retval") LPWSTR* name);

  /// Cookie value.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Value(@("out, retval") LPWSTR* value);
  /// Set the cookie value property.
  @(" propput")
	HRESULT put_Value(in LPCWSTR value);

  /// The domain for which the cookie is valid.
  /// The default is the host that this cookie has been received from.
  /// Note that, for instance, ".bing.com", "bing.com", and "www.bing.com" are
  /// considered different domains.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Domain(@("out, retval") LPWSTR* domain);

  /// The path for which the cookie is valid. The default is "/", which means
  /// this cookie will be sent to all pages on the Domain.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Path(@("out, retval") LPWSTR* path);

  /// The expiration date and time for the cookie as the number of seconds since the UNIX epoch.
  /// The default is -1.0, which means cookies are session cookies by default.
  @(" propget")
	HRESULT get_Expires(@("out, retval") double* expires);
  /// Set the Expires property. Cookies are session cookies and will not be
  /// persistent if Expires is set to -1.0. NaN, infinity, and any negative
  /// value set other than -1.0 is disallowed.
  @(" propput")
	HRESULT put_Expires(in double expires);

  /// Whether this cookie is http-only.
  /// True if a page script or other active content cannot access this
  /// cookie. The default is false.
  @(" propget")
	HRESULT get_IsHttpOnly(@("out, retval") BOOL* isHttpOnly);
  /// Set the IsHttpOnly property.
  @(" propput")
	HRESULT put_IsHttpOnly(in BOOL isHttpOnly);

  /// SameSite status of the cookie which represents the enforcement mode of the cookie.
  /// The default is COREWEBVIEW2_COOKIE_SAME_SITE_KIND_LAX.
  @(" propget")
	HRESULT get_SameSite(@("out, retval") COREWEBVIEW2_COOKIE_SAME_SITE_KIND* sameSite);
  /// Set the SameSite property.
  @(" propput")
	HRESULT put_SameSite(in COREWEBVIEW2_COOKIE_SAME_SITE_KIND sameSite);

  /// The security level of this cookie. True if the client is only to return
  /// the cookie in subsequent requests if those requests use HTTPS.
  /// The default is false.
  /// Note that cookie that requests COREWEBVIEW2_COOKIE_SAME_SITE_KIND_NONE but
  /// is not marked Secure will be rejected.
  @(" propget")
	HRESULT get_IsSecure(@("out, retval") BOOL* isSecure);
  /// Set the IsSecure property.
  @(" propput")
	HRESULT put_IsSecure(in BOOL isSecure);

  /// Whether this is a session cookie. The default is false.
  @(" propget")
	HRESULT get_IsSession(@("out, retval") BOOL* isSession);
}

/// Creates, adds or updates, gets, or or view the cookies. The changes would
/// apply to the context of the user profile. That is, other WebViews under the
/// same user profile could be affected.
const GUID IID_ICoreWebView2CookieManager = ICoreWebView2CookieManager.iid;

interface ICoreWebView2CookieManager : IUnknown
{
    static const GUID iid = { 0x177CD9E7,0xB6F5,0x451A,[ 0x94,0xA0,0x5D,0x7A,0x3A,0x4C,0x41,0x41 ] };
  /// Create a cookie object with a specified name, value, domain, and path.
  /// One can set other optional properties after cookie creation.
  /// This only creates a cookie object and it is not added to the cookie
  /// manager until you call AddOrUpdateCookie.
  /// Leading or trailing whitespace(s), empty string, and special characters
  /// are not allowed for name.
  /// See ICoreWebView2Cookie for more details.
  HRESULT CreateCookie(
    in LPCWSTR name,
    in LPCWSTR value,
    in LPCWSTR domain,
    in LPCWSTR path,
    @("out, retval") ICoreWebView2Cookie * cookie);

  /// Creates a cookie whose params matches those of the specified cookie.
  HRESULT CopyCookie(
    /+[in]+/ ICoreWebView2Cookie cookieParam,
    @("out, retval") ICoreWebView2Cookie * cookie);

  /// Gets a list of cookies matching the specific URI.
  /// If uri is empty string or null, all cookies under the same profile are
  /// returned.
  /// You can modify the cookie objects by calling
  /// ICoreWebView2CookieManager::AddOrUpdateCookie, and the changes
  /// will be applied to the webview.
  /// \snippet ScenarioCookieManagement.cpp GetCookies
  HRESULT GetCookies(
    in LPCWSTR uri,
    /+[in]+/ ICoreWebView2GetCookiesCompletedHandler handler);

  /// Adds or updates a cookie with the given cookie data; may overwrite
  /// cookies with matching name, domain, and path if they exist.
  /// This method will fail if the domain of the given cookie is not specified.
  /// \snippet ScenarioCookieManagement.cpp AddOrUpdateCookie
  HRESULT AddOrUpdateCookie(/+[in]+/ ICoreWebView2Cookie cookie);

  /// Deletes a cookie whose name and domain/path pair
  /// match those of the specified cookie.
  HRESULT DeleteCookie(/+[in]+/ ICoreWebView2Cookie cookie);

  /// Deletes cookies with matching name and uri.
  /// Cookie name is required.
  /// All cookies with the given name where domain
  /// and path match provided URI are deleted.
  HRESULT DeleteCookies(in LPCWSTR name, in LPCWSTR uri);

  /// Deletes cookies with matching name and domain/path pair.
  /// Cookie name is required.
  /// If domain is specified, deletes only cookies with the exact domain.
  /// If path is specified, deletes only cookies with the exact path.
  HRESULT DeleteCookiesWithDomainAndPath(in LPCWSTR name, in LPCWSTR domain, in LPCWSTR path);

  /// Deletes all cookies under the same profile.
  /// This could affect other WebViews under the same user profile.
  HRESULT DeleteAllCookies();
}

/// A list of cookie objects. See `ICoreWebView2Cookie`.
/// \snippet ScenarioCookieManagement.cpp GetCookies
const GUID IID_ICoreWebView2CookieList = ICoreWebView2CookieList.iid;

interface ICoreWebView2CookieList : IUnknown
{
    static const GUID iid = { 0xF7F6F714,0x5D2A,0x43C6,[ 0x95,0x03,0x34,0x6E,0xCE,0x02,0xD1,0x86 ] };
  /// The number of cookies contained in the ICoreWebView2CookieList.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT* count);

  /// Gets the cookie object at the given index.
  HRESULT GetValueAtIndex(in UINT index,
		@("out, retval") ICoreWebView2Cookie * cookie);
}

/// Receives the result of the `GetCookies` method.  The result is written to
/// the cookie list provided in the `GetCookies` method call.
const GUID IID_ICoreWebView2GetCookiesCompletedHandler = ICoreWebView2GetCookiesCompletedHandler.iid;

interface ICoreWebView2GetCookiesCompletedHandler : IUnknown
{
    static const GUID iid = { 0x5A4F5069,0x5C15,0x47C3,[ 0x86,0x46,0xF4,0xDE,0x1C,0x11,0x66,0x70 ] };
  /// Provides the completion status of the corresponding asynchronous method
  /// call.
  HRESULT Invoke(HRESULT result, ICoreWebView2CookieList cookieList);
}

/// Provides access to the client certificate metadata.
const GUID IID_ICoreWebView2ClientCertificate = ICoreWebView2ClientCertificate.iid;

interface ICoreWebView2ClientCertificate : IUnknown
{
    static const GUID iid = { 0xe7188076,0xbcc3,0x11eb,[ 0x85,0x29,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Subject of the certificate.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Subject(@("out, retval") LPWSTR* value);
  /// Name of the certificate authority that issued the certificate.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Issuer(@("out, retval") LPWSTR* value);
  /// The valid start date and time for the certificate as the number of seconds since
  /// the UNIX epoch.
  @(" propget")
	HRESULT get_ValidFrom(@("out, retval") double* value);
  /// The valid expiration date and time for the certificate as the number of seconds since
  /// the UNIX epoch.
  @(" propget")
	HRESULT get_ValidTo(@("out, retval") double* value);
  /// Base64 encoding of DER encoded serial number of the certificate.
  /// Read more about DER at [RFC 7468 DER]
  /// (https://tools.ietf.org/html/rfc7468#appendix-B).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_DerEncodedSerialNumber(@("out, retval") LPWSTR* value);
  /// Display name for a certificate.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_DisplayName(@("out, retval") LPWSTR* value);
  /// PEM encoded data for the certificate.
  /// Returns Base64 encoding of DER encoded certificate.
  /// Read more about PEM at [RFC 1421 Privacy Enhanced Mail]
  /// (https://tools.ietf.org/html/rfc1421).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  HRESULT ToPemEncoding(@("out, retval") LPWSTR* pemEncodedData);
  /// Collection of PEM encoded client certificate issuer chain.
  /// In this collection first element is the current certificate followed by
  /// intermediate1, intermediate2...intermediateN-1. Root certificate is the
  /// last element in collection.
  @(" propget")
	HRESULT get_PemEncodedIssuerCertificateChain(@("out, retval")
      ICoreWebView2StringCollection * value);
  /// Kind of a certificate (eg., smart card, pin, other).
  @(" propget")
	HRESULT get_Kind(@("out, retval")
      COREWEBVIEW2_CLIENT_CERTIFICATE_KIND* value);
}

/// A collection of client certificate object.
const GUID IID_ICoreWebView2ClientCertificateCollection = ICoreWebView2ClientCertificateCollection.iid;

interface ICoreWebView2ClientCertificateCollection : IUnknown
{
    static const GUID iid = { 0xef5674d2,0xbcc3,0x11eb,[ 0x85,0x29,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// The number of client certificates contained in the
  /// ICoreWebView2ClientCertificateCollection.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT* value);
  /// Gets the certificate object at the given index.
  HRESULT GetValueAtIndex(in UINT index,
      @("out, retval") ICoreWebView2ClientCertificate * certificate);
}

/// A collection of strings.
const GUID IID_ICoreWebView2StringCollection = ICoreWebView2StringCollection.iid;

interface ICoreWebView2StringCollection : IUnknown
{
    static const GUID iid = { 0xf41f3f8a,0xbcc3,0x11eb,[ 0x85,0x29,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// The number of strings contained in ICoreWebView2StringCollection.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT* value);

  /// Gets the value at a given index.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  HRESULT GetValueAtIndex(in UINT index,
		@("out, retval") LPWSTR* value);
}

/// An event handler for the `ClientCertificateRequested` event.
const GUID IID_ICoreWebView2ClientCertificateRequestedEventHandler = ICoreWebView2ClientCertificateRequestedEventHandler.iid;

interface ICoreWebView2ClientCertificateRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0xd7175ba2,0xbcc3,0x11eb,[ 0x85,0x29,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2ClientCertificateRequestedEventArgs args);
}

/// Event args for the `ClientCertificateRequested` event.
const GUID IID_ICoreWebView2ClientCertificateRequestedEventArgs = ICoreWebView2ClientCertificateRequestedEventArgs.iid;

interface ICoreWebView2ClientCertificateRequestedEventArgs : IUnknown
{
    static const GUID iid = { 0xbc59db28,0xbcc3,0x11eb,[ 0x85,0x29,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Host name of the server that requested client certificate authentication.
  /// Normalization rules applied to the hostname are:
  /// * Convert to lowercase characters for ascii characters.
  /// * Punycode is used for representing non ascii characters.
  /// * Strip square brackets for IPV6 address.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Host(@("out, retval") LPWSTR* value);

  /// Port of the server that requested client certificate authentication.
  @(" propget")
	HRESULT get_Port(@("out, retval") int* value);

  /// Returns true if the server that issued this request is an http proxy.
  /// Returns false if the server is the origin server.
  @(" propget")
	HRESULT get_IsProxy(@("out, retval") BOOL* value);

  /// Returns the `ICoreWebView2StringCollection`.
  /// The collection contains Base64 encoding of DER encoded distinguished names of
  /// certificate authorities allowed by the server.
  @(" propget")
	HRESULT get_AllowedCertificateAuthorities(@("out, retval")
      ICoreWebView2StringCollection * value);

  /// Returns the `ICoreWebView2ClientCertificateCollection` when client
  /// certificate authentication is requested. The collection contains mutually
  /// trusted CA certificates.
  @(" propget")
	HRESULT get_MutuallyTrustedCertificates(@("out, retval")
      ICoreWebView2ClientCertificateCollection * value);

  /// Returns the selected certificate.
  @(" propget")
	HRESULT get_SelectedCertificate(@("out, retval")
      ICoreWebView2ClientCertificate * value);

  /// Sets the certificate to respond to the server.
  @(" propput")
	HRESULT put_SelectedCertificate(
      /+[in]+/ ICoreWebView2ClientCertificate value);

  /// You may set this flag to cancel the certificate selection. If canceled,
  /// the request is aborted regardless of the `Handled` property. By default the
  /// value is `FALSE`.
  @(" propget")
	HRESULT get_Cancel(@("out, retval") BOOL* value);

  /// Sets the `Cancel` property.
  @(" propput")
	HRESULT put_Cancel(in BOOL value);

  /// You may set this flag to `TRUE` to respond to the server with or
  /// without a certificate. If this flag is `TRUE` with a `SelectedCertificate`
  /// it responds to the server with the selected certificate otherwise respond to the
  /// server without a certificate. By default the value of `Handled` and `Cancel` are `FALSE`
  /// and display default client certificate selection dialog prompt to allow the user to
  /// choose a certificate. The `SelectedCertificate` is ignored unless `Handled` is set `TRUE`.
  @(" propget")
	HRESULT get_Handled(@("out, retval") BOOL* value);

  /// Sets the `Handled` property.
  @(" propput")
	HRESULT put_Handled(in BOOL value);

  /// Returns an `ICoreWebView2Deferral` object. Use this operation to
  /// complete the event at a later time.
  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);
}

/// This mostly represents a combined win32
/// POINTER_INFO/POINTER_TOUCH_INFO/POINTER_PEN_INFO object. It takes fields
/// from all three and excludes some win32 specific data types like HWND and
/// HANDLE. Note, sourceDevice is taken out but we expect the PointerDeviceRect
/// and DisplayRect to cover the existing use cases of sourceDevice.
/// Another big difference is that any of the point or rect locations are
/// expected to be in WebView physical coordinates. That is, coordinates
/// relative to the WebView and no DPI scaling applied.
//
// The PointerId, PointerFlags, ButtonChangeKind, PenFlags, PenMask, TouchFlags,
// and TouchMask are all #defined flags or enums in the
// POINTER_INFO/POINTER_TOUCH_INFO/POINTER_PEN_INFO structure. We define those
// properties here as UINT32 or INT32 and expect the developer to know how to
// populate those values based on the Windows definitions.
const GUID IID_ICoreWebView2PointerInfo = ICoreWebView2PointerInfo.iid;

interface ICoreWebView2PointerInfo : IUnknown
{
    static const GUID iid = { 0xe6995887,0xd10d,0x4f5d,[ 0x93,0x59,0x4c,0xe4,0x6e,0x4f,0x96,0xb9 ] };
  /// Get the PointerKind of the pointer event. This corresponds to the
  /// pointerKind property of the POINTER_INFO struct. The values are defined by
  /// the POINTER_INPUT_KIND enum in the Windows SDK (winuser.h). Supports
  /// PT_PEN and PT_TOUCH.
  @(" propget")
	HRESULT get_PointerKind(@("out, retval") DWORD* pointerKind);
  /// Set the PointerKind of the pointer event. This corresponds to the
  /// pointerKind property of the POINTER_INFO struct. The values are defined by
  /// the POINTER_INPUT_KIND enum in the Windows SDK (winuser.h). Supports
  /// PT_PEN and PT_TOUCH.
  @(" propput")
	HRESULT put_PointerKind(in DWORD pointerKind);

  /// Get the PointerId of the pointer event. This corresponds to the pointerId
  /// property of the POINTER_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_PointerId(@("out, retval") UINT32* pointerId);
  /// Set the PointerId of the pointer event. This corresponds to the pointerId
  /// property of the POINTER_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_PointerId(in UINT32 pointerId);

  /// Get the FrameID of the pointer event. This corresponds to the frameId
  /// property of the POINTER_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_FrameId(@("out, retval") UINT32* frameId);
  /// Set the FrameID of the pointer event. This corresponds to the frameId
  /// property of the POINTER_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_FrameId(in UINT32 frameId);

  /// Get the PointerFlags of the pointer event. This corresponds to the
  /// pointerFlags property of the POINTER_INFO struct. The values are defined
  /// by the POINTER_FLAGS constants in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_PointerFlags(@("out, retval") UINT32* pointerFlags);
  /// Set the PointerFlags of the pointer event. This corresponds to the
  /// pointerFlags property of the POINTER_INFO struct. The values are defined
  /// by the POINTER_FLAGS constants in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_PointerFlags(in UINT32 pointerFlags);

  /// Get the PointerDeviceRect of the sourceDevice property of the
  /// POINTER_INFO struct as defined in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_PointerDeviceRect(@("out, retval") RECT* pointerDeviceRect);
  /// Set the PointerDeviceRect of the sourceDevice property of the
  /// POINTER_INFO struct as defined in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_PointerDeviceRect(in RECT pointerDeviceRect);

  /// Get the DisplayRect of the sourceDevice property of the POINTER_INFO
  /// struct as defined in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_DisplayRect(@("out, retval") RECT* displayRect);
  /// Set the DisplayRect of the sourceDevice property of the POINTER_INFO
  /// struct as defined in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_DisplayRect(in RECT displayRect);

  /// Get the PixelLocation of the pointer event. This corresponds to the
  /// ptPixelLocation property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_PixelLocation(@("out, retval") POINT* pixelLocation);
  /// Set the PixelLocation of the pointer event. This corresponds to the
  /// ptPixelLocation property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_PixelLocation(in POINT pixelLocation);

  /// Get the HimetricLocation of the pointer event. This corresponds to the
  /// ptHimetricLocation property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_HimetricLocation(@("out, retval") POINT* himetricLocation);
  /// Set the HimetricLocation of the pointer event. This corresponds to the
  /// ptHimetricLocation property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_HimetricLocation(in POINT himetricLocation);

  /// Get the PixelLocationRaw of the pointer event. This corresponds to the
  /// ptPixelLocationRaw property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_PixelLocationRaw(@("out, retval") POINT* pixelLocationRaw);
  /// Set the PixelLocationRaw of the pointer event. This corresponds to the
  /// ptPixelLocationRaw property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_PixelLocationRaw(in POINT pixelLocationRaw);

  /// Get the HimetricLocationRaw of the pointer event. This corresponds to the
  /// ptHimetricLocationRaw property of the POINTER_INFO struct as defined in
  /// the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_HimetricLocationRaw(@("out, retval") POINT* himetricLocationRaw);
  /// Set the HimetricLocationRaw of the pointer event. This corresponds to the
  /// ptHimetricLocationRaw property of the POINTER_INFO struct as defined in
  /// the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_HimetricLocationRaw(in POINT himetricLocationRaw);

  /// Get the Time of the pointer event. This corresponds to the dwTime property
  /// of the POINTER_INFO struct as defined in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_Time(@("out, retval") DWORD* time);
  /// Set the Time of the pointer event. This corresponds to the dwTime property
  /// of the POINTER_INFO struct as defined in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_Time(in DWORD time);

  /// Get the HistoryCount of the pointer event. This corresponds to the
  /// historyCount property of the POINTER_INFO struct as defined in the Windows
  /// SDK (winuser.h).
  @(" propget")
	HRESULT get_HistoryCount(@("out, retval") UINT32* historyCount);
  /// Set the HistoryCount of the pointer event. This corresponds to the
  /// historyCount property of the POINTER_INFO struct as defined in the Windows
  /// SDK (winuser.h).
  @(" propput")
	HRESULT put_HistoryCount(in UINT32 historyCount);

  /// Get the InputData of the pointer event. This corresponds to the InputData
  /// property of the POINTER_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_InputData(@("out, retval") INT32* inputData);
  /// Set the InputData of the pointer event. This corresponds to the InputData
  /// property of the POINTER_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_InputData(in INT32 inputData);

  /// Get the KeyStates of the pointer event. This corresponds to the
  /// dwKeyStates property of the POINTER_INFO struct as defined in the Windows
  /// SDK (winuser.h).
  @(" propget")
	HRESULT get_KeyStates(@("out, retval") DWORD* keyStates);
  /// Set the KeyStates of the pointer event. This corresponds to the
  /// dwKeyStates property of the POINTER_INFO struct as defined in the Windows
  /// SDK (winuser.h).
  @(" propput")
	HRESULT put_KeyStates(in DWORD keyStates);

  /// Get the PerformanceCount of the pointer event. This corresponds to the
  /// PerformanceCount property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_PerformanceCount(@("out, retval") UINT64* performanceCount);
  /// Set the PerformanceCount of the pointer event. This corresponds to the
  /// PerformanceCount property of the POINTER_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_PerformanceCount(in UINT64 performanceCount);

  /// Get the ButtonChangeKind of the pointer event. This corresponds to the
  /// ButtonChangeKind property of the POINTER_INFO struct. The values are
  /// defined by the POINTER_BUTTON_CHANGE_KIND enum in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_ButtonChangeKind(@("out, retval") INT32* buttonChangeKind);
  /// Set the ButtonChangeKind of the pointer event. This corresponds to the
  /// ButtonChangeKind property of the POINTER_INFO struct. The values are
  /// defined by the POINTER_BUTTON_CHANGE_KIND enum in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_ButtonChangeKind(in INT32 buttonChangeKind);

  // Pen specific attributes

  /// Get the PenFlags of the pointer event. This corresponds to the penFlags
  /// property of the POINTER_PEN_INFO struct. The values are defined by the
  /// PEN_FLAGS constants in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_PenFlags(@("out, retval") UINT32* penFLags);
  /// Set the PenFlags of the pointer event. This corresponds to the penFlags
  /// property of the POINTER_PEN_INFO struct. The values are defined by the
  /// PEN_FLAGS constants in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_PenFlags(in UINT32 penFLags);

  /// Get the PenMask of the pointer event. This corresponds to the penMask
  /// property of the POINTER_PEN_INFO struct. The values are defined by the
  /// PEN_MASK constants in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_PenMask(@("out, retval") UINT32* penMask);
  /// Set the PenMask of the pointer event. This corresponds to the penMask
  /// property of the POINTER_PEN_INFO struct. The values are defined by the
  /// PEN_MASK constants in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_PenMask(in UINT32 penMask);

  /// Get the PenPressure of the pointer event. This corresponds to the pressure
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_PenPressure(@("out, retval") UINT32* penPressure);
  /// Set the PenPressure of the pointer event. This corresponds to the pressure
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_PenPressure(in UINT32 penPressure);

  /// Get the PenRotation of the pointer event. This corresponds to the rotation
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_PenRotation(@("out, retval") UINT32* penRotation);
  /// Set the PenRotation of the pointer event. This corresponds to the rotation
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_PenRotation(in UINT32 penRotation);

  /// Get the PenTiltX of the pointer event. This corresponds to the tiltX
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_PenTiltX(@("out, retval") INT32* penTiltX);
  /// Set the PenTiltX of the pointer event. This corresponds to the tiltX
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_PenTiltX(in INT32 penTiltX);

  /// Get the PenTiltY of the pointer event. This corresponds to the tiltY
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propget")
	HRESULT get_PenTiltY(@("out, retval") INT32* penTiltY);
  /// Set the PenTiltY of the pointer event. This corresponds to the tiltY
  /// property of the POINTER_PEN_INFO struct as defined in the Windows SDK
  /// (winuser.h).
  @(" propput")
	HRESULT put_PenTiltY(in INT32 penTiltY);

  // Touch specific attributes

  /// Get the TouchFlags of the pointer event. This corresponds to the
  /// touchFlags property of the POINTER_TOUCH_INFO struct. The values are
  /// defined by the TOUCH_FLAGS constants in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_TouchFlags(@("out, retval") UINT32* touchFlags);
  /// Set the TouchFlags of the pointer event. This corresponds to the
  /// touchFlags property of the POINTER_TOUCH_INFO struct. The values are
  /// defined by the TOUCH_FLAGS constants in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_TouchFlags(in UINT32 touchFlags);

  /// Get the TouchMask of the pointer event. This corresponds to the
  /// touchMask property of the POINTER_TOUCH_INFO struct. The values are
  /// defined by the TOUCH_MASK constants in the Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_TouchMask(@("out, retval") UINT32* touchMask);
  /// Set the TouchMask of the pointer event. This corresponds to the
  /// touchMask property of the POINTER_TOUCH_INFO struct. The values are
  /// defined by the TOUCH_MASK constants in the Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_TouchMask(in UINT32 touchMask);

  /// Get the TouchContact of the pointer event. This corresponds to the
  /// rcContact property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_TouchContact(@("out, retval") RECT* touchContact);
  /// Set the TouchContact of the pointer event. This corresponds to the
  /// rcContact property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_TouchContact(in RECT touchContact);

  /// Get the TouchContactRaw of the pointer event. This corresponds to the
  /// rcContactRaw property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_TouchContactRaw(@("out, retval") RECT* touchContactRaw);
  /// Set the TouchContactRaw of the pointer event. This corresponds to the
  /// rcContactRaw property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_TouchContactRaw(in RECT touchContactRaw);

  /// Get the TouchOrientation of the pointer event. This corresponds to the
  /// orientation property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_TouchOrientation(@("out, retval") UINT32* touchOrientation);
  /// Set the TouchOrientation of the pointer event. This corresponds to the
  /// orientation property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_TouchOrientation(in UINT32 touchOrientation);

  /// Get the TouchPressure of the pointer event. This corresponds to the
  /// pressure property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propget")
	HRESULT get_TouchPressure(@("out, retval") UINT32* touchPressure);
  /// Set the TouchPressure of the pointer event. This corresponds to the
  /// pressure property of the POINTER_TOUCH_INFO struct as defined in the
  /// Windows SDK (winuser.h).
  @(" propput")
	HRESULT put_TouchPressure(in UINT32 touchPressure);
}

/// The caller implements this interface to receive CursorChanged events. Use
/// the Cursor property to get the new cursor.
const GUID IID_ICoreWebView2CursorChangedEventHandler = ICoreWebView2CursorChangedEventHandler.iid;

interface ICoreWebView2CursorChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x9da43ccc,0x26e1,0x4dad,[ 0xb5,0x6c,0xd8,0x96,0x1c,0x94,0xc5,0x71 ] };
  /// Called to provide the implementer with the event args for the
  /// corresponding event. There are no event args and the args
  /// parameter will be null.
  HRESULT Invoke(/+[in]+/ ICoreWebView2CompositionController sender, /+[in]+/ IUnknown args);
}

/// Receives `RasterizationScaleChanged` events.  Use the `RasterizationScale`
/// property to get the modified scale.

const GUID IID_ICoreWebView2RasterizationScaleChangedEventHandler = ICoreWebView2RasterizationScaleChangedEventHandler.iid;

interface ICoreWebView2RasterizationScaleChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x9c98c8b1,0xac53,0x427e,[ 0xa3,0x45,0x30,0x49,0xb5,0x52,0x4b,0xbe ] };
  /// Called to provide the implementer with the event args for the
  /// corresponding event. There are no event args and the args
  /// parameter will be null.
  HRESULT Invoke(
    /+[in]+/ ICoreWebView2Controller sender,
    /+[in]+/ IUnknown args);
}

/// Represents the WebView2 Environment.  WebViews created from an environment
/// run on the browser process specified with environment parameters and
/// objects created from an environment should be used in the same
/// environment.  Using it in different environments are not guaranteed to be
///  compatible and may fail.

const GUID IID_ICoreWebView2Environment = ICoreWebView2Environment.iid;

interface ICoreWebView2Environment : IUnknown
{
    static const GUID iid = { 0xb96d755e,0x0319,0x4e92,[ 0xa2,0x96,0x23,0x43,0x6f,0x46,0xa1,0xfc ] };

  /// Asynchronously create a new WebView.
  ///
  /// `parentWindow` is the `HWND` in which the WebView should be displayed and
  /// from which receive input.  The WebView adds a child window to the
  /// provided window before this function returns.  Z-order and other things
  /// impacted by sibling window order are affected accordingly.  If you want to
  /// move the WebView to a different parent after it has been created, you must
  /// call put_ParentWindow to update tooltip positions, accessibility trees,
  /// and such.
  ///
  /// HWND_MESSAGE is a valid parameter for `parentWindow` for an invisible
  /// WebView for Windows 8 and above. In this case the window will never
  /// become visible. You are not able to reparent the window after you have
  /// created the WebView.  This is not supported in Windows 7 or below.
  /// Passing this parameter in Windows 7 or below will return
  /// ERROR_INVALID_WINDOW_HANDLE in the controller callback.
  ///
  /// It is recommended that the app set Application User Model ID for the
  /// process or the app window.  If none is set, during WebView creation a
  /// generated Application User Model ID is set to root window of
  /// `parentWindow`.
  ///
  /// \snippet AppWindow.cpp CreateCoreWebView2Controller
  ///
  /// It is recommended that the app handles restart manager messages, to
  /// gracefully restart it in the case when the app is using the WebView2
  /// Runtime from a certain installation and that installation is being
  /// uninstalled.  For example, if a user installs a version of the WebView2
  /// Runtime and opts to use another version of the WebView2 Runtime for
  /// testing the app, and then uninstalls the 1st version of the WebView2
  /// Runtime without closing the app, the app restarts to allow
  /// un-installation to succeed.
  ///
  /// \snippet AppWindow.cpp RestartManager
  ///
  /// The app should retry `CreateCoreWebView2Controller` upon failure, unless the
  /// error code is `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
  /// When the app retries `CreateCoreWebView2Controller` upon failure, it is
  /// recommended that the app restarts from creating a new WebView2
  /// Environment.  If a WebView2 Runtime update happens, the version
  /// associated with a WebView2 Environment may have been removed and causing
  /// the object to no longer work.  Creating a new WebView2 Environment works
  /// since it uses the latest version.
  ///
  /// WebView creation fails with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)` if a
  /// running instance using the same user data folder exists, and the Environment
  /// objects have different `EnvironmentOptions`.  For example, if a WebView was
  /// created with one language, an attempt to create a WebView with a different
  /// language using the same user data folder will fail.
  ///
  /// The creation will fail with `E_ABORT` if `parentWindow` is destroyed
  /// before the creation is finished.  If this is caused by a call to
  /// `DestroyWindow`, the creation completed handler will be invoked before
  /// `DestroyWindow` returns, so you can use this to cancel creation and clean
  /// up resources synchronously when quitting a thread.
  ///
  /// In rare cases the creation can fail with `E_UNEXPECTED` if runtime does not have
  /// permissions to the user data folder.

  HRESULT CreateCoreWebView2Controller(
    HWND parentWindow,
    ICoreWebView2CreateCoreWebView2ControllerCompletedHandler handler);

  /// Create a new web resource response object.  The `headers` parameter is
  /// the raw response header string delimited by newline.  It is also possible
  /// to create this object with null headers string and then use the
  /// `ICoreWebView2HttpResponseHeaders` to construct the headers line by line.
  /// For more information about other parameters, navigate to
  /// [ICoreWebView2WebResourceResponse](/microsoft-edge/webview2/reference/win32/icorewebview2webresourceresponse).
  ///
  /// \snippet SettingsComponent.cpp WebResourceRequested0
  /// \snippet SettingsComponent.cpp WebResourceRequested1
  HRESULT CreateWebResourceResponse(
    in IStream* content,
    in int statusCode,
    in LPCWSTR reasonPhrase,
    in LPCWSTR headers,
    @("out, retval") ICoreWebView2WebResourceResponse * response);

  /// The browser version info of the current `ICoreWebView2Environment`,
  /// including channel name if it is not the WebView2 Runtime.  It matches the
  /// format of the `GetAvailableCoreWebView2BrowserVersionString` API.
  /// Channel names are `beta`, `dev`, and `canary`.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  ///
  /// \snippet AppWindow.cpp GetBrowserVersionString
  @(" propget")
	HRESULT get_BrowserVersionString(@("out, retval") LPWSTR* versionInfo);

  /// Add an event handler for the `NewBrowserVersionAvailable` event.
  /// `NewBrowserVersionAvailable` runs when a newer version of the WebView2
  /// Runtime is installed and available using WebView2.  To use the newer
  /// version of the browser you must create a new environment and WebView.
  /// The event only runs for new version from the same WebView2 Runtime from
  /// which the code is running. When not running with installed WebView2
  /// Runtime, no event is run.
  ///
  /// Because a user data folder is only able to be used by one browser
  /// process at a time, if you want to use the same user data folder in the
  /// WebView using the new version of the browser, you must close the
  /// environment and instance of WebView that are using the older version of
  /// the browser first.  Or simply prompt the user to restart the app.
  ///
  /// \snippet AppWindow.cpp NewBrowserVersionAvailable
  HRESULT add_NewBrowserVersionAvailable(
      /+[in]+/ ICoreWebView2NewBrowserVersionAvailableEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_NewBrowserVersionAvailable`.
  HRESULT remove_NewBrowserVersionAvailable(
      in EventRegistrationToken token);
}

/// A continuation of the ICoreWebView2Environment interface.
const GUID IID_ICoreWebView2Environment2 = ICoreWebView2Environment2.iid;

interface ICoreWebView2Environment2 : ICoreWebView2Environment
{
    static const GUID iid = { 0x41F3632B,0x5EF4,0x404F,[ 0xAD,0x82,0x2D,0x60,0x6C,0x5A,0x9A,0x21 ] };
  /// Create a new web resource request object.
  /// URI parameter must be absolute URI.
  /// The headers string is the raw request header string delimited by CRLF
  /// (optional in last header).
  /// It's also possible to create this object with null headers string
  /// and then use the ICoreWebView2HttpRequestHeaders to construct the headers
  /// line by line.
  /// For information on other parameters see ICoreWebView2WebResourceRequest.
  ///
  /// \snippet ScenarioNavigateWithWebResourceRequest.cpp NavigateWithWebResourceRequest
  HRESULT CreateWebResourceRequest(in LPCWSTR uri,
                                   in LPCWSTR method,
                                   in IStream* postData,
                                   in LPCWSTR headers,
                                   @("out, retval") ICoreWebView2WebResourceRequest * request);
}

/// A continuation of the ICoreWebView2Environment2 interface.
const GUID IID_ICoreWebView2Environment3 = ICoreWebView2Environment3.iid;

interface ICoreWebView2Environment3 : ICoreWebView2Environment2
{
    static const GUID iid = { 0x80a22ae3,0xbe7c,0x4ce2,[ 0xaf,0xe1,0x5a,0x50,0x05,0x6c,0xde,0xeb ] };
  /// Asynchronously create a new WebView for use with visual hosting.
  ///
  /// parentWindow is the HWND in which the app will connect the visual tree of
  /// the WebView. This will be the HWND that the app will receive pointer/
  /// mouse input meant for the WebView (and will need to use SendMouseInput/
  /// SendPointerInput to forward). If the app moves the WebView visual tree to
  /// underneath a different window, then it needs to call put_ParentWindow to
  /// update the new parent HWND of the visual tree.
  ///
  /// HWND_MESSAGE is not a valid parameter for `parentWindow` for visual hosting.
  /// The underlying implementation of supporting HWND_MESSAGE would break
  /// accessibility for visual hosting. This is supported in windowed
  /// WebViews - see CreateCoreWebView2Controller.
  ///
  /// Use put_RootVisualTarget on the created CoreWebView2CompositionController to
  /// provide a visual to host the browser's visual tree.
  ///
  /// It is recommended that the application set Application User Model ID for
  /// the process or the application window. If none is set, during WebView
  /// creation a generated Application User Model ID is set to root window of
  /// parentWindow.
  /// \snippet AppWindow.cpp CreateCoreWebView2Controller
  ///
  /// It is recommended that the application handles restart manager messages
  /// so that it can be restarted gracefully in the case when the app is using
  /// Edge for WebView from a certain installation and that installation is
  /// being uninstalled. For example, if a user installs Edge from Dev channel
  /// and opts to use Edge from that channel for testing the app, and then
  /// uninstalls Edge from that channel without closing the app, the app will
  /// be restarted to allow uninstallation of the dev channel to succeed.
  /// \snippet AppWindow.cpp RestartManager
  ///
  /// The app should retry `CreateCoreWebView2CompositionController` upon failure,
  /// unless the error code is `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
  /// When the app retries `CreateCoreWebView2CompositionController`
  /// upon failure, it is recommended that the app restarts from creating a new
  /// WebView2 Environment.  If a WebView2 Runtime update happens, the version
  /// associated with a WebView2 Environment may have been removed and causing
  /// the object to no longer work.  Creating a new WebView2 Environment works
  /// since it uses the latest version.
  ///
  /// WebView creation fails with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)` if a
  /// running instance using the same user data folder exists, and the Environment
  /// objects have different `EnvironmentOptions`.  For example, if a WebView was
  /// created with one language, an attempt to create a WebView with a different
  /// language using the same user data folder will fail.
  ///
  /// The creation will fail with `E_ABORT` if `parentWindow` is destroyed
  /// before the creation is finished.  If this is caused by a call to
  /// `DestroyWindow`, the creation completed handler will be invoked before
  /// `DestroyWindow` returns, so you can use this to cancel creation and clean
  /// up resources synchronously when quitting a thread.
  ///
  /// In rare cases the creation can fail with `E_UNEXPECTED` if runtime does not have
  /// permissions to the user data folder.
  ///
  /// CreateCoreWebView2CompositionController is supported in the following versions of Windows:
  ///
  /// - Windows 11
  /// - Windows 10
  /// - Windows Server 2019
  /// - Windows Server 2016
  ///
  HRESULT CreateCoreWebView2CompositionController(
      HWND parentWindow,
      ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler handler);

  /// Create an empty ICoreWebView2PointerInfo. The returned
  /// ICoreWebView2PointerInfo needs to be populated with all of the relevant
  /// info before calling SendPointerInput.
  HRESULT CreateCoreWebView2PointerInfo(
    @("out, retval") ICoreWebView2PointerInfo * pointerInfo);
}

/// A continuation of the ICoreWebView2Environment3 interface.
const GUID IID_ICoreWebView2Environment4 = ICoreWebView2Environment4.iid;

interface ICoreWebView2Environment4 : ICoreWebView2Environment3
{
    static const GUID iid = { 0x20944379,0x6dcf,0x41d6,[ 0xa0,0xa0,0xab,0xc0,0xfc,0x50,0xde,0x0d ] };
  /// Returns the Automation Provider for the WebView that matches the provided
  /// window. Host apps are expected to implement
  /// IRawElementProviderHwndOverride. When GetOverrideProviderForHwnd is
  /// called, the app can pass the HWND to GetAutomationProviderForWindow to
  /// find the matching WebView Automation Provider.
  HRESULT GetAutomationProviderForWindow(in HWND hwnd,
                                         @("out, retval") IUnknown * provider);
}

/// A continuation of the `ICoreWebView2Environment4` interface that supports
/// the `BrowserProcessExited` event.
const GUID IID_ICoreWebView2Environment5 = ICoreWebView2Environment5.iid;

interface ICoreWebView2Environment5 : ICoreWebView2Environment4
{
    static const GUID iid = { 0x319e423d,0xe0d7,0x4b8d,[ 0x92,0x54,0xae,0x94,0x75,0xde,0x9b,0x17 ] };
  /// Add an event handler for the `BrowserProcessExited` event.
  /// The `BrowserProcessExited` event is raised when the collection of WebView2
  /// Runtime processes for the browser process of this environment terminate
  /// due to browser process failure or normal shutdown (for example, when all
  /// associated WebViews are closed), after all resources have been released
  /// (including the user data folder). To learn about what these processes are,
  /// go to [Process model](/microsoft-edge/webview2/concepts/process-model).
  ///
  /// A handler added with this method is called until removed with
  /// `remove_BrowserProcessExited`, even if a new browser process is bound to
  /// this environment after earlier `BrowserProcessExited` events are raised.
  ///
  /// Multiple app processes can share a browser process by creating their webviews
  /// from a `ICoreWebView2Environment` with the same user data folder. When the entire
  /// collection of WebView2Runtime processes for the browser process exit, all
  /// associated `ICoreWebView2Environment` objects receive the `BrowserProcessExited`
  /// event. Multiple processes sharing the same browser process need to coordinate
  /// their use of the shared user data folder to avoid race conditions and
  /// unnecessary waits. For example, one process should not clear the user data
  /// folder at the same time that another process recovers from a crash by recreating
  /// its WebView controls; one process should not block waiting for the event if
  /// other app processes are using the same browser process (the browser process will
  /// not exit until those other processes have closed their webviews too).
  ///
  /// Note this is an event from the `ICoreWebView2Environment3` interface, not
  /// the `ICoreWebView2` one. The difference between `BrowserProcessExited` and
  /// `ICoreWebView2`'s `ProcessFailed` is that `BrowserProcessExited` is
  /// raised for any **browser process** exit (expected or unexpected, after all
  /// associated processes have exited too), while `ProcessFailed` is raised for
  /// **unexpected** process exits of any kind (browser, render, GPU, and all
  /// other types), or for main frame **render process** unresponsiveness. To
  /// learn more about the WebView2 Process Model, go to
  /// [Process model](/microsoft-edge/webview2/concepts/process-model).
  ///
  /// In the case the browser process crashes, both `BrowserProcessExited` and
  /// `ProcessFailed` events are raised, but the order is not guaranteed. These
  /// events are intended for different scenarios. It is up to the app to
  /// coordinate the handlers so they do not try to perform reliability recovery
  /// while also trying to move to a new WebView2 Runtime version or remove the
  /// user data folder.
  ///
  /// \snippet AppWindow.cpp Close
  HRESULT add_BrowserProcessExited(
      /+[in]+/ ICoreWebView2BrowserProcessExitedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_BrowserProcessExited`.
  HRESULT remove_BrowserProcessExited(in EventRegistrationToken token);
}

/// This interface is an extension of the ICoreWebView2Environment that supports
/// creating print settings for printing to PDF.
const GUID IID_ICoreWebView2Environment6 = ICoreWebView2Environment6.iid;

interface ICoreWebView2Environment6 : ICoreWebView2Environment5
{
    static const GUID iid = { 0xe59ee362,0xacbd,0x4857,[ 0x9a,0x8e,0xd3,0x64,0x4d,0x94,0x59,0xa9 ] };
    /// Creates the `ICoreWebView2PrintSettings` used by the `PrintToPdf`
    /// method.
    HRESULT CreatePrintSettings(
        @("out, retval") ICoreWebView2PrintSettings * printSettings);
}

/// This interface is an extension of the ICoreWebView2Environment. An object
/// implementing the ICoreWebView2Environment7 interface will also
/// implement ICoreWebView2Environment.
const GUID IID_ICoreWebView2Environment7 = ICoreWebView2Environment7.iid;

interface ICoreWebView2Environment7 : ICoreWebView2Environment6
{
    static const GUID iid = { 0x43C22296,0x3BBD,0x43A4,[ 0x9C,0x00,0x5C,0x0D,0xF6,0xDD,0x29,0xA2 ] };
  /// Returns the user data folder that all CoreWebView2's created from this
  /// environment are using.
  /// This could be either the value passed in by the developer when creating
  /// the environment object or the calculated one for default handling.  It
  /// will always be an absolute path.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  ///
  /// \snippet AppWindow.cpp GetUserDataFolder
  @(" propget")
	HRESULT get_UserDataFolder(@(" out, retval ") LPWSTR * value);
}

/// A continuation of the `ICoreWebView2Environment7` interface that supports
/// the `ProcessInfosChanged` event.
const GUID IID_ICoreWebView2Environment8 = ICoreWebView2Environment8.iid;

interface ICoreWebView2Environment8 : ICoreWebView2Environment7
{
    static const GUID iid = { 0xD6EB91DD,0xC3D2,0x45E5,[ 0xBD,0x29,0x6D,0xC2,0xBC,0x4D,0xE9,0xCF ] };
  /// Adds an event handler for the `ProcessInfosChanged` event.
  ///
  /// \snippet ProcessComponent.cpp ProcessInfosChanged
  /// \snippet ProcessComponent.cpp ProcessInfosChanged1
  HRESULT add_ProcessInfosChanged(
      /+[in]+/ ICoreWebView2ProcessInfosChangedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_ProcessInfosChanged`.
  HRESULT remove_ProcessInfosChanged(
      in EventRegistrationToken token);

  /// Returns the `ICoreWebView2ProcessInfoCollection`
  /// Provide a list of all process using same user data folder except for crashpad process.
  HRESULT GetProcessInfos(@("out, retval")ICoreWebView2ProcessInfoCollection * value);
}

/// Provides a set of properties for a process in the `ICoreWebView2Environment`.
const GUID IID_ICoreWebView2ProcessInfo = ICoreWebView2ProcessInfo.iid;

interface ICoreWebView2ProcessInfo : IUnknown
{
    static const GUID iid = { 0x84FA7612,0x3F3D,0x4FBF,[ 0x88,0x9D,0xFA,0xD0,0x00,0x49,0x2D,0x72 ] };

  /// The process id of the process.
  @(" propget")
	HRESULT get_ProcessId(@("out, retval") INT32* value);

  /// The kind of the process.
  @(" propget")
	HRESULT get_Kind(@("out, retval") COREWEBVIEW2_PROCESS_KIND* kind);
}

/// A continuation of the ICoreWebView2Environment interface for
/// creating CoreWebView2 ContextMenuItem objects.
const GUID IID_ICoreWebView2Environment9 = ICoreWebView2Environment9.iid;

interface ICoreWebView2Environment9 : ICoreWebView2Environment8
{
    static const GUID iid = { 0xf06f41bf,0x4b5a,0x49d8,[ 0xb9,0xf6,0xfa,0x16,0xcd,0x29,0xf2,0x74 ] };
  /// Create a custom `ContextMenuItem` object to insert into the WebView context menu.
  /// CoreWebView2 will rewind the icon stream before decoding.
  /// There is a limit of 1000 active custom context menu items at a given time.
  /// Attempting to create more before deleting existing ones will fail with
  /// ERROR_NOT_ENOUGH_QUOTA.
  /// It is recommended to reuse ContextMenuItems across ContextMenuRequested events
  /// for performance.
  /// The returned ContextMenuItem object's `IsEnabled` property will default to `TRUE`
  /// and `IsChecked` property will default to `FALSE`. A `CommandId` will be assigned
  /// to the ContextMenuItem object that's unique across active custom context menu items,
  /// but command ID values of deleted ContextMenuItems can be reassigned.
  HRESULT CreateContextMenuItem(
      in LPCWSTR label,
      in IStream* iconStream,
      in COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND kind,
      @("out, retval") ICoreWebView2ContextMenuItem * item);
}

/// This interface is used to create `ICoreWebView2ControllerOptions` object, which
/// can be passed as a parameter in `CreateCoreWebView2ControllerWithOptions` and
/// `CreateCoreWebView2CompositionControllerWithOptions` function for multiple profiles support.
/// The profile will be created on disk or opened when calling `CreateCoreWebView2ControllerWithOptions` or
/// `CreateCoreWebView2CompositionControllerWithOptions` no matter InPrivate mode is enabled or not, and
/// it will be released in memory when the corresponding controller is closed but still remain on disk.
/// If you create a WebView2Controller with {ProfileName="name", InPrivate=false} and then later create another
/// one with {ProfileName="name", InPrivate=true}, these two controllers using the same profile would be allowed to
/// run at the same time.
/// As WebView2 is built on top of Edge browser, it follows Edge's behavior pattern. To create an InPrivate WebView,
/// we gets an off-the-record profile (an InPrivate profile) from a regular profile, then create the WebView with the
/// off-the-record profile.
///
/// \snippet AppWindow.cpp CreateControllerWithOptions
const GUID IID_ICoreWebView2Environment10 = ICoreWebView2Environment10.iid;

interface ICoreWebView2Environment10 : ICoreWebView2Environment9
{
    static const GUID iid = { 0xee0eb9df,0x6f12,0x46ce,[ 0xb5,0x3f,0x3f,0x47,0xb9,0xc9,0x28,0xe0 ] };
  /// Create a new ICoreWebView2ControllerOptions to be passed as a parameter of
  /// CreateCoreWebView2ControllerWithOptions and CreateCoreWebView2CompositionControllerWithOptions.
  /// The 'options' is settable and in it the default value for profile name is the empty string,
  /// and the default value for IsInPrivateModeEnabled is false.
  /// Also the profile name can be reused.
  HRESULT CreateCoreWebView2ControllerOptions(
      @("out, retval") ICoreWebView2ControllerOptions * options);

  /// Create a new WebView with options.
  HRESULT CreateCoreWebView2ControllerWithOptions(
      in HWND parentWindow,
      /+[in]+/ ICoreWebView2ControllerOptions options,
      /+[in]+/ ICoreWebView2CreateCoreWebView2ControllerCompletedHandler handler);

  /// Create a new WebView in visual hosting mode with options.
  HRESULT CreateCoreWebView2CompositionControllerWithOptions(
      in HWND parentWindow,
      /+[in]+/ ICoreWebView2ControllerOptions options,
      /+[in]+/ ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler handler);
}

/// A list containing process id and corresponding process type.
const GUID IID_ICoreWebView2ProcessInfoCollection = ICoreWebView2ProcessInfoCollection.iid;

interface ICoreWebView2ProcessInfoCollection : IUnknown
{
    static const GUID iid = { 0x402B99CD,0xA0CC,0x4FA5,[ 0xB7,0xA5,0x51,0xD8,0x6A,0x1D,0x23,0x39 ] };
  /// The number of process contained in the ICoreWebView2ProcessInfoCollection.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT* count);

  /// Gets the `ICoreWebView2ProcessInfo` located in the `ICoreWebView2ProcessInfoCollection`
  /// at the given index.
  HRESULT GetValueAtIndex(in UINT32 index,
                          @("out, retval") ICoreWebView2ProcessInfo * processInfo);
}

/// An event handler for the `ProcessInfosChanged` event.
const GUID IID_ICoreWebView2ProcessInfosChangedEventHandler = ICoreWebView2ProcessInfosChangedEventHandler.iid;

interface ICoreWebView2ProcessInfosChangedEventHandler : IUnknown
{
    static const GUID iid = { 0xF4AF0C39,0x44B9,0x40E9,[ 0x8B,0x11,0x04,0x84,0xCF,0xB9,0xE0,0xA1 ] };
  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(/+[in]+/ ICoreWebView2Environment sender, /+[in]+/ IUnknown args);
}

/// Options used to create WebView2 Environment.  A default implementation is
/// provided in `WebView2EnvironmentOptions.h`.
///
/// \snippet AppWindow.cpp CreateCoreWebView2EnvironmentWithOptions

const GUID IID_ICoreWebView2EnvironmentOptions = ICoreWebView2EnvironmentOptions.iid;

interface ICoreWebView2EnvironmentOptions : IUnknown
{
    static const GUID iid = { 0x2fde08a8,0x1e9a,0x4766,[ 0x8c,0x05,0x95,0xa9,0xce,0xb9,0xd1,0xc5 ] };

  /// Changes the behavior of the WebView.  The arguments are passed to the
  /// browser process as part of the command.  For more information about
  /// using command-line switches with Chromium browser processes, navigate to
  /// [Run Chromium with Flags](https://www.chromium.org/developers/how-tos/run-chromium-with-flags).
  /// The value appended to a switch is appended to the browser process, for
  /// example, in `--edge-webview-switches=xxx` the value is `xxx`.  If you
  /// specify a switch that is important to WebView functionality, it is
  /// ignored, for example, `--user-data-dir`.  Specific features are disabled
  /// internally and blocked from being enabled.  If a switch is specified
  /// multiple times, only the last instance is used.
  ///
  /// \> [!NOTE]\n\> A merge of the different values of the same switch is not attempted,
  /// except for disabled and enabled features. The features specified by
  /// `--enable-features` and `--disable-features` are merged with simple
  /// logic.\n\> *   The features is the union of the specified features
  /// and built-in features.  If a feature is disabled, it is removed from the
  /// enabled features list.
  ///
  /// If you specify command-line switches and use the
  /// `additionalBrowserArguments` parameter, the `--edge-webview-switches`
  /// value takes precedence and is processed last.  If a switch fails to
  /// parse, the switch is ignored.  The default state for the operation is
  /// to run the browser process with no extra flags.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_AdditionalBrowserArguments(@("out, retval") LPWSTR* value);

  /// Sets the `AdditionalBrowserArguments` property.
  ///
  /// Please note that calling this API twice will replace the previous value
  /// rather than appending to it. If there are multiple switches, there
  /// should be a space in between them. The one exception is if multiple
  /// features are being enabled/disabled for a single switch, in which
  /// case the features should be comma-seperated.
  /// Ex. "--disable-features=feature1,feature2 --some-other-switch --do-something"
  @(" propput")
	HRESULT put_AdditionalBrowserArguments(in LPCWSTR value);

  /// The default display language for WebView.  It applies to browser UI such as
  /// context menu and dialogs.  It also applies to the `accept-languages` HTTP
  ///  header that WebView sends to websites. The intended locale value is in the
  /// format of BCP 47 Language Tags. More information can be found from
  /// [IETF BCP47](https://www.ietf.org/rfc/bcp/bcp47.html).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Language(@("out, retval") LPWSTR* value);

  /// Sets the `Language` property.
  @(" propput")
	HRESULT put_Language(in LPCWSTR value);

  /// Specifies the version of the WebView2 Runtime binaries required to be
  /// compatible with your app.  This defaults to the WebView2 Runtime version
  /// that corresponds with the version of the SDK the app is using.  The
  /// format of this value is the same as the format of the
  /// `BrowserVersionString` property and other `BrowserVersion` values.  Only
  /// the version part of the `BrowserVersion` value is respected.  The channel
  ///  suffix, if it exists, is ignored.  The version of the WebView2 Runtime
  /// binaries actually used may be different from the specified
  /// `TargetCompatibleBrowserVersion`.  The binaries are only guaranteed to be
  /// compatible.  Verify the actual version on the `BrowserVersionString`
  /// property on the `ICoreWebView2Environment`.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_TargetCompatibleBrowserVersion(@("out, retval") LPWSTR* value);

  /// Sets the `TargetCompatibleBrowserVersion` property.
  @(" propput")
	HRESULT put_TargetCompatibleBrowserVersion(in LPCWSTR value);

  /// The `AllowSingleSignOnUsingOSPrimaryAccount` property is used to enable
  /// single sign on with Azure Active Directory (AAD) and personal Microsoft
  /// Account (MSA) resources inside WebView. All AAD accounts, connected to
  /// Windows and shared for all apps, are supported. For MSA, SSO is only enabled
  /// for the account associated for Windows account login, if any.
  /// Default is disabled. Universal Windows Platform apps must also declare
  /// `enterpriseCloudSSO`
  /// [Restricted capabilities](/windows/uwp/packaging/app-capability-declarations\#restricted-capabilities)
  /// for the single sign on (SSO) to work.
  @(" propget")
	HRESULT get_AllowSingleSignOnUsingOSPrimaryAccount(@("out, retval") BOOL* allow);

  /// Sets the `AllowSingleSignOnUsingOSPrimaryAccount` property.
  @(" propput")
	HRESULT put_AllowSingleSignOnUsingOSPrimaryAccount(in BOOL allow);
}

/// Additional options used to create WebView2 Environment.  A default implementation is
/// provided in `WebView2EnvironmentOptions.h`.
///
/// \snippet AppWindow.cpp CreateCoreWebView2EnvironmentWithOptions

// Note: ICoreWebView2EnvironmentOptions* interfaces derive from IUnknown to make moving
// the API from experimental to public smoothier. These interfaces are mostly internal to
// WebView's own code. Normal apps just use the objects we provided and never interact
// with the interfaces. Advanced apps might implement their own options object. In that
// case, it is also easier for them to implement the interface if it is derived from IUnknown.
const GUID IID_ICoreWebView2EnvironmentOptions2 = ICoreWebView2EnvironmentOptions2.iid;

interface ICoreWebView2EnvironmentOptions2 : IUnknown
{
    static const GUID iid = { 0xFF85C98A,0x1BA7,0x4A6B,[ 0x90,0xC8,0x2B,0x75,0x2C,0x89,0xE9,0xE2 ] };

  /// Whether other processes can create WebView2 from WebView2Environment created with the
  /// same user data folder and therefore sharing the same WebView browser process instance.
  /// Default is FALSE.
  @(" propget")
	HRESULT get_ExclusiveUserDataFolderAccess(@("out, retval") BOOL* value);

  /// Sets the `ExclusiveUserDataFolderAccess` property.
  /// The `ExclusiveUserDataFolderAccess` property specifies that the WebView environment
  /// obtains exclusive access to the user data folder.
  /// If the user data folder is already being used by another WebView environment with a
  /// different value for `ExclusiveUserDataFolderAccess` property, the creation of a WebView2Controller
  /// using the environment object will fail with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
  /// When set as TRUE, no other WebView can be created from other processes using WebView2Environment
  /// objects with the same UserDataFolder. This prevents other processes from creating WebViews
  /// which share the same browser process instance, since sharing is performed among
  /// WebViews that have the same UserDataFolder. When another process tries to create a
  /// WebView2Controller from an WebView2Environment object created with the same user data folder,
  /// it will fail with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
  @(" propput")
	HRESULT put_ExclusiveUserDataFolderAccess(in BOOL value);
}

/// Additional options used to create WebView2 Environment to manage crash
/// reporting.
const GUID IID_ICoreWebView2EnvironmentOptions3 = ICoreWebView2EnvironmentOptions3.iid;

interface ICoreWebView2EnvironmentOptions3 : IUnknown
{
    static const GUID iid = { 0x4A5C436E,0xA9E3,0x4A2E,[ 0x89,0xC3,0x91,0x0D,0x35,0x13,0xF5,0xCC ] };
  /// When `IsCustomCrashReportingEnabled` is set to `TRUE`, Windows won't send crash data to Microsoft endpoint.
  /// `IsCustomCrashReportingEnabled` is default to be `FALSE`, in this case, WebView will respect OS consent.
  @(" propget")
	HRESULT get_IsCustomCrashReportingEnabled(@("out, retval") BOOL* value);

  /// Sets the `IsCustomCrashReportingEnabled` property.
  @(" propput")
	HRESULT put_IsCustomCrashReportingEnabled(in BOOL value);
}

/// Additional options used to create WebView2 Environment that manages custom scheme registration.
const GUID IID_ICoreWebView2EnvironmentOptions4 = ICoreWebView2EnvironmentOptions4.iid;

interface ICoreWebView2EnvironmentOptions4 : IUnknown
{
    static const GUID iid = { 0xac52d13f,0x0d38,0x475a,[ 0x9d,0xca,0x87,0x65,0x80,0xd6,0x79,0x3e ] };
  /// Array of custom scheme registrations. The returned
  /// ICoreWebView2CustomSchemeRegistration pointers must be released, and the
  /// array itself must be deallocated with CoTaskMemFree.
  HRESULT GetCustomSchemeRegistrations(
      @("out") UINT32* count,
      @("out") ICoreWebView2CustomSchemeRegistration ** schemeRegistrations);
  /// Set the array of custom scheme registrations to be used.
  /// \snippet AppWindow.cpp CoreWebView2CustomSchemeRegistration
  HRESULT SetCustomSchemeRegistrations(
      in UINT32 count,
      /+[in]+/ ICoreWebView2CustomSchemeRegistration * schemeRegistrations);
}

/// Additional options used to create WebView2 Environment to manage tracking
/// prevention.
const GUID IID_ICoreWebView2EnvironmentOptions5 = ICoreWebView2EnvironmentOptions5.iid;

interface ICoreWebView2EnvironmentOptions5 : IUnknown
{
    static const GUID iid = { 0x0AE35D64,0xC47F,0x4464,[ 0x81,0x4E,0x25,0x9C,0x34,0x5D,0x15,0x01 ] };
  /// The `EnableTrackingPrevention` property is used to enable/disable tracking prevention
  /// feature in WebView2. This property enable/disable tracking prevention for all the
  /// WebView2's created in the same environment. By default this feature is enabled to block
  /// potentially harmful trackers and trackers from sites that aren't visited before and set to
  /// `COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BALANCED` or whatever value was last changed/persisted
  /// on the profile.
  ///
  /// You can set this property to false to disable the tracking prevention feature if the app only
  /// renders content in the WebView2 that is known to be safe. Disabling this feature when creating
  /// environment also improves runtime performance by skipping related code.
  ///
  /// You shouldn't disable this property if WebView2 is being used as a "full browser" with arbitrary
  /// navigation and should protect end user privacy.
  ///
  /// There is `ICoreWebView2Profile3::PreferredTrackingPreventionLevel` property to control levels of
  /// tracking prevention of the WebView2's associated with a same profile. However, you can also disable
  /// tracking prevention later using `ICoreWebView2Profile3::PreferredTrackingPreventionLevel` property and
  /// `COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_NONE` value but that doesn't improves runtime performance.
  ///
  /// See `ICoreWebView2Profile3::PreferredTrackingPreventionLevel` for more details.
  ///
  /// Tracking prevention protects users from online tracking by restricting the ability of trackers to
  /// access browser-based storage as well as the network. See [Tracking prevention](/microsoft-edge/web-platform/tracking-prevention).
  @(" propget")
	HRESULT get_EnableTrackingPrevention(@("out, retval") BOOL* value);
  /// Sets the `EnableTrackingPrevention` property.
  @(" propput")
	HRESULT put_EnableTrackingPrevention(in BOOL value);
}

/// Additional options used to create WebView2 Environment to manage browser extensions.
const GUID IID_ICoreWebView2EnvironmentOptions6 = ICoreWebView2EnvironmentOptions6.iid;

interface ICoreWebView2EnvironmentOptions6 : IUnknown
{
    static const GUID iid = { 0x57D29CC3,0xC84F,0x42A0,[ 0xB0,0xE2,0xEF,0xFB,0xD5,0xE1,0x79,0xDE ] };
  /// When `AreBrowserExtensionsEnabled` is set to `TRUE`, new extensions can be added to user
  /// profile and used. `AreBrowserExtensionsEnabled` is default to be `FALSE`, in this case,
  /// new extensions can't be installed, and already installed extension won't be
  /// available to use in user profile.
  /// If connecting to an already running environment with a different value for `AreBrowserExtensionsEnabled`
  /// property, it will fail with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
  /// See `ICoreWebView2BrowserExtension` for Extensions API details.
  @(" propget")
	HRESULT get_AreBrowserExtensionsEnabled(@("out, retval") BOOL* value);
  /// Sets the `AreBrowserExtensionsEnabled` property.
  @(" propput")
	HRESULT put_AreBrowserExtensionsEnabled(in BOOL value);
}

/// A continuation of the ICoreWebView2Environment interface for
/// getting the crash dump folder path.
const GUID IID_ICoreWebView2Environment11 = ICoreWebView2Environment11.iid;

interface ICoreWebView2Environment11 : ICoreWebView2Environment10
{
    static const GUID iid = { 0xF0913DC6,0xA0EC,0x42EF,[ 0x98,0x05,0x91,0xDF,0xF3,0xA2,0x96,0x6A ] };
  /// `FailureReportFolderPath` returns the path of the folder where minidump files are written.
  /// Whenever a WebView2 process crashes, a crash dump file will be created in the crash dump folder.
  /// The crash dump format is minidump files. Please see
  /// [Minidump Files documentation](/windows/win32/debug/minidump-files) for detailed information.
  /// Normally when a single child process fails, a minidump will be generated and written to disk,
  /// then the `ProcessFailed` event is raised. But for unexpected crashes, a minidump file might not be generated
  /// at all, despite whether `ProcessFailed` event is raised. If there are multiple
  /// process failures at once, multiple minidump files could be generated. Thus `FailureReportFolderPath`
  /// could contain old minidump files that are not associated with a specific `ProcessFailed` event.
  /// \snippet AppWindow.cpp GetFailureReportFolder
  @(" propget")
	HRESULT get_FailureReportFolderPath(@("out, retval") LPWSTR* value);
}

/// A continuation of the ICoreWebView2Environment interface for creating shared buffer object.
const GUID IID_ICoreWebView2Environment12 = ICoreWebView2Environment12.iid;

interface ICoreWebView2Environment12 : ICoreWebView2Environment11
{
    static const GUID iid = { 0xF503DB9B,0x739F,0x48DD,[ 0xB1,0x51,0xFD,0xFC,0xF2,0x53,0xF5,0x4E ] };
  /// Create a shared memory based buffer with the specified size in bytes.
  /// The buffer can be shared with web contents in WebView by calling
  /// `PostSharedBufferToScript` on `CoreWebView2` or `CoreWebView2Frame` object.
  /// Once shared, the same content of the buffer will be accessible from both
  /// the app process and script in WebView. Modification to the content will be visible
  /// to all parties that have access to the buffer.
  /// The shared buffer is presented to the script as ArrayBuffer. All JavaScript APIs
  /// that work for ArrayBuffer including Atomics APIs can be used on it.
  /// There is currently a limitation that only size less than 2GB is supported.
  HRESULT CreateSharedBuffer(
    in UINT64 size,
    @("out, retval") ICoreWebView2SharedBuffer * shared_buffer);
}

/// Receives the `WebView2Environment` created using
/// `CreateCoreWebView2Environment`.
const GUID IID_ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler.iid;

interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler : IUnknown
{
    static const GUID iid = { 0x4e8a3389,0xc9d8,0x4bd2,[ 0xb6,0xb5,0x12,0x4f,0xee,0x6c,0xc1,0x4d ] };

  /// Provides the completion status and result of the corresponding
  /// asynchronous method.

  HRESULT Invoke(HRESULT errorCode, ICoreWebView2Environment createdEnvironment);
}

/// A Receiver is created for a particular DevTools Protocol event and allows
/// you to subscribe and unsubscribe from that event.  Obtained from the
/// WebView object using `GetDevToolsProtocolEventReceiver`.
const GUID IID_ICoreWebView2DevToolsProtocolEventReceiver = ICoreWebView2DevToolsProtocolEventReceiver.iid;

interface ICoreWebView2DevToolsProtocolEventReceiver : IUnknown
{
    static const GUID iid = { 0xb32ca51a,0x8371,0x45e9,[ 0x93,0x17,0xaf,0x02,0x1d,0x08,0x03,0x67 ] };

  /// Subscribe to a `DevToolsProtocol` event.  The `Invoke` method of the
  /// `handler` runs whenever the corresponding `DevToolsProtocol` event runs.
  /// `Invoke` runs with an event args object containing the parameter object
  /// of the DevTools Protocol event as a JSON string.
  ///
  /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived

  HRESULT add_DevToolsProtocolEventReceived(
      /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventHandler handler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with
  /// `add_DevToolsProtocolEventReceived`.

  HRESULT remove_DevToolsProtocolEventReceived(
      in EventRegistrationToken token);
}

/// A continuation of the ICoreWebView2Environment interface for getting process
/// with associated information.
const GUID IID_ICoreWebView2Environment13 = ICoreWebView2Environment13.iid;

interface ICoreWebView2Environment13 : ICoreWebView2Environment12
{
    static const GUID iid = { 0xaf641f58,0x72b2,0x11ee,[ 0xb9,0x62,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// Gets a snapshot collection of `ProcessExtendedInfo`s corresponding to all
  /// currently running processes associated with this `CoreWebView2Environment`
  /// excludes crashpad process.
  /// This provides the same list of `ProcessInfo`s as what's provided in
  /// `GetProcessInfos`, but additionally provides a list of associated `FrameInfo`s
  /// which are actively running (showing or hiding UI elements) in the renderer
  /// process. See `AssociatedFrameInfos` for more information.
  ///
  /// \snippet ProcessComponent.cpp GetProcessExtendedInfos
  HRESULT GetProcessExtendedInfos(/+[in]+/ ICoreWebView2GetProcessExtendedInfosCompletedHandler handler);
}

/// Receives the result of the `GetProcessExtendedInfos` method.
/// The result is written to the collection of `ProcessExtendedInfo`s provided
/// in the `GetProcessExtendedInfos` method call.
const GUID IID_ICoreWebView2GetProcessExtendedInfosCompletedHandler = ICoreWebView2GetProcessExtendedInfosCompletedHandler.iid;

interface ICoreWebView2GetProcessExtendedInfosCompletedHandler : IUnknown
{
    static const GUID iid = { 0xf45e55aa,0x3bc2,0x11ee,[ 0xbe,0x56,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// Provides the process extended info list for the `GetProcessExtendedInfos`.
  HRESULT Invoke(in HRESULT errorCode, /+[in]+/ ICoreWebView2ProcessExtendedInfoCollection value);
}

/// Provides process with associated extended information in the `ICoreWebView2Environment`.
const GUID IID_ICoreWebView2ProcessExtendedInfo = ICoreWebView2ProcessExtendedInfo.iid;

interface ICoreWebView2ProcessExtendedInfo : IUnknown
{
    static const GUID iid = { 0xaf4c4c2e,0x45db,0x11ee,[ 0xbe,0x56,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// The process info of the current process.
  @(" propget")
	HRESULT get_ProcessInfo(
    @("out, retval") ICoreWebView2ProcessInfo * processInfo);

  /// The collection of associated `FrameInfo`s which are actively running
  /// (showing or hiding UI elements) in this renderer process. `AssociatedFrameInfos`
  /// will only be populated when this `CoreWebView2ProcessExtendedInfo`
  /// corresponds to a renderer process. Non-renderer processes will always
  /// have an empty `AssociatedFrameInfos`. The `AssociatedFrameInfos` may
  /// also be empty for renderer processes that have no active frames.
  ///
  /// \snippet ProcessComponent.cpp AssociatedFrameInfos
  @(" propget")
	HRESULT get_AssociatedFrameInfos(
    @("out, retval") ICoreWebView2FrameInfoCollection * frames);
}

/// A list containing processInfo and associated extended information.
const GUID IID_ICoreWebView2ProcessExtendedInfoCollection = ICoreWebView2ProcessExtendedInfoCollection.iid;

interface ICoreWebView2ProcessExtendedInfoCollection : IUnknown
{
    static const GUID iid = { 0x32efa696,0x407a,0x11ee,[ 0xbe,0x56,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// The number of process contained in the `ICoreWebView2ProcessExtendedInfoCollection`.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT* count);

  /// Gets the `ICoreWebView2ProcessExtendedInfo` located in the
  /// `ICoreWebView2ProcessExtendedInfoCollection` at the given index.
  HRESULT GetValueAtIndex(in UINT32 index,
                          @("out, retval") ICoreWebView2ProcessExtendedInfo * processInfo);
}

/// ICoreWebView2Frame provides direct access to the iframes information.
/// You can get an ICoreWebView2Frame by handling the ICoreWebView2_4::add_FrameCreated event.
const GUID IID_ICoreWebView2Frame = ICoreWebView2Frame.iid;

interface ICoreWebView2Frame : IUnknown
{
    static const GUID iid = { 0xf1131a5e,0x9ba9,0x11eb,[ 0xa8,0xb3,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// The name of the iframe from the iframe html tag declaring it.
  /// You can access this property even if the iframe is destroyed.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Name(@(" out, retval ") LPWSTR * name);
  /// Raised when the iframe changes its window.name property.
  HRESULT add_NameChanged(
      /+[in]+/ ICoreWebView2FrameNameChangedEventHandler  eventHandler,
      @("out") EventRegistrationToken * token);
  /// Remove an event handler previously added with add_NameChanged.
  HRESULT remove_NameChanged(in EventRegistrationToken token);

  /// Add the provided host object to script running in the iframe with the
  /// specified name for the list of the specified origins. The host object
  /// will be accessible for this iframe only if the iframe's origin during
  /// access matches one of the origins which are passed. The provided origins
  /// will be normalized before comparing to the origin of the document.
  /// So the scheme name is made lower case, the host will be punycode decoded
  /// as appropriate, default port values will be removed, and so on.
  /// This means the origin's host may be punycode encoded or not and will match
  /// regardless. If list contains malformed origin the call will fail.
  /// The method can be called multiple times in a row without calling
  /// RemoveHostObjectFromScript for the same object name. It will replace
  /// the previous object with the new object and new list of origins.
  /// List of origins will be treated as following:
  /// 1. empty list - call will succeed and object will be added for the iframe
  /// but it will not be exposed to any origin;
  /// 2. list with origins - during access to host object from iframe the
  /// origin will be checked that it belongs to this list;
  /// 3. list with "*" element - host object will be available for iframe for
  /// all origins. We suggest not to use this feature without understanding
  /// security implications of giving access to host object from from iframes
  /// with unknown origins.
  /// 4. list with "file://" element - host object will be available for iframes
  /// loaded via file protocol.
  /// Calling this method fails if it is called after the iframe is destroyed.
  /// \snippet ScenarioAddHostObject.cpp AddHostObjectToScriptWithOrigins
  /// For more information about host objects navigate to
  /// ICoreWebView2::AddHostObjectToScript.
  HRESULT AddHostObjectToScriptWithOrigins(
      in LPCWSTR name,
      in VARIANT * object,
      in UINT32 originsCount,
      @(" size_is (originsCount)") in LPCWSTR * origins);
  /// Remove the host object specified by the name so that it is no longer
  /// accessible from JavaScript code in the iframe. While new access
  /// attempts are denied, if the object is already obtained by JavaScript code
  /// in the iframe, the JavaScript code continues to have access to that
  /// object. Calling this method for a name that is already removed or was
  /// never added fails. If the iframe is destroyed this method will return fail
  /// also.
  HRESULT RemoveHostObjectFromScript(in LPCWSTR name);

  /// The Destroyed event is raised when the iframe corresponding
  /// to this CoreWebView2Frame object is removed or the document
  /// containing that iframe is destroyed.
  HRESULT add_Destroyed(
      /+[in]+/ ICoreWebView2FrameDestroyedEventHandler  eventHandler,
      @("out") EventRegistrationToken * token);
  /// Remove an event handler previously added with add_Destroyed.
  HRESULT remove_Destroyed(in EventRegistrationToken token);
  /// Check whether a frame is destroyed. Returns true during
  /// the Destroyed event.
  HRESULT IsDestroyed(@(" out, retval ") BOOL * destroyed);
}

/// A continuation of the ICoreWebView2Frame interface with navigation events,
/// executing script and posting web messages.
const GUID IID_ICoreWebView2Frame2 = ICoreWebView2Frame2.iid;

interface ICoreWebView2Frame2 : ICoreWebView2Frame
{
    static const GUID iid = { 0x7a6a5834,0xd185,0x4dbf,[ 0xb6,0x3f,0x4a,0x9b,0xc4,0x31,0x07,0xd4 ] };
  /// Add an event handler for the `NavigationStarting` event.
  /// A frame navigation will raise a `NavigationStarting` event and
  /// a `CoreWebView2.FrameNavigationStarting` event. All of the
  /// `FrameNavigationStarting` event handlers for the current frame will be
  /// run before the `NavigationStarting` event handlers. All of the event handlers
  /// share a common `NavigationStartingEventArgs` object. Whichever event handler is
  /// last to change the `NavigationStartingEventArgs.Cancel` property will
  /// decide if the frame navigation will be cancelled. Redirects raise this
  /// event as well, and the navigation id is the same as the original one.
  ///
  /// Navigations will be blocked until all `NavigationStarting` and
  /// `CoreWebView2.FrameNavigationStarting` event handlers return.
  HRESULT add_NavigationStarting(
      /+[in]+/ ICoreWebView2FrameNavigationStartingEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_NavigationStarting`.
  HRESULT remove_NavigationStarting(
      in EventRegistrationToken token);

  /// Add an event handler for the `ContentLoading` event.  `ContentLoading`
  /// triggers before any content is loaded, including scripts added with
  /// `AddScriptToExecuteOnDocumentCreated`.  `ContentLoading` does not trigger
  /// if a same page navigation occurs (such as through `fragment`
  /// navigations or `history.pushState` navigations).  This operation
  /// follows the `NavigationStarting` and precedes `NavigationCompleted` events.
  HRESULT add_ContentLoading(
      /+[in]+/ ICoreWebView2FrameContentLoadingEventHandler  eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_ContentLoading`.
  HRESULT remove_ContentLoading(
      in EventRegistrationToken token);

  /// Add an event handler for the `NavigationCompleted` event.
  /// `NavigationCompleted` runs when the CoreWebView2Frame has completely
  /// loaded (concurrently when `body.onload` runs) or loading stopped with error.
  HRESULT add_NavigationCompleted(
      /+[in]+/ ICoreWebView2FrameNavigationCompletedEventHandler
          eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_NavigationCompleted`.
  HRESULT remove_NavigationCompleted(
      in EventRegistrationToken token);

  /// Add an event handler for the DOMContentLoaded event.
  /// DOMContentLoaded is raised when the iframe html document has been parsed.
  /// This aligns with the document's DOMContentLoaded event in html.
  HRESULT add_DOMContentLoaded(
      /+[in]+/ ICoreWebView2FrameDOMContentLoadedEventHandler  eventHandler,
      @("out") EventRegistrationToken* token);
  /// Remove an event handler previously added with add_DOMContentLoaded.
  HRESULT remove_DOMContentLoaded(
      in EventRegistrationToken token);

  /// Run JavaScript code from the javascript parameter in the current frame.
  /// The result of evaluating the provided JavaScript is passed to the completion handler.
  /// The result value is a JSON encoded string. If the result is undefined,
  /// contains a reference cycle, or otherwise is not able to be encoded into
  /// JSON, then the result is considered to be null, which is encoded
  /// in JSON as the string "null".
  ///
  /// \> [!NOTE]\n\> A function that has no explicit return value returns undefined. If the
  /// script that was run throws an unhandled exception, then the result is
  /// also "null". This method is applied asynchronously. If the method is
  /// run before `ContentLoading`, the script will not be executed
  /// and the string "null" will be returned.
  /// This operation executes the script even if `ICoreWebView2Settings::IsScriptEnabled` is
  /// set to `FALSE`.
  ///
  /// \snippet ScenarioDOMContentLoaded.cpp ExecuteScriptFrame
  HRESULT ExecuteScript(
      in LPCWSTR javaScript,
      /+[in]+/ ICoreWebView2ExecuteScriptCompletedHandler handler);

  /// Posts the specified webMessage to the frame.
  /// The frame receives the message by subscribing to the `message` event of
  /// the `window.chrome.webview` of the frame document.
  ///
  /// ```cpp
  /// window.chrome.webview.addEventListener('message', handler)
  /// window.chrome.webview.removeEventListener('message', handler)
  /// ```
  ///
  /// The event args is an instances of `MessageEvent`. The
  /// `ICoreWebView2Settings::IsWebMessageEnabled` setting must be `TRUE` or
  /// the message will not be sent. The `data` property of the event
  /// args is the `webMessage` string parameter parsed as a JSON string into a
  /// JavaScript object. The `source` property of the event args is a reference
  /// to the `window.chrome.webview` object.  For information about sending
  /// messages from the HTML document in the WebView to the host, navigate to
  /// [add_WebMessageReceived](/microsoft-edge/webview2/reference/win32/icorewebview2#add_webmessagereceived).
  /// The message is delivered asynchronously. If a navigation occurs before the
  /// message is posted to the page, the message is discarded.
  HRESULT PostWebMessageAsJson(in LPCWSTR webMessageAsJson);

  /// Posts a message that is a simple string rather than a JSON string
  /// representation of a JavaScript object. This behaves in exactly the same
  /// manner as `PostWebMessageAsJson`, but the `data` property of the event
  /// args of the `window.chrome.webview` message is a string with the same
  /// value as `webMessageAsString`. Use this instead of
  /// `PostWebMessageAsJson` if you want to communicate using simple strings
  /// rather than JSON objects.
  HRESULT PostWebMessageAsString(in LPCWSTR webMessageAsString);

  /// Add an event handler for the `WebMessageReceived` event.
  /// `WebMessageReceived` runs when the
  /// `ICoreWebView2Settings::IsWebMessageEnabled` setting is set and the
  /// frame document runs `window.chrome.webview.postMessage`.
  /// The `postMessage` function is `void postMessage(object)`
  /// where object is any object supported by JSON conversion.
  ///
  /// \snippet assets\ScenarioWebMessage.html chromeWebView
  ///
  /// When the frame calls `postMessage`, the object parameter is converted to a
  /// JSON string and is posted asynchronously to the host process. This will
  /// result in the handlers `Invoke` method being called with the JSON string
  /// as its parameter.
  ///
  /// \snippet ScenarioWebMessage.cpp WebMessageReceivedIFrame
  HRESULT add_WebMessageReceived(
      /+[in]+/ ICoreWebView2FrameWebMessageReceivedEventHandler
          handler,
      @("out") EventRegistrationToken * token);

  /// Remove an event handler previously added with `add_WebMessageReceived`.
  HRESULT remove_WebMessageReceived(in EventRegistrationToken token);
}

/// Receives `FrameCreated` event.
const GUID IID_ICoreWebView2FrameCreatedEventHandler = ICoreWebView2FrameCreatedEventHandler.iid;

interface ICoreWebView2FrameCreatedEventHandler : IUnknown
{
    static const GUID iid = { 0x38059770,0x9baa,0x11eb,[ 0xa8,0xb3,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Provides the result for the iframe created event.
  HRESULT Invoke(/+[in]+/ ICoreWebView2  sender,
                 /+[in]+/ ICoreWebView2FrameCreatedEventArgs  args);
}

/// Receives `FrameNameChanged` event.
const GUID IID_ICoreWebView2FrameNameChangedEventHandler = ICoreWebView2FrameNameChangedEventHandler.iid;

interface ICoreWebView2FrameNameChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x435c7dc8,0x9baa,0x11eb,[ 0xa8,0xb3,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Provides the result for the iframe name changed event.
  /// No event args exist and the `args` parameter is set to `null`.
  HRESULT Invoke(/+[in]+/ ICoreWebView2Frame  sender, /+[in]+/ IUnknown  args);
}

/// Receives `NavigationStarting` events for iframe.
const GUID IID_ICoreWebView2FrameNavigationStartingEventHandler = ICoreWebView2FrameNavigationStartingEventHandler.iid;

interface ICoreWebView2FrameNavigationStartingEventHandler : IUnknown
{
    static const GUID iid = { 0xe79908bf,0x2d5d,0x4968,[ 0x83,0xdb,0x26,0x3f,0xea,0x2c,0x1d,0xa3 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Frame sender,
      /+[in]+/ ICoreWebView2NavigationStartingEventArgs args);
}

/// Receives `ContentLoading` events for iframe.
const GUID IID_ICoreWebView2FrameContentLoadingEventHandler = ICoreWebView2FrameContentLoadingEventHandler.iid;

interface ICoreWebView2FrameContentLoadingEventHandler : IUnknown
{
    static const GUID iid = { 0x0d6156f2,0xd332,0x49a7,[ 0x9e,0x03,0x7d,0x8f,0x2f,0xee,0xee,0x54 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Frame sender,
      /+[in]+/ ICoreWebView2ContentLoadingEventArgs args);
}

/// Receives `NavigationCompleted` events for iframe.
const GUID IID_ICoreWebView2FrameNavigationCompletedEventHandler = ICoreWebView2FrameNavigationCompletedEventHandler.iid;

interface ICoreWebView2FrameNavigationCompletedEventHandler : IUnknown
{
    static const GUID iid = { 0x609302ad,0x0e36,0x4f9a,[ 0xa2,0x10,0x6a,0x45,0x27,0x28,0x42,0xa9 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Frame sender,
      /+[in]+/ ICoreWebView2NavigationCompletedEventArgs args);
}

/// Receives `DOMContentLoaded` events for iframe.
const GUID IID_ICoreWebView2FrameDOMContentLoadedEventHandler = ICoreWebView2FrameDOMContentLoadedEventHandler.iid;

interface ICoreWebView2FrameDOMContentLoadedEventHandler : IUnknown
{
    static const GUID iid = { 0x38d9520d,0x340f,0x4d1e,[ 0xa7,0x75,0x43,0xfc,0xe9,0x75,0x36,0x83 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Frame sender,
      /+[in]+/ ICoreWebView2DOMContentLoadedEventArgs args);
}

/// Receives `WebMessageReceived` events for iframe.
const GUID IID_ICoreWebView2FrameWebMessageReceivedEventHandler = ICoreWebView2FrameWebMessageReceivedEventHandler.iid;

interface ICoreWebView2FrameWebMessageReceivedEventHandler : IUnknown
{
    static const GUID iid = { 0xe371e005,0x6d1d,0x4517,[ 0x93,0x4b,0xa8,0xf1,0x62,0x9c,0x62,0xa5 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Frame sender,
      /+[in]+/ ICoreWebView2WebMessageReceivedEventArgs args);
}

/// Event args for the `FrameCreated` events.
const GUID IID_ICoreWebView2FrameCreatedEventArgs = ICoreWebView2FrameCreatedEventArgs.iid;

interface ICoreWebView2FrameCreatedEventArgs : IUnknown
{
    static const GUID iid = { 0x4d6e7b5e,0x9baa,0x11eb,[ 0xa8,0xb3,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// The frame which was created.
  @(" propget")
	HRESULT get_Frame(@(" out, retval ") ICoreWebView2Frame *frame);
}

/// Receives `FrameDestroyed` event.
const GUID IID_ICoreWebView2FrameDestroyedEventHandler = ICoreWebView2FrameDestroyedEventHandler.iid;

interface ICoreWebView2FrameDestroyedEventHandler : IUnknown
{
    static const GUID iid = { 0x59dd7b4c,0x9baa,0x11eb,[ 0xa8,0xb3,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Provides the result for the iframe destroyed event.
  /// No event args exist and the `args` parameter is set to `null`.
  HRESULT Invoke(/+[in]+/ ICoreWebView2Frame  sender, /+[in]+/ IUnknown  args);
}

/// Add an event handler for the `DownloadStarting` event.
const GUID IID_ICoreWebView2DownloadStartingEventHandler = ICoreWebView2DownloadStartingEventHandler.iid;

interface ICoreWebView2DownloadStartingEventHandler : IUnknown
{
    static const GUID iid = { 0xefedc989,0xc396,0x41ca,[ 0x83,0xf7,0x07,0xf8,0x45,0xa5,0x57,0x24 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2DownloadStartingEventArgs args);
}

/// Event args for the `DownloadStarting` event.
const GUID IID_ICoreWebView2DownloadStartingEventArgs = ICoreWebView2DownloadStartingEventArgs.iid;

interface ICoreWebView2DownloadStartingEventArgs : IUnknown
{
    static const GUID iid = { 0xe99bbe21,0x43e9,0x4544,[ 0xa7,0x32,0x28,0x27,0x64,0xea,0xfa,0x60 ] };
  /// Returns the `ICoreWebView2DownloadOperation` for the download that
  /// has started.
  @(" propget")
	HRESULT get_DownloadOperation(
      @("out, retval") ICoreWebView2DownloadOperation * downloadOperation);

  /// The host may set this flag to cancel the download. If canceled, the
  /// download save dialog is not displayed regardless of the
  /// `Handled` property.
  @(" propget")
	HRESULT get_Cancel(@("out, retval") BOOL* cancel);

  /// Sets the `Cancel` property.
  @(" propput")
	HRESULT put_Cancel(in BOOL cancel);

  /// The path to the file. If setting the path, the host should ensure that it
  /// is an absolute path, including the file name, and that the path does not
  /// point to an existing file. If the path points to an existing file, the
  /// file will be overwritten. If the directory does not exist, it is created.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ResultFilePath(@("out, retval") LPWSTR* resultFilePath);

  /// Sets the `ResultFilePath` property.
  @(" propput")
	HRESULT put_ResultFilePath(in LPCWSTR resultFilePath);

  /// The host may set this flag to `TRUE` to hide the default download dialog
  /// for this download. The download will progress as normal if it is not
  /// canceled, there will just be no default UI shown. By default the value is
  /// `FALSE` and the default download dialog is shown.
  @(" propget")
	HRESULT get_Handled(@("out, retval") BOOL* handled);

  /// Sets the `Handled` property.
  @(" propput")
	HRESULT put_Handled(in BOOL handled);

  /// Returns an `ICoreWebView2Deferral` object.  Use this operation to
  /// complete the event at a later time.
  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);
}

/// Implements the interface to receive `BytesReceivedChanged` event.  Use the
/// `ICoreWebView2DownloadOperation.BytesReceived` property to get the received
/// bytes count.
const GUID IID_ICoreWebView2BytesReceivedChangedEventHandler = ICoreWebView2BytesReceivedChangedEventHandler.iid;

interface ICoreWebView2BytesReceivedChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x828e8ab6,0xd94c,0x4264,[ 0x9c,0xef,0x52,0x17,0x17,0x0d,0x62,0x51 ] };
  /// Provides the event args for the corresponding event. No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2DownloadOperation sender, /+[in]+/ IUnknown args);
}

/// Implements the interface to receive `EstimatedEndTimeChanged` event. Use the
/// `ICoreWebView2DownloadOperation.EstimatedEndTime` property to get the new
/// estimated end time.
const GUID IID_ICoreWebView2EstimatedEndTimeChangedEventHandler = ICoreWebView2EstimatedEndTimeChangedEventHandler.iid;

interface ICoreWebView2EstimatedEndTimeChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x28f0d425,0x93fe,0x4e63,[ 0x9f,0x8d,0x2a,0xee,0xc6,0xd3,0xba,0x1e ] };
  /// Provides the event args for the corresponding event. No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2DownloadOperation sender, /+[in]+/ IUnknown args);
}

/// Implements the interface to receive `StateChanged` event. Use the
/// `ICoreWebView2DownloadOperation.State` property to get the current state,
/// which can be in progress, interrupted, or completed. Use the
/// `ICoreWebView2DownloadOperation.InterruptReason` property to get the
/// interrupt reason if the download is interrupted.
const GUID IID_ICoreWebView2StateChangedEventHandler = ICoreWebView2StateChangedEventHandler.iid;

interface ICoreWebView2StateChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x81336594,0x7ede,0x4ba9,[ 0xbf,0x71,0xac,0xf0,0xa9,0x5b,0x58,0xdd ] };
  /// Provides the event args for the corresponding event. No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2DownloadOperation sender, /+[in]+/ IUnknown args);
}

/// Represents a download operation. Gives access to the download's metadata
/// and supports a user canceling, pausing, or resuming the download.
const GUID IID_ICoreWebView2DownloadOperation = ICoreWebView2DownloadOperation.iid;

interface ICoreWebView2DownloadOperation : IUnknown
{
    static const GUID iid = { 0x3d6b6cf2,0xafe1,0x44c7,[ 0xa9,0x95,0xc6,0x51,0x17,0x71,0x43,0x36 ] };
  /// Add an event handler for the `BytesReceivedChanged` event.
  ///
  /// \snippet ScenarioCustomDownloadExperience.cpp BytesReceivedChanged
  HRESULT add_BytesReceivedChanged(
    /+[in]+/ ICoreWebView2BytesReceivedChangedEventHandler eventHandler,
    @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_BytesReceivedChanged`.
  HRESULT remove_BytesReceivedChanged(
      in EventRegistrationToken token);

  /// Add an event handler for the `EstimatedEndTimeChanged` event.
  HRESULT add_EstimatedEndTimeChanged(
    /+[in]+/ ICoreWebView2EstimatedEndTimeChangedEventHandler eventHandler,
    @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_EstimatedEndTimeChanged`.
  HRESULT remove_EstimatedEndTimeChanged(
      in EventRegistrationToken token);

  /// Add an event handler for the `StateChanged` event.
  ///
  /// \snippet ScenarioCustomDownloadExperience.cpp StateChanged
  HRESULT add_StateChanged(
    /+[in]+/ ICoreWebView2StateChangedEventHandler eventHandler,
    @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_StateChanged`.
  HRESULT remove_StateChanged(
      in EventRegistrationToken token);

  /// The URI of the download.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* uri);

  /// The Content-Disposition header value from the download's HTTP response.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ContentDisposition(@("out, retval") LPWSTR* contentDisposition);

  /// MIME type of the downloaded content.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_MimeType(@("out, retval") LPWSTR* mimeType);

  /// The expected size of the download in total number of bytes based on the
  /// HTTP Content-Length header. Returns -1 if the size is unknown.
  @(" propget")
	HRESULT get_TotalBytesToReceive(@("out, retval") INT64* totalBytesToReceive);

  /// The number of bytes that have been written to the download file.
  @(" propget")
	HRESULT get_BytesReceived(@("out, retval") INT64* bytesReceived);

  /// The estimated end time in [ISO 8601 Date and Time Format](https://www.iso.org/iso-8601-date-and-time-format.html).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_EstimatedEndTime(@("out, retval") LPWSTR* estimatedEndTime);

  /// The absolute path to the download file, including file name. Host can change
  /// this from `ICoreWebView2DownloadStartingEventArgs`.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ResultFilePath(@("out, retval") LPWSTR* resultFilePath);

  /// The state of the download. A download can be in progress, interrupted, or
  /// completed. See `COREWEBVIEW2_DOWNLOAD_STATE` for descriptions of states.
  @(" propget")
	HRESULT get_State(@("out, retval") COREWEBVIEW2_DOWNLOAD_STATE* downloadState);

  /// The reason why connection with file host was broken.
  @(" propget")
	HRESULT get_InterruptReason(
      @("out, retval") COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON* interruptReason);

  /// Cancels the download. If canceled, the default download dialog shows
  /// that the download was canceled. Host should set the `Cancel` property from
  /// `ICoreWebView2SDownloadStartingEventArgs` if the download should be
  /// canceled without displaying the default download dialog.
  HRESULT Cancel();

  /// Pauses the download. If paused, the default download dialog shows that the
  /// download is paused. No effect if download is already paused. Pausing a
  /// download changes the state to `COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED`
  /// with `InterruptReason` set to `COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_PAUSED`.
  HRESULT Pause();

  /// Resumes a paused download. May also resume a download that was interrupted
  /// for another reason, if `CanResume` returns true. Resuming a download changes
  /// the state from `COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED` to
  /// `COREWEBVIEW2_DOWNLOAD_STATE_IN_PROGRESS`.
  HRESULT Resume();

  /// Returns true if an interrupted download can be resumed. Downloads with
  /// the following interrupt reasons may automatically resume without you
  /// calling any methods:
  /// `COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE`,
  /// `COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH`,
  /// `COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT`.
  /// In these cases download progress may be restarted with `BytesReceived`
  /// reset to 0.
  @(" propget")
	HRESULT get_CanResume(@("out, retval") BOOL* canResume);
}

/// A continuation of the `ICoreWebView2ProcessFailedEventArgs` interface.
const GUID IID_ICoreWebView2ProcessFailedEventArgs2 = ICoreWebView2ProcessFailedEventArgs2.iid;

interface ICoreWebView2ProcessFailedEventArgs2 : ICoreWebView2ProcessFailedEventArgs
{
    static const GUID iid = { 0x4dab9422,0x46fa,0x4c3e,[ 0xa5,0xd2,0x41,0xd2,0x07,0x1d,0x36,0x80 ] };

  /// The reason for the process failure. Some of the reasons are only
  /// applicable to specific values of
  /// `ICoreWebView2ProcessFailedEventArgs::ProcessFailedKind`, and the
  /// following `ProcessFailedKind` values always return the indicated reason
  /// value:
  ///
  /// ProcessFailedKind | Reason
  /// ---|---
  /// COREWEBVIEW2_PROCESS_FAILED_KIND_BROWSER_PROCESS_EXITED | COREWEBVIEW2_PROCESS_FAILED_REASON_UNEXPECTED
  /// COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE | COREWEBVIEW2_PROCESS_FAILED_REASON_UNRESPONSIVE
  ///
  /// For other `ProcessFailedKind` values, the reason may be any of the reason
  /// values. To learn about what these values mean, see
  /// `COREWEBVIEW2_PROCESS_FAILED_REASON`.
  @(" propget")
	HRESULT get_Reason(
      @("out, retval") COREWEBVIEW2_PROCESS_FAILED_REASON* reason);

  /// The exit code of the failing process, for telemetry purposes. The exit
  /// code is always `STILL_ACTIVE` (`259`) when `ProcessFailedKind` is
  /// `COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE`.
  @(" propget")
	HRESULT get_ExitCode(
      @("out, retval") int* exitCode);

  /// Description of the process assigned by the WebView2 Runtime. This is a
  /// technical English term appropriate for logging or development purposes,
  /// and not localized for the end user. It applies to utility processes (for
  /// example, "Audio Service", "Video Capture") and plugin processes (for
  /// example, "Flash"). The returned `processDescription` is empty if the
  /// WebView2 Runtime did not assign a description to the process.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ProcessDescription(
      @("out, retval") LPWSTR* processDescription);

  /// The collection of `FrameInfo`s for frames in the `ICoreWebView2` that were
  /// being rendered by the failed process. The content in these frames is
  /// replaced with an error page.
  /// This is only available when `ProcessFailedKind` is
  /// `COREWEBVIEW2_PROCESS_FAILED_KIND_FRAME_RENDER_PROCESS_EXITED`;
  /// `frames` is `null` for all other process failure kinds, including the case
  /// in which the failed process was the renderer for the main frame and
  /// subframes within it, for which the failure kind is
  /// `COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED`.
  @(" propget")
	HRESULT get_FrameInfosForFailedProcess(
      @("out, retval") ICoreWebView2FrameInfoCollection * frames);
}

/// Collection of `FrameInfo`s (name and source). Used to list the affected
/// frames' info when a frame-only render process failure occurs in the
/// `ICoreWebView2`.
const GUID IID_ICoreWebView2FrameInfoCollection = ICoreWebView2FrameInfoCollection.iid;

interface ICoreWebView2FrameInfoCollection : IUnknown
{
    static const GUID iid = { 0x8f834154,0xd38e,0x4d90,[ 0xaf,0xfb,0x68,0x00,0xa7,0x27,0x28,0x39 ] };

  /// Gets an iterator over the collection of `FrameInfo`s.

  HRESULT GetIterator(
      @("out, retval") ICoreWebView2FrameInfoCollectionIterator * iterator);
}

/// Iterator for a collection of `FrameInfo`s. For more info, see
/// `ICoreWebView2ProcessFailedEventArgs2` and
/// `ICoreWebView2FrameInfoCollection`.
const GUID IID_ICoreWebView2FrameInfoCollectionIterator = ICoreWebView2FrameInfoCollectionIterator.iid;

interface ICoreWebView2FrameInfoCollectionIterator : IUnknown
{
    static const GUID iid = { 0x1bf89e2d,0x1b2b,0x4629,[ 0xb2,0x8f,0x05,0x09,0x9b,0x41,0xbb,0x03 ] };

  /// `TRUE` when the iterator has not run out of `FrameInfo`s.  If the
  /// collection over which the iterator is iterating is empty or if the
  /// iterator has gone past the end of the collection, then this is `FALSE`.

  @(" propget")
	HRESULT get_HasCurrent(@("out, retval") BOOL* hasCurrent);

  /// Get the current `ICoreWebView2FrameInfo` of the iterator.
  /// Returns `HRESULT_FROM_WIN32(ERROR_INVALID_INDEX)` if HasCurrent is
  /// `FALSE`.

  HRESULT GetCurrent(@("out, retval") ICoreWebView2FrameInfo * frameInfo);

  /// Move the iterator to the next `FrameInfo` in the collection.

  HRESULT MoveNext(@("out, retval") BOOL* hasNext);
}

/// Provides a set of properties for a frame in the `ICoreWebView2`.
const GUID IID_ICoreWebView2FrameInfo = ICoreWebView2FrameInfo.iid;

interface ICoreWebView2FrameInfo : IUnknown
{
    static const GUID iid = { 0xda86b8a1,0xbdf3,0x4f11,[ 0x99,0x55,0x52,0x8c,0xef,0xa5,0x97,0x27 ] };

  /// The name attribute of the frame, as in `<iframe name="frame-name" ...>`.
  /// The returned string is empty when the frame has no name attribute.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Name(@("out, retval") LPWSTR* name);

  /// The URI of the document in the frame.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

  @(" propget")
	HRESULT get_Source(@("out, retval") LPWSTR* source);
}

/// A continuation of the ICoreWebView2FrameInfo interface that provides
/// `ParentFrameInfo`, `FrameId` and `FrameKind` properties.
const GUID IID_ICoreWebView2FrameInfo2 = ICoreWebView2FrameInfo2.iid;

interface ICoreWebView2FrameInfo2 : ICoreWebView2FrameInfo
{
    static const GUID iid = { 0x56f85cfa,0x72c4,0x11ee,[ 0xb9,0x62,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// This parent frame's `FrameInfo`. `ParentFrameInfo` will only be
  /// populated when obtained via calling
  ///`CoreWebView2ProcessExtendedInfo.AssociatedFrameInfos`.
  /// `CoreWebView2FrameInfo` objects obtained via `CoreWebView2.ProcessFailed` will
  /// always have a `null` `ParentFrameInfo`. This property is also `null` for the
  /// main frame in the WebView2 which has no parent frame.
  /// Note that this `ParentFrameInfo` could be out of date as it's a snapshot.
  @(" propget")
	HRESULT get_ParentFrameInfo(@("out, retval") ICoreWebView2FrameInfo * frameInfo);
  /// The unique identifier of the frame associated with the current `FrameInfo`.
  /// It's the same kind of ID as with the `FrameId` in `CoreWebView2` and via
  /// `CoreWebView2Frame`. `FrameId` will only be populated (non-zero) when obtained
  /// calling `CoreWebView2ProcessExtendedInfo.AssociatedFrameInfos`.
  /// `CoreWebView2FrameInfo` objects obtained via `CoreWebView2.ProcessFailed` will
  /// always have an invalid frame Id 0.
  /// Note that this `FrameId` could be out of date as it's a snapshot.
  /// If there's WebView2 created or destroyed or `FrameCreated/FrameDestroyed` events
  /// after the asynchronous call `CoreWebView2Environment.GetProcessExtendedInfos`
  /// starts, you may want to call asynchronous method again to get the updated `FrameInfo`s.
  @(" propget")
	HRESULT get_FrameId(@("out, retval") UINT32* id);
  /// The frame kind of the frame. `FrameKind` will only be populated when
  /// obtained calling `CoreWebView2ProcessExtendedInfo.AssociatedFrameInfos`.
  /// `CoreWebView2FrameInfo` objects obtained via `CoreWebView2.ProcessFailed`
  /// will always have the default value `COREWEBVIEW2_FRAME_KIND_UNKNOWN`.
  /// Note that this `FrameKind` could be out of date as it's a snapshot.
  @(" propget")
	HRESULT get_FrameKind(@("out, retval") COREWEBVIEW2_FRAME_KIND* kind);
}

/// Represents a Basic HTTP authentication response that contains a user name
/// and a password as according to RFC7617 (https://tools.ietf.org/html/rfc7617)
const GUID IID_ICoreWebView2BasicAuthenticationResponse = ICoreWebView2BasicAuthenticationResponse.iid;

interface ICoreWebView2BasicAuthenticationResponse : IUnknown
{
    static const GUID iid = { 0x07023f7d,0x2d77,0x4d67,[ 0x90,0x40,0x6e,0x7d,0x42,0x8c,0x6a,0x40 ] };
  /// User name provided for authentication.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_UserName(@("out, retval") LPWSTR* userName);
  /// Set user name property
  @(" propput")
	HRESULT put_UserName(in LPCWSTR userName);

  /// Password provided for authentication.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Password(@("out, retval") LPWSTR* password);
  /// Set password property
  @(" propput")
	HRESULT put_Password(in LPCWSTR password);
}

/// Event args for the BasicAuthenticationRequested event. Will contain the
/// request that led to the HTTP authorization challenge, the challenge
/// and allows the host to provide authentication response or cancel the request.
const GUID IID_ICoreWebView2BasicAuthenticationRequestedEventArgs = ICoreWebView2BasicAuthenticationRequestedEventArgs.iid;

interface ICoreWebView2BasicAuthenticationRequestedEventArgs : IUnknown
{
    static const GUID iid = { 0xef05516f,0xd897,0x4f9e,[ 0xb6,0x72,0xd8,0xe2,0x30,0x7a,0x3f,0xb0 ] };
  /// The URI that led to the authentication challenge. For proxy authentication
  /// requests, this will be the URI of the proxy server.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Uri(@("out, retval") LPWSTR* value);

  /// The authentication challenge string
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Challenge(@("out, retval") LPWSTR* challenge);

  /// Response to the authentication request with credentials. This object will be populated by the app
  /// if the host would like to provide authentication credentials.
  @(" propget")
	HRESULT get_Response(@("out, retval") ICoreWebView2BasicAuthenticationResponse * response);

  /// Cancel the authentication request. False by default.
  /// If set to true, Response will be ignored.
  @(" propget")
	HRESULT get_Cancel(@("out, retval") BOOL* cancel);
  /// Set the Cancel property.
  @(" propput")
	HRESULT put_Cancel(in BOOL cancel);

  /// Returns an `ICoreWebView2Deferral` object. Use this deferral to
  /// defer the decision to show the Basic Authentication dialog.
  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);
}

/// Implements the interface to receive `IsDocumentPlayingAudioChanged` events.  Use the
/// IsDocumentPlayingAudio property to get the audio playing state.
const GUID IID_ICoreWebView2IsDocumentPlayingAudioChangedEventHandler = ICoreWebView2IsDocumentPlayingAudioChangedEventHandler.iid;

interface ICoreWebView2IsDocumentPlayingAudioChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x5DEF109A,0x2F4B,0x49FA,[ 0xB7,0xF6,0x11,0xC3,0x9E,0x51,0x33,0x28 ] };
  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
}

/// Implements the interface to receive `IsMutedChanged` events.  Use the
/// IsMuted property to get the mute state.
const GUID IID_ICoreWebView2IsMutedChangedEventHandler = ICoreWebView2IsMutedChangedEventHandler.iid;

interface ICoreWebView2IsMutedChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x57D90347,0xCD0E,0x4952,[ 0xA4,0xA2,0x74,0x83,0xA2,0x75,0x6F,0x08 ] };
  /// Provides the event args for the corresponding event.  No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
}

/// This is an extension of the ICoreWebView2Frame interface that supports PermissionRequested
const GUID IID_ICoreWebView2Frame3 = ICoreWebView2Frame3.iid;

interface ICoreWebView2Frame3 : ICoreWebView2Frame2
{
    static const GUID iid = { 0xb50d82cc,0xcc28,0x481d,[ 0x96,0x14,0xcb,0x04,0x88,0x95,0xe6,0xa0 ] };
  /// Add an event handler for the `PermissionRequested` event.
  /// `PermissionRequested` is raised when content in an iframe any of its
  /// descendant iframes requests permission to privileged resources.
  ///
  /// This relates to the `PermissionRequested` event on the `CoreWebView2`.
  /// Both these events will be raised in the case of an iframe requesting
  /// permission. The `CoreWebView2Frame`'s event handlers will be invoked
  /// before the event handlers on the `CoreWebView2`. If the `Handled` property
  /// of the `PermissionRequestedEventArgs` is set to TRUE within the
  /// `CoreWebView2Frame` event handler, then the event will not be
  /// raised on the `CoreWebView2`, and it's event handlers will not be invoked.
  ///
  /// In the case of nested iframes, the 'PermissionRequested' event will
  /// be raised from the top level iframe.
  ///
  /// If a deferral is not taken on the event args, the subsequent scripts are
  /// blocked until the event handler returns.  If a deferral is taken, the
  /// scripts are blocked until the deferral is completed.
  ///
  /// \snippet ScenarioIFrameDevicePermission.cpp PermissionRequested0
  /// \snippet ScenarioIFrameDevicePermission.cpp PermissionRequested1
  HRESULT add_PermissionRequested(
      /+[in]+/ ICoreWebView2FramePermissionRequestedEventHandler handler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_PermissionRequested`
  HRESULT remove_PermissionRequested(
      in EventRegistrationToken token);
}

/// This is an extension of the ICoreWebView2Frame interface that supports shared buffer based on file mapping.
const GUID IID_ICoreWebView2Frame4 = ICoreWebView2Frame4.iid;

interface ICoreWebView2Frame4 : ICoreWebView2Frame3
{
    static const GUID iid = { 0x188782DC,0x92AA,0x4732,[ 0xAB,0x3C,0xFC,0xC5,0x9F,0x6F,0x68,0xB9 ] };
  /// Share a shared buffer object with script of the iframe in the WebView.
  /// The script will receive a `sharedbufferreceived` event from chrome.webview.
  /// The event arg for that event will have the following methods and properties:
  ///   `getBuffer()`: return an ArrayBuffer object with the backing content from the shared buffer.
  ///   `additionalData`: an object as the result of parsing `additionalDataAsJson` as JSON string.
  ///           This property will be `undefined` if `additionalDataAsJson` is nullptr or empty string.
  ///   `source`: with a value set as `chrome.webview` object.
  /// If a string is provided as `additionalDataAsJson` but it is not a valid JSON string,
  /// the API will fail with `E_INVALIDARG`.
  /// If `access` is COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_ONLY, the script will only have read access to the buffer.
  /// If the script tries to modify the content in a read only buffer, it will cause an access
  /// violation in WebView renderer process and crash the renderer process.
  /// If the shared buffer is already closed, the API will fail with `RO_E_CLOSED`.
  ///
  /// The script code should call `chrome.webview.releaseBuffer` with
  /// the shared buffer as the parameter to release underlying resources as soon
  /// as it does not need access to the shared buffer any more.
  ///
  /// The application can post the same shared buffer object to multiple web pages or iframes, or
  /// post to the same web page or iframe multiple times. Each `PostSharedBufferToScript` will
  /// create a separate ArrayBuffer object with its own view of the memory and is separately
  /// released. The underlying shared memory will be released when all the views are released.
  ///
  /// For example, if we want to send data to script for one time read only consumption.
  ///
  /// \snippet ScenarioSharedBuffer.cpp OneTimeShareBuffer
  ///
  /// In the HTML document,
  ///
  /// \snippet assets\ScenarioSharedBuffer.html ShareBufferScriptCode_1
  ///
  /// \snippet assets\ScenarioSharedBuffer.html ShareBufferScriptCode_2
  ///
  /// Sharing a buffer to script has security risk. You should only share buffer with trusted site.
  /// If a buffer is shared to a untrusted site, possible sensitive information could be leaked.
  /// If a buffer is shared as modifiable by the script and the script modifies it in an unexpected way,
  /// it could result in corrupted data that might even crash the application.
  HRESULT PostSharedBufferToScript(
    /+[in]+/ ICoreWebView2SharedBuffer sharedBuffer,
    in COREWEBVIEW2_SHARED_BUFFER_ACCESS access,
    in LPCWSTR additionalDataAsJson);
}

/// This is an extension of the ICoreWebView2Frame interface that provides the `FrameId` property.
const GUID IID_ICoreWebView2Frame5 = ICoreWebView2Frame5.iid;

interface ICoreWebView2Frame5 : ICoreWebView2Frame4
{
    static const GUID iid = { 0x99d199c4,0x7305,0x11ee,[ 0xb9,0x62,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// The unique identifier of the current frame. It's the same kind of ID as
  /// with the `FrameId` in `CoreWebView2` and via `CoreWebView2FrameInfo`.
  @(" propget")
	HRESULT get_FrameId(@("out, retval") UINT32* id);
}

/// Receives `PermissionRequested` events for iframes.
const GUID IID_ICoreWebView2FramePermissionRequestedEventHandler = ICoreWebView2FramePermissionRequestedEventHandler.iid;

interface ICoreWebView2FramePermissionRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0x845d0edd,0x8bd8,0x429b,[ 0x99,0x15,0x48,0x21,0x78,0x9f,0x23,0xe9 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Frame sender,
      /+[in]+/ ICoreWebView2PermissionRequestedEventArgs2 args);
}

/// This is a continuation of the `ICoreWebView2PermissionRequestedEventArgs` interface.
const GUID IID_ICoreWebView2PermissionRequestedEventArgs2 = ICoreWebView2PermissionRequestedEventArgs2.iid;

interface ICoreWebView2PermissionRequestedEventArgs2 : ICoreWebView2PermissionRequestedEventArgs
{
    static const GUID iid = { 0x74d7127f,0x9de6,0x4200,[ 0x87,0x34,0x42,0xd6,0xfb,0x4f,0xf7,0x41 ] };
  /// By default, both the `PermissionRequested` event handlers on the
  /// `CoreWebView2Frame` and the `CoreWebView2` will be invoked, with the
  /// `CoreWebView2Frame` event handlers invoked first. The host may
  /// set this flag to `TRUE` within the `CoreWebView2Frame` event handlers
  /// to prevent the remaining `CoreWebView2` event handlers from being invoked.
  ///
  /// If a deferral is taken on the event args, then you must synchronously
  /// set `Handled` to TRUE prior to taking your deferral to prevent the
  /// `CoreWebView2`s event handlers from being invoked.
  @(" propget")
	HRESULT get_Handled(@("out, retval") BOOL* handled);

  /// Sets the `Handled` property.
  @(" propput")
	HRESULT put_Handled(in BOOL handled);
}

/// Represents a context menu item of a context menu displayed by WebView.
const GUID IID_ICoreWebView2ContextMenuItem = ICoreWebView2ContextMenuItem.iid;

interface ICoreWebView2ContextMenuItem : IUnknown
{
    static const GUID iid = { 0x7aed49e3,0xa93f,0x497a,[ 0x81,0x1c,0x74,0x9c,0x6b,0x6b,0x6c,0x65 ] };
  /// Gets the unlocalized name for the `ContextMenuItem`. Use this to
  /// distinguish between context menu item types. This will be the English
  /// label of the menu item in lower camel case. For example, the "Save as"
  /// menu item will be "saveAs". Extension menu items will be "extension",
  /// custom menu items will be "custom" and spellcheck items will be
  /// "spellCheck".
  /// Some example context menu item names are:
  /// - "saveAs"
  /// - "copyImage"
  /// - "openLinkInNewWindow"
  /// - "cut"
  /// - "copy"
  /// - "paste"
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Name(@("out, retval") LPWSTR* value);

  /// Gets the localized label for the `ContextMenuItem`. Will contain an
  /// ampersand for characters to be used as keyboard accelerator.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Label(@("out, retval") LPWSTR* value);

  /// Gets the Command ID for the `ContextMenuItem`. Use this to report the
  /// `SelectedCommandId` in `ContextMenuRequested` event.
  @(" propget")
	HRESULT get_CommandId(@("out, retval") INT32* value);

  /// Gets the localized keyboard shortcut for this ContextMenuItem. It will be
  /// the empty string if there is no keyboard shortcut. This is text intended
  /// to be displayed to the end user to show the keyboard shortcut. For example
  /// this property is Ctrl+Shift+I for the "Inspect" `ContextMenuItem`.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ShortcutKeyDescription(@("out, retval") LPWSTR* value);

  /// Gets the Icon for the `ContextMenuItem` in PNG, Bitmap or SVG formats in the form of an IStream.
  /// Stream will be rewound to the start of the image data.
  @(" propget")
	HRESULT get_Icon(@("out, retval") IStream** value);

  /// Gets the `ContextMenuItem` kind.
  @(" propget")
	HRESULT get_Kind(@("out, retval") COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND* value);

  /// Sets the enabled property of the `ContextMenuItem`. Must only be used in the case of a
  /// custom context menu item. The default value for this is `TRUE`.
  @(" propput")
	HRESULT put_IsEnabled(in BOOL value);

  /// Gets the enabled property of the `ContextMenuItem`.
  @(" propget")
	HRESULT get_IsEnabled(@("out, retval") BOOL* value);

  /// Sets the checked property of the `ContextMenuItem`. Must only be used for custom context
  /// menu items that are of kind Check box or Radio.
  @(" propput")
	HRESULT put_IsChecked(in BOOL value);

  /// Gets the checked property of the `ContextMenuItem`, used if the kind is Check box or Radio.
  @(" propget")
	HRESULT get_IsChecked(@("out, retval") BOOL* value);

  /// Gets the list of children menu items through a `ContextMenuItemCollection`
  /// if the kind is Submenu. If the kind is not submenu, will return null.
  @(" propget")
	HRESULT get_Children(@("out, retval") ICoreWebView2ContextMenuItemCollection * value);

  /// Add an event handler for the `CustomItemSelected` event.
  /// `CustomItemSelected` event is raised when the user selects this `ContextMenuItem`.
  /// Will only be raised for end developer created context menu items
  HRESULT add_CustomItemSelected(
      /+[in]+/ ICoreWebView2CustomItemSelectedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Remove an event handler previously added with `add_CustomItemSelected`.
  HRESULT remove_CustomItemSelected(
      in EventRegistrationToken token);
}

/// Represents a collection of `ContextMenuItem` objects. Used to get, remove and add
/// `ContextMenuItem` objects at the specified index.
const GUID IID_ICoreWebView2ContextMenuItemCollection = ICoreWebView2ContextMenuItemCollection.iid;

interface ICoreWebView2ContextMenuItemCollection : IUnknown
{
    static const GUID iid = { 0xf562a2f5,0xc415,0x45cf,[ 0xb9,0x09,0xd4,0xb7,0xc1,0xe2,0x76,0xd3 ] };
  /// Gets the number of `ContextMenuItem` objects contained in the `ContextMenuItemCollection`.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT32* value);

  /// Gets the `ContextMenuItem` at the specified index.
  HRESULT GetValueAtIndex(in UINT32 index,
      @("out, retval") ICoreWebView2ContextMenuItem * value);

  /// Removes the `ContextMenuItem` at the specified index.
  HRESULT RemoveValueAtIndex(in UINT32 index);

  /// Inserts the `ContextMenuItem` at the specified index.
  HRESULT InsertValueAtIndex(
      in UINT32 index,
        /+[in]+/ ICoreWebView2ContextMenuItem value);
}

/// Receives `ContextMenuRequested` events.
const GUID IID_ICoreWebView2ContextMenuRequestedEventHandler = ICoreWebView2ContextMenuRequestedEventHandler.iid;

interface ICoreWebView2ContextMenuRequestedEventHandler : IUnknown
{
    static const GUID iid = { 0x04d3fe1d,0xab87,0x42fb,[ 0xa8,0x98,0xda,0x24,0x1d,0x35,0xb6,0x3c ] };
  /// Called to provide the event args when a context menu is requested on a
  /// WebView element.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2ContextMenuRequestedEventArgs args);
}

/// Raised to notify the host that the end user selected a custom
/// `ContextMenuItem`. `CustomItemSelected` event is raised on the specific
/// `ContextMenuItem` that the end user selected.
const GUID IID_ICoreWebView2CustomItemSelectedEventHandler = ICoreWebView2CustomItemSelectedEventHandler.iid;

interface ICoreWebView2CustomItemSelectedEventHandler : IUnknown
{
    static const GUID iid = { 0x49e1d0bc,0xfe9e,0x4481,[ 0xb7,0xc2,0x32,0x32,0x4a,0xa2,0x19,0x98 ] };
  /// Provides the event args for the corresponding event. No event args exist
  /// and the `args` parameter is set to `null`.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2ContextMenuItem sender, /+[in]+/ IUnknown args);
}

/// Represents the information regarding the context menu target.
/// Includes the context selected and the appropriate data used for the actions of a context menu.
const GUID IID_ICoreWebView2ContextMenuTarget = ICoreWebView2ContextMenuTarget.iid;

interface ICoreWebView2ContextMenuTarget : IUnknown
{
    static const GUID iid = { 0xb8611d99,0xeed6,0x4f3f,[ 0x90,0x2c,0xa1,0x98,0x50,0x2a,0xd4,0x72 ] };
  /// Gets the kind of context that the user selected.
  @(" propget")
	HRESULT get_Kind(@("out, retval") COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND* value);

  /// Returns TRUE if the context menu is requested on an editable component.
  @(" propget")
	HRESULT get_IsEditable(@("out, retval") BOOL* value);

  /// Returns TRUE if the context menu was requested on the main frame and
  /// FALSE if invoked on another frame.
  @(" propget")
	HRESULT get_IsRequestedForMainFrame(@("out, retval") BOOL* value);

  /// Gets the uri of the page.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_PageUri(@("out, retval") LPWSTR* value);

  /// Gets the uri of the frame. Will match the PageUri if `IsRequestedForMainFrame` is TRUE.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_FrameUri(@("out, retval") LPWSTR* value);

  /// Returns TRUE if the context menu is requested on HTML containing an anchor tag.
  @(" propget")
	HRESULT get_HasLinkUri(@("out, retval") BOOL* value);

  /// Gets the uri of the link (if `HasLinkUri` is TRUE, null otherwise).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_LinkUri(@("out, retval") LPWSTR* value);

  /// Returns TRUE if the context menu is requested on text element that contains an anchor tag.
  @(" propget")
	HRESULT get_HasLinkText(@("out, retval") BOOL* value);

  /// Gets the text of the link (if `HasLinkText` is TRUE, null otherwise).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_LinkText(@("out, retval") LPWSTR * value);

  /// Returns TRUE if the context menu is requested on HTML containing a source uri.
  @(" propget")
	HRESULT get_HasSourceUri(@("out, retval") BOOL* value);

  /// Gets the active source uri of element (if `HasSourceUri` is TRUE, null otherwise).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_SourceUri(@("out, retval") LPWSTR* value);

  /// Returns TRUE if the context menu is requested on a selection.
  @(" propget")
	HRESULT get_HasSelection(@("out, retval") BOOL* value);

  /// Gets the selected text (if `HasSelection` is TRUE, null otherwise).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_SelectionText(@("out, retval") LPWSTR* value);
}

/// Event args for the `ContextMenuRequested` event. Will contain the selection information
/// and a collection of all of the default context menu items that the WebView
/// would show. Allows the app to draw its own context menu or add/remove
/// from the default context menu.
const GUID IID_ICoreWebView2ContextMenuRequestedEventArgs = ICoreWebView2ContextMenuRequestedEventArgs.iid;

interface ICoreWebView2ContextMenuRequestedEventArgs : IUnknown
{
    static const GUID iid = { 0xa1d309ee,0xc03f,0x11eb,[ 0x85,0x29,0x02,0x42,0xac,0x13,0x00,0x03 ] };
  /// Gets the collection of `ContextMenuItem` objects.
  /// See `ICoreWebView2ContextMenuItemCollection` for more details.
  @(" propget")
	HRESULT get_MenuItems(@("out, retval") ICoreWebView2ContextMenuItemCollection * value);

  /// Gets the target information associated with the requested context menu.
  /// See `ICoreWebView2ContextMenuTarget` for more details.
  @(" propget")
	HRESULT get_ContextMenuTarget(@("out, retval") ICoreWebView2ContextMenuTarget * value);

  /// Gets the coordinates where the context menu request occurred in relation to the upper
  /// left corner of the WebView bounds.
  @(" propget")
	HRESULT get_Location(@("out, retval") POINT* value);

  /// Sets the selected context menu item's command ID. When this is set,
  /// WebView will execute the selected command. This
  /// value should always be obtained via the selected `ContextMenuItem`'s `CommandId` property.
  /// The default value is -1 which means that no selection occurred. The app can
  /// also report the selected command ID for a custom context menu item, which
  /// will cause the `CustomItemSelected` event to be fired for the custom item, however
  /// while command IDs for each custom context menu item is unique
  /// during a ContextMenuRequested event, CoreWebView2 may reassign command ID
  /// values of deleted custom ContextMenuItems to new objects and the command
  /// ID assigned to the same custom item can be different between each app runtime.
  @(" propput")
	HRESULT put_SelectedCommandId(in INT32 value);

  /// Gets the selected CommandId.
  @(" propget")
	HRESULT get_SelectedCommandId(@("out, retval") INT32* value);

  /// Sets whether the `ContextMenuRequested` event is handled by host after
  /// the event handler completes or if there is a deferral then after the deferral is completed.
  /// If `Handled` is set to TRUE then WebView will not display a context menu and will instead
  /// use the `SelectedCommandId` property to indicate which, if any, context menu item command to invoke.
  /// If after the event handler or deferral completes `Handled` is set to FALSE then WebView
  /// will display a context menu based on the contents of the `MenuItems` property.
  /// The default value is FALSE.
  @(" propput")
	HRESULT put_Handled(in BOOL value);

  /// Gets whether the `ContextMenuRequested` event is handled by host.
  @(" propget")
	HRESULT get_Handled(@("out, retval") BOOL* value);

  /// Returns an `ICoreWebView2Deferral` object. Use this operation to
  /// complete the event when the custom context menu is closed.
  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);
}

/// This interface is used to manage profile options that created by 'CreateCoreWebView2ControllerOptions'.
///
/// \snippet AppWindow.cpp CreateControllerWithOptions
const GUID IID_ICoreWebView2ControllerOptions = ICoreWebView2ControllerOptions.iid;

interface ICoreWebView2ControllerOptions : IUnknown
{
    static const GUID iid = { 0x12aae616,0x8ccb,0x44ec,[ 0xbc,0xb3,0xeb,0x18,0x31,0x88,0x16,0x35 ] };
  /// `ProfileName` property is to specify a profile name, which is only allowed to contain
  /// the following ASCII characters. It has a maximum length of 64 characters excluding the null-terminator.
  /// It is ASCII case insensitive.
  ///
  /// * alphabet characters: a-z and A-Z
  /// * digit characters: 0-9
  /// * and '#', '@', '$', '(', ')', '+', '-', '_', '~', '.', ' ' (space).
  ///
  /// Note: the text must not end with a period '.' or ' ' (space). And, although upper-case letters are
  /// allowed, they're treated just as lower-case counterparts because the profile name will be mapped to
  /// the real profile directory path on disk and Windows file system handles path names in a case-insensitive way.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ProfileName(@("out, retval") LPWSTR* value);
  /// Sets the `ProfileName` property.
  @(" propput")
	HRESULT put_ProfileName(in LPCWSTR value);

  /// `IsInPrivateModeEnabled` property is to enable/disable InPrivate mode.
  @(" propget")
	HRESULT get_IsInPrivateModeEnabled(@("out, retval") BOOL* value);
  /// Sets the `IsInPrivateModeEnabled` property.
  @(" propput")
	HRESULT put_IsInPrivateModeEnabled(in BOOL value);
}

/// Provides a set of properties to configure a Profile object.
///
/// \snippet AppWindow.cpp OnCreateCoreWebView2ControllerCompleted
const GUID IID_ICoreWebView2Profile = ICoreWebView2Profile.iid;

interface ICoreWebView2Profile : IUnknown
{
    static const GUID iid = { 0x79110ad3,0xcd5d,0x4373,[ 0x8b,0xc3,0xc6,0x06,0x58,0xf1,0x7a,0x5f ] };
  /// Name of the profile.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ProfileName(@("out, retval") LPWSTR* value);

  /// InPrivate mode is enabled or not.
  @(" propget")
	HRESULT get_IsInPrivateModeEnabled(@("out, retval") BOOL* value);

  /// Full path of the profile directory.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_ProfilePath(@("out, retval") LPWSTR* value);

  /// Gets the `DefaultDownloadFolderPath` property. The default value is the
  /// system default download folder path for the user.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_DefaultDownloadFolderPath(@("out, retval") LPWSTR* value);

  /// Sets the `DefaultDownloadFolderPath` property. The default download folder
  /// path is persisted in the user data folder across sessions. The value
  /// should be an absolute path to a folder that the user and application can
  /// write to. Returns `E_INVALIDARG` if the value is invalid, and the default
  /// download folder path is not changed. Otherwise the path is changed
  /// immediately. If the directory does not yet exist, it is created at the
  /// time of the next download. If the host application does not have
  /// permission to create the directory, then the user is prompted to provide a
  /// new path through the Save As dialog. The user can override the default
  /// download folder path for a given download by choosing a different path in
  /// the Save As dialog.
  @(" propput")
	HRESULT put_DefaultDownloadFolderPath(in LPCWSTR value);

  /// The PreferredColorScheme property sets the overall color scheme of the
  /// WebView2s associated with this profile. This sets the color scheme for
  /// WebView2 UI like dialogs, prompts, and context menus by setting the
  /// media feature `prefers-color-scheme` for websites to respond to.
  ///
  /// The default value for this is COREWEBVIEW2_PREFERRED_COLOR_AUTO,
  /// which will follow whatever theme the OS is currently set to.
  ///
  /// \snippet ViewComponent.cpp SetPreferredColorScheme
  /// Returns the value of the `PreferredColorScheme` property.
  @(" propget")
	HRESULT get_PreferredColorScheme(
    @("out, retval") COREWEBVIEW2_PREFERRED_COLOR_SCHEME* value);

  /// Sets the `PreferredColorScheme` property.
  @(" propput")
	HRESULT put_PreferredColorScheme(
    in COREWEBVIEW2_PREFERRED_COLOR_SCHEME value);
}

/// Provides access to the certificate metadata.
const GUID IID_ICoreWebView2Certificate = ICoreWebView2Certificate.iid;

interface ICoreWebView2Certificate : IUnknown
{
    static const GUID iid = { 0xC5FB2FCE,0x1CAC,0x4AEE,[ 0x9C,0x79,0x5E,0xD0,0x36,0x2E,0xAA,0xE0 ] };
  /// Subject of the certificate.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Subject(@("out, retval") LPWSTR* value);
  /// Name of the certificate authority that issued the certificate.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_Issuer(@("out, retval") LPWSTR* value);
  /// The valid start date and time for the certificate as the number of seconds since
  /// the UNIX epoch.
  @(" propget")
	HRESULT get_ValidFrom(@("out, retval") double* value);
  /// The valid expiration date and time for the certificate as the number of seconds since
  /// the UNIX epoch.
  @(" propget")
	HRESULT get_ValidTo(@("out, retval") double* value);
  /// Base64 encoding of DER encoded serial number of the certificate.
  /// Read more about DER at [RFC 7468 DER]
  /// (https://tools.ietf.org/html/rfc7468#appendix-B).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_DerEncodedSerialNumber(@("out, retval") LPWSTR* value);
  /// Display name for a certificate.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings)
  @(" propget")
	HRESULT get_DisplayName(@("out, retval") LPWSTR* value);
  /// PEM encoded data for the certificate.
  /// Returns Base64 encoding of DER encoded certificate.
  /// Read more about PEM at [RFC 1421 Privacy Enhanced Mail]
  /// (https://tools.ietf.org/html/rfc1421).
  ///
  /// The caller must free the returned string with `CoTaskMemFree`. See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings)
  HRESULT ToPemEncoding(@("out, retval") LPWSTR* pemEncodedData);
  /// Collection of PEM encoded certificate issuer chain.
  /// In this collection first element is the current certificate followed by
  /// intermediate1, intermediate2...intermediateN-1. Root certificate is the
  /// last element in collection.
  @(" propget")
	HRESULT get_PemEncodedIssuerCertificateChain(@("out, retval")
      ICoreWebView2StringCollection * value);
}

/// An event handler for the `ServerCertificateErrorDetected` event.
const GUID IID_ICoreWebView2ServerCertificateErrorDetectedEventHandler = ICoreWebView2ServerCertificateErrorDetectedEventHandler.iid;

interface ICoreWebView2ServerCertificateErrorDetectedEventHandler : IUnknown
{
    static const GUID iid = { 0x969B3A26,0xD85E,0x4795,[ 0x81,0x99,0xFE,0xF5,0x73,0x44,0xDA,0x22 ] };
  /// Provides the event args for the corresponding event.
  HRESULT Invoke(/+[in]+/ ICoreWebView2 sender,
      /+[in]+/ ICoreWebView2ServerCertificateErrorDetectedEventArgs
                     args);
}

/// Event args for the `ServerCertificateErrorDetected` event.
const GUID IID_ICoreWebView2ServerCertificateErrorDetectedEventArgs = ICoreWebView2ServerCertificateErrorDetectedEventArgs.iid;

interface ICoreWebView2ServerCertificateErrorDetectedEventArgs : IUnknown
{
    static const GUID iid = { 0x012193ED,0x7C13,0x48FF,[ 0x96,0x9D,0xA8,0x4C,0x1F,0x43,0x2A,0x14 ] };
  /// The TLS error code for the invalid certificate.
  @(" propget")
	HRESULT get_ErrorStatus(@("out, retval") COREWEBVIEW2_WEB_ERROR_STATUS* value);

  /// URI associated with the request for the invalid certificate.
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  @(" propget")
	HRESULT get_RequestUri(@("out, retval") LPWSTR* value);

  /// Returns the server certificate.
  @(" propget")
	HRESULT get_ServerCertificate(@("out, retval") ICoreWebView2Certificate * value);

  /// The action of the server certificate error detection.
  /// The default value is `COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_DEFAULT`.
  @(" propget")
	HRESULT get_Action(@("out, retval") COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION* value);

  /// Sets the `Action` property.
  @(" propput")
	HRESULT put_Action(in COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION value);

  /// Returns an `ICoreWebView2Deferral` object. Use this operation to
  /// complete the event at a later time.
  HRESULT GetDeferral(@("out, retval") ICoreWebView2Deferral * deferral);
}

/// Receives the result of the `ClearServerCertificateErrorActions` method.
const GUID IID_ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler = ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler.iid;

interface ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler : IUnknown
{
    static const GUID iid = { 0x3B40AAC6,0xACFE,0x4FFD,[ 0x82,0x11,0xF6,0x07,0xB9,0x6E,0x2D,0x5B ] };
  /// Provides the result of the corresponding asynchronous method.
  HRESULT Invoke(in HRESULT errorCode);
}

/// Profile2 interface.
///
const GUID IID_ICoreWebView2Profile2 = ICoreWebView2Profile2.iid;

interface ICoreWebView2Profile2 : ICoreWebView2Profile
{
    static const GUID iid = { 0xfa740d4b,0x5eae,0x4344,[ 0xa8,0xad,0x74,0xbe,0x31,0x92,0x53,0x97 ] };

  /// Clear browsing data based on a data type. This method takes two parameters,
  /// the first being a mask of one or more `COREWEBVIEW2_BROWSING_DATA_KINDS`. OR
  /// operation(s) can be applied to multiple `COREWEBVIEW2_BROWSING_DATA_KINDS` to
  /// create a mask representing those data types. The browsing data kinds that are
  /// supported are listed below. These data kinds follow a hierarchical structure in
  /// which nested bullet points are included in their parent bullet point's data kind.
  /// Ex: All DOM storage is encompassed in all site data which is encompassed in
  /// all profile data.
  /// * All Profile
  ///   * All Site Data
  ///     * All DOM Storage: File Systems, Indexed DB, Local Storage, Web SQL, Cache
  ///         Storage
  ///     * Cookies
  ///   * Disk Cache
  ///   * Download History
  ///   * General Autofill
  ///   * Password Autosave
  ///   * Browsing History
  ///   * Settings
  /// The completed handler will be invoked when the browsing data has been cleared and
  /// will indicate if the specified data was properly cleared. In the case in which
  /// the operation is interrupted and the corresponding data is not fully cleared
  /// the handler will return `E_ABORT` and otherwise will return `S_OK`.
  /// Because this is an asynchronous operation, code that is dependent on the cleared
  /// data must be placed in the callback of this operation.
  /// If the WebView object is closed before the clear browsing data operation
  /// has completed, the handler will be released, but not invoked. In this case
  /// the clear browsing data operation may or may not be completed.
  /// ClearBrowsingData clears the `dataKinds` regardless of timestamp.

  HRESULT ClearBrowsingData(
      in COREWEBVIEW2_BROWSING_DATA_KINDS dataKinds,
      /+[in]+/ ICoreWebView2ClearBrowsingDataCompletedHandler handler);

  /// ClearBrowsingDataInTimeRange behaves like ClearBrowsingData except that it
  /// takes in two additional parameters for the start and end time for which it
  /// should clear the data between.  The `startTime` and `endTime`
  /// parameters correspond to the number of seconds since the UNIX epoch.
  /// `startTime` is inclusive while `endTime` is exclusive, therefore the data will
  /// be cleared between [startTime, endTime).

  HRESULT ClearBrowsingDataInTimeRange(
      in COREWEBVIEW2_BROWSING_DATA_KINDS dataKinds,
      in double startTime,
      in double endTime,
      /+[in]+/ ICoreWebView2ClearBrowsingDataCompletedHandler handler);

  /// ClearBrowsingDataAll behaves like ClearBrowsingData except that it
  /// clears the entirety of the data associated with the profile it is called on.
  /// It clears the data regardless of timestamp.
  ///
  /// \snippet AppWindow.cpp ClearBrowsingData

  HRESULT ClearBrowsingDataAll(
    /+[in]+/ ICoreWebView2ClearBrowsingDataCompletedHandler handler);
}

/// The caller implements this interface to receive the ClearBrowsingData result.
const GUID IID_ICoreWebView2ClearBrowsingDataCompletedHandler = ICoreWebView2ClearBrowsingDataCompletedHandler.iid;

interface ICoreWebView2ClearBrowsingDataCompletedHandler : IUnknown
{
    static const GUID iid = { 0xe9710a06,0x1d1d,0x49b2,[ 0x82,0x34,0x22,0x6f,0x35,0x84,0x6a,0xe5 ] };

  /// Provide the completion status of the corresponding asynchronous method.
  HRESULT Invoke(in HRESULT errorCode);
}

/// This is an extension of the ICoreWebView2Profile interface to control levels of tracking prevention.
const GUID IID_ICoreWebView2Profile3 = ICoreWebView2Profile3.iid;

interface ICoreWebView2Profile3 : ICoreWebView2Profile2
{
    static const GUID iid = { 0xB188E659,0x5685,0x4E05,[ 0xBD,0xBA,0xFC,0x64,0x0E,0x0F,0x19,0x92 ] };
  /// The `PreferredTrackingPreventionLevel` property allows you to control levels of tracking prevention for WebView2
  /// which are associated with a profile. This level would apply to the context of the profile. That is, all WebView2s
  /// sharing the same profile will be affected and also the value is persisted in the user data folder.
  ///
  /// See `COREWEBVIEW2_TRACKING_PREVENTION_LEVEL` for descriptions of levels.
  ///
  /// If tracking prevention feature is enabled when creating the WebView2 environment, you can also disable tracking
  /// prevention later using this property and `COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_NONE` value but that doesn't
  /// improves runtime performance.
  ///
  /// There is `ICoreWebView2EnvironmentOptions5::EnableTrackingPrevention` property to enable/disable tracking prevention feature
  /// for all the WebView2's created in the same environment. If enabled, `PreferredTrackingPreventionLevel` is set to
  /// `COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BALANCED` by default for all the WebView2's and profiles created in the same
  /// environment or is set to the level whatever value was last changed/persisted to the profile. If disabled
  /// `PreferredTrackingPreventionLevel` is not respected by WebView2. If `PreferredTrackingPreventionLevel` is set when the
  /// feature is disabled, the property value get changed and persisted but it will takes effect only if
  /// `ICoreWebView2EnvironmentOptions5::EnableTrackingPrevention` is true.
  ///
  /// See `ICoreWebView2EnvironmentOptions5::EnableTrackingPrevention` for more details.
  /// \snippet SettingsComponent.cpp SetTrackingPreventionLevel
  @(" propget")
	HRESULT get_PreferredTrackingPreventionLevel(
      @("out, retval") COREWEBVIEW2_TRACKING_PREVENTION_LEVEL* value);
  /// Set the `PreferredTrackingPreventionLevel` property.
  ///
  /// If `ICoreWebView2EnvironmentOptions5::EnableTrackingPrevention` is false, this property will be changed and persisted
  /// to the profile but the WebView2 ignores the level silently.
  @(" propput")
	HRESULT put_PreferredTrackingPreventionLevel(
      in COREWEBVIEW2_TRACKING_PREVENTION_LEVEL value);
}

/// This interface is a handler for when the `Favicon` is changed.
/// The sender is the ICoreWebView2 object the top-level document of
/// which has changed favicon and the eventArgs is nullptr. Use the
/// FaviconUri property and GetFavicon method to obtain the favicon
/// data. The second argument is always null.
/// For more information see `add_FaviconChanged`.
const GUID IID_ICoreWebView2FaviconChangedEventHandler = ICoreWebView2FaviconChangedEventHandler.iid;

interface ICoreWebView2FaviconChangedEventHandler : IUnknown
{
    static const GUID iid = { 0x2913DA94,0x833D,0x4DE0,[ 0x8D,0xCA,0x90,0x0F,0xC5,0x24,0xA1,0xA4 ] };
  /// Called to notify the favicon changed. The event args are always null.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2 sender,
      /+[in]+/ IUnknown args);
}

/// This interface is a handler for the completion of the population of
/// `imageStream`.
/// `errorCode` returns S_OK if the API succeeded.
/// The image is returned in the `faviconStream` object. If there is no image
/// then no data would be copied into the imageStream.
/// For more details, see the `GetFavicon` API.
const GUID IID_ICoreWebView2GetFaviconCompletedHandler = ICoreWebView2GetFaviconCompletedHandler.iid;

interface ICoreWebView2GetFaviconCompletedHandler : IUnknown
{
    static const GUID iid = { 0xA2508329,0x7DA8,0x49D7,[ 0x8C,0x05,0xFA,0x12,0x5E,0x4A,0xEE,0x8D ] };
  /// Called to notify the favicon has been retrieved.
  HRESULT Invoke(
      in HRESULT errorCode,
      in IStream* faviconStream);
}

/// Represents the registration of a custom scheme with the
/// CoreWebView2Environment.
/// This allows the WebView2 app to be able to handle WebResourceRequested
/// event for requests with the specified scheme and be able to navigate the
/// WebView2 to the custom scheme. Once the environment is created, the
/// registrations are valid and immutable throughout the lifetime of the
/// associated WebView2s' browser process and any WebView2 environments
/// sharing the browser process must be created with identical custom scheme
/// registrations, otherwise the environment creation will fail.
/// Any further attempts to register the same scheme will fail during environment creation.
/// The URIs of registered custom schemes will be treated similar to http
/// URIs for their origins.
/// They will have tuple origins for URIs with host and opaque origins for
/// URIs without host as specified in
/// [7.5 Origin - HTML Living Standard](https://html.spec.whatwg.org/multipage/origin.html)
///
/// Example:
/// `custom-scheme-with-host://hostname/path/to/resource` has origin of
/// `custom-scheme-with-host://hostname`.
/// `custom-scheme-without-host:path/to/resource` has origin of
/// `custom-scheme-without-host:path/to/resource`.
/// For WebResourceRequested event, the cases of request URIs and filter URIs
/// with custom schemes will be normalized according to generic URI syntax
/// rules. Any non-ASCII characters will be preserved.
/// The registered custom schemes also participate in
/// [CORS](https://developer.mozilla.org/docs/Web/HTTP/CORS) and
/// adheres to [CSP](https://developer.mozilla.org/docs/Web/HTTP/CSP).
/// The app needs to set the appropriate access headers in its
/// WebResourceRequested event handler to allow CORS requests.
/// \snippet AppWindow.cpp CoreWebView2CustomSchemeRegistration
const GUID IID_ICoreWebView2CustomSchemeRegistration = ICoreWebView2CustomSchemeRegistration.iid;

interface ICoreWebView2CustomSchemeRegistration : IUnknown
{
    static const GUID iid = { 0xd60ac92c,0x37a6,0x4b26,[ 0xa3,0x9e,0x95,0xcf,0xe5,0x90,0x47,0xbb ] };
  /// The name of the custom scheme to register.
  @(" propget")
	HRESULT get_SchemeName(@("out, retval") LPWSTR* schemeName);

  /// Whether the sites with this scheme will be treated as a
  /// [Secure Context](https://developer.mozilla.org/docs/Web/Security/Secure_Contexts)
  /// like an HTTPS site. This flag is only effective when HasAuthorityComponent
  /// is also set to `true`.
  /// `false` by default.
  @(" propget")
	HRESULT get_TreatAsSecure(@("out, retval") BOOL* treatAsSecure);
  /// Set if the scheme will be treated as a Secure Context.
  @(" propput")
	HRESULT put_TreatAsSecure(in BOOL value);

  /// List of origins that are allowed to issue requests with the custom
  /// scheme, such as XHRs and subresource requests that have an Origin header.
  /// The origin of any request (requests that have the
  /// [Origin header](https://developer.mozilla.org/docs/Web/HTTP/Headers/Origin))
  /// to the custom scheme URI needs to be in this list. No-origin requests
  /// are requests that do not have an Origin header, such as link
  /// navigations, embedded images and are always allowed.
  /// Note: POST requests always contain an Origin header, therefore
  /// AllowedOrigins must be set for even for same origin POST requests.
  /// Note that cross-origin restrictions still apply.
  /// From any opaque origin (Origin header is null), no cross-origin requests
  /// are allowed.
  /// If the list is empty, no cross-origin request to this scheme is
  /// allowed.
  /// Origins are specified as a string in the format of
  /// scheme://host:port.
  /// The origins are string pattern matched with `*` (matches 0 or more
  /// characters) and `?` (matches 0 or 1 character) wildcards just like
  /// the URI matching in the
  /// [AddWebResourceRequestedFilter API](/dotnet/api/microsoft.web.webview2.core.corewebview2.addwebresourcerequestedfilter).
  /// For example, "http://*.example.com:80".
  /// Here's a set of examples of what is allowed and not:
  ///
  /// | Request URI | Originating URL | AllowedOrigins | Allowed |
  /// | -- | -- | -- | -- |
  /// | `custom-scheme:request` | `https://www.example.com` | {"https://www.example.com"} | Yes |
  /// | `custom-scheme:request` | `https://www.example.com` | {"https://*.example.com"} | Yes |
  /// | `custom-scheme:request` | `https://www.example.com` | {"https://www.example2.com"} | No |
  /// | `custom-scheme-with-authority://host/path` | `custom-scheme-with-authority://host2` | {""} | No |
  /// | `custom-scheme-with-authority://host/path` | `custom-scheme-with-authority2://host` | {"custom-scheme-with-authority2://*"} | Yes |
  /// | `custom-scheme-without-authority:path` | custom-scheme-without-authority:path2 | {"custom-scheme-without-authority:*"} | No |
  /// | `custom-scheme-without-authority:path` | custom-scheme-without-authority:path2 | {"*"} | Yes |
  ///
  /// The returned strings and the array itself must be deallocated with
  /// CoTaskMemFree.
  HRESULT GetAllowedOrigins(
    @("out") UINT32* allowedOriginsCount,
    @("out") LPWSTR** allowedOrigins);
  /// Set the array of origins that are allowed to use the scheme.
  HRESULT SetAllowedOrigins(
    in UINT32 allowedOriginsCount,
    in LPCWSTR* allowedOrigins);

  /// Set this property to `true` if the URIs with this custom
  /// scheme will have an authority component (a host for custom schemes).
  /// Specifically, if you have a URI of the following form you should set the
  /// `HasAuthorityComponent` value as listed.
  ///
  /// | URI | Recommended HasAuthorityComponent value |
  /// | -- | -- |
  /// | `custom-scheme-with-authority://host/path` | `true` |
  /// | `custom-scheme-without-authority:path` | `false` |
  ///
  /// When this property is set to `true`, the URIs with this scheme will be
  /// interpreted as having a
  /// [scheme and host](https://html.spec.whatwg.org/multipage/origin.html#concept-origin-tuple)
  /// origin similar to an http URI. Note that the port and user
  /// information are never included in the computation of origins for
  /// custom schemes.
  /// If this property is set to `false`, URIs with this scheme will have an
  /// [opaque origin](https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque)
  /// similar to a data URI.
  /// This property is `false` by default.
  ///
  /// Note: For custom schemes registered as having authority component,
  /// navigations to URIs without authority of such custom schemes will fail.
  /// However, if the content inside WebView2 references
  /// a subresource with a URI that does not have
  /// an authority component, but of a custom scheme that is registered as
  /// having authority component, the URI will be interpreted as a relative path
  /// as specified in [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).
  /// For example, `custom-scheme-with-authority:path` will be interpreted
  /// as `custom-scheme-with-authority://host/path`.
  /// However, this behavior cannot be guaranteed to remain in future
  /// releases so it is recommended not to rely on this behavior.
  @(" propget")
	HRESULT get_HasAuthorityComponent(@("out, retval") BOOL* hasAuthorityComponent);

  /// Get has authority component.
  @(" propput")
	HRESULT put_HasAuthorityComponent(in BOOL  hasAuthorityComponent);
}

/// This is a continuation of the `ICoreWebView2PermissionRequestedEventArgs2`
/// interface.
const GUID IID_ICoreWebView2PermissionRequestedEventArgs3 = ICoreWebView2PermissionRequestedEventArgs3.iid;

interface ICoreWebView2PermissionRequestedEventArgs3 :
    ICoreWebView2PermissionRequestedEventArgs2
{
    static const GUID iid = { 0xe61670bc,0x3dce,0x4177,[ 0x86,0xd2,0xc6,0x29,0xae,0x3c,0xb6,0xac ] };
  /// The permission state set from the `PermissionRequested` event is saved in
  /// the profile by default; it persists across sessions and becomes the new
  /// default behavior for future `PermissionRequested` events. Browser
  /// heuristics can affect whether the event continues to be raised when the
  /// state is saved in the profile. Set the `SavesInProfile` property to
  /// `FALSE` to not persist the state beyond the current request, and to
  /// continue to receive `PermissionRequested`
  /// events for this origin and permission kind.
  @(" propget")
	HRESULT get_SavesInProfile(@("out, retval") BOOL* value);

  /// Sets the `SavesInProfile` property.
  @(" propput")
	HRESULT put_SavesInProfile(in BOOL value);
}

/// The caller implements this interface to handle the result of
/// `SetPermissionState`.
const GUID IID_ICoreWebView2SetPermissionStateCompletedHandler = ICoreWebView2SetPermissionStateCompletedHandler.iid;

interface ICoreWebView2SetPermissionStateCompletedHandler : IUnknown
{
    static const GUID iid = { 0xfc77fb30,0x9c9e,0x4076,[ 0xb8,0xc7,0x76,0x44,0xa7,0x03,0xca,0x1b ] };
  /// Provide the completion status of the corresponding asynchronous method.
  HRESULT Invoke(in HRESULT errorCode);
}

/// The caller implements this interface to handle the result of
/// `GetNonDefaultPermissionSettings`.
const GUID IID_ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler = ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler.iid;

interface ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler : IUnknown
{
    static const GUID iid = { 0x38274481,0xa15c,0x4563,[ 0x94,0xcf,0x99,0x0e,0xdc,0x9a,0xeb,0x95 ] };
  /// Provides the permission setting collection for the requested permission kind.
  HRESULT Invoke(in HRESULT errorCode,
      /+[in]+/ ICoreWebView2PermissionSettingCollectionView collectionView);
}

/// This is the ICoreWebView2Profile interface for the permission management APIs.
const GUID IID_ICoreWebView2Profile4 = ICoreWebView2Profile4.iid;

interface ICoreWebView2Profile4 : ICoreWebView2Profile3
{
    static const GUID iid = { 0x8F4ae680,0x192e,0x4eC8,[ 0x83,0x3a,0x21,0xcf,0xad,0xae,0xf6,0x28 ] };
  /// Sets permission state for the given permission kind and origin
  /// asynchronously. The change persists across sessions until it is changed by
  /// another call to `SetPermissionState`, or by setting the `State` property
  /// in `PermissionRequestedEventArgs`. Setting the state to
  /// `COREWEBVIEW2_PERMISSION_STATE_DEFAULT` will erase any state saved in the
  /// profile and restore the default behavior.
  /// The origin should have a valid scheme and host (e.g. "https://www.example.com"),
  /// otherwise the method fails with `E_INVALIDARG`. Additional URI parts like
  /// path and fragment are ignored. For example, "https://wwww.example.com/app1/index.html/"
  /// is treated the same as "https://wwww.example.com". See the
  /// [MDN origin definition](https://developer.mozilla.org/en-US/docs/Glossary/Origin)
  /// for more details.
  ///
  /// \snippet ScenarioPermissionManagement.cpp SetPermissionState
  HRESULT SetPermissionState(
        in COREWEBVIEW2_PERMISSION_KIND permissionKind,
        in LPCWSTR origin,
        in COREWEBVIEW2_PERMISSION_STATE state,
        /+[in]+/ ICoreWebView2SetPermissionStateCompletedHandler completedHandler);

  /// Invokes the handler with a collection of all nondefault permission settings.
  /// Use this method to get the permission state set in the current and previous
  /// sessions.
  ///
  /// \snippet ScenarioPermissionManagement.cpp GetNonDefaultPermissionSettings
  HRESULT GetNonDefaultPermissionSettings(
      /+[in]+/ ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler completedHandler);
}

/// Read-only collection of `PermissionSetting`s (origin, kind, and state). Used to list
/// the nondefault permission settings on the profile that are persisted across
/// sessions.
const GUID IID_ICoreWebView2PermissionSettingCollectionView = ICoreWebView2PermissionSettingCollectionView.iid;

interface ICoreWebView2PermissionSettingCollectionView : IUnknown
{
    static const GUID iid = { 0xf5596f62,0x3de5,0x47b1,[ 0x91,0xe8,0xa4,0x10,0x4b,0x59,0x6b,0x96 ] };
  /// Gets the `ICoreWebView2PermissionSetting` at the specified index.
  HRESULT GetValueAtIndex(
      in UINT32 index,
      @("out, retval") ICoreWebView2PermissionSetting * permissionSetting);

  /// The number of `ICoreWebView2PermissionSetting`s in the collection.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT32* value);
}

/// Provides a set of properties for a permission setting.
const GUID IID_ICoreWebView2PermissionSetting = ICoreWebView2PermissionSetting.iid;

interface ICoreWebView2PermissionSetting : IUnknown
{
    static const GUID iid = { 0x792b6eca,0x5576,0x421c,[ 0x91,0x19,0x74,0xeb,0xb3,0xa4,0xff,0xb3 ] };
  /// The kind of the permission setting. See `COREWEBVIEW2_PERMISSION_KIND` for
  /// more details.
  @(" propget")
	HRESULT get_PermissionKind(
      @("out, retval") COREWEBVIEW2_PERMISSION_KIND* value);

  /// The origin of the permission setting.
  @(" propget")
	HRESULT get_PermissionOrigin(@("out, retval") LPWSTR* value);

  /// The state of the permission setting.
  @(" propget")
	HRESULT get_PermissionState(
      @("out, retval") COREWEBVIEW2_PERMISSION_STATE* value);
}

/// This is the interface in ControllerOptions for ScriptLocale.
const GUID IID_ICoreWebView2ControllerOptions2 = ICoreWebView2ControllerOptions2.iid;

interface ICoreWebView2ControllerOptions2 : ICoreWebView2ControllerOptions
{
    static const GUID iid = { 0x06c991d8,0x9e7e,0x11ed,[ 0xa8,0xfc,0x02,0x42,0xac,0x12,0x00,0x02 ] };
  /// The default locale for the WebView2.  It sets the default locale for all
  /// Intl JavaScript APIs and other JavaScript APIs that depend on it, namely
  /// `Intl.DateTimeFormat()` which affects string formatting like
  /// in the time/date formats. Example: `Intl.DateTimeFormat().format(new Date())`
  /// The intended locale value is in the format of
  /// BCP 47 Language Tags. More information can be found from
  /// [IETF BCP47](https://www.ietf.org/rfc/bcp/bcp47.html).
  ///
  /// This property sets the locale for a CoreWebView2Environment used to create the
  /// WebView2ControllerOptions object, which is passed as a parameter in
  /// `CreateCoreWebView2ControllerWithOptions`.
  ///
  /// Changes to the ScriptLocale property apply to renderer processes created after
  /// the change. Any existing renderer processes will continue to use the previous
  /// ScriptLocale value. To ensure changes are applied to all renderer process,
  /// close and restart the CoreWebView2Environment and all associated WebView2 objects.
  ///
  /// The default value for ScriptLocale will depend on the WebView2 language
  /// and OS region. If the language portions of the WebView2 language and OS region
  /// match, then it will use the OS region. Otherwise, it will use the WebView2
  /// language.
  ///
  /// | OS Region | WebView2 Language | Default WebView2 ScriptLocale |
  /// |-----------|-------------------|-------------------------------|
  /// | en-GB     | en-US             | en-GB                         |
  /// | es-MX     | en-US             | en-US                         |
  /// | en-US     | en-GB             | en-US                         |
  ///
  /// You can set the ScriptLocale to the empty string to get the default ScriptLocale value.
  ///
  /// Use OS specific APIs to determine the OS region to use with this property
  /// if you want to match the OS. For example:
  ///
  /// Win32 C++:
  /// ```cpp
  ///   wchar_t osLocale[LOCALE_NAME_MAX_LENGTH] = {0};
  ///   GetUserDefaultLocaleName(osLocale, LOCALE_NAME_MAX_LENGTH);
  /// ```
  ///
  /// The caller must free the returned string with `CoTaskMemFree`.  See
  /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
  /// \snippet AppWindow.cpp ScriptLocaleSetting
  @(" propget")
	HRESULT get_ScriptLocale(@("out, retval") LPWSTR* locale);
  /// Sets the `ScriptLocale` property.
  @(" propput")
	HRESULT put_ScriptLocale(in LPCWSTR locale);
}

/// The shared buffer object that is created by [CreateSharedBuffer](/microsoft-edge/webview2/reference/win32/icorewebview2environment12#createsharedbuffer).
/// The object is presented to script as ArrayBuffer when posted to script with
/// [PostSharedBufferToScript](/microsoft-edge/webview2/reference/win32/icorewebview2_17#postsharedbuffertoscript).
const GUID IID_ICoreWebView2SharedBuffer = ICoreWebView2SharedBuffer.iid;

interface ICoreWebView2SharedBuffer : IUnknown
{
    static const GUID iid = { 0xB747A495,0x0C6F,0x449E,[ 0x97,0xB8,0x2F,0x81,0xE9,0xD6,0xAB,0x43 ] };
  /// The size of the shared buffer in bytes.
  @(" propget")
	HRESULT get_Size(@("out, retval") UINT64* value);

  /// The memory address of the shared buffer.
  @(" propget")
	HRESULT get_Buffer(@("out, retval") BYTE** value);

  /// Get an IStream object that can be used to access the shared buffer.
  HRESULT OpenStream(@("out, retval") IStream** value);

  /// Returns a handle to the file mapping object that backs this shared buffer.
  /// The returned handle is owned by the shared buffer object. You should not
  /// call CloseHandle on it.
  /// Normal app should use `Buffer` or `OpenStream` to get memory address
  /// or IStream object to access the buffer.
  /// For advanced scenarios, you could use file mapping APIs to obtain other views
  /// or duplicate this handle to another application process and create a view from
  /// the duplicated handle in that process to access the buffer from that separate process.
  @(" propget")
	HRESULT get_FileMappingHandle(@("out, retval") HANDLE* value);

  /// Release the backing shared memory. The application should call this API when no
  /// access to the buffer is needed any more, to ensure that the underlying resources
  /// are released timely even if the shared buffer object itself is not released due to
  /// some leaked reference.
  /// After the shared buffer is closed, the buffer address and file mapping handle previously
  /// obtained becomes invalid and cannot be used anymore. Accessing properties of the object
  /// will fail with `RO_E_CLOSED`. Operations like Read or Write on the IStream objects returned
  /// from `OpenStream` will fail with `RO_E_CLOSED`. `PostSharedBufferToScript` will also
  /// fail with `RO_E_CLOSED`.
  ///
  /// The script code should call `chrome.webview.releaseBuffer` with
  /// the shared buffer as the parameter to release underlying resources as soon
  /// as it does not need access the shared buffer any more.
  /// When script tries to access the buffer after calling `chrome.webview.releaseBuffer`,
  /// JavaScript `TypeError` exception will be raised complaining about accessing a
  /// detached ArrayBuffer, the same exception when trying to access a transferred ArrayBuffer.
  ///
  /// Closing the buffer object on native side doesn't impact access from Script and releasing
  /// the buffer from script doesn't impact access to the buffer from native side.
  /// The underlying shared memory will be released by the OS when both native and script side
  /// release the buffer.
  HRESULT Close();
}

/// Representation of a DOM
/// [File](https://developer.mozilla.org/en-US/docs/Web/API/File) object
/// passed via WebMessage. You can use this object to obtain the path of a
/// File dropped on WebView2.
/// \snippet ScenarioDragDrop.cpp DroppedFilePath
const GUID IID_ICoreWebView2File = ICoreWebView2File.iid;

interface ICoreWebView2File : IUnknown
{
    static const GUID iid = { 0xf2c19559,0x6bc1,0x4583,[ 0xa7,0x57,0x90,0x02,0x1b,0xe9,0xaf,0xec ] };
  /// Get the absolute file path.
  @(" propget")
	HRESULT get_Path(@("out, retval") LPWSTR* path);
}

/// Read-only collection of generic objects.
const GUID IID_ICoreWebView2ObjectCollectionView = ICoreWebView2ObjectCollectionView.iid;

interface ICoreWebView2ObjectCollectionView : IUnknown
{
    static const GUID iid = { 0x0f36fd87,0x4f69,0x4415,[ 0x98,0xda,0x88,0x8f,0x89,0xfb,0x9a,0x33 ] };
  /// Gets the number of items in the collection.
  @(" propget")
	HRESULT get_Count(@("out, retval") UINT32* value);

  /// Gets the object at the specified index. Cast the object to the native type
  /// to access its specific properties.
  HRESULT GetValueAtIndex(in UINT32 index,
      @("out, retval") IUnknown * value);
}

/// Extension of WebMessageReceivedEventArgs to provide access to additional
/// WebMessage objects.
const GUID IID_ICoreWebView2WebMessageReceivedEventArgs2 = ICoreWebView2WebMessageReceivedEventArgs2.iid;

interface ICoreWebView2WebMessageReceivedEventArgs2 : ICoreWebView2WebMessageReceivedEventArgs
{
    static const GUID iid = { 0x06fc7ab7,0xc90c,0x4297,[ 0x93,0x89,0x33,0xca,0x01,0xcf,0x6d,0x5e ] };
  /// Additional received WebMessage objects. To pass `additionalObjects` via
  /// WebMessage to the app, use the
  /// `chrome.webview.postMessageWithAdditionalObjects` content API.
  /// Any DOM object type that can be natively representable that has been
  /// passed in to `additionalObjects` parameter will be accessible here.
  /// Currently a WebMessage object can be the `ICoreWebView2File` type.
  /// Entries in the collection can be `nullptr` if `null` or `undefined` was
  /// passed.
  @(" propget")
	HRESULT get_AdditionalObjects(
      @("out, retval") ICoreWebView2ObjectCollectionView * value);
}

/// This is the ICoreWebView2Profile interface for cookie manager.
const GUID IID_ICoreWebView2Profile5 = ICoreWebView2Profile5.iid;

interface ICoreWebView2Profile5 : ICoreWebView2Profile4
{
    static const GUID iid = { 0x2EE5B76E,0x6E80,0x4DF2,[ 0xBC,0xD3,0xD4,0xEC,0x33,0x40,0xA0,0x1B ] };
  /// Get the cookie manager for the profile. All CoreWebView2s associated with this
  /// profile share the same cookie values. Changes to cookies in this cookie manager apply to all
  /// CoreWebView2s associated with this profile.
  /// See ICoreWebView2CookieManager.
  ///
  /// \snippet ScenarioCookieManagement.cpp CookieManagerProfile
  @(" propget")
	HRESULT get_CookieManager(@("out, retval") ICoreWebView2CookieManager * cookieManager);
}

/// Interfaces in profile for managing password-autosave and general-autofill.
const GUID IID_ICoreWebView2Profile6 = ICoreWebView2Profile6.iid;

interface ICoreWebView2Profile6 : ICoreWebView2Profile5
{
    static const GUID iid = { 0xBD82FA6A,0x1D65,0x4C33,[ 0xB2,0xB4,0x03,0x93,0x02,0x0C,0xC6,0x1B ] };
  /// IsPasswordAutosaveEnabled controls whether autosave for password
  /// information is enabled. The IsPasswordAutosaveEnabled property behaves
  /// independently of the IsGeneralAutofillEnabled property. When IsPasswordAutosaveEnabled is
  /// false, no new password data is saved and no Save/Update Password prompts are displayed.
  /// However, if there was password data already saved before disabling this setting,
  /// then that password information is auto-populated, suggestions are shown and clicking on
  /// one will populate the fields.
  /// When IsPasswordAutosaveEnabled is true, password information is auto-populated,
  /// suggestions are shown and clicking on one will populate the fields, new data
  /// is saved, and a Save/Update Password prompt is displayed.
  /// It will take effect immediately after setting.
  /// The default value is `FALSE`.
  /// This property has the same value as
  /// `CoreWebView2Settings.IsPasswordAutosaveEnabled`, and changing one will
  /// change the other. All `CoreWebView2`s with the same `CoreWebView2Profile`
  /// will share the same value for this property, so for the `CoreWebView2`s
  /// with the same profile, their
  /// `CoreWebView2Settings.IsPasswordAutosaveEnabled` and
  /// `CoreWebView2Profile.IsPasswordAutosaveEnabled` will always have the same
  /// value.
  ///
  /// \snippet SettingsComponent.cpp ToggleProfilePasswordAutosaveEnabled
  @(" propget")
	HRESULT get_IsPasswordAutosaveEnabled(@("out, retval") BOOL* value);

  /// Set the IsPasswordAutosaveEnabled property.
  @(" propput")
	HRESULT put_IsPasswordAutosaveEnabled(in BOOL value);

  /// IsGeneralAutofillEnabled controls whether autofill for information
  /// like names, street and email addresses, phone numbers, and arbitrary input
  /// is enabled. This excludes password and credit card information. When
  /// IsGeneralAutofillEnabled is false, no suggestions appear, and no new information
  /// is saved. When IsGeneralAutofillEnabled is true, information is saved, suggestions
  /// appear and clicking on one will populate the form fields.
  /// It will take effect immediately after setting.
  /// The default value is `TRUE`.
  /// This property has the same value as
  /// `CoreWebView2Settings.IsGeneralAutofillEnabled`, and changing one will
  /// change the other. All `CoreWebView2`s with the same `CoreWebView2Profile`
  /// will share the same value for this property, so for the `CoreWebView2`s
  /// with the same profile, their
  /// `CoreWebView2Settings.IsGeneralAutofillEnabled` and
  /// `CoreWebView2Profile.IsGeneralAutofillEnabled` will always have the same
  /// value.
  ///
  /// \snippet SettingsComponent.cpp ToggleProfileGeneralAutofillEnabled
  @(" propget")
	HRESULT get_IsGeneralAutofillEnabled(@("out, retval") BOOL* value);

  /// Set the IsGeneralAutofillEnabled property.
  @(" propput")
	HRESULT put_IsGeneralAutofillEnabled(in BOOL value);
}

/// This is a continuation of the `ICoreWebView2NewWindowRequestedEventArgs` interface.
const GUID IID_ICoreWebView2NewWindowRequestedEventArgs3 = ICoreWebView2NewWindowRequestedEventArgs3.iid;

interface ICoreWebView2NewWindowRequestedEventArgs3 : ICoreWebView2NewWindowRequestedEventArgs2
{
    static const GUID iid = { 0x842bed3c,0x6ad6,0x4dd9,[ 0xb9,0x38,0x28,0xc9,0x66,0x67,0xad,0x66 ] };
  /// The frame info of the frame where the new window request originated. The
  /// `OriginalSourceFrameInfo` is a snapshot of frame information at the time when the
  /// new window was requested. See `ICoreWebView2FrameInfo` for details on frame
  /// properties.
  @(" propget")
	HRESULT get_OriginalSourceFrameInfo(
      @("out, retval") ICoreWebView2FrameInfo * frameInfo);
}

/// Interfaces in profile for managing browser extensions.
const GUID IID_ICoreWebView2Profile7 = ICoreWebView2Profile7.iid;

interface ICoreWebView2Profile7 : ICoreWebView2Profile6
{
    static const GUID iid = { 0x7b4c7906,0xa1aa,0x4cb4,[ 0xb7,0x23,0xdb,0x09,0xf8,0x13,0xd5,0x41 ] };
    /// Adds the [browser extension](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions)
    /// using the extension path for unpacked extensions from the local device. Extension is
    /// running right after installation.
    /// The extension folder path is the topmost folder of an unpacked browser extension and
    /// contains the browser extension manifest file.
    /// If the `extensionFolderPath` is an invalid path or doesn't contain the extension manifest.json
    /// file, this function will return `ERROR_FILE_NOT_FOUND` to callers.
    /// Installed extension will default `IsEnabled` to true.
    /// When `AreBrowserExtensionsEnabled` is `FALSE`, `AddBrowserExtension` will fail and return
    /// HRESULT `ERROR_NOT_SUPPORTED`.
    /// During installation, the content of the extension is not copied to the user data folder.
    /// Once the extension is installed, changing the content of the extension will cause the
    /// extension to be removed from the installed profile.
    /// When an extension is added the extension is persisted in the corresponding profile. The
    /// extension will still be installed the next time you use this profile.
    /// When an extension is installed from a folder path, adding the same extension from the same
    /// folder path means reinstalling this extension. When two extensions with the same Id are
    /// installed, only the later installed extension will be kept.
    ///
    /// Extensions that are designed to include any UI interactions (e.g. icon, badge, pop up, etc.)
    /// can be loaded and used but will have missing UI entry points due to the lack of browser
    /// UI elements to host these entry points in WebView2.
    ///
    /// The following summarizes the possible error values that can be returned from
    /// `AddBrowserExtension` and a description of why these errors occur.
    ///
    /// Error value                                     | Description
    /// ----------------------------------------------- | --------------------------
    /// `HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)`       | Extensions are disabled.
    /// `HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)`      | Cannot find `manifest.json` file or it is not a valid extension manifest.
    /// `E_ACCESSDENIED`                                | Cannot load extension with file or directory name starting with \"_\", reserved for use by the system.
    /// `E_FAIL`                                        | Extension failed to install with other unknown reasons.
    HRESULT AddBrowserExtension(in LPCWSTR extensionFolderPath, /+[in]+/ ICoreWebView2ProfileAddBrowserExtensionCompletedHandler handler);
    /// Gets a snapshot of the set of extensions installed at the time `GetBrowserExtensions` is
    /// called. If an extension is installed or uninstalled after `GetBrowserExtensions` completes,
    /// the list returned by `GetBrowserExtensions` remains the same.
    /// When `AreBrowserExtensionsEnabled` is `FALSE`, `GetBrowserExtensions` won't return any
    /// extensions on current user profile.
    HRESULT GetBrowserExtensions(/+[in]+/ ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler handler);
}

/// Provides a set of properties for managing an Extension, which includes
/// an ID, name, and whether it is enabled or not, and the ability to Remove
/// the Extension, and enable or disable it.
const GUID IID_ICoreWebView2BrowserExtension = ICoreWebView2BrowserExtension.iid;

interface ICoreWebView2BrowserExtension : IUnknown
{
    static const GUID iid = { 0x7EF7FFA0,0xFAC5,0x462C,[ 0xB1,0x89,0x3D,0x9E,0xDB,0xE5,0x75,0xDA ] };
    /// This is the browser extension's ID. This is the same browser extension ID returned by
    /// the browser extension API [`chrome.runtime.id`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/id).
    /// Please see that documentation for more details on how the ID is generated.
    /// After an extension is removed, calling `Id` will return the id of the extension that is removed.
    /// The caller must free the returned string with `CoTaskMemFree`.  See
    /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
    @(" propget")
	HRESULT get_Id(@("out, retval") LPWSTR* value);
    /// This is the browser extension's name. This value is defined in this browser extension's
    /// manifest.json file. If manifest.json define extension's localized name, this value will
    /// be the localized version of the name.
    /// Please see [Manifest.json name](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/name)
    /// for more details.
    /// After an extension is removed, calling `Name` will return the name of the extension that is removed.
    /// The caller must free the returned string with `CoTaskMemFree`.  See
    /// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
    @(" propget")
	HRESULT get_Name(@("out, retval") LPWSTR* value);
    /// Removes this browser extension from its WebView2 Profile. The browser extension is removed
    /// immediately including from all currently running HTML documents associated with this
    /// WebView2 Profile. The removal is persisted and future uses of this profile will not have this
    /// extension installed. After an extension is removed, calling `Remove` again will cause an exception.
    HRESULT Remove(/+[in]+/ ICoreWebView2BrowserExtensionRemoveCompletedHandler handler);
    /// If `isEnabled` is true then the Extension is enabled and running in WebView instances.
    /// If it is false then the Extension is disabled and not running in WebView instances.
    /// When a Extension is first installed, `IsEnable` are default to be `TRUE`.
    /// `isEnabled` is persisted per profile.
    /// After an extension is removed, calling `isEnabled` will return the value at the time it was removed.
    @(" propget")
	HRESULT get_IsEnabled(@("out, retval") BOOL* value);
    /// Sets whether this browser extension is enabled or disabled. This change applies immediately
    /// to the extension in all HTML documents in all WebView2s associated with this profile.
    /// After an extension is removed, calling `Enable` will not change the value of `IsEnabled`.
    HRESULT Enable(in BOOL isEnabled, /+[in]+/ ICoreWebView2BrowserExtensionEnableCompletedHandler handler);
}

/// The caller implements this interface to receive the result of removing
/// the browser Extension from the Profile.
const GUID IID_ICoreWebView2BrowserExtensionRemoveCompletedHandler = ICoreWebView2BrowserExtensionRemoveCompletedHandler.iid;

interface ICoreWebView2BrowserExtensionRemoveCompletedHandler : IUnknown
{
    static const GUID iid = { 0x8E41909A,0x9B18,0x4BB1,[ 0x8C,0xDF,0x93,0x0F,0x46,0x7A,0x50,0xBE ] };
    /// Provides the result of the browser extension Remove operation.
    HRESULT Invoke(in HRESULT errorCode);
}

/// The caller implements this interface to receive the result of setting the
/// browser Extension as enabled or disabled. If enabled, the browser Extension is
/// running in WebView instances. If disabled, the browser Extension is not running in WebView instances.
const GUID IID_ICoreWebView2BrowserExtensionEnableCompletedHandler = ICoreWebView2BrowserExtensionEnableCompletedHandler.iid;

interface ICoreWebView2BrowserExtensionEnableCompletedHandler : IUnknown
{
    static const GUID iid = { 0x30C186CE,0x7FAD,0x421F,[ 0xA3,0xBC,0xA8,0xEA,0xF0,0x71,0xDD,0xB8 ] };
    /// Provides the result of the browser extension enable operation.
    HRESULT Invoke(in HRESULT errorCode);
}

/// Provides a set of properties for managing browser Extension Lists from user profile. This
/// includes the number of browser Extensions in the list, and the ability to get an browser
/// Extension from the list at a particular index.
const GUID IID_ICoreWebView2BrowserExtensionList = ICoreWebView2BrowserExtensionList.iid;

interface ICoreWebView2BrowserExtensionList : IUnknown
{
    static const GUID iid = { 0x2EF3D2DC,0xBD5F,0x4F4D,[ 0x90,0xAF,0xFD,0x67,0x79,0x8F,0x0C,0x2F ] };
    /// The number of browser Extensions in the list.
    @(" propget")
	HRESULT get_Count(@("out, retval") UINT* count);
    /// Gets the browser Extension located in the browser Extension List at the given index.
    HRESULT GetValueAtIndex(in UINT index,
		@("out, retval") ICoreWebView2BrowserExtension * extension);
}

/// The caller implements this interface to receive the result of
/// getting the browser Extensions.
const GUID IID_ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler = ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler.iid;

interface ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler : IUnknown
{
    static const GUID iid = { 0xFCE16A1C,0xF107,0x4601,[ 0x8B,0x75,0xFC,0x49,0x40,0xAE,0x25,0xD0 ] };
    /// Provides the browser extension list for the requested user profile.
    HRESULT Invoke(in HRESULT errorCode, /+[in]+/ ICoreWebView2BrowserExtensionList extensionList);
}

/// The caller implements this interface to receive the result
/// of loading an browser Extension.
const GUID IID_ICoreWebView2ProfileAddBrowserExtensionCompletedHandler = ICoreWebView2ProfileAddBrowserExtensionCompletedHandler.iid;

interface ICoreWebView2ProfileAddBrowserExtensionCompletedHandler : IUnknown
{
    static const GUID iid = { 0xDF1AAB27,0x82B9,0x4AB6,[ 0xAA,0xE8,0x01,0x7A,0x49,0x39,0x8C,0x14 ] };
    /// Provides the result of the `AddBrowserExtension` operation.g
    HRESULT Invoke(in HRESULT errorCode, /+[in]+/ ICoreWebView2BrowserExtension extension);
}

/// This is the profile interface that manages profile
/// deletion.
const GUID IID_ICoreWebView2Profile8 = ICoreWebView2Profile8.iid;

interface ICoreWebView2Profile8 : ICoreWebView2Profile7
{
    static const GUID iid = { 0xfbf70c2f,0xeb1f,0x4383,[ 0x85,0xa0,0x16,0x3e,0x92,0x04,0x40,0x11 ] };
  /// After the API is called, the profile will be marked for deletion. The
  /// local profile's directory will be deleted at browser process exit. If it
  /// fails to delete, because something else is holding the files open,
  /// WebView2 will try to delete the profile at all future browser process
  /// starts until successful.
  /// The corresponding CoreWebView2s will be closed and the
  /// CoreWebView2Profile.Deleted event will be raised. See
  /// `CoreWebView2Profile.Deleted` for more information.
  /// If you try to create a new profile with the same name as an existing
  /// profile that has been marked as deleted but hasn't yet been deleted,
  /// profile creation will fail with HRESULT_FROM_WIN32(ERROR_DELETE_PENDING).
  ///
  /// \snippet SettingsComponent.cpp DeleteProfile
  HRESULT Delete();

  /// Add an event handler for the `Deleted` event. The `Deleted` event is
  /// raised when the profile is marked for deletion. When this event is
  /// raised, the CoreWebView2Profile and its corresponding CoreWebView2s have
  /// been closed, and cannot be used anymore.
  ///
  /// \snippet AppWindow.cpp ProfileDeleted
  HRESULT add_Deleted(
      /+[in]+/ ICoreWebView2ProfileDeletedEventHandler eventHandler,
      @("out") EventRegistrationToken* token);

  /// Removes an event handler previously added with `add_Deleted`.
  HRESULT remove_Deleted(
      in EventRegistrationToken token);
}

/// Receives the `CoreWebView2Profile.Deleted` event.
const GUID IID_ICoreWebView2ProfileDeletedEventHandler = ICoreWebView2ProfileDeletedEventHandler.iid;

interface ICoreWebView2ProfileDeletedEventHandler : IUnknown
{
    static const GUID iid = { 0xDF35055D,0x772E,0x4DBE,[ 0xB7,0x43,0x5F,0xBF,0x74,0xA2,0xB2,0x58 ] };
  /// Called to provide the implementer with the event args for the
  /// profile deleted event. No event args exist and the `args`
  /// parameter is set to `null`.
  HRESULT Invoke(
      /+[in]+/ ICoreWebView2Profile sender,
      /+[in]+/ IUnknown args);
}

// End of interfaces

/// DLL export to create a WebView2 environment with a custom version of
/// WebView2 Runtime, user data folder, and with or without additional options.
///
/// When WebView2 experimental APIs are used, make sure to provide a valid `environmentOptions`
/// so that WebView2 runtime knows which version of the SDK that the app is using. Otherwise,
/// WebView2 runtime assumes that the version of the SDK being used is the latest
/// version known to it, which might not be the version of the SDK being used.
/// This wrong SDK version assumption could result in some experimental APIs not being available.
///
/// The WebView2 environment and all other WebView2 objects are single threaded
///  and have dependencies on Windows components that require COM to be
/// initialized for a single-threaded apartment.  The app is expected to run
/// `CoInitializeEx` before running `CreateCoreWebView2EnvironmentWithOptions`.
///
/// ```text
/// CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
/// ```
///
/// If `CoInitializeEx` did not run or previously ran with
/// `COINIT_MULTITHREADED`, `CreateCoreWebView2EnvironmentWithOptions` fails
/// with one of the following errors.
///
/// ```text
/// CO_E_NOTINITIALIZED -  if CoInitializeEx was not called
/// RPC_E_CHANGED_MODE  -  if CoInitializeEx was previously called with
///                        COINIT_MULTITHREADED
/// ```
///
///
/// Use `browserExecutableFolder` to specify whether WebView2 controls use a
/// fixed or installed version of the WebView2 Runtime that exists on a user
/// machine.  To use a fixed version of the WebView2 Runtime, pass the
/// folder path that contains the fixed version of the WebView2 Runtime to
/// `browserExecutableFolder`. BrowserExecutableFolder supports both relative
///  (to the application's executable) and absolute files paths.
/// To create WebView2 controls that use the
/// installed version of the WebView2 Runtime that exists on user machines,
/// pass a `null` or empty string to `browserExecutableFolder`.  In this
/// scenario, the API tries to find a compatible version of the WebView2
/// Runtime that is installed on the user machine (first at the machine level,
///  and then per user) using the selected channel preference.  The path of
/// fixed version of the WebView2 Runtime should not contain
/// `\Edge\Application\`. When such a path is used, the API fails
/// with `HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)`.
///
/// The default channel search order is the WebView2 Runtime, Beta, Dev, and
/// Canary.  When an override `WEBVIEW2_RELEASE_CHANNEL_PREFERENCE` environment
///  variable or applicable `releaseChannelPreference` registry value is set to
///  `1`, the channel search order is reversed.
///
/// You may specify the `userDataFolder` to change the default user data
/// folder location for WebView2.  The path is either an absolute file path
/// or a relative file path that is interpreted as relative to the compiled
/// code for the current process.  For UWP apps, the default user data
/// folder is the app data folder for the package.  For non-UWP apps, the
/// default user data (`{Executable File Name}.WebView2`) folder is
/// created in the same directory next to the compiled code for the app.
/// WebView2 creation fails if the compiled code is running in a directory in
/// which the process does not have permission to create a new directory.  The
/// app is responsible to clean up the associated user data folder when it
/// is done.
///
/// \> [!NOTE]\n\> As a browser process may be shared among WebViews, WebView creation fails
/// with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)` if the specified options
/// does not match the options of the WebViews that are currently running in
/// the shared browser process.
///
/// `environmentCreatedHandler` is the handler result to the async operation
/// that contains the `WebView2Environment` that was created.
///
/// The `browserExecutableFolder`, `userDataFolder` and
/// `additionalBrowserArguments` of the `environmentOptions` may be overridden
/// by values either specified in environment variables or in the registry.
///
/// When creating a `WebView2Environment` the following environment variables
/// are verified.
///
/// ```text
/// WEBVIEW2_BROWSER_EXECUTABLE_FOLDER
/// WEBVIEW2_USER_DATA_FOLDER
/// WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS
/// WEBVIEW2_RELEASE_CHANNEL_PREFERENCE
/// ```
///
/// If you find an override environment variable, use the
/// `browserExecutableFolder` and `userDataFolder` values as replacements for
/// the corresponding values in `CreateCoreWebView2EnvironmentWithOptions`
/// parameters.  If `additionalBrowserArguments` is specified in environment
/// variable or in the registry, it is appended to the corresponding values in
/// `CreateCoreWebView2EnvironmentWithOptions` parameters.
///
/// While not strictly overrides, additional environment variables may be set.
///
/// ```text
/// WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER
/// ```
///
/// When found with a non-empty value, this indicates that the WebView is being
///  launched under a script debugger.  In this case, the WebView issues a
/// `Page.waitForDebugger` CDP command that runs the script inside the WebView
/// to pause on launch, until a debugger issues a corresponding
/// `Runtime.runIfWaitingForDebugger` CDP command to resume the runtime.
///
/// \> [!NOTE]\n\> The following environment variable does not have a registry key
/// equivalent: `WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER`.
///
/// When found with a non-empty value, it indicates that the WebView is being
/// launched under a script debugger that also supports host apps that use
/// multiple WebViews.  The value is used as the identifier for a named pipe
/// that is opened and written to when a new WebView is created by the host
/// app.  The payload should match the payload of the `remote-debugging-port`
/// JSON target and an external debugger may use it to attach to a specific
/// WebView instance.  The format of the pipe created by the debugger should be
/// `\\.\pipe\WebView2\Debugger\{app_name}\{pipe_name}`, where the following
/// are true.
///
/// *   `{app_name}` is the host app exe file name, for example,
///     `WebView2Example.exe`
/// *   `{pipe_name}` is the value set for `WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER`
///
/// To enable debugging of the targets identified by the JSON, you must set the
///  `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS` environment variable to send
/// `--remote-debugging-port={port_num}`, where the following is true.
///
/// *   `{port_num}` is the port on which the CDP server binds.
///
/// \> [!WARNING]\n\> If you set both `WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER` and
/// `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS` environment variables, the
/// WebViews hosted in your app and associated contents may exposed to 3rd
/// party apps such as debuggers.
///
/// \> [!NOTE]\n\> The following environment variable does not have a registry key
/// equivalent: `WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER`.
///
/// If none of those environment variables exist, then the registry is examined
/// next.  The following registry values are verified.
///
/// ```text
/// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder
/// "{AppId}"=""
///
/// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannelPreference
/// "{AppId}"=""
///
/// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments
/// "{AppId}"=""
///
/// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\UserDataFolder
/// "{AppId}"=""
/// ```
///
/// Use a group policy under **Administrative Templates** >
/// **Microsoft Edge WebView2** to configure `browserExecutableFolder` and
/// `releaseChannelPreference`.
///
/// In the unlikely scenario where some instances of WebView are open during a
/// browser update, the deletion of the previous WebView2 Runtime may be
/// blocked.  To avoid running out of disk space, a new WebView creation fails
/// with `HRESULT_FROM_WIN32(ERROR_DISK_FULL)` if it detects that too many
/// previous WebView2 Runtime versions exist.
///
/// The default maximum number of WebView2 Runtime versions allowed is `20`.
/// To override the maximum number of the previous WebView2 Runtime versions
/// allowed, set the value of the following environment variable.
///
/// ```text
/// COREWEBVIEW2_MAX_INSTANCES
/// ```
///
/// If the Webview depends upon an installed WebView2 Runtime version and it is
/// uninstalled, any subsequent creation fails with
/// `HRESULT_FROM_WIN32(ERROR_PRODUCT_UNINSTALLED)`.
///
/// First verify with Root as `HKLM` and then `HKCU`.  `AppId` is first set to
/// the Application User Model ID of the process, then if no corresponding
/// registry key, the `AppId` is set to the compiled code name of the process,
/// or if that is not a registry key then `*`.  If an override registry key is
/// found, use the `browserExecutableFolder` and `userDataFolder` registry
/// values as replacements and append `additionalBrowserArguments` registry
/// values for the corresponding values in
/// `CreateCoreWebView2EnvironmentWithOptions` parameters.
///
/// The following summarizes the possible error values that can be returned from
/// `CreateCoreWebView2EnvironmentWithOptions` and a description of why these
/// errors occur.
///
/// Error value                                     | Description
/// ----------------------------------------------- | --------------------------
/// `CO_E_NOTINITIALIZED`                           | CoInitializeEx was not called.
/// `RPC_E_CHANGED_MODE`                            | CoInitializeEx was previously called with COINIT_MULTITHREADED.
/// `HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)`       | *\\Edge\\Application* path used in browserExecutableFolder.
/// `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`       | Specified options do not match the options of the WebViews that are currently running in the shared browser process.
/// `HRESULT_FROM_WIN32(ERROR_DISK_FULL)`           | In the unlikely scenario where some instances of WebView are open during a browser update, the deletion of the previous WebView2 Runtime may be blocked. To avoid running out of disk space, a new WebView creation fails with `HRESULT_FROM_WIN32(ERROR_DISK_FULL)` if it detects that too many previous WebView2 Runtime versions exist.
/// `HRESULT_FROM_WIN32(ERROR_PRODUCT_UNINSTALLED)` | If the Webview depends upon an installed WebView2 Runtime version and it is uninstalled.
/// `HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)`      | Could not find Edge installation.
/// `HRESULT_FROM_WIN32(ERROR_FILE_EXISTS)`         | User data folder cannot be created because a file with the same name already exists.
/// `E_ACCESSDENIED`                                | Unable to create user data folder, Access Denied.
/// `E_FAIL`                                        | Edge runtime unable to start.

extern(Windows) HRESULT CreateCoreWebView2EnvironmentWithOptions(PCWSTR browserExecutableFolder, PCWSTR userDataFolder, ICoreWebView2EnvironmentOptions environmentOptions, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler);

/// Creates an evergreen WebView2 Environment using the installed WebView2
/// Runtime version.  This is equivalent to running
/// `CreateCoreWebView2EnvironmentWithOptions` with `nullptr` for
/// `browserExecutableFolder`, `userDataFolder`, `additionalBrowserArguments`.
/// For more information, navigate to
/// `CreateCoreWebView2EnvironmentWithOptions`.

extern(Windows) HRESULT CreateCoreWebView2Environment(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler);

/// Get the browser version info including channel name if it is not the
/// WebView2 Runtime.  Channel names are Beta, Dev, and Canary.
/// If an override exists for the `browserExecutableFolder` or the channel
/// preference, the override is used.  If an override is not specified, then
/// the parameter value passed to
/// `GetAvailableCoreWebView2BrowserVersionString` is used.
/// Returns `HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)` if it fails to find an
/// installed WebView2 runtime or non-stable Microsoft Edge installation.
///
/// The caller must free the returned string with `CoTaskMemFree`.  See
/// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).

extern(Windows) HRESULT GetAvailableCoreWebView2BrowserVersionString(PCWSTR browserExecutableFolder, LPWSTR* versionInfo);

/// This method is for anyone want to compare version correctly to determine
/// which version is newer, older or same.  Use it to determine whether
/// to use webview2 or certain feature based upon version.  Sets the value of
/// result to `-1`, `0` or `1` if `version1` is less than, equal or greater
/// than `version2` respectively.  Returns `E_INVALIDARG` if it fails to parse
/// any of the version strings or any input parameter is `null`.  Directly use
/// the `versionInfo` obtained from
/// `GetAvailableCoreWebView2BrowserVersionString` with input, channel
/// information is ignored.

extern(Windows) HRESULT CompareBrowserVersions(PCWSTR version1, PCWSTR version2, int* result);

}
}
}
