1 /++
2 	A thin wrapper around common system webviews.
3 	Based on: https://github.com/zserge/webview
4 
5 	Work in progress. DO NOT USE YET as I am prolly gonna break everything.
6 +/
7 module arsd.webview;
8 
9 // Please note; the Microsoft terms and conditions say they may be able to collect
10 // information about your users if you use this on Windows.
11 // see: https://developer.microsoft.com/en-us/microsoft-edge/webview2/
12 
13 // https://go.microsoft.com/fwlink/p/?LinkId=2124703
14 
15 
16 /* Original https://github.com/zserge/webview notice below:
17  * MIT License
18  *
19  * Copyright (c) 2017 Serge Zaitsev
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining a copy
22  * of this software and associated documentation files (the "Software"), to deal
23  * in the Software without restriction, including without limitation the rights
24  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25  * copies of the Software, and to permit persons to whom the Software is
26  * furnished to do so, subject to the following conditions:
27  *
28  * The above copyright notice and this permission notice shall be included in
29  * all copies or substantial portions of the Software.
30  *
31  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37  * SOFTWARE.
38  */
39 
40 /*
41 	Port to D by Adam D. Ruppe, November 30, 2019
42 */
43 
44 version(cef) {
45 
46 
47 	import arsd.simpledisplay;
48 
49 	void main() {
50 		auto window = new SimpleWindow;
51 
52 		window.eventLoop(0);
53 	}
54 
55 
56 } else {
57 
58 version(linux):
59 
60 version(Windows)
61 	version=WEBVIEW_EDGE;
62 else version(linux)
63 	version=WEBVIEW_GTK;
64 else version(OSX)
65 	version=WEBVIEW_COCOA;
66 
67 version(Demo)
68 void main() {
69 	auto wv = new WebView(true, null);
70 	wv.navigate("http://dpldocs.info/");
71 	wv.setTitle("omg a D webview");
72 	wv.setSize(500, 500, true);
73 	wv.eval("console.log('just testing');");
74 	wv.run();
75 }
76 }
77 
78 version(linux)
79 
80 /++
81 
82 +/
83 class WebView : browser_engine {
84 
85 	/++
86 		Creates a new webview instance. If dbg is non-zero - developer tools will
87 		be enabled (if the platform supports them). Window parameter can be a
88 		pointer to the native window handle. If it's non-null - then child WebView
89 		is embedded into the given parent window. Otherwise a new window is created.
90 		Depending on the platform, a GtkWindow, NSWindow or HWND pointer can be
91 		passed here.
92 	+/
93 	this(bool dbg, void* window) {
94 		super(&on_message, dbg, window);
95 	}
96 
97 	extern(C)
98 	static void on_message(const char*) {}
99 
100 	/// Destroys a webview and closes the native window.
101 	void destroy() {
102 
103 	}
104 
105 	/// Runs the main loop until it's terminated. After this function exits - you
106 	/// must destroy the webview.
107 	override void run() { super.run(); }
108 
109 	/// Stops the main loop. It is safe to call this function from another other
110 	/// background thread.
111 	override void terminate() { super.terminate(); }
112 
113 	/+
114 	/// Posts a function to be executed on the main thread. You normally do not need
115 	/// to call this function, unless you want to tweak the native window.
116 	void dispatch(void function(WebView w, void *arg) fn, void *arg) {}
117 	+/
118 
119 	/// Returns a native window handle pointer. When using GTK backend the pointer
120 	/// is GtkWindow pointer, when using Cocoa backend the pointer is NSWindow
121 	/// pointer, when using Win32 backend the pointer is HWND pointer.
122 	void* getWindow() { return m_window; }
123 
124 	/// Updates the title of the native window. Must be called from the UI thread.
125 	override void setTitle(const char *title) { super.setTitle(title); }
126 
127 	/// Navigates webview to the given URL. URL may be a data URI.
128 	override void navigate(const char *url) { super.navigate(url); }
129 
130 	/// Injects JavaScript code at the initialization of the new page. Every time
131 	/// the webview will open a the new page - this initialization code will be
132 	/// executed. It is guaranteed that code is executed before window.onload.
133 	override void init(const char *js) { super.init(js); }
134 
135 	/// Evaluates arbitrary JavaScript code. Evaluation happens asynchronously, also
136 	/// the result of the expression is ignored. Use RPC bindings if you want to
137 	/// receive notifications about the results of the evaluation.
138 	override void eval(const char *js) { super.eval(js); }
139 
140 	/// Binds a native C callback so that it will appear under the given name as a
141 	/// global JavaScript function. Internally it uses webview_init(). Callback
142 	/// receives a request string and a user-provided argument pointer. Request
143 	/// string is a JSON array of all the arguments passed to the JavaScript
144 	/// function.
145 	void bind(const char *name, void function(const char *, void *) fn, void *arg) {}
146 
147 	/// Allows to return a value from the native binding. Original request pointer
148 	/// must be provided to help internal RPC engine match requests with responses.
149 	/// If status is zero - result is expected to be a valid JSON result value.
150 	/// If status is not zero - result is an error JSON object.
151 	void webview_return(const char *req, int status, const char *result) {}
152 
153   /*
154   void on_message(const char *msg) {
155     auto seq = json_parse(msg, "seq", 0);
156     auto name = json_parse(msg, "name", 0);
157     auto args = json_parse(msg, "args", 0);
158     auto fn = bindings[name];
159     if (fn == null) {
160       return;
161     }
162     std::async(std::launch::async, [=]() {
163       auto result = (*fn)(args);
164       dispatch([=]() {
165         eval(("var b = window['" + name + "'];b['callbacks'][" + seq + "](" +
166               result + ");b['callbacks'][" + seq +
167               "] = undefined;b['errors'][" + seq + "] = undefined;")
168                  .c_str());
169       });
170     });
171   }
172   std::map<std::string, binding_t *> bindings;
173 
174   alias binding_t = std::function<std::string(std::string)>;
175 
176   void bind(const char *name, binding_t f) {
177     auto js = "(function() { var name = '" + std::string(name) + "';" + R"(
178       window[name] = function() {
179         var me = window[name];
180         var errors = me['errors'];
181         var callbacks = me['callbacks'];
182         if (!callbacks) {
183           callbacks = {};
184           me['callbacks'] = callbacks;
185         }
186         if (!errors) {
187           errors = {};
188           me['errors'] = errors;
189         }
190         var seq = (me['lastSeq'] || 0) + 1;
191         me['lastSeq'] = seq;
192         var promise = new Promise(function(resolve, reject) {
193           callbacks[seq] = resolve;
194           errors[seq] = reject;
195         });
196         window.external.invoke(JSON.stringify({
197           name: name,
198           seq:seq,
199           args: Array.prototype.slice.call(arguments),
200         }));
201         return promise;
202       }
203     })())";
204     init(js.c_str());
205     bindings[name] = new binding_t(f);
206   }
207 
208 */
209 }
210 
211 private extern(C) {
212 	alias dispatch_fn_t = void function();
213 	alias msg_cb_t = void function(const char *msg);
214 }
215 
216 version(WEBVIEW_GTK) {
217 
218 	pragma(lib, "gtk-3");
219 	pragma(lib, "glib-2.0");
220 	pragma(lib, "gobject-2.0");
221 	pragma(lib, "webkit2gtk-4.0");
222 	pragma(lib, "javascriptcoregtk-4.0");
223 
224 	private extern(C) {
225 		import core.stdc.config;
226 		alias GtkWidget = void;
227 		enum GtkWindowType {
228 			GTK_WINDOW_TOPLEVEL = 0
229 		}
230 		bool gtk_init_check(int*, char***);
231 		GtkWidget* gtk_window_new(GtkWindowType);
232 		c_ulong g_signal_connect_data(void*, const char*, void* /* function pointer!!! */, void*, void*, int);
233 		GtkWidget* webkit_web_view_new();
234 		alias WebKitUserContentManager = void;
235 		WebKitUserContentManager* webkit_web_view_get_user_content_manager(GtkWidget*);
236 
237 		void gtk_container_add(GtkWidget*, GtkWidget*);
238 		void gtk_widget_grab_focus(GtkWidget*);
239 		void gtk_widget_show_all(GtkWidget*);
240 		void gtk_main();
241 		void gtk_main_quit();
242 		void webkit_web_view_load_uri(GtkWidget*, const char*);
243 		alias WebKitSettings = void;
244 		WebKitSettings* webkit_web_view_get_settings(GtkWidget*);
245 		void webkit_settings_set_enable_write_console_messages_to_stdout(WebKitSettings*, bool);
246 		void webkit_settings_set_enable_developer_extras(WebKitSettings*, bool);
247 		void webkit_user_content_manager_register_script_message_handler(WebKitUserContentManager*, const char*);
248 		alias JSCValue = void;
249 		alias WebKitJavascriptResult = void;
250 		JSCValue* webkit_javascript_result_get_js_value(WebKitJavascriptResult*);
251 		char* jsc_value_to_string(JSCValue*);
252 		void g_free(void*);
253 		void webkit_web_view_run_javascript(GtkWidget*, const char*, void*, void*, void*);
254 		alias WebKitUserScript = void;
255 		void webkit_user_content_manager_add_script(WebKitUserContentManager*, WebKitUserScript*);
256 		WebKitUserScript* webkit_user_script_new(const char*, WebKitUserContentInjectedFrames, WebKitUserScriptInjectionTime, const char*, const char*);
257 		enum WebKitUserContentInjectedFrames {
258 			WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES,
259 			WEBKIT_USER_CONTENT_INJECT_TOP_FRAME
260 		}
261 		enum WebKitUserScriptInjectionTime {
262 			WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START,
263 			WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END
264 		}
265 		void gtk_window_set_title(GtkWidget*, const char*);
266 
267 		void gtk_window_set_resizable(GtkWidget*, bool);
268 		void gtk_window_set_default_size(GtkWidget*, int, int);
269 		void gtk_widget_set_size_request(GtkWidget*, int, int);
270 	}
271 
272 	private class browser_engine {
273 
274 		static extern(C)
275 		void ondestroy (GtkWidget *w, void* arg) {
276 			(cast(browser_engine) arg).terminate();
277 		}
278 
279 		static extern(C)
280 		void smr(WebKitUserContentManager* m, WebKitJavascriptResult* r, void* arg) {
281 			auto w = cast(browser_engine) arg;
282 			JSCValue *value = webkit_javascript_result_get_js_value(r);
283 			auto s = jsc_value_to_string(value);
284 			w.m_cb(s);
285 			g_free(s);
286 		}
287 
288 		this(msg_cb_t cb, bool dbg, void* window) {
289 			m_cb = cb;
290 
291 			gtk_init_check(null, null);
292 			m_window = cast(GtkWidget*) window;
293 			if (m_window == null)
294 				m_window = gtk_window_new(GtkWindowType.GTK_WINDOW_TOPLEVEL);
295 
296 			g_signal_connect_data(m_window, "destroy", &ondestroy, cast(void*) this, null, 0);
297 
298 			m_webview = webkit_web_view_new();
299 			WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webview);
300 
301 			g_signal_connect_data(manager, "script-message-received::external", &smr, cast(void*) this, null, 0);
302 			webkit_user_content_manager_register_script_message_handler(manager, "external");
303 			init("window.external={invoke:function(s){window.webkit.messageHandlers.external.postMessage(s);}}");
304 
305 			gtk_container_add(m_window, m_webview);
306 			gtk_widget_grab_focus(m_webview);
307 
308 			if (dbg) {
309 				WebKitSettings *settings = webkit_web_view_get_settings(m_webview);
310 				webkit_settings_set_enable_write_console_messages_to_stdout(settings, true);
311 				webkit_settings_set_enable_developer_extras(settings, true);
312 			}
313 
314 			gtk_widget_show_all(m_window);
315 		}
316 		void run() { gtk_main(); }
317 		void terminate() { gtk_main_quit(); }
318 
319 		void navigate(const char *url) {
320 			webkit_web_view_load_uri(m_webview, url);
321 		}
322 
323 		void setTitle(const char* title) {
324 			gtk_window_set_title(m_window, title);
325 		}
326 
327 		/+
328 			void dispatch(std::function<void()> f) {
329 				g_idle_add_full(G_PRIORITY_HIGH_IDLE, (GSourceFunc)([](void *f) -> int {
330 							(*static_cast<dispatch_fn_t *>(f))();
331 							return G_SOURCE_REMOVE;
332 							}),
333 						new std::function<void()>(f),
334 						[](void *f) { delete static_cast<dispatch_fn_t *>(f); });
335 			}
336 		+/
337 
338 		void setSize(int width, int height, bool resizable) {
339 			gtk_window_set_resizable(m_window, resizable);
340 			if (resizable) {
341 				gtk_window_set_default_size(m_window, width, height);
342 			}
343 			gtk_widget_set_size_request(m_window, width, height);
344 		}
345 
346 		void init(const char *js) {
347 			WebKitUserContentManager *manager = webkit_web_view_get_user_content_manager(m_webview);
348 			webkit_user_content_manager_add_script(
349 				manager, webkit_user_script_new(
350 					js, WebKitUserContentInjectedFrames.WEBKIT_USER_CONTENT_INJECT_TOP_FRAME,
351 					WebKitUserScriptInjectionTime.WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START, null, null));
352 			}
353 
354 		void eval(const char *js) {
355 			webkit_web_view_run_javascript(m_webview, js, null, null, null);
356 		}
357 
358 		protected:
359 		GtkWidget* m_window;
360 		GtkWidget* m_webview;
361 		msg_cb_t m_cb;
362 	}
363 } else version(WEBVIEW_COCOA) {
364 /+
365 
366 //
367 // ====================================================================
368 //
369 // This implementation uses Cocoa WKWebView backend on macOS. It is
370 // written using ObjC runtime and uses WKWebView class as a browser runtime.
371 // You should pass "-framework Webkit" flag to the compiler.
372 //
373 // ====================================================================
374 //
375 
376 #define OBJC_OLD_DISPATCH_PROTOTYPES 1
377 #include <CoreGraphics/CoreGraphics.h>
378 #include <objc/objc-runtime.h>
379 
380 #define NSBackingStoreBuffered 2
381 
382 #define NSWindowStyleMaskResizable 8
383 #define NSWindowStyleMaskMiniaturizable 4
384 #define NSWindowStyleMaskTitled 1
385 #define NSWindowStyleMaskClosable 2
386 
387 #define NSApplicationActivationPolicyRegular 0
388 
389 #define WKUserScriptInjectionTimeAtDocumentStart 0
390 
391 id operator"" _cls(const char *s, std::size_t sz) {
392   return (id)objc_getClass(s);
393 }
394 SEL operator"" _sel(const char *s, std::size_t sz) {
395   return sel_registerName(s);
396 }
397 id operator"" _str(const char *s, std::size_t sz) {
398   return objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, s);
399 }
400 
401 class browser_engine {
402 public:
403   browser_engine(msg_cb_t cb, bool dbg, void *window) : m_cb(cb) {
404     // Application
405     id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel);
406     objc_msgSend(app, "setActivationPolicy:"_sel,
407                  NSApplicationActivationPolicyRegular);
408 
409     // Delegate
410     auto cls = objc_allocateClassPair((Class) "NSObject"_cls, "AppDelegate", 0);
411     class_addProtocol(cls, objc_getProtocol("NSApplicationDelegate"));
412     class_addProtocol(cls, objc_getProtocol("WKScriptMessageHandler"));
413     class_addMethod(
414         cls, "applicationShouldTerminateAfterLastWindowClosed:"_sel,
415         (IMP)(+[](id self, SEL cmd, id notification) -> BOOL { return 1; }),
416         "c@:@");
417     class_addMethod(
418         cls, "userContentController:didReceiveScriptMessage:"_sel,
419         (IMP)(+[](id self, SEL cmd, id notification, id msg) {
420           auto w = (browser_engine *)objc_getAssociatedObject(self, "webview");
421           w->m_cb((const char *)objc_msgSend(objc_msgSend(msg, "body"_sel),
422                                              "UTF8String"_sel));
423         }),
424         "v@:@@");
425     objc_registerClassPair(cls);
426 
427     auto delegate = objc_msgSend((id)cls, "new"_sel);
428     objc_setAssociatedObject(delegate, "webview", (id)this,
429                              OBJC_ASSOCIATION_ASSIGN);
430     objc_msgSend(app, sel_registerName("setDelegate:"), delegate);
431 
432     // Main window
433     if (window is null) {
434       m_window = objc_msgSend("NSWindow"_cls, "alloc"_sel);
435       m_window = objc_msgSend(
436           m_window, "initWithContentRect:styleMask:backing:defer:"_sel,
437           CGRectMake(0, 0, 0, 0), 0, NSBackingStoreBuffered, 0);
438       setSize(480, 320, true);
439     } else {
440       m_window = (id)window;
441     }
442 
443     // Webview
444     auto config = objc_msgSend("WKWebViewConfiguration"_cls, "new"_sel);
445     m_manager = objc_msgSend(config, "userContentController"_sel);
446     m_webview = objc_msgSend("WKWebView"_cls, "alloc"_sel);
447     objc_msgSend(m_webview, "initWithFrame:configuration:"_sel,
448                  CGRectMake(0, 0, 0, 0), config);
449     objc_msgSend(m_manager, "addScriptMessageHandler:name:"_sel, delegate,
450                  "external"_str);
451     init(R"script(
452                       window.external = {
453                         invoke: function(s) {
454                           window.webkit.messageHandlers.external.postMessage(s);
455                         },
456                       };
457                      )script");
458     if (dbg) {
459       objc_msgSend(objc_msgSend(config, "preferences"_sel),
460                    "setValue:forKey:"_sel, 1, "developerExtrasEnabled"_str);
461     }
462     objc_msgSend(m_window, "setContentView:"_sel, m_webview);
463     objc_msgSend(m_window, "makeKeyAndOrderFront:"_sel, null);
464   }
465   ~browser_engine() { close(); }
466   void terminate() { close(); objc_msgSend("NSApp"_cls, "terminate:"_sel, null); }
467   void run() {
468     id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel);
469     dispatch([&]() { objc_msgSend(app, "activateIgnoringOtherApps:"_sel, 1); });
470     objc_msgSend(app, "run"_sel);
471   }
472   void dispatch(std::function<void()> f) {
473     dispatch_async_f(dispatch_get_main_queue(), new dispatch_fn_t(f),
474                      (dispatch_function_t)([](void *arg) {
475                        auto f = static_cast<dispatch_fn_t *>(arg);
476                        (*f)();
477                        delete f;
478                      }));
479   }
480   void setTitle(const char *title) {
481     objc_msgSend(
482         m_window, "setTitle:"_sel,
483         objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, title));
484   }
485   void setSize(int width, int height, bool resizable) {
486     auto style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
487                  NSWindowStyleMaskMiniaturizable;
488     if (resizable) {
489       style = style | NSWindowStyleMaskResizable;
490     }
491     objc_msgSend(m_window, "setStyleMask:"_sel, style);
492     objc_msgSend(m_window, "setFrame:display:animate:"_sel,
493                  CGRectMake(0, 0, width, height), 1, 0);
494   }
495   void navigate(const char *url) {
496     auto nsurl = objc_msgSend(
497         "NSURL"_cls, "URLWithString:"_sel,
498         objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, url));
499     objc_msgSend(
500         m_webview, "loadRequest:"_sel,
501         objc_msgSend("NSURLRequest"_cls, "requestWithURL:"_sel, nsurl));
502   }
503   void init(const char *js) {
504     objc_msgSend(
505         m_manager, "addUserScript:"_sel,
506         objc_msgSend(
507             objc_msgSend("WKUserScript"_cls, "alloc"_sel),
508             "initWithSource:injectionTime:forMainFrameOnly:"_sel,
509             objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js),
510             WKUserScriptInjectionTimeAtDocumentStart, 1));
511   }
512   void eval(const char *js) {
513     objc_msgSend(m_webview, "evaluateJavaScript:completionHandler:"_sel,
514                  objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js),
515                  null);
516   }
517 
518 protected:
519   void close() { objc_msgSend(m_window, "close"_sel); }
520   id m_window;
521   id m_webview;
522   id m_manager;
523   msg_cb_t m_cb;
524 };
525 
526 +/
527 
528 }
529 
530 version(cef) {
531 // from derelict-cef
532 /*
533 
534 Boost Software License - Version 1.0 - August 17th, 2003
535 
536 Permission is hereby granted, free of charge, to any person or organization
537 obtaining a copy of the software and accompanying documentation covered by
538 this license (the "Software") to use, reproduce, display, distribute,
539 execute, and transmit the Software, and to prepare derivative works of the
540 Software, and to permit third-parties to whom the Software is furnished to
541 do so, all subject to the following:
542 
543 The copyright notices in the Software and this entire statement, including
544 the above license grant, this restriction and the following disclaimer,
545 must be included in all copies of the Software, in whole or in part, and
546 all derivative works of the Software, unless such copies or derivative
547 works are solely in the form of machine-executable object code generated by
548 a source language processor.
549 
550 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
551 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
552 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
553 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
554 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
555 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
556 DEALINGS IN THE SOFTWARE.
557 
558 */
559 // module derelict.cef.types;
560 
561 private {
562     import core.stdc.stddef;
563     // import derelict.util.system;
564 }
565 
566 // cef_string_*.h
567 alias void* cef_string_list_t;
568 alias void* cef_string_map_t;
569 alias void* cef_string_multimap_t;
570 
571 struct cef_string_wide_t {
572     wchar_t* str;
573     size_t length;
574     extern( C ) @nogc nothrow void function( wchar* ) dtor;
575 }
576 
577 struct cef_string_utf8_t {
578     char* str;
579     size_t length;
580     extern( C ) @nogc nothrow void function( char* ) dtor;
581 }
582 
583 struct cef_string_utf16_t {
584     wchar* str;
585     size_t length;
586     extern( C ) @nogc nothrow void function( wchar* ) dtor;
587 }
588 
589 alias cef_string_userfree_wide_t = cef_string_wide_t*;
590 alias cef_string_userfree_utf8_t = cef_string_utf8_t*;
591 alias cef_string_userfree_utf16_t = cef_string_utf16_t*;
592 
593 version( DerelictCEF_WideStrings ) {
594     enum CEF_STRING_TYPE_WIDE = true;
595     enum CEF_STRING_TYPE_UTF16 = false;
596     enum CEF_STRING_TYPE_UTF8 = false;
597     alias cef_char_t = wchar_t;
598     alias cef_string_t = cef_string_wide_t;
599     alias cef_string_userfree_t = cef_string_userfree_wide_t;
600 } else version( DerelictCEF_UTF8Strings ) {
601     enum CEF_STRING_TYPE_WIDE = false;
602     enum CEF_STRING_TYPE_UTF16 = false;
603     enum CEF_STRING_TYPE_UTF8 = true;
604     alias cef_char_t = char;
605     alias cef_string_t = cef_string_utf8_t;
606     alias cef_string_userfree_t = cef_string_userfree_utf8_t;
607 } else {
608     // CEF builds with UTF16 strings by default.
609     enum CEF_STRING_TYPE_WIDE = false;
610     enum CEF_STRING_TYPE_UTF16 = true;
611     enum CEF_STRING_TYPE_UTF8 = false;
612     alias cef_char_t = wchar;
613     alias cef_string_t = cef_string_utf16_t;
614     alias cef_string_userfree_t = cef_string_userfree_utf16_t;
615 }
616 
617 // cef_time.h
618 struct cef_time_t {
619     int year;
620     int month;
621     int day_of_week;
622     int day_of_month;
623     int hour;
624     int minute;
625     int second;
626     int millisecond;
627 }
628 
629 // cef_types.h
630 alias int64 = long;
631 alias uint64 = ulong;
632 alias int32 = int;
633 alias uint32 = uint;
634 alias cef_color_t = uint32;
635 alias char16 = wchar;
636 
637 alias cef_log_severity_t = int;
638 enum {
639     LOGSEVERITY_DEFAULT,
640     LOGSEVERITY_VERBOSE,
641     LOGSEVERITY_DEBUG,
642     LOGSEVERITY_INFO,
643     LOGSEVERITY_WARNING,
644     LOGSEVERITY_ERROR,
645     LOGSEVERITY_FATAL,
646     LOGSEVERITY_DISABLE = 99
647 }
648 
649 alias cef_state_t = int;
650 enum {
651     STATE_DEFAULT = 0,
652     STATE_ENABLED,
653     STATE_DISABLED,
654 }
655 
656 struct cef_settings_t {
657     size_t size;
658     int no_sandbox;
659     cef_string_t browser_subprocess_path;
660     cef_string_t framework_dir_path;
661     int multi_threaded_message_loop;
662     int external_message_pump;
663     int windowless_rendering_enabled;
664     int command_line_args_disabled;
665     cef_string_t cache_path;
666     cef_string_t user_data_path;
667     int persist_session_cookies;
668     int persist_user_preferences;
669     cef_string_t user_agent;
670     cef_string_t product_version;
671     cef_string_t locale;
672     cef_string_t log_file;
673     cef_log_severity_t log_severity;
674     cef_string_t javascript_flags;
675     cef_string_t resources_dir_path;
676     cef_string_t locales_dir_path;
677     int pack_loading_disabled;
678     int remote_debugging_port;
679     int uncaught_exception_stack_size;
680     int ignore_certificate_errors;
681     int enable_net_security_expiration;
682     cef_color_t background_color;
683     cef_string_t accept_language_list;
684 }
685 
686 struct cef_request_context_settings_t {
687     size_t size;
688     cef_string_t cache_path;
689     int persist_session_cookies;
690     int persist_user_preferences;
691     int ignore_certificate_errors;
692     int enable_net_security_expiration;
693     cef_string_t accept_language_list;
694 }
695 
696 struct cef_browser_settings_t {
697     size_t size;
698     int windowless_frame_rate;
699     cef_string_t standard_font_family;
700     cef_string_t fixed_font_family;
701     cef_string_t serif_font_family;
702     cef_string_t sans_serif_font_family;
703     cef_string_t cursive_font_family;
704     cef_string_t fantasy_font_family;
705     int default_font_size;
706     int default_fixed_font_size;
707     int minimum_font_size;
708     int minimum_logical_font_size;
709     cef_string_t default_encoding;
710     cef_state_t remote_fonts;
711     cef_state_t javascript;
712     cef_state_t javascript_close_windows;
713     cef_state_t javascript_access_clipboard;
714     cef_state_t javascript_dom_paste;
715     cef_state_t plugins;
716     cef_state_t universal_access_from_file_urls;
717     cef_state_t file_access_from_file_urls;
718     cef_state_t web_security;
719     cef_state_t image_loading;
720     cef_state_t image_shrink_standalone_to_fit;
721     cef_state_t text_area_resize;
722     cef_state_t tab_to_links;
723     cef_state_t local_storage;
724     cef_state_t databases;
725     cef_state_t application_cache;
726     cef_state_t webgl;
727     cef_color_t background_color;
728     cef_string_t accept_language_list;
729 }
730 
731 alias cef_return_value_t = int;
732 enum {
733     RV_CANCEL = 0,
734     RV_CONTINUE,
735     RV_CONTINUE_ASYNC,
736 }
737 
738 struct cef_urlparts_t {
739     cef_string_t spec;
740     cef_string_t scheme;
741     cef_string_t username;
742     cef_string_t password;
743     cef_string_t host;
744     cef_string_t port;
745     cef_string_t origin;
746     cef_string_t path;
747     cef_string_t query;
748 }
749 
750 struct cef_cookie_t {
751     cef_string_t name;
752     cef_string_t value;
753     cef_string_t domain;
754     cef_string_t path;
755     int secure;
756     int httponly;
757     cef_time_t creation;
758     cef_time_t last_access;
759     int has_expires;
760     cef_time_t expires;
761 }
762 
763 alias cef_termination_status_t = int;
764 enum {
765     TS_ABNORMAL_TERMINATION,
766     TS_PROCESS_WAS_KILLED,
767     TS_PROCESS_CRASHED,
768     TS_PROCESS_OOM,
769 }
770 
771 alias cef_path_key_t = int;
772 enum {
773     PK_DIR_CURRENT,
774     PK_DIR_EXE,
775     PK_DIR_MODULE,
776     PK_DIR_TEMP,
777     PK_FILE_EXE,
778     PK_FILE_MODULE,
779     PK_LOCAL_APP_DATA,
780     PK_USER_DATA,
781     PK_DIR_RESOURCES,
782 }
783 
784 alias cef_storage_type_t = int;
785 enum {
786     ST_LOCALSTORAGE = 0,
787     ST_SESSIONSTORAGE,
788 }
789 
790 alias cef_errorcode_t = int;
791 enum {
792     ERR_NONE = 0,
793     ERR_FAILED = -2,
794     ERR_ABORTED = -3,
795     ERR_INVALID_ARGUMENT = -4,
796     ERR_INVALID_HANDLE = -5,
797     ERR_FILE_NOT_FOUND = -6,
798     ERR_TIMED_OUT = -7,
799     ERR_FILE_TOO_BIG = -8,
800     ERR_UNEXPECTED = -9,
801     ERR_ACCESS_DENIED = -10,
802     ERR_NOT_IMPLEMENTED = -11,
803     ERR_CONNECTION_CLOSED = -100,
804     ERR_CONNECTION_RESET = -101,
805     ERR_CONNECTION_REFUSED = -102,
806     ERR_CONNECTION_ABORTED = -103,
807     ERR_CONNECTION_FAILED = -104,
808     ERR_NAME_NOT_RESOLVED = -105,
809     ERR_INTERNET_DISCONNECTED = -106,
810     ERR_SSL_PROTOCOL_ERROR = -107,
811     ERR_ADDRESS_INVALID = -108,
812     ERR_ADDRESS_UNREACHABLE = -109,
813     ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110,
814     ERR_TUNNEL_CONNECTION_FAILED = -111,
815     ERR_NO_SSL_VERSIONS_ENABLED = -112,
816     ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113,
817     ERR_SSL_RENEGOTIATION_REQUESTED = -114,
818     ERR_CERT_COMMON_NAME_INVALID = -200,
819     ERR_CERT_DATE_INVALID = -201,
820     ERR_CERT_AUTHORITY_INVALID = -202,
821     ERR_CERT_CONTAINS_ERRORS = -203,
822     ERR_CERT_NO_REVOCATION_MECHANISM = -204,
823     ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205,
824     ERR_CERT_REVOKED = -206,
825     ERR_CERT_INVALID = -207,
826     ERR_CERT_END = -208,
827     ERR_INVALID_URL = -300,
828     ERR_DISALLOWED_URL_SCHEME = -301,
829     ERR_UNKNOWN_URL_SCHEME = -302,
830     ERR_TOO_MANY_REDIRECTS = -310,
831     ERR_UNSAFE_REDIRECT = -311,
832     ERR_UNSAFE_PORT = -312,
833     ERR_INVALID_RESPONSE = -320,
834     ERR_INVALID_CHUNKED_ENCODING = -321,
835     ERR_METHOD_NOT_SUPPORTED = -322,
836     ERR_UNEXPECTED_PROXY_AUTH = -323,
837     ERR_EMPTY_RESPONSE = -324,
838     ERR_RESPONSE_HEADERS_TOO_BIG = -325,
839     ERR_CACHE_MISS = -400,
840     ERR_INSECURE_RESPONSE = -501,
841 }
842 
843 alias cef_cert_status_t = int;
844 enum {
845     CERT_STATUS_NONE = 0,
846     CERT_STATUS_COMMON_NAME_INVALID = 1 << 0,
847     CERT_STATUS_DATE_INVALID = 1 << 1,
848     CERT_STATUS_AUTHORITY_INVALID = 1 << 2,
849     CERT_STATUS_NO_REVOCATION_MECHANISM = 1 << 4,
850     CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = 1 << 5,
851     CERT_STATUS_REVOKED = 1 << 6,
852     CERT_STATUS_INVALID = 1 << 7,
853     CERT_STATUS_WEAK_SIGNATURE_ALGORITHM = 1 << 8,
854     CERT_STATUS_NON_UNIQUE_NAME = 1 << 10,
855     CERT_STATUS_WEAK_KEY = 1 << 11,
856     CERT_STATUS_PINNED_KEY_MISSING = 1 << 13,
857     CERT_STATUS_NAME_CONSTRAINT_VIOLATION = 1 << 14,
858     CERT_STATUS_VALIDITY_TOO_LONG = 1 << 15,
859     CERT_STATUS_IS_EV = 1 << 16,
860     CERT_STATUS_REV_CHECKING_ENABLED = 1 << 17,
861     CERT_STATUS_SHA1_SIGNATURE_PRESENT = 1 << 19,
862     CERT_STATUS_CT_COMPLIANCE_FAILED = 1 << 20,
863 }
864 
865 alias cef_window_open_disposition_t = int;
866 enum {
867     WOD_UNKNOWN,
868     WOD_CURRENT_TAB,
869     WOD_SINGLETON_TAB,
870     WOD_NEW_FOREGROUND_TAB,
871     WOD_NEW_BACKGROUND_TAB,
872     WOD_NEW_POPUP,
873     WOD_NEW_WINDOW,
874     WOD_SAVE_TO_DISK,
875     WOD_OFF_THE_RECORD,
876     WOD_IGNORE_ACTION
877 }
878 
879 
880 alias cef_drag_operations_mask_t = int;
881 enum {
882     DRAG_OPERATION_NONE = 0,
883     DRAG_OPERATION_COPY = 1,
884     DRAG_OPERATION_LINK = 2,
885     DRAG_OPERATION_GENERIC = 4,
886     DRAG_OPERATION_PRIVATE = 8,
887     DRAG_OPERATION_MOVE = 16,
888     DRAG_OPERATION_DELETE = 32,
889     DRAG_OPERATION_EVERY = uint.max,
890 }
891 
892 alias cef_v8_accesscontrol_t = int;
893 enum {
894     V8_ACCESS_CONTROL_DEFAULT = 0,
895     V8_ACCESS_CONTROL_ALL_CAN_READ = 1,
896     V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1<<1,
897     V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1<<2
898 }
899 
900 alias cef_v8_propertyattribute_t = int;
901 enum {
902     V8_PROPERTY_ATTRIBUTE_NONE       = 0,
903     V8_PROPERTY_ATTRIBUTE_READONLY   = 1<<0,
904     V8_PROPERTY_ATTRIBUTE_DONTENUM   = 1<<1,
905     V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1<<2
906 }
907 
908 alias cef_postdataelement_type_t = int;
909 enum {
910     PDE_TYPE_EMPTY = 0,
911     PDE_TYPE_BYTES,
912     PDE_TYPE_FILE,
913 }
914 
915 alias cef_resource_type_t = int;
916 enum {
917     RT_MAIN_FRAME = 0,
918     RT_SUB_FRAME,
919     RT_STYLESHEET,
920     RT_SCRIPT,
921     RT_IMAGE,
922     RT_FONT_RESOURCE,
923     RT_SUB_RESOURCE,
924     RT_OBJECT,
925     RT_MEDIA,
926     RT_WORKER,
927     RT_SHARED_WORKER,
928     RT_PREFETCH,
929     RT_FAVICON,
930     RT_XHR,
931     RT_PING,
932     RT_SERVICE_WORKER,
933     RT_CSP_REPORT,
934     RT_PLUGIN_RESOURCE,
935 }
936 
937 alias cef_transition_type_t = int;
938 enum {
939     TT_LINK = 0,
940     TT_EXPLICIT = 1,
941     TT_AUTO_SUBFRAME = 3,
942     TT_MANUAL_SUBFRAME = 4,
943     TT_FORM_SUBMIT = 7,
944     TT_RELOAD = 8,
945     TT_SOURCE_MASK = 0xFF,
946     TT_BLOCKED_FLAG = 0x00800000,
947     TT_FORWARD_BACK_FLAG = 0x01000000,
948     TT_CHAIN_START_FLAG = 0x10000000,
949     TT_CHAIN_END_FLAG = 0x20000000,
950     TT_CLIENT_REDIRECT_FLAG = 0x40000000,
951     TT_SERVER_REDIRECT_FLAG = 0x80000000,
952     TT_IS_REDIRECT_MASK = 0xC0000000,
953     TT_QUALIFIER_MASK = 0xFFFFFF00,
954 }
955 
956 alias cef_urlrequest_flags_t = int;
957 enum {
958     UR_FLAG_NONE = 0,
959     UR_FLAG_SKIP_CACHE = 1 << 0,
960     UR_FLAG_ONLY_FROM_CACHE = 1 << 1,
961     UR_FLAG_ALLOW_STORED_CREDENTIALS = 1 << 2,
962     UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3,
963     UR_FLAG_NO_DOWNLOAD_DATA = 1 << 4,
964     UR_FLAG_NO_RETRY_ON_5XX = 1 << 5,
965     UR_FLAG_STOP_ON_REDIRECT = 1 << 6,
966 }
967 
968 alias cef_urlrequest_status_t = int;
969 enum {
970     UR_UNKNOWN = 0,
971     UR_SUCCESS,
972     UR_IO_PENDING,
973     UR_CANCELED,
974     UR_FAILED,
975 }
976 
977 struct cef_point_t {
978     int x;
979     int y;
980 }
981 
982 struct cef_rect_t {
983     int x;
984     int y;
985     int width;
986     int height;
987 }
988 
989 struct cef_size_t {
990     int width;
991     int height;
992 }
993 
994 struct cef_range_t {
995     int from;
996     int to;
997 }
998 
999 struct cef_insets_t {
1000   int top;
1001   int left;
1002   int bottom;
1003   int right;
1004 }
1005 
1006 struct cef_draggable_region_t {
1007     cef_rect_t bounds;
1008     int draggable;
1009 }
1010 
1011 alias cef_process_id_t = int;
1012 enum {
1013     PID_BROWSER,
1014     PID_RENDERER,
1015 }
1016 
1017 alias cef_thread_id_t = int;
1018 enum {
1019     TID_UI,
1020     TID_DB,
1021     TID_FILE,
1022     TID_FILE_USER_BLOCKING,
1023     TID_PROCESS_LAUNCHER,
1024     TID_CACHE,
1025     TID_IO,
1026     TID_RENDERER,
1027 }
1028 
1029 alias cef_thread_priority_t = int;
1030 enum {
1031     TP_BACKGROUND,
1032     TP_NORMAL,
1033     TP_DISPLAY,
1034     TP_REALTIME_AUDIO,
1035 }
1036 
1037 alias cef_message_loop_type_t = int;
1038 enum {
1039     ML_TYPE_DEFAULT,
1040     ML_TYPE_UI,
1041     ML_TYPE_IO,
1042 }
1043 
1044 alias cef_com_init_mode_t = int;
1045 enum {
1046     COM_INIT_MODE_NONE,
1047     COM_INIT_MODE_STA,
1048     COM_INIT_MODE_MTA,
1049 }
1050 
1051 alias cef_value_type_t = int;
1052 enum {
1053     VTYPE_INVALID = 0,
1054     VTYPE_NULL,
1055     VTYPE_BOOL,
1056     VTYPE_INT,
1057     VTYPE_DOUBLE,
1058     VTYPE_STRING,
1059     VTYPE_BINARY,
1060     VTYPE_DICTIONARY,
1061     VTYPE_LIST,
1062 }
1063 
1064 alias cef_jsdialog_type_t = int;
1065 enum {
1066     JSDIALOGTYPE_ALERT = 0,
1067     JSDIALOGTYPE_CONFIRM,
1068     JSDIALOGTYPE_PROMPT,
1069 }
1070 
1071 struct cef_screen_info_t {
1072     float device_scale_factor;
1073     int depth;
1074     int depth_per_component;
1075     int is_monochrome;
1076     cef_rect_t rect;
1077     cef_rect_t available_rect;
1078 }
1079 
1080 alias cef_menu_id_t = int;
1081 enum {
1082     MENU_ID_BACK = 100,
1083     MENU_ID_FORWARD = 101,
1084     MENU_ID_RELOAD = 102,
1085     MENU_ID_RELOAD_NOCACHE = 103,
1086     MENU_ID_STOPLOAD = 104,
1087     MENU_ID_UNDO = 110,
1088     MENU_ID_REDO = 111,
1089     MENU_ID_CUT = 112,
1090     MENU_ID_COPY = 113,
1091     MENU_ID_PASTE = 114,
1092     MENU_ID_DELETE = 115,
1093     MENU_ID_SELECT_ALL = 116,
1094     MENU_ID_FIND = 130,
1095     MENU_ID_PRINT = 131,
1096     MENU_ID_VIEW_SOURCE = 132,
1097     MENU_ID_SPELLCHECK_SUGGESTION_0 = 200,
1098     MENU_ID_SPELLCHECK_SUGGESTION_1 = 201,
1099     MENU_ID_SPELLCHECK_SUGGESTION_2 = 202,
1100     MENU_ID_SPELLCHECK_SUGGESTION_3 = 203,
1101     MENU_ID_SPELLCHECK_SUGGESTION_4 = 204,
1102     MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204,
1103     MENU_ID_NO_SPELLING_SUGGESTIONS = 205,
1104     MENU_ID_ADD_TO_DICTIONARY = 206,
1105     MENU_ID_CUSTOM_FIRST = 220,
1106     MENU_ID_CUSTOM_LAST = 250,
1107     MENU_ID_USER_FIRST = 26500,
1108     MENU_ID_USER_LAST = 28500,
1109 }
1110 
1111 alias cef_mouse_button_type_t = int;
1112 enum {
1113     MBT_LEFT = 0,
1114     MBT_MIDDLE,
1115     MBT_RIGHT,
1116 }
1117 
1118 struct cef_mouse_event_t {
1119     int x;
1120     int y;
1121     uint32 modifiers;
1122 }
1123 
1124 alias cef_paint_element_type_t = int;
1125 enum {
1126     PET_VIEW = 0,
1127     PET_POPUP,
1128 }
1129 
1130 alias cef_event_flags_t = int;
1131 enum {
1132     EVENTFLAG_NONE = 0,
1133     EVENTFLAG_CAPS_LOCK_ON = 1<<0,
1134     EVENTFLAG_SHIFT_DOWN = 1<<1,
1135     EVENTFLAG_CONTROL_DOWN = 1<<2,
1136     EVENTFLAG_ALT_DOWN = 1<<3,
1137     EVENTFLAG_LEFT_MOUSE_BUTTON = 1<<4,
1138     EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1<<5,
1139     EVENTFLAG_RIGHT_MOUSE_BUTTON = 1<<6,
1140     EVENTFLAG_COMMAND_DOWN = 1<<7,
1141     EVENTFLAG_NUM_LOCK_ON = 1<<8,
1142     EVENTFLAG_IS_KEY_PAD = 1<<9,
1143     EVENTFLAG_IS_LEFT = 1<<10,
1144     EVENTFLAG_IS_RIGHT = 1<<11,
1145 }
1146 
1147 alias cef_menu_item_type_t = int;
1148 enum {
1149     MENUITEMTYPE_NONE,
1150     MENUITEMTYPE_COMMAND,
1151     MENUITEMTYPE_CHECK,
1152     MENUITEMTYPE_RADIO,
1153     MENUITEMTYPE_SEPARATOR,
1154     MENUITEMTYPE_SUBMENU,
1155 }
1156 
1157 alias cef_context_menu_type_flags_t = int;
1158 enum {
1159     CM_TYPEFLAG_NONE = 0,
1160     CM_TYPEFLAG_PAGE = 1<<0,
1161     CM_TYPEFLAG_FRAME = 1<<1,
1162     CM_TYPEFLAG_LINK = 1<<2,
1163     CM_TYPEFLAG_MEDIA = 1<<3,
1164     CM_TYPEFLAG_SELECTION = 1<<4,
1165     CM_TYPEFLAG_EDITABLE = 1<<5,
1166 }
1167 
1168 alias cef_context_menu_media_type_t = int;
1169 enum {
1170     CM_MEDIATYPE_NONE,
1171     CM_MEDIATYPE_IMAGE,
1172     CM_MEDIATYPE_VIDEO,
1173     CM_MEDIATYPE_AUDIO,
1174     CM_MEDIATYPE_FILE,
1175     CM_MEDIATYPE_PLUGIN,
1176 }
1177 
1178 alias cef_context_menu_media_state_flags_t = int;
1179 enum {
1180     CM_MEDIAFLAG_NONE = 0,
1181     CM_MEDIAFLAG_ERROR = 1<<0,
1182     CM_MEDIAFLAG_PAUSED = 1<<1,
1183     CM_MEDIAFLAG_MUTED = 1<<2,
1184     CM_MEDIAFLAG_LOOP = 1<<3,
1185     CM_MEDIAFLAG_CAN_SAVE = 1<<4,
1186     CM_MEDIAFLAG_HAS_AUDIO = 1<<5,
1187     CM_MEDIAFLAG_HAS_VIDEO = 1<<6,
1188     CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1<<7,
1189     CM_MEDIAFLAG_CAN_PRINT = 1<<8,
1190     CM_MEDIAFLAG_CAN_ROTATE = 1<<9,
1191 }
1192 
1193 alias cef_context_menu_edit_state_flags_t = int;
1194 enum {
1195     CM_EDITFLAG_NONE = 0,
1196     CM_EDITFLAG_CAN_UNDO = 1<<0,
1197     CM_EDITFLAG_CAN_REDO = 1<<1,
1198     CM_EDITFLAG_CAN_CUT = 1<<2,
1199     CM_EDITFLAG_CAN_COPY = 1<<3,
1200     CM_EDITFLAG_CAN_PASTE = 1<<4,
1201     CM_EDITFLAG_CAN_DELETE = 1<<5,
1202     CM_EDITFLAG_CAN_SELECT_ALL = 1<<6,
1203     CM_EDITFLAG_CAN_TRANSLATE = 1<<7,
1204 }
1205 
1206 alias cef_key_event_type_t = int;
1207 enum {
1208     KEYEVENT_RAWKEYDOWN = 0,
1209     KEYEVENT_KEYDOWN,
1210     KEYEVENT_KEYUP,
1211     KEYEVENT_CHAR
1212 }
1213 
1214 struct cef_key_event_t {
1215     cef_key_event_type_t type;
1216     uint32 modifiers;
1217     int windows_key_code;
1218     int native_key_code;
1219     int is_system_key;
1220     char16 character;
1221     char16 unmodified_character;
1222     int focus_on_editable_field;
1223 }
1224 
1225 alias cef_focus_source_t = int;
1226 enum {
1227     FOCUS_SOURCE_NAVIGATION = 0,
1228     FOCUS_SOURCE_SYSTEM,
1229 }
1230 
1231 alias cef_navigation_type_t = int;
1232 enum {
1233     NAVIGATION_LINK_CLICKED = 0,
1234     NAVIGATION_FORM_SUBMITTED,
1235     NAVIGATION_BACK_FORWARD,
1236     NAVIGATION_RELOAD,
1237     NAVIGATION_FORM_RESUBMITTED,
1238     NAVIGATION_OTHER,
1239 }
1240 
1241 alias cef_xml_encoding_type_t = int;
1242 enum {
1243     XML_ENCODING_NONE = 0,
1244     XML_ENCODING_UTF8,
1245     XML_ENCODING_UTF16LE,
1246     XML_ENCODING_UTF16BE,
1247     XML_ENCODING_ASCII,
1248 }
1249 
1250 alias cef_xml_node_type_t = int;
1251 enum {
1252     XML_NODE_UNSUPPORTED = 0,
1253     XML_NODE_PROCESSING_INSTRUCTION,
1254     XML_NODE_DOCUMENT_TYPE,
1255     XML_NODE_ELEMENT_START,
1256     XML_NODE_ELEMENT_END,
1257     XML_NODE_ATTRIBUTE,
1258     XML_NODE_TEXT,
1259     XML_NODE_CDATA,
1260     XML_NODE_ENTITY_REFERENCE,
1261     XML_NODE_WHITESPACE,
1262     XML_NODE_COMMENT,
1263 }
1264 
1265 struct cef_popup_features_t {
1266     int x;
1267     int xSet;
1268     int y;
1269     int ySet;
1270     int width;
1271     int widthSet;
1272     int height;
1273     int heightSet;
1274     int menuBarVisible;
1275     int statusBarVisible;
1276     int toolBarVisible;
1277     int scrollbarsVisible;
1278 }
1279 
1280 alias cef_dom_document_type_t = int;
1281 enum {
1282     DOM_DOCUMENT_TYPE_UNKNOWN = 0,
1283     DOM_DOCUMENT_TYPE_HTML,
1284     DOM_DOCUMENT_TYPE_XHTML,
1285     DOM_DOCUMENT_TYPE_PLUGIN,
1286 }
1287 
1288 alias cef_dom_event_category_t = int;
1289 enum {
1290     DOM_EVENT_CATEGORY_UNKNOWN = 0x0,
1291     DOM_EVENT_CATEGORY_UI = 0x1,
1292     DOM_EVENT_CATEGORY_MOUSE = 0x2,
1293     DOM_EVENT_CATEGORY_MUTATION = 0x4,
1294     DOM_EVENT_CATEGORY_KEYBOARD = 0x8,
1295     DOM_EVENT_CATEGORY_TEXT = 0x10,
1296     DOM_EVENT_CATEGORY_COMPOSITION = 0x20,
1297     DOM_EVENT_CATEGORY_DRAG = 0x40,
1298     DOM_EVENT_CATEGORY_CLIPBOARD = 0x80,
1299     DOM_EVENT_CATEGORY_MESSAGE = 0x100,
1300     DOM_EVENT_CATEGORY_WHEEL = 0x200,
1301     DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400,
1302     DOM_EVENT_CATEGORY_OVERFLOW = 0x800,
1303     DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000,
1304     DOM_EVENT_CATEGORY_POPSTATE = 0x2000,
1305     DOM_EVENT_CATEGORY_PROGRESS = 0x4000,
1306     DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000,
1307 }
1308 
1309 alias cef_dom_event_phase_t = int;
1310 enum {
1311     DOM_EVENT_PHASE_UNKNOWN = 0,
1312     DOM_EVENT_PHASE_CAPTURING,
1313     DOM_EVENT_PHASE_AT_TARGET,
1314     DOM_EVENT_PHASE_BUBBLING,
1315 }
1316 
1317 alias cef_dom_node_type_t = int;
1318 enum {
1319     DOM_NODE_TYPE_UNSUPPORTED = 0,
1320     DOM_NODE_TYPE_ELEMENT,
1321     DOM_NODE_TYPE_ATTRIBUTE,
1322     DOM_NODE_TYPE_TEXT,
1323     DOM_NODE_TYPE_CDATA_SECTION,
1324     DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS,
1325     DOM_NODE_TYPE_COMMENT,
1326     DOM_NODE_TYPE_DOCUMENT,
1327     DOM_NODE_TYPE_DOCUMENT_TYPE,
1328     DOM_NODE_TYPE_DOCUMENT_FRAGMENT
1329 }
1330 
1331 alias cef_file_dialog_mode_t = int;
1332 enum {
1333     FILE_DIALOG_OPEN,
1334     FILE_DIALOG_OPEN_MULTIPLE,
1335     FILE_DIALOG_OPEN_FOLDER,
1336     FILE_DIALOG_SAVE,
1337     FILE_DIALOG_TYPE_MASK = 0xFF,
1338     FILE_DIALOG_OVERWRITEPROMPT_FLAG = 0x01000000,
1339     FILE_DIALOG_HIDEREADONLY_FLAG = 0x02000000,
1340 }
1341 
1342 alias cef_color_model_t = int;
1343 enum {
1344     COLOR_MODEL_UNKNOWN,
1345     COLOR_MODEL_GRAY,
1346     COLOR_MODEL_COLOR,
1347     COLOR_MODEL_CMYK,
1348     COLOR_MODEL_CMY,
1349     COLOR_MODEL_KCMY,
1350     COLOR_MODEL_CMY_K,  // CMY_K represents CMY+K.
1351     COLOR_MODEL_BLACK,
1352     COLOR_MODEL_GRAYSCALE,
1353     COLOR_MODEL_RGB,
1354     COLOR_MODEL_RGB16,
1355     COLOR_MODEL_RGBA,
1356     COLOR_MODEL_COLORMODE_COLOR,              // Used in samsung printer ppds.
1357     COLOR_MODEL_COLORMODE_MONOCHROME,         // Used in samsung printer ppds.
1358     COLOR_MODEL_HP_COLOR_COLOR,               // Used in HP color printer ppds.
1359     COLOR_MODEL_HP_COLOR_BLACK,               // Used in HP color printer ppds.
1360     COLOR_MODEL_PRINTOUTMODE_NORMAL,          // Used in foomatic ppds.
1361     COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY,     // Used in foomatic ppds.
1362     COLOR_MODEL_PROCESSCOLORMODEL_CMYK,       // Used in canon printer ppds.
1363     COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE,  // Used in canon printer ppds.
1364     COLOR_MODEL_PROCESSCOLORMODEL_RGB,        // Used in canon printer ppds
1365 }
1366 
1367 alias cef_duplex_mode_t = int;
1368 enum {
1369     DUPLEX_MODE_UNKNOWN = -1,
1370     DUPLEX_MODE_SIMPLEX,
1371     DUPLEX_MODE_LONG_EDGE,
1372     DUPLEX_MODE_SHORT_EDGE,
1373 }
1374 
1375 alias cef_cursor_type_t = int;
1376 enum {
1377     CT_POINTER = 0,
1378     CT_CROSS,
1379     CT_HAND,
1380     CT_IBEAM,
1381     CT_WAIT,
1382     CT_HELP,
1383     CT_EASTRESIZE,
1384     CT_NORTHRESIZE,
1385     CT_NORTHEASTRESIZE,
1386     CT_NORTHWESTRESIZE,
1387     CT_SOUTHRESIZE,
1388     CT_SOUTHEASTRESIZE,
1389     CT_SOUTHWESTRESIZE,
1390     CT_WESTRESIZE,
1391     CT_NORTHSOUTHRESIZE,
1392     CT_EASTWESTRESIZE,
1393     CT_NORTHEASTSOUTHWESTRESIZE,
1394     CT_NORTHWESTSOUTHEASTRESIZE,
1395     CT_COLUMNRESIZE,
1396     CT_ROWRESIZE,
1397     CT_MIDDLEPANNING,
1398     CT_EASTPANNING,
1399     CT_NORTHPANNING,
1400     CT_NORTHEASTPANNING,
1401     CT_NORTHWESTPANNING,
1402     CT_SOUTHPANNING,
1403     CT_SOUTHEASTPANNING,
1404     CT_SOUTHWESTPANNING,
1405     CT_WESTPANNING,
1406     CT_MOVE,
1407     CT_VERTICALTEXT,
1408     CT_CELL,
1409     CT_CONTEXTMENU,
1410     CT_ALIAS,
1411     CT_PROGRESS,
1412     CT_NODROP,
1413     CT_COPY,
1414     CT_NONE,
1415     CT_NOTALLOWED,
1416     CT_ZOOMIN,
1417     CT_ZOOMOUT,
1418     CT_GRAB,
1419     CT_GRABBING,
1420     CT_CUSTOM,
1421 }
1422 
1423 struct cef_cursor_info_t {
1424     cef_point_t hotspot;
1425     float image_scale_factor;
1426     void* buffer;
1427     cef_size_t size;
1428 }
1429 
1430 alias cef_uri_unescape_rule_t = int;
1431 enum {
1432     UU_NONE = 0,
1433     UU_NORMAL = 1 << 0,
1434     UU_SPACES = 1 << 1,
1435     UU_PATH_SEPARATORS = 1 << 2,
1436     UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = 1 << 3,
1437     UU_SPOOFING_AND_CONTROL_CHARS = 1 << 4,
1438     UU_REPLACE_PLUS_WITH_SPACE = 1 << 5,
1439 }
1440 
1441 alias cef_json_parser_options_t = int;
1442 enum {
1443     JSON_PARSER_RFC = 0,
1444     JSON_PARSER_ALLOW_TRAILING_COMMAS = 1 << 0,
1445 }
1446 
1447 alias cef_json_parser_error_t = int;
1448 enum {
1449     JSON_NO_ERROR = 0,
1450     JSON_INVALID_ESCAPE,
1451     JSON_SYNTAX_ERROR,
1452     JSON_UNEXPECTED_TOKEN,
1453     JSON_TRAILING_COMMA,
1454     JSON_TOO_MUCH_NESTING,
1455     JSON_UNEXPECTED_DATA_AFTER_ROOT,
1456     JSON_UNSUPPORTED_ENCODING,
1457     JSON_UNQUOTED_DICTIONARY_KEY,
1458     JSON_PARSE_ERROR_COUNT
1459 }
1460 
1461 alias cef_json_writer_options_t = int;
1462 enum {
1463     JSON_WRITER_DEFAULT = 0,
1464     JSON_WRITER_OMIT_BINARY_VALUES = 1 << 0,
1465     JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = 1 << 1,
1466     JSON_WRITER_PRETTY_PRINT = 1 << 2,
1467 }
1468 
1469 alias cef_pdf_print_margin_type_t = int;
1470 enum {
1471     PDF_PRINT_MARGIN_DEFAULT,
1472     PDF_PRINT_MARGIN_NONE,
1473     PDF_PRINT_MARGIN_MINIMUM,
1474     PDF_PRINT_MARGIN_CUSTOM,
1475 }
1476 
1477 struct cef_pdf_print_settings_t {
1478     cef_string_t header_footer_title;
1479     cef_string_t header_footer_url;
1480     int page_width;
1481     int page_height;
1482     int scale_factor;
1483     double margin_top;
1484     double margin_right;
1485     double margin_bottom;
1486     double margin_left;
1487     cef_pdf_print_margin_type_t margin_type;
1488     int header_footer_enabled;
1489     int selection_only;
1490     int landscape;
1491     int backgrounds_enabled;
1492 }
1493 
1494 alias cef_scale_factor_t = int;
1495 enum {
1496     SCALE_FACTOR_NONE = 0,
1497     SCALE_FACTOR_100P,
1498     SCALE_FACTOR_125P,
1499     SCALE_FACTOR_133P,
1500     SCALE_FACTOR_140P,
1501     SCALE_FACTOR_150P,
1502     SCALE_FACTOR_180P,
1503     SCALE_FACTOR_200P,
1504     SCALE_FACTOR_250P,
1505     SCALE_FACTOR_300P,
1506 }
1507 
1508 alias cef_plugin_policy_t = int;
1509 enum {
1510     PLUGIN_POLICY_ALLOW,
1511     PLUGIN_POLICY_DETECT_IMPORTANT,
1512     PLUGIN_POLICY_BLOCK,
1513     PLUGIN_POLICY_DISABLE,
1514 }
1515 
1516 alias cef_referrer_policy_t = int;
1517 enum {
1518     REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
1519     REFERRER_POLICY_DEFAULT,
1520     REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN,
1521     REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN,
1522     REFERRER_POLICY_NEVER_CLEAR_REFERRER,
1523     REFERRER_POLICY_ORIGIN,
1524     REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN,
1525     REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
1526     REFERRER_POLICY_NO_REFERRER,
1527     REFERRER_POLICY_LAST_VALUE,
1528 }
1529 
1530 alias cef_response_filter_status_t = int;
1531 enum {
1532     RESPONSE_FILTER_NEED_MORE_DATA,
1533     RESPONSE_FILTER_DONE,
1534     RESPONSE_FILTER_ERROR
1535 }
1536 
1537 alias cef_color_type_t = int;
1538 enum {
1539     CEF_COLOR_TYPE_RGBA_8888,
1540     CEF_COLOR_TYPE_BGRA_8888,
1541 }
1542 
1543 alias cef_alpha_type_t = int;
1544 enum {
1545     CEF_ALPHA_TYPE_OPAQUE,
1546     CEF_ALPHA_TYPE_PREMULTIPLIED,
1547     CEF_ALPHA_TYPE_POSTMULTIPLIED,
1548 }
1549 
1550 alias cef_text_style_t = int;
1551 enum {
1552     CEF_TEXT_STYLE_BOLD,
1553     CEF_TEXT_STYLE_ITALIC,
1554     CEF_TEXT_STYLE_STRIKE,
1555     CEF_TEXT_STYLE_DIAGONAL_STRIKE,
1556     CEF_TEXT_STYLE_UNDERLINE,
1557 }
1558 
1559 alias cef_main_axis_alignment_t = int;
1560 enum {
1561     CEF_MAIN_AXIS_ALIGNMENT_START,
1562     CEF_MAIN_AXIS_ALIGNMENT_CENTER,
1563     CEF_MAIN_AXIS_ALIGNMENT_END,
1564 }
1565 
1566 alias cef_cross_axis_alignment_t = int;
1567 enum {
1568     CEF_CROSS_AXIS_ALIGNMENT_STRETCH,
1569     CEF_CROSS_AXIS_ALIGNMENT_START,
1570     CEF_CROSS_AXIS_ALIGNMENT_CENTER,
1571     CEF_CROSS_AXIS_ALIGNMENT_END,
1572 }
1573 
1574 struct cef_box_layout_settings_t {
1575     int horizontal;
1576     int inside_border_horizontal_spacing;
1577     int inside_border_vertical_spacing;
1578     cef_insets_t inside_border_insets;
1579     int between_child_spacing;
1580     cef_main_axis_alignment_t main_axis_alignment;
1581     cef_cross_axis_alignment_t cross_axis_alignment;
1582     int minimum_cross_axis_size;
1583     int default_flex;
1584 }
1585 
1586 alias cef_button_state_t = int;
1587 enum {
1588     CEF_BUTTON_STATE_NORMAL,
1589     CEF_BUTTON_STATE_HOVERED,
1590     CEF_BUTTON_STATE_PRESSED,
1591     CEF_BUTTON_STATE_DISABLED,
1592 }
1593 
1594 alias cef_horizontal_alignment_t = int;
1595 enum {
1596     CEF_HORIZONTAL_ALIGNMENT_LEFT,
1597     CEF_HORIZONTAL_ALIGNMENT_CENTER,
1598     CEF_HORIZONTAL_ALIGNMENT_RIGHT,
1599 }
1600 
1601 alias cef_menu_anchor_position_t = int;
1602 enum {
1603   CEF_MENU_ANCHOR_TOPLEFT,
1604   CEF_MENU_ANCHOR_TOPRIGHT,
1605   CEF_MENU_ANCHOR_BOTTOMCENTER,
1606 }
1607 
1608 alias cef_menu_color_type_t = int;
1609 enum {
1610     CEF_MENU_COLOR_TEXT,
1611     CEF_MENU_COLOR_TEXT_HOVERED,
1612     CEF_MENU_COLOR_TEXT_ACCELERATOR,
1613     CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED,
1614     CEF_MENU_COLOR_BACKGROUND,
1615     CEF_MENU_COLOR_BACKGROUND_HOVERED,
1616     CEF_MENU_COLOR_COUNT,
1617 }
1618 
1619 alias cef_ssl_version_t = int;
1620 enum {
1621     SSL_CONNECTION_VERSION_UNKNOWN = 0,
1622     SSL_CONNECTION_VERSION_SSL2 = 1,
1623     SSL_CONNECTION_VERSION_SSL3 = 2,
1624     SSL_CONNECTION_VERSION_TLS1 = 3,
1625     SSL_CONNECTION_VERSION_TLS1_1 = 4,
1626     SSL_CONNECTION_VERSION_TLS1_2 = 5,
1627     SSL_CONNECTION_VERSION_QUIC = 7,
1628 }
1629 
1630 alias cef_ssl_content_status_t = int;
1631 enum {
1632     SSL_CONTENT_NORMAL_CONTENT = 0,
1633     SSL_CONTENT_DISPLAYED_INSECURE_CONTENT = 1 << 0,
1634     SSL_CONTENT_RAN_INSECURE_CONTENT = 1 << 1,
1635 }
1636 
1637 alias cef_cdm_registration_error_t = int;
1638 enum {
1639     CEF_CDM_REGISTRATION_ERROR_NONE,
1640     CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS,
1641     CEF_CDM_REGISTRATION_ERROR_INCOMPATIBLE,
1642     CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED,
1643 }
1644 
1645 struct cef_composition_underline_t {
1646     cef_range_t range;
1647     cef_color_t color;
1648     cef_color_t background_color;
1649     int thick;
1650 }
1651 
1652 // cef_types_win.h
1653 alias cef_cursor_handle_t = void*;
1654 alias cef_event_handle_t = void*;
1655 alias cef_window_handle_t = void*;
1656 alias cef_text_input_context_t = void*;
1657 
1658 static if( Derelict_OS_Windows ) {
1659     struct cef_main_args_t {
1660         void* instance;
1661     }
1662 
1663     struct cef_window_info_t {
1664         uint ex_style;
1665         cef_string_t window_name;
1666         uint style;
1667         int x;
1668         int y;
1669         int width;
1670         int height;
1671         cef_window_handle_t parent_window;
1672         void* menu;
1673         int window_rendering_disabled;
1674         int transparent_painting;
1675         cef_window_handle_t window;
1676     }
1677 } else static if( Derelict_OS_Linux ) {
1678     struct cef_main_args_t {
1679         int argc;
1680         char** argv;
1681     }
1682 
1683     struct cef_window_info_t {
1684         cef_window_handle_t parent_widget;
1685         int window_rendering_disabled;
1686         int transparent_painting;
1687         cef_window_handle_t widget;
1688     }
1689 } else static if( Derelict_OS_Mac ) {
1690     struct cef_main_args_t {
1691         int argc;
1692         char** argv;
1693     }
1694 
1695     struct cef_window_info_t {
1696         cef_string_t window_name;
1697         int x;
1698         int y;
1699         int width;
1700         int height;
1701         int hidden;
1702         cef_window_handle_t parent_view;
1703         int window_rendering_disabled;
1704         int transparent_painting;
1705         cef_window_handle_t view;
1706     }
1707 } else {
1708     static assert( 0, "Platform-specific types not yet implemented on this platform." );
1709 }
1710 
1711 // cef_accessibility_handler_capi.h
1712 struct cef_accessibility_handler_t {
1713     cef_base_t base;
1714     extern( System ) @nogc nothrow {
1715         void function( cef_accessibility_handler_t* , cef_value_t* ) on_accessibility_tree_change;
1716         void function( cef_accessibility_handler_t*, cef_value_t* ) on_accessibility_location_change;
1717     }
1718 }
1719 
1720 // cef_app_capi.h
1721 struct cef_app_t {
1722     cef_base_t base;
1723     extern( System ) @nogc nothrow {
1724         void function( cef_app_t*,const( cef_string_t )*,cef_command_line_t* ) on_before_command_line_processing;
1725         void function( cef_app_t*,cef_scheme_registrar_t* ) on_register_custom_schemes;
1726         cef_resource_bundle_handler_t* function( cef_app_t* ) get_resource_bundle_handler;
1727         cef_browser_process_handler_t* function( cef_app_t* ) get_browser_process_handler;
1728         cef_render_process_handler_t* function( cef_app_t* ) get_render_process_handler;
1729     }
1730 }
1731 
1732 // cef_auth_callback_capi.h
1733 struct cef_auth_callback_t {
1734     cef_base_t base;
1735     extern( System ) @nogc nothrow {
1736         void function( cef_auth_callback_t*, const( cef_string_t )*, const( cef_string_t )* ) cont;
1737         void function( cef_auth_callback_t* ) cancel;
1738     }
1739 }
1740 
1741 // cef_base_capi.h
1742 struct cef_base_t {
1743     size_t size;
1744     extern( System ) @nogc nothrow {
1745         int function( cef_base_t* ) add_ref;
1746         int function( cef_base_t* ) release;
1747         int function( cef_base_t* ) has_one_ref;
1748         int function( cef_base_t* ) has_at_least_one_ref;
1749     }
1750 }
1751 
1752 struct cef_base_scoped_t {
1753     size_t size;
1754     extern( System ) @nogc nothrow void function( cef_base_scoped_t* ) del;
1755 }
1756 
1757 // cef_browser_capi.h
1758 static if( Derelict_OS_Windows ) {
1759     alias cef_platform_thread_id_t = uint;
1760     alias cef_platform_thread_handle_t = uint;
1761 } else static if( Derelict_OS_Posix ) {
1762     import core.sys.posix.unistd: pid_t;
1763     alias cef_platform_thread_id_t = pid_t;
1764     alias cef_platform_thread_handle_t = pid_t;
1765 } else {
1766     static assert( 0, "Platform-specific types not yet implemented on this platform." );
1767 }
1768 
1769 struct cef_browser_t {
1770     cef_base_t base;
1771     extern( System ) @nogc nothrow {
1772         cef_browser_host_t* function( cef_browser_t* ) get_host;
1773         int function( cef_browser_t* ) can_go_back;
1774         void function( cef_browser_t* ) go_back;
1775         int function( cef_browser_t* ) can_go_forward;
1776         void function( cef_browser_t* ) go_forward;
1777         int function( cef_browser_t* ) is_loading;
1778         void function( cef_browser_t* ) reload;
1779         void function( cef_browser_t* ) reload_ignore_cache;
1780         void function( cef_browser_t* ) stop_load;
1781         int function( cef_browser_t* ) get_identifier;
1782         int function( cef_browser_t*,cef_browser_t* ) is_same;
1783         int function( cef_browser_t* ) is_popup;
1784         int function( cef_browser_t* ) has_document;
1785         cef_frame_t* function( cef_browser_t* ) get_main_frame;
1786         cef_frame_t* function( cef_browser_t* ) get_focused_frame;
1787         cef_frame_t* function( cef_browser_t*,int64 ) get_frame_byident;
1788         cef_frame_t* function( cef_browser_t*,const( cef_string_t )* ) get_frame;
1789         size_t function( cef_browser_t* ) get_frame_count;
1790         void function( cef_browser_t*,size_t*,int64* ) get_frame_identifiers;
1791         void function( cef_browser_t*,cef_string_list_t ) get_frame_names;
1792         int function( cef_browser_t*,cef_process_id_t,cef_process_message_t* ) send_process_message;
1793     }
1794 }
1795 
1796 struct cef_run_file_dialog_callback_t {
1797     cef_base_t base;
1798     extern( System ) @nogc nothrow void function( cef_run_file_dialog_callback_t*,cef_browser_host_t*,cef_string_list_t ) cont;
1799 }
1800 
1801 struct cef_navigation_entry_visitor_t {
1802     cef_base_t base;
1803     extern( System ) @nogc nothrow int function( cef_navigation_entry_visitor_t*, cef_navigation_entry_t*, int, int, int ) visit;
1804 }
1805 
1806 struct cef_pdf_print_callback_t {
1807     cef_base_t base;
1808     extern( System ) @nogc nothrow void function( cef_pdf_print_callback_t*, const( cef_string_t )*, int ) on_pdf_print_finished;
1809 }
1810 
1811 struct cef_download_image_callback_t {
1812     cef_base_t base;
1813     extern( System ) @nogc nothrow void function( cef_download_image_callback_t*, const( cef_string_t )*, int, cef_image_t* ) on_download_image_finished;
1814 }
1815 
1816 struct cef_browser_host_t {
1817     cef_base_t base;
1818     extern( System ) @nogc nothrow {
1819         cef_browser_t* function( cef_browser_host_t* ) get_browser;
1820         void function( cef_browser_host_t*, int ) close_browser;
1821         int function( cef_browser_host_t* ) try_close_browser;
1822         void function( cef_browser_host_t*, int ) set_focus;
1823         cef_window_handle_t function( cef_browser_host_t* ) get_window_handle;
1824         cef_window_handle_t function( cef_browser_host_t* ) get_opener_window_handle;
1825         int function( cef_browser_host_t* ) has_view;
1826         cef_client_t* function( cef_browser_host_t* ) get_client;
1827         cef_request_context_t* function( cef_browser_host_t* ) get_request_context;
1828         double function( cef_browser_host_t* ) get_zoom_level;
1829         void function( cef_browser_host_t*, double ) set_zoom_level;
1830         void function( cef_browser_host_t*, cef_file_dialog_mode_t, const( cef_string_t )*, const( cef_string_t )*, cef_string_list_t, int, cef_run_file_dialog_callback_t* ) run_file_dialog;
1831         void function( cef_browser_host_t*, const( cef_string_t )* ) start_download;
1832         void function( cef_browser_host_t*, const( cef_string_t )*, int, uint32, int, cef_download_image_callback_t* ) download_image;
1833         void function( cef_browser_host_t* ) print;
1834         void function( cef_browser_host_t*, const( cef_string_t )*, const( cef_pdf_print_settings_t )* settings, cef_pdf_print_callback_t* ) print_to_pdf;
1835         void function( cef_browser_host_t*, int, const( cef_string_t )*, int, int, int ) find;
1836         void function( cef_browser_host_t*, int ) stop_finding;
1837         void function( cef_browser_host_t*, const( cef_window_info_t )*, cef_client_t*, const( cef_browser_settings_t )*, const( cef_point_t )* ) show_dev_tools;
1838         void function( cef_browser_host_t* ) close_dev_tools;
1839         int function( cef_browser_host_t* ) has_dev_tools;
1840         void function( cef_browser_host_t*, cef_navigation_entry_visitor_t*, int ) get_navigation_entries;
1841         void function( cef_browser_host_t*, int ) set_mouse_cursor_change_disabled;
1842         int function( cef_browser_host_t* ) is_mouse_cursor_change_disabled;
1843         void function( cef_browser_host_t*, const( cef_string_t )* ) replace_misspelling;
1844         void function( cef_browser_host_t*, const( cef_string_t )* ) add_word_to_dictionary;
1845         int function( cef_browser_host_t* ) is_window_rendering_disabled;
1846         void function( cef_browser_host_t* ) was_resized;
1847         void function( cef_browser_host_t*, int ) was_hidden;
1848         void function( cef_browser_host_t* ) notify_screen_info_changed;
1849         void function( cef_browser_host_t*, cef_paint_element_type_t ) invalidate;
1850         void function( cef_browser_host_t* ) send_external_begin_frame;
1851         void function( cef_browser_host_t*, const( cef_key_event_t )* ) send_key_event;
1852         void function( cef_browser_host_t*, const( cef_mouse_event_t )*, cef_mouse_button_type_t, int, int ) send_mouse_click_event;
1853         void function( cef_browser_host_t*, const( cef_mouse_event_t )*, int ) send_mouse_move_event;
1854         void function( cef_browser_host_t* self, const( cef_mouse_event_t )*, int, int ) send_mouse_wheel_event;
1855         void function( cef_browser_host_t*, int ) send_focus_event;
1856         void function( cef_browser_host_t* ) send_capture_lost_event;
1857         void function( cef_browser_host_t* ) notify_move_or_resize_started;
1858         int function( cef_browser_host_t* ) get_windowless_frame_rate;
1859         void function( cef_browser_host_t*, int ) set_windowless_frame_rate;
1860         void function( cef_browser_host_t*, const( cef_string_t )*, size_t, const( cef_composition_underline_t* ), const( cef_range_t )*, const( cef_range_t )* ) ime_set_composition;
1861         void function( cef_browser_host_t*, const( cef_string_t )*, const( cef_range_t )*, int ) ime_commit_text;
1862         void function( cef_browser_host_t*, int ) ime_finish_composing_text;
1863         void function( cef_browser_host_t* ) ime_cancel_composition;
1864         void function( cef_browser_host_t*, cef_drag_data_t*, const( cef_mouse_event_t )*, cef_drag_operations_mask_t ) drag_target_drag_enter;
1865         void function( cef_browser_host_t*, const( cef_mouse_event_t )*, cef_drag_operations_mask_t ) drag_target_drag_over;
1866         void function( cef_browser_host_t* ) drag_target_drag_leave;
1867         void function( cef_browser_host_t*, const( cef_mouse_event_t )* ) drag_target_drop;
1868         void function( cef_browser_host_t*, int, int, cef_drag_operations_mask_t ) drag_source_ended_at;
1869         void function( cef_browser_host_t* ) drag_source_system_drag_ended;
1870         cef_navigation_entry_t* function( cef_browser_host_t* ) get_visible_navigation_entry;
1871         void function( cef_browser_host_t*, cef_state_t ) set_accessibility_state;
1872         void function( cef_browser_host_t*, int, const( cef_size_t )*, const( cef_size_t)* ) set_auto_resize_enabled;
1873         cef_extension_t* function( cef_browser_host_t* ) get_extension;
1874         int function( cef_browser_host_t* ) is_background_host;
1875     }
1876 }
1877 
1878 // cef_browser_process_handler_capi
1879 struct cef_browser_process_handler_t  {
1880     cef_base_t base;
1881     extern( System ) @nogc nothrow {
1882         void function( cef_browser_process_handler_t* ) on_context_initialized;
1883         void function( cef_browser_process_handler_t*,cef_command_line_t* ) on_before_child_process_launch;
1884         void function( cef_browser_process_handler_t*,cef_list_value_t* ) on_render_process_thread_created;
1885         cef_print_handler_t* function( cef_browser_process_handler_t* ) get_print_handler;
1886         void function( cef_browser_process_handler_t*, ulong ) on_schedule_message_pump_work;
1887     }
1888 }
1889 
1890 // cef_callback_capi.h
1891 struct cef_callback_t {
1892     cef_base_t base;
1893     extern( System ) @nogc nothrow {
1894         void function( cef_callback_t* ) cont;
1895         void function( cef_callback_t* ) cancel;
1896     }
1897 }
1898 
1899 struct cef_completion_callback_t {
1900     cef_base_t base;
1901     extern( System ) @nogc nothrow void function( cef_completion_callback_t* ) on_complete;
1902 }
1903 
1904 // cef_client_capi.h
1905 struct cef_client_t {
1906     cef_base_t base;
1907     extern( System ) @nogc nothrow {
1908         cef_context_menu_handler_t* function( cef_client_t* ) get_context_menu_handler;
1909         cef_dialog_handler_t* function( cef_client_t* ) get_dialog_handler;
1910         cef_display_handler_t* function( cef_client_t* ) get_display_handler;
1911         cef_download_handler_t* function( cef_client_t* ) get_download_handler;
1912         cef_drag_handler_t* function( cef_client_t* ) get_drag_handler;
1913         cef_find_handler_t* function( cef_client_t* ) get_find_handler;
1914         cef_focus_handler_t* function( cef_client_t* ) get_focus_handler;
1915         cef_jsdialog_handler_t* function( cef_client_t* ) get_jsdialog_handler;
1916         cef_keyboard_handler_t* function( cef_client_t* ) get_keyboard_handler;
1917         cef_life_span_handler_t* function( cef_client_t* ) get_life_span_handler;
1918         cef_load_handler_t* function( cef_client_t* ) get_load_handler;
1919         cef_render_handler_t* function( cef_client_t* ) get_render_handler;
1920         cef_request_handler_t* function( cef_client_t*) get_request_handler;
1921         int function( cef_client_t*,cef_browser_t*,cef_process_id_t,cef_process_message_t* ) on_process_message_received;
1922     }
1923 }
1924 
1925 // cef_command_line_capi.h
1926 struct cef_command_line_t {
1927     cef_base_t base;
1928     extern( System ) @nogc nothrow {
1929         int function( cef_command_line_t* ) is_valid;
1930         int function( cef_command_line_t* ) is_read_only;
1931         cef_command_line_t* function( cef_command_line_t* ) copy;
1932         void function( cef_command_line_t*,int,const( char* )* ) init_from_argv;
1933         void function( cef_command_line_t*,const( cef_string_t )* ) init_from_string;
1934         void function( cef_command_line_t* ) reset;
1935         void function( cef_command_line_t*,cef_string_list_t ) get_argv;
1936         cef_string_userfree_t function( cef_command_line_t* ) get_command_line_string;
1937         cef_string_userfree_t function( cef_command_line_t* ) get_program;
1938         void function( cef_command_line_t*,const( cef_string_t )* ) set_program;
1939         int function( cef_command_line_t* ) has_switches;
1940         int function( cef_command_line_t*,const( cef_string_t )* ) has_switch;
1941         cef_string_userfree_t function( cef_command_line_t*,const( cef_string_t )* ) get_switch_value;
1942         void function( cef_command_line_t*,cef_string_map_t ) get_switches;
1943         void function( cef_command_line_t*,const( cef_string_t )* ) append_switch;
1944         void function( cef_command_line_t*,const( cef_string_t )*,const( cef_string_t )* ) append_switch_with_value;
1945         int function( cef_command_line_t* ) has_arguments;
1946         void function( cef_command_line_t*,cef_string_list_t ) get_arguments;
1947         void function( cef_command_line_t*,const( cef_string_t )* ) append_argument;
1948         void function( cef_command_line_t*,const( cef_string_t )* ) prepend_wrapper;
1949     }
1950 }
1951 
1952 // cef_context_menu_handler_capi.h
1953 struct cef_run_context_menu_callback_t {
1954     cef_base_t base;
1955     extern( System ) @nogc nothrow {
1956         void function( cef_run_context_menu_callback_t*, int, cef_event_flags_t ) cont;
1957         void function( cef_run_context_menu_callback_t* ) cancel;
1958     }
1959 }
1960 
1961 struct cef_context_menu_handler_t {
1962     cef_base_t base;
1963     extern( System ) @nogc nothrow {
1964         void function( cef_context_menu_handler_t*,cef_browser_t*,cef_frame_t*,cef_context_menu_params_t*,cef_menu_model_t* ) on_before_context_menu;
1965         int function( cef_context_menu_handler_t*, cef_browser_t*, cef_frame_t*, cef_context_menu_params_t*, cef_menu_model_t*, cef_run_context_menu_callback_t* ) run_context_menu;
1966         int function( cef_context_menu_handler_t*,cef_browser_t*,cef_frame_t*,cef_context_menu_params_t*,int,cef_event_flags_t ) on_context_menu_command;
1967         int function( cef_context_menu_handler_t*,cef_browser_t*,cef_frame_t* ) on_context_menu_dismissed;
1968     }
1969 }
1970 
1971 struct cef_context_menu_params_t {
1972     cef_base_t base;
1973     extern( System ) @nogc nothrow {
1974         int function( cef_context_menu_params_t* ) get_xcoord;
1975         int function( cef_context_menu_params_t* ) get_ycoord;
1976         cef_context_menu_type_flags_t function( cef_context_menu_params_t* ) get_type_flags;
1977         cef_string_userfree_t function( cef_context_menu_params_t* ) get_link_url;
1978         cef_string_userfree_t function( cef_context_menu_params_t* ) get_unfiltered_link_url;
1979         cef_string_userfree_t function( cef_context_menu_params_t* ) get_source_url;
1980         int function( cef_context_menu_params_t* ) has_image_contents;
1981         cef_string_userfree_t function( cef_context_menu_params_t* ) get_page_url;
1982         cef_string_userfree_t function( cef_context_menu_params_t* ) get_frame_url;
1983         cef_string_userfree_t function( cef_context_menu_params_t* ) get_frame_charset;
1984         cef_context_menu_media_type_t function( cef_context_menu_params_t* ) get_media_type;
1985         cef_context_menu_media_state_flags_t function( cef_context_menu_params_t* ) get_media_state_flags;
1986         cef_string_userfree_t function( cef_context_menu_params_t* ) get_selection_text;
1987         int function( cef_context_menu_params_t*) is_editable;
1988         int function( cef_context_menu_params_t* ) is_speech_input_enabled;
1989         cef_context_menu_edit_state_flags_t function( cef_context_menu_params_t* ) get_edit_state_flags;
1990     }
1991 }
1992 
1993 // cef_cookie_capi.h
1994 struct cef_cookie_manager_t {
1995     cef_base_t base;
1996     extern( System ) @nogc nothrow {
1997         void function( cef_cookie_manager_t*,cef_string_list_t ) set_supported_schemes;
1998         int function( cef_cookie_manager_t*,cef_cookie_visitor_t* ) visit_all_cookies;
1999         int function( cef_cookie_manager_t*,cef_cookie_visitor_t* ) visit_url_cookies;
2000         int function( cef_cookie_manager_t*,const( cef_string_t )*,const( cef_cookie_t )* ) set_cookie;
2001         int function( cef_cookie_manager_t*,const( cef_string_t )*,const( cef_string_t )* ) delete_cookie;
2002         int function( cef_cookie_manager_t*,const( cef_string_t )*,int ) set_storage_path;
2003         int function( cef_cookie_manager_t*,cef_completion_callback_t* ) flush_store;
2004     }
2005 }
2006 
2007 struct cef_cookie_visitor_t {
2008     cef_base_t base;
2009     extern( System ) @nogc nothrow int function( cef_cookie_visitor_t*,const( cef_cookie_t )*,int,int,int* ) visit;
2010 }
2011 
2012 // cef_dialog_handler_capi.h
2013 struct cef_file_dialog_callback_t {
2014     cef_base_t base;
2015     extern( System ) @nogc nothrow {
2016         void function( cef_file_dialog_callback_t*,cef_string_list_t ) cont;
2017         void function( cef_file_dialog_callback_t* ) cancel;
2018     }
2019 }
2020 
2021 struct cef_dialog_handler_t {
2022     cef_base_t base;
2023     extern( System ) @nogc nothrow int function( cef_dialog_handler_t*,cef_browser_t*,cef_file_dialog_mode_t,const( cef_string_t )*,const( cef_string_t )*,cef_string_list_t,cef_file_dialog_callback_t* ) on_file_dialog;
2024 }
2025 
2026 // cef_display_handler_capi.h
2027 struct cef_display_handler_t {
2028     cef_base_t base;
2029     extern( System ) @nogc nothrow {
2030         void function( cef_display_handler_t*,cef_browser_t*,cef_frame_t*,const( cef_string_t )* ) on_address_change;
2031         void function( cef_display_handler_t*,cef_browser_t*,const( cef_string_t )* ) on_title_change;
2032         void function( cef_display_handler_t*, cef_browser_t*, cef_string_list_t ) on_favicon_urlchange;
2033         void function( cef_display_handler_t*, cef_browser_t* , int ) on_fullscreen_mode_change;
2034         int function( cef_display_handler_t*, cef_browser_t,cef_string_t* ) on_tooltip;
2035         void function( cef_display_handler_t*,cef_browser_t*,const( cef_string_t )* ) on_status_message;
2036         int function( cef_display_handler_t*,cef_browser_t*,const( cef_string_t )*,const( cef_string_t )*,int ) on_console_message;
2037         int function( cef_display_handler_t*, cef_browser_t*, const( cef_size_t )* ) on_auto_resize;
2038         void function( cef_display_handler_t*, cef_browser_t*, double ) on_loading_progress_change;
2039     }
2040 }
2041 
2042 // cef_dom_capi.h
2043 struct cef_domvisitor_t {
2044     cef_base_t base;
2045     extern( System ) @nogc nothrow void function( cef_domvisitor_t*,cef_domdocument_t* ) visit;
2046 }
2047 struct cef_domdocument_t {
2048     cef_base_t base;
2049     extern( System ) @nogc nothrow {
2050         cef_dom_document_type_t function( cef_domdocument_t* ) get_type;
2051         cef_domnode_t* function( cef_domdocument_t* ) get_document;
2052         cef_domnode_t* function( cef_domdocument_t* ) get_body;
2053         cef_domnode_t* function( cef_domdocument_t* ) get_head;
2054         cef_string_userfree_t function( cef_domdocument_t* ) get_title;
2055         cef_domnode_t* function( cef_domdocument_t*,const( cef_string_t )* ) get_element_by_id;
2056         cef_domnode_t* function( cef_domdocument_t* ) get_focused_node;
2057         int function( cef_domdocument_t* ) has_selection;
2058         int function( cef_domdocument_t* ) get_selection_start_offset;
2059         int function( cef_domdocument_t* ) get_selection_end_offset;
2060         cef_string_userfree_t function( cef_domdocument_t* ) get_selection_as_markup;
2061         cef_string_userfree_t function( cef_domdocument_t* ) get_selection_as_text;
2062         cef_string_userfree_t function( cef_domdocument_t* ) get_base_url;
2063         cef_string_userfree_t function( cef_domdocument_t*,const( cef_string_t )* ) get_complete_url;
2064     }
2065 }
2066 
2067 struct cef_domnode_t {
2068     cef_base_t base;
2069     extern( System ) @nogc nothrow {
2070         cef_dom_node_type_t function( cef_domnode_t* ) get_type;
2071         int function( cef_domnode_t* ) is_text;
2072         int function( cef_domnode_t* ) is_element;
2073         int function( cef_domnode_t* ) is_editable;
2074         int function( cef_domnode_t* ) is_form_control_element;
2075         cef_string_userfree_t function( cef_domnode_t* ) get_form_control_element_type;
2076         int function( cef_domnode_t*,cef_domnode_t* ) is_same;
2077         cef_string_userfree_t function( cef_domnode_t* ) get_name;
2078         cef_string_userfree_t function( cef_domnode_t* ) get_value;
2079         int function( cef_domnode_t*,const( cef_string_t )* ) set_value;
2080         cef_string_userfree_t function( cef_domnode_t* ) get_as_markup;
2081         cef_domdocument_t* function( cef_domnode_t* ) get_document;
2082         cef_domnode_t* function( cef_domnode_t* ) get_parent;
2083         cef_domnode_t* function( cef_domnode_t* ) get_previous_sibling;
2084         cef_domnode_t* function( cef_domnode_t* ) get_next_sibling;
2085         int function( cef_domnode_t* ) has_children;
2086         cef_domnode_t* function( cef_domnode_t* ) get_first_child;
2087         cef_domnode_t* function( cef_domnode_t* ) get_last_child;
2088         cef_string_userfree_t function( cef_domnode_t* ) get_element_tag_name;
2089         int function( cef_domnode_t* ) has_element_attributes;
2090         int function( cef_domnode_t*,const( cef_string_t )* ) has_element_attribute;
2091         cef_string_userfree_t function( cef_domnode_t*,const( cef_string_t )* ) get_element_attribute;
2092         void function( cef_domnode_t*,cef_string_map_t ) get_element_attributes;
2093         int function( cef_domnode_t* ,const( cef_string_t )*,const( cef_string_t )* ) set_element_attribute;
2094         cef_string_userfree_t function( cef_domnode_t* ) get_element_inner_text;
2095         cef_rect_t function( cef_domnode_t* ) get_element_bounds;
2096     }
2097 }
2098 
2099 struct cef_domevent_t {
2100     cef_base_t base;
2101     extern( System ) @nogc nothrow {
2102         cef_string_userfree_t function( cef_domevent_t* ) get_type;
2103         cef_dom_event_category_t function( cef_domevent_t* ) get_category;
2104         cef_dom_event_phase_t function( cef_domevent_t* ) get_phase;
2105         int function( cef_domevent_t* ) can_bubble;
2106         int function( cef_domevent_t* ) can_cancel;
2107         cef_domdocument_t* function( cef_domevent_t* ) get_document;
2108         cef_domnode_t* function( cef_domevent_t* ) get_target;
2109         cef_domnode_t* function( cef_domevent_t* ) get_current_target;
2110     }
2111 }
2112 
2113 struct cef_domevent_listener_t {
2114     cef_base_t base;
2115     extern( System ) @nogc nothrow void function( cef_domevent_listener_t*,cef_domevent_t* ) handle_event;
2116 }
2117 
2118 // cef_download_handler_capi.h
2119 struct cef_before_download_callback_t {
2120     cef_base_t base;
2121     extern( System ) @nogc nothrow void function( cef_before_download_callback_t,const( cef_string_t )*,int ) cont;
2122 }
2123 
2124 struct cef_download_item_callback_t {
2125     cef_base_t base;
2126     extern( System ) @nogc nothrow {
2127         void function( cef_download_item_callback_t* ) cancel;
2128         void function( cef_download_item_callback_t* ) pause;
2129         void function( cef_download_item_callback_t* ) resume;
2130     }
2131 }
2132 
2133 struct cef_download_handler_t {
2134     cef_base_t base;
2135     extern( System ) @nogc nothrow {
2136         void function( cef_download_handler_t*,cef_browser_t*,cef_download_item_t*,const( cef_string_t )*,cef_before_download_callback_t* ) on_before_download;
2137         void function( cef_download_handler_t*,cef_browser_t*,cef_download_item_t*,cef_download_item_callback_t* ) on_download_updated;
2138     }
2139 }
2140 
2141 // cef_download_item_capi.h
2142 struct cef_download_item_t {
2143     cef_base_t base;
2144     extern( System ) @nogc nothrow {
2145         int function( cef_download_item_t* ) is_valid;
2146         int function( cef_download_item_t* ) is_in_progress;
2147         int function( cef_download_item_t* ) is_complete;
2148         int function( cef_download_item_t* ) is_canceled;
2149         int64 function( cef_download_item_t* ) get_current_speed;
2150         int function( cef_download_item_t* ) get_percent_complete;
2151         int64 function( cef_download_item_t* ) get_total_bytes;
2152         int64 function( cef_download_item_t* ) get_received_bytes;
2153         cef_time_t function( cef_download_item_t* ) get_start_time;
2154         cef_time_t function( cef_download_item_t* ) get_end_time;
2155         cef_string_userfree_t function( cef_download_item_t* ) get_full_path;
2156         uint32 function( cef_download_item_t* ) get_id;
2157         cef_string_userfree_t function( cef_download_item_t* ) get_url;
2158         cef_string_userfree_t function( cef_download_item_t* ) get_suggested_file_name;
2159         cef_string_userfree_t function( cef_download_item_t* ) get_content_disposition;
2160         cef_string_userfree_t function( cef_download_item_t* ) get_mime_type;
2161     }
2162 }
2163 
2164 // cef_drag_data_capi.h
2165 struct cef_drag_data_t {
2166     cef_base_t base;
2167     extern( System ) @nogc nothrow {
2168         cef_drag_data_t* function( cef_drag_data_t* ) clone;
2169         int function( cef_drag_data_t* ) is_read_only;
2170         int function( cef_drag_data_t* ) is_link;
2171         int function( cef_drag_data_t* ) is_fragment;
2172         int function( cef_drag_data_t* ) is_file;
2173         int function( cef_drag_data_t* ) get_link_url;
2174         cef_string_userfree_t function( cef_drag_data_t* ) get_link_title;
2175         cef_string_userfree_t function( cef_drag_data_t* ) get_link_metadata;
2176         cef_string_userfree_t function( cef_drag_data_t* ) get_fragment_text;
2177         cef_string_userfree_t function( cef_drag_data_t* ) get_fragment_html;
2178         cef_string_userfree_t function( cef_drag_data_t* ) get_fragment_base_url;
2179         cef_string_userfree_t function( cef_drag_data_t* ) get_file_name;
2180         size_t function( cef_drag_data_t*, cef_stream_writer_t* ) get_file_contents;
2181         int function( cef_drag_data_t*, cef_string_list_t ) get_file_names;
2182         void function( cef_drag_data_t*, const( cef_string_t )* ) set_link_url;
2183         void function( cef_drag_data_t*, const( cef_string_t )* ) set_link_title;
2184         void function( cef_drag_data_t*, const( cef_string_t )* ) set_link_metadata;
2185         void function( cef_drag_data_t*, const( cef_string_t )* ) set_fragment_text;
2186         void function( cef_drag_data_t*, const( cef_string_t )* ) set_fragment_html;
2187         void function( cef_drag_data_t*, const( cef_string_t )* ) set_fragment_base_url;
2188         void function( cef_drag_data_t* ) reset_file_contents;
2189         void function( cef_drag_data_t*, const( cef_string_t )*, const( cef_string_t )* ) add_file;
2190         cef_image_t* function( cef_drag_data_t* ) get_image;
2191         cef_point_t function( cef_drag_data_t* ) get_image_hotspot;
2192         int function( cef_drag_data_t* ) has_image;
2193     }
2194 }
2195 
2196 // cef_drag_handler_capi.h
2197 struct cef_drag_handler_t {
2198     cef_base_t base;
2199     extern( System ) @nogc nothrow {
2200         int function( cef_drag_handler_t*,cef_browser_t*,cef_drag_data_t*,cef_drag_operations_mask_t ) on_drag_enter;
2201         void function( cef_drag_handler_t*, cef_browser_t*, size_t, const( cef_draggable_region_t*) ) on_draggable_regions_changed;
2202     }
2203 }
2204 
2205 // cef_extension_capi.h
2206 struct cef_extension_t {
2207     cef_base_t base;
2208     extern( System ) @nogc nothrow {
2209         cef_string_userfree_t function( cef_extension_t* ) get_identifier;
2210         cef_string_userfree_t function( cef_extension_t* ) get_path;
2211         cef_dictionary_value_t* function( cef_extension_t* ) get_manifest;
2212         int function( cef_extension_t*, cef_extension_t* ) is_same;
2213         cef_extension_handler_t* function( cef_extension_t* ) get_handler;
2214         cef_request_context_t* function( cef_extension_t* ) get_loader_context;
2215         int function( cef_extension_t* ) is_loaded;
2216         void function( cef_extension_t* ) unload;
2217     }
2218 }
2219 
2220 // cef_extension_handler_capi.h
2221 struct cef_get_extension_resource_callback_t {
2222     cef_base_t base;
2223     extern( System ) @nogc nothrow {
2224         void function( cef_get_extension_resource_callback_t*, cef_stream_reader_t* ) cont;
2225         void function( cef_get_extension_resource_callback_t* ) cancel;
2226     }
2227 }
2228 
2229 struct cef_extension_handler_t {
2230     cef_base_t base;
2231     extern( System ) @nogc nothrow {
2232         void function( cef_extension_handler_t*, cef_errorcode_t ) on_extension_load_failed;
2233         void function( cef_extension_handler_t*, cef_extension_t* ) on_extension_loaded;
2234         void function( cef_extension_handler_t*, cef_extension_t* ) on_extension_unloaded;
2235         int function( cef_extension_handler_t*, cef_extension_t*, const( cef_string_t )*, cef_client_t**, cef_browser_settings_t* ) on_before_background_browser;
2236         int function( cef_extension_handler_t*, cef_extension_t*, cef_browser_t*, cef_browser_t*, int, const( cef_string_t )*, int, cef_window_info_t*, cef_client_t**, cef_browser_settings_t* ) on_before_browser;
2237         cef_browser_t* function( cef_extension_handler_t*, cef_extension_t*, cef_browser_t*, int ) get_active_browser;
2238         int function( cef_extension_handler_t*, cef_extension_t*, cef_browser_t*, int, cef_browser_t* ) can_access_browser;
2239         int function( cef_extension_handler_t*, cef_extension_t*, cef_browser_t*, const( cef_string_t )*, cef_get_extension_resource_callback_t* ) get_extension_resource;
2240     }
2241 }
2242 
2243 // cef_find_handler_capi.h
2244 struct cef_find_handler_t {
2245     cef_base_t base;
2246     extern( System ) @nogc nothrow void function( cef_find_handler_t*, cef_browser_t*, int, int, const( cef_rect_t )*, int, int ) on_find_result;
2247 }
2248 
2249 // cef_focus_handler_capi.h
2250 struct cef_focus_handler_t {
2251     cef_base_t base;
2252     extern( System ) @nogc nothrow {
2253         void function( cef_focus_handler_t*,cef_browser_t*,int ) on_take_focus;
2254         int function( cef_focus_handler_t*,cef_browser_t*,cef_focus_source_t* ) on_set_focus;
2255         void function( cef_focus_handler_t*,cef_browser_t* ) on_get_focus;
2256     }
2257 }
2258 
2259 // cef_frame_capi.h
2260 struct cef_frame_t {
2261     cef_base_t base;
2262     extern( System ) @nogc nothrow {
2263         int function( cef_frame_t* ) is_valid;
2264         void function( cef_frame_t* ) undo;
2265         void function( cef_frame_t* ) redo;
2266         void function( cef_frame_t* ) cut;
2267         void function( cef_frame_t* ) copy;
2268         void function( cef_frame_t* ) paste;
2269         void function( cef_frame_t* ) del;
2270         void function( cef_frame_t*cef_drag_handler_t ) select_all;
2271         void function( cef_frame_t* ) view_source;
2272         void function( cef_frame_t*,cef_string_visitor_t* ) get_source;
2273         void function( cef_frame_t*,cef_string_visitor_t* ) get_text;
2274         void function( cef_frame_t*,cef_request_t* ) load_request;
2275         void function( cef_frame_t*,const( cef_string_t )* ) load_url;
2276         void function( cef_frame_t*,const( cef_string_t )*,const( cef_string_t )* ) load_string;
2277         void function( cef_frame_t*,const( cef_string_t )*,const( cef_string_t )*,int ) execute_java_script;
2278         int function( cef_frame_t* ) is_main;
2279         int function( cef_frame_t* ) is_focused;
2280         cef_string_userfree_t function( cef_frame_t* ) get_name;
2281         int64 function( cef_frame_t* ) get_identifier;
2282         cef_frame_t* function( cef_frame_t* ) get_parent;
2283         cef_string_userfree_t function( cef_frame_t* ) get_url;
2284         cef_browser_t* function( cef_frame_t* ) get_browser;
2285         cef_v8context_t* function( cef_frame_t* ) get_v8context;
2286         void function( cef_frame_t*,cef_domvisitor_t* ) visit_dom;
2287 
2288     }
2289 }
2290 
2291 // cef_image_capi.h
2292 struct cef_image_t {
2293     cef_base_t base;
2294     extern( System ) @nogc nothrow {
2295         int function( cef_image_t* ) is_empty;
2296         int function( cef_image_t*, cef_image_t* ) is_same;
2297         int function( cef_image_t*, float, int, int, cef_color_type_t, cef_alpha_type_t, const( void )*, size_t ) add_bitmap;
2298         int function( cef_image_t*, float, const( void )*, size_t ) add_png;
2299         int function( cef_image_t*, float, const( void )*, size_t ) add_jpeg;
2300         size_t function( cef_image_t* ) get_width;
2301         size_t function( cef_image_t* ) get_height;
2302         int function( cef_image_t*, float ) has_representation;
2303         int function( cef_image_t*, float ) remove_representation;
2304         int function( cef_image_t*, float, float*, int*, int* ) get_representation_info;
2305         cef_binary_value_t* function( cef_image_t*, float, cef_color_type_t, cef_alpha_type_t, int*, int* ) get_as_bitmap;
2306         cef_binary_value_t* function( cef_image_t*, float, int, int*, int* ) get_as_png;
2307         cef_binary_value_t* function( cef_image_t*, float, int, int*, int* ) get_as_jpeg;
2308     }
2309 };
2310 
2311 // cef_jsdialog_handler_capi.h
2312 struct cef_jsdialog_callback_t {
2313     cef_base_t base;
2314     extern( System ) @nogc nothrow void function( cef_jsdialog_callback_t*,int,const( cef_string_t )* ) cont;
2315 }
2316 
2317 struct cef_jsdialog_handler_t {
2318     cef_base_t base;
2319     extern( System ) @nogc nothrow {
2320         int function( cef_jsdialog_handler_t*,cef_browser_t*,const( cef_string_t )*,const( cef_string_t )*,cef_jsdialog_type_t,const( cef_string_t )*,cef_jsdialog_callback_t*,int* ) on_jsdialog;
2321         int function( cef_jsdialog_handler_t*,cef_browser_t*,const( cef_string_t )*,int,cef_jsdialog_callback_t* ) on_before_unload_dialog;
2322         void function( cef_jsdialog_handler_t*,cef_browser_t* ) on_reset_dialog_state;
2323         void function( cef_jsdialog_handler_t*,cef_browser_t* ) on_dialog_closed;
2324     }
2325 }
2326 
2327 // cef_keyboard_handler_capi.h
2328 struct cef_keyboard_handler_t {
2329     cef_base_t base;
2330     extern( System ) @nogc nothrow {
2331         int function( cef_keyboard_handler_t*,cef_browser_t*,const( cef_key_event_t )*,cef_event_handle_t,int* ) on_pre_key_event;
2332         int function( cef_keyboard_handler_t*,cef_browser_t*,const( cef_key_event_t )*,cef_event_handle_t ) on_key_event;
2333     }
2334 }
2335 
2336 // cef_life_span_handler_capi.h
2337 struct cef_life_span_handler_t {
2338     cef_base_t base;
2339     extern( System ) @nogc nothrow {
2340         int function( cef_life_span_handler_t*,cef_browser_t*,cef_frame_t*,const( cef_string_t )*,const( cef_string_t )*,const( cef_popup_features_t )*,cef_window_info_t*,cef_client_t**,cef_browser_settings_t*,int* ) on_before_popup;
2341         void function( cef_life_span_handler_t*,cef_browser_t* ) on_after_created;
2342         void function( cef_life_span_handler_t*,cef_browser_t* ) run_modal;
2343         int function( cef_life_span_handler_t*,cef_browser_t* ) do_close;
2344         void function( cef_life_span_handler_t*,cef_browser_t* ) on_before_close;
2345     }
2346 }
2347 
2348 // cef_load_handler_capi.h
2349 struct cef_load_handler_t {
2350     cef_base_t base;
2351     extern( System ) @nogc nothrow {
2352         void function( cef_load_handler_t*,cef_browser_t*,int,int,int ) on_loading_state_change;
2353         void function( cef_load_handler_t*,cef_browser_t*,cef_frame_t* ) on_load_start;
2354         void function( cef_load_handler_t*,cef_browser_t*,cef_frame_t*,int ) on_load_end;
2355         void function( cef_load_handler_t*,cef_browser_t*,cef_frame_t*,cef_errorcode_t,const( cef_string_t )*,const( cef_string_t )* ) on_load_error;
2356     }
2357 }
2358 
2359 // cef_menu_model_capi.h
2360 struct cef_menu_model_t {
2361     cef_base_t base;
2362     extern( System ) @nogc nothrow {
2363         int function( cef_menu_model_t* ) is_sub_menu;
2364         int function( cef_menu_model_t* ) clear;
2365         int function( cef_menu_model_t* ) get_count;
2366         int function( cef_menu_model_t* ) add_separator;
2367         int function( cef_menu_model_t*,int,const( cef_string_t )* ) add_item;
2368         int function( cef_menu_model_t*,int,const( cef_string_t )* ) add_check_item;
2369         int function( cef_menu_model_t*,int,const( cef_string_t )*,int ) add_radio_item;
2370         cef_menu_model_t* function( cef_menu_model_t*,int,const( cef_string_t )* ) add_sub_menu;
2371         int function( cef_menu_model_t*,int ) insert_separator_at;
2372         int function( cef_menu_model_t*,int,int,const( cef_string_t )* ) insert_item_at;
2373         int function( cef_menu_model_t*,int,int,const( cef_string_t )* ) insert_check_item_at;
2374         int function( cef_menu_model_t*,int,int,const( cef_string_t )*,int ) insert_radio_item_at;
2375         cef_menu_model_t* function( cef_menu_model_t*,int,int,const( cef_string_t )* ) insert_submenu_at;
2376         int function( cef_menu_model_t*,int ) remove;
2377         int function( cef_menu_model_t*,int ) remove_at;
2378         int function( cef_menu_model_t*,int ) get_index_of;
2379         int function( cef_menu_model_t*,int ) get_command_id_at;
2380         int function( cef_menu_model_t*,int,int ) set_command_id_at;
2381         cef_string_userfree_t function( cef_menu_model_t*,int ) get_label;
2382         cef_string_userfree_t function( cef_menu_model_t*,int ) get_label_at;
2383         int function( cef_menu_model_t*,int,const( cef_string_t )* ) set_label;
2384         int function( cef_menu_model_t*,int,const( cef_string_t )* ) set_label_at;
2385         cef_menu_item_type_t function( cef_menu_model_t*,int ) get_type;
2386         cef_menu_item_type_t function( cef_menu_model_t*,int ) get_type_at;
2387         int function( cef_menu_model_t*,int ) get_group_id;
2388         int function( cef_menu_model_t*,int ) get_group_id_at;
2389         int function( cef_menu_model_t*,int,int ) set_group_id;
2390         int function( cef_menu_model_t*,int,int ) set_group_id_at;
2391         cef_menu_model_t* function( cef_menu_model_t*,int ) get_sub_menu;
2392         cef_menu_model_t* function( cef_menu_model_t*,int ) get_sub_menu_at;
2393         int function( cef_menu_model_t*,int ) is_visible;
2394         int function( cef_menu_model_t*,int ) is_visible_at;
2395         int function( cef_menu_model_t*,int,int ) set_visible;
2396         int function( cef_menu_model_t*,int,int ) set_visible_at;
2397         int function( cef_menu_model_t*,int ) is_enabled;
2398         int function( cef_menu_model_t*,int ) is_enabled_at;
2399         int function( cef_menu_model_t*,int,int ) set_enabled;
2400         int function( cef_menu_model_t*,int,int ) set_enabled_at;
2401         int function( cef_menu_model_t*,int ) is_checked;
2402         int function( cef_menu_model_t*,int ) is_checked_at;
2403         int function( cef_menu_model_t*,int,int ) set_checked;
2404         int function( cef_menu_model_t*,int,int ) set_checked_at;
2405         int function( cef_menu_model_t*,int ) has_accelerator;
2406         int function( cef_menu_model_t*,int ) has_accelerator_at;
2407         int function( cef_menu_model_t*,int,int,int,int,int ) set_accelerator;
2408         int function( cef_menu_model_t*,int,int,int,int,int ) set_accelerator_at;
2409         int function( cef_menu_model_t*,int ) remove_accelerator;
2410         int function( cef_menu_model_t*,int ) remove_accelerator_at;
2411         int function( cef_menu_model_t*,int,int*,int*,int*,int* ) get_accelerator;
2412         int function( cef_menu_model_t*,int,int*,int*,int*,int* ) get_accelerator_at;
2413         int function( cef_menu_model_t*, int, cef_menu_color_type_t, cef_color_t ) set_color;
2414         int function( cef_menu_model_t*, int, cef_menu_color_type_t, cef_color_t ) set_color_at;
2415         int function( cef_menu_model_t*, int, cef_menu_color_type_t, cef_color_t* ) get_color;
2416         int function( cef_menu_model_t*, int, cef_menu_color_type_t, cef_color_t* ) get_color_at;
2417         int function( cef_menu_model_t*, int, const( cef_string_t )* ) set_font_list;
2418         int function( cef_menu_model_t*, int, const( cef_string_t )* ) set_font_list_at;
2419     }
2420 }
2421 
2422 // cef_menu_model_delegate_capi.h
2423 struct cef_menu_model_delegate_t {
2424     cef_base_t base;
2425     extern( System ) @nogc nothrow {
2426         void function( cef_menu_model_delegate_t*, cef_menu_model_t*, int, cef_event_flags_t ) execute_command;
2427         void function( cef_menu_model_delegate_t*, cef_menu_model_t*, const( cef_point_t)* ) mouse_outside_menu;
2428         void function( cef_menu_model_delegate_t*, cef_menu_model_t*, int ) unhandled_open_submenu;
2429         void function( cef_menu_model_delegate_t*, cef_menu_model_t*, int ) unhandled_close_submenu;
2430         void function( cef_menu_model_delegate_t*, cef_menu_model_t* ) menu_will_show;
2431         void function( cef_menu_model_delegate_t*, cef_menu_model_t* ) menu_closed;
2432         int function( cef_menu_model_delegate_t*, cef_menu_model_t*, cef_string_t* ) format_label;
2433     }
2434 }
2435 
2436 // cef_navigation_entry_capi.h
2437 struct cef_navigation_entry_t {
2438     cef_base_t base;
2439     extern( System ) @nogc nothrow {
2440         int function( cef_navigation_entry_t* self) is_valid;
2441         cef_string_userfree_t function( cef_navigation_entry_t* ) get_url;
2442         cef_string_userfree_t function( cef_navigation_entry_t* ) get_display_url;
2443         cef_string_userfree_t function( cef_navigation_entry_t* ) get_original_url;
2444         cef_string_userfree_t function( cef_navigation_entry_t* ) get_title;
2445         cef_transition_type_t function( cef_navigation_entry_t* ) get_transition_type;
2446         int function( cef_navigation_entry_t* ) has_post_data;
2447         cef_time_t function( cef_navigation_entry_t* ) get_completion_time;
2448         int function( cef_navigation_entry_t* ) get_http_status_code;
2449         cef_sslstatus_t* function( cef_navigation_entry_t* ) get_sslstatus;
2450     }
2451 }
2452 
2453 // cef_print_handler_capi.h
2454 struct cef_print_dialog_callback_t {
2455     cef_base_t base;
2456     extern( System ) @nogc nothrow {
2457         void function( cef_print_dialog_callback_t*, cef_print_settings_t* ) cont;
2458         void function( cef_print_dialog_callback_t* ) cancel;
2459     }
2460 } 
2461 
2462 struct cef_print_job_callback_t {
2463     cef_base_t base;
2464     extern( System ) @nogc nothrow void function( cef_print_job_callback_t* ) cont;
2465 }
2466 
2467 struct cef_print_handler_t {
2468     cef_base_t base;
2469     extern( System ) @nogc nothrow {
2470         void function( cef_print_handler_t*, cef_browser_t* ) on_print_start;
2471         void function( cef_print_handler_t*, cef_browser_t*, cef_print_settings_t*, int ) on_print_settings;
2472         int function( cef_print_handler_t*, cef_browser_t*, int, cef_print_dialog_callback_t* ) on_print_dialog;
2473         int function( cef_print_handler_t*, cef_browser_t*, const( cef_string_t )*, const( cef_string_t )* , cef_print_job_callback_t* ) on_print_job;
2474         void function( cef_print_handler_t*, cef_browser_t* ) on_print_reset;
2475         cef_size_t function( cef_print_handler_t*, int ) get_pdf_paper_size;
2476     }
2477 }
2478 
2479 // cef_print_settings_capi.h
2480 struct cef_print_settings_t {
2481     cef_base_t base;
2482     extern( System ) @nogc nothrow {
2483         int function( cef_print_settings_t* ) is_valid;
2484         int function( cef_print_settings_t* ) is_read_only;
2485         cef_print_settings_t* function(  cef_print_settings_t* ) copy;
2486         void function( cef_print_settings_t*, int ) set_orientation;
2487         int function( cef_print_settings_t* ) is_landscape;
2488         void function( cef_print_settings_t*, const( cef_size_t )*, const( cef_rect_t )* , int ) set_printer_printable_area;
2489         void function( cef_print_settings_t*, const( cef_string_t )* ) set_device_name;
2490         cef_string_userfree_t function( cef_print_settings_t* ) get_device_name;
2491         void function( cef_print_settings_t*, int ) set_dpi;
2492         int function( cef_print_settings_t* ) get_dpi;
2493         void function( cef_print_settings_t*, size_t, const( cef_range_t )* ) set_page_ranges;
2494         size_t function( cef_print_settings_t* ) get_page_ranges_count;
2495         void function( cef_print_settings_t*, size_t*, cef_range_t* ) get_page_ranges;
2496         void function( cef_print_settings_t*, int ) set_selection_only;
2497         int function( cef_print_settings_t* ) is_selection_only;
2498         void function( cef_print_settings_t*, int ) set_collate;
2499         int function( cef_print_settings_t* ) will_collate;
2500         void function( cef_print_settings_t*, cef_color_model_t ) set_color_model;
2501         cef_color_model_t function( cef_print_settings_t* ) get_color_model;
2502         void function( cef_print_settings_t*, int ) set_copies;
2503         int function( cef_print_settings_t* ) get_copies;
2504         void function( cef_print_settings_t*, cef_duplex_mode_t mode ) set_duplex_mode;
2505         cef_duplex_mode_t function( cef_print_settings_t* ) get_duplex_mode;
2506     }
2507 }
2508 
2509 // cef_process_message_capi.h
2510 struct cef_process_message_t {
2511     cef_base_t base;
2512     extern( System ) @nogc nothrow {
2513         int function( cef_process_message_t* ) is_valid;
2514         int function( cef_process_message_t* ) is_read_only;
2515         cef_process_message_t* function( cef_process_message_t* ) copy;
2516         cef_string_userfree_t function( cef_process_message_t* ) get_name;
2517         cef_list_value_t* function( cef_process_message_t* ) get_argument_list;
2518     }
2519 }
2520 
2521 // cef_render_handler_capi.h
2522 struct cef_render_handler_t {
2523     cef_base_t base;
2524     extern( System ) @nogc nothrow {
2525         cef_accessibility_handler_t* function( cef_render_handler_t* ) get_accessibility_handler;
2526         int function( cef_render_handler_t*,cef_browser_t*,cef_rect_t* ) get_root_screen_rect;
2527         int function( cef_render_handler_t*,cef_browser_t*,cef_rect_t* ) get_view_rect;
2528         int function( cef_render_handler_t*,cef_browser_t*,int,int,int*,int* ) get_screen_point;
2529         int function( cef_render_handler_t*,cef_browser_t*,cef_screen_info_t* ) get_screen_info;
2530         void function( cef_render_handler_t*,cef_browser_t*,int ) on_popup_show;
2531         void function( cef_render_handler_t*,cef_browser_t*,const( cef_rect_t )* ) on_popup_size;
2532         void function( cef_render_handler_t*,cef_browser_t*,cef_paint_element_type_t,size_t,const( cef_rect_t* ),const( void )*,int,int ) on_paint;
2533         void function( cef_render_handler_t*, cef_browser_t*, cef_paint_element_type_t, size_t , const( cef_rect_t* ), void* ) on_accelerated_paint;
2534         void function( cef_render_handler_t*,cef_browser_t*,cef_cursor_handle_t ) on_cursor_change;
2535         int function( cef_render_handler_t*, cef_browser_t*, cef_drag_data_t*, cef_drag_operations_mask_t, int, int ) start_dragging;
2536         void function( cef_render_handler_t*, cef_browser_t*, cef_drag_operations_mask_t ) update_drag_cursor;
2537         void function( cef_render_handler_t*, cef_browser_t*, double, double ) on_scroll_offset_changed;
2538         void function( cef_render_handler_t*, cef_browser_t*, const( cef_range_t )*, size_t, const( cef_rect_t* ) ) on_ime_composition_range_changed;
2539         void function( cef_render_handler_t*, cef_browser_t*, const( cef_string_t )*, const( cef_range_t )* ) on_text_selection_changed;
2540     }
2541 }
2542 
2543 // cef_render_process_handler_capi.h
2544 struct cef_render_process_handler_t {
2545     cef_base_t base;
2546     extern( System ) @nogc nothrow {
2547         void function( cef_render_process_handler_t*,cef_list_value_t* ) on_render_thread_created;
2548         void function( cef_render_process_handler_t* ) on_web_kit_initialized;
2549         void function( cef_render_process_handler_t*,cef_browser_t* ) on_browser_created;
2550         void function( cef_render_process_handler_t*,cef_browser_t* ) on_browser_destroyed;
2551         cef_load_handler_t* function( cef_render_process_handler_t* ) get_load_handler;
2552         int function( cef_render_process_handler_t*,cef_browser_t*,cef_frame_t*,cef_request_t*,cef_navigation_type_t,int ) on_before_navigation;
2553         void function( cef_render_process_handler_t*,cef_browser_t*,cef_frame_t*,cef_v8context_t* ) on_context_created;
2554         void function( cef_render_process_handler_t*,cef_browser_t*,cef_frame_t*,cef_v8context_t* ) on_context_released;
2555         void function( cef_render_process_handler_t*,cef_browser_t*,cef_frame_t*,cef_v8context_t*,cef_v8exception_t*,cef_v8stack_trace_t* ) on_uncaught_exception;
2556         void function( cef_render_process_handler_t*,cef_browser_t*,cef_frame_t*,cef_domnode_t* ) on_focused_node_changed;
2557         int function( cef_render_process_handler_t*,cef_browser_t*,cef_process_id_t,cef_process_message_t* ) on_process_message_received;
2558     }
2559 }
2560 
2561 // cef_request_capi.h
2562 struct cef_request_t {
2563     cef_base_t base;
2564     extern( System ) @nogc nothrow {
2565         int function( cef_request_t* ) is_read_only;
2566         cef_string_userfree_t function( cef_request_t* ) get_url;
2567         void function( cef_request_t*,const( cef_string_t )* ) set_url;
2568         cef_string_userfree_t function( cef_request_t* ) get_method;
2569         void function( cef_request_t*,const( cef_string_t )* ) set_method;
2570         void function( cef_request_t*, const( cef_string_t )*, cef_referrer_policy_t ) set_referrer;
2571         cef_string_userfree_t function( cef_request_t* ) get_referrer_url;
2572         cef_referrer_policy_t function( cef_request_t* ) get_referrer_policy;
2573         cef_post_data_t* function( cef_request_t* ) get_post_data;
2574         void function( cef_request_t*, cef_post_data_t* ) set_post_data;
2575         void function( cef_request_t*,cef_string_multimap_t ) get_header_map;
2576         void function( cef_request_t*,cef_string_multimap_t ) set_header_map;
2577         void function( cef_request_t*,const( cef_string_t )*,const( cef_string_t )*,cef_post_data_t*,cef_string_multimap_t ) set;
2578         int function( cef_request_t* ) get_flags;
2579         void function( cef_request_t*,int ) set_flags;
2580         cef_string_userfree_t function( cef_request_t* ) get_first_party_for_cookies;
2581         void function( cef_request_t*,const( cef_string_t )* ) set_first_party_for_cookies;
2582         cef_resource_type_t function( cef_request_t* ) get_resource_type;
2583         cef_transition_type_t function( cef_request_t* ) get_transition_type;
2584         ulong function( cef_request_t* ) get_identifier;
2585     }
2586 }
2587 
2588 struct cef_post_data_t {
2589     cef_base_t base;
2590     extern( System ) @nogc nothrow {
2591         int function( cef_post_data_t* ) is_read_only;
2592         int function( cef_post_data_t* ) has_excluded_elements;
2593         size_t function( cef_post_data_t* ) get_element_count;
2594         void function( cef_post_data_t*,size_t*,cef_post_data_element_t** ) get_elements;
2595         int function( cef_post_data_t*,cef_post_data_element_t* ) remove_element;
2596         int function( cef_post_data_t*,cef_post_data_element_t* ) add_element;
2597         void function( cef_post_data_t* ) remove_elements;
2598     }
2599 }
2600 
2601 struct cef_post_data_element_t {
2602     cef_base_t base;
2603     extern( System ) @nogc nothrow {
2604         int function( cef_post_data_element_t* ) is_read_only;
2605         void function( cef_post_data_element_t* ) set_to_empty;
2606         void function( cef_post_data_element_t*,const( cef_string_t )* ) set_to_file;
2607         void function( cef_post_data_element_t*,size_t,const( void )* ) set_to_bytes;
2608         cef_postdataelement_type_t function( cef_post_data_element_t* ) get_type;
2609         cef_string_userfree_t function( cef_post_data_element_t* ) get_file;
2610         size_t function( cef_post_data_element_t* ) get_bytes_count;
2611         size_t function( cef_post_data_element_t*,size_t,void* ) get_bytes;
2612     }
2613 }
2614 
2615 // cef_request_context_capi.h
2616 struct cef_resolve_callback_t {
2617     cef_base_t base;
2618     extern( System ) @nogc nothrow void function( cef_resolve_callback_t*, cef_errorcode_t, cef_string_list_t ) on_resolve_completed;
2619 }
2620 
2621 struct cef_request_context_t {
2622     cef_base_t base;
2623     extern( System ) @nogc nothrow {
2624         int function( cef_request_context_t* self, cef_request_context_t* ) is_same;
2625         int function( cef_request_context_t*, cef_request_context_t* ) is_sharing_with;
2626         int function( cef_request_context_t* ) is_global;
2627         cef_request_context_handler_t* function( cef_request_context_t* ) get_handler;
2628         cef_string_userfree_t function( cef_request_context_t* ) get_cache_path;
2629         cef_cookie_manager_t* function( cef_request_context_t*, cef_completion_callback_t* ) get_default_cookie_manager;
2630         int function( cef_request_context_t*, const( cef_string_t )*, const( cef_string_t )*, cef_scheme_handler_factory_t* ) register_scheme_handler_factory;
2631         int function( cef_request_context_t* ) clear_scheme_handler_factories;
2632         void function( cef_request_context_t*, int ) purge_plugin_list_cache;
2633         int function( cef_request_context_t*, const( cef_string_t )* name) has_preference;
2634         cef_value_t* function( cef_request_context_t*, cef_string_t* ) get_preference;
2635         cef_dictionary_value_t* function( cef_request_context_t*, int ) get_all_preferences;
2636         int function( cef_request_context_t*, const( cef_string_t )* ) can_set_preference;
2637         int function( cef_request_context_t*, const( cef_string_t )*, cef_value_t*, cef_string_t* ) set_preference;
2638         void function( cef_request_context_t*, cef_completion_callback_t* ) clear_certificate_exceptions;
2639         void function( cef_request_context_t*, cef_completion_callback_t* ) close_all_connections;
2640         void function( cef_request_context_t*, const( cef_string_t )*, cef_resolve_callback_t* ) resolve_host;
2641         cef_errorcode_t function( cef_request_context_t*, const( cef_string_t )*, cef_string_list_t ) resolve_host_cached;
2642         void function( cef_request_context_t*, const( cef_string_t )*, cef_dictionary_value_t*, cef_extension_handler_t* ) load_extension;
2643         int function( cef_request_context_t*, const( cef_string_t )* ) did_load_extension;
2644         int function( cef_request_context_t*, const( cef_string_t )* ) has_extension;
2645         int function( cef_request_context_t*, cef_string_list_t ) get_extensions;
2646         cef_extension_t* function( cef_request_context_t*, const( cef_string_t )* ) get_extension;
2647     }
2648 }
2649 
2650 // cef_request_context_handler_capi.h
2651 struct cef_request_context_handler_t {
2652     cef_base_t base;
2653     extern( System ) @nogc nothrow {
2654         void function( cef_request_context_handler_t*, cef_request_context_t* ) on_request_context_initialized;
2655         cef_cookie_manager_t* function( cef_request_context_handler_t* ) get_cookie_manager;
2656         int function( cef_request_context_handler_t*, const( cef_string_t )*, const( cef_string_t )*, int, const( cef_string_t )*, cef_web_plugin_info_t*, cef_plugin_policy_t* ) on_before_plugin_load;
2657     }
2658 }
2659 
2660 // cef_request_handler_capi.h
2661 struct cef_request_callback_t {
2662     cef_base_t base;
2663     extern( System ) @nogc nothrow {
2664         void function( cef_request_callback_t*,int ) cont;
2665         void function( cef_request_callback_t* ) cancel;
2666     }
2667 }
2668 
2669 struct cef_select_client_certificate_callback_t {
2670     cef_base_t base;
2671     extern( System ) @nogc nothrow void function( cef_select_client_certificate_callback_t*, cef_x509certificate_t* ) select;
2672 }
2673 
2674 struct cef_request_handler_t {
2675     cef_base_t base;
2676     extern( System ) @nogc nothrow {
2677         int function( cef_request_handler_t*,cef_browser_t*,cef_frame_t*,cef_request_t*,int ) on_before_browse;
2678         int function( cef_request_handler_t*, cef_browser_t*, cef_frame_t*, const( cef_string_t )*, cef_window_open_disposition_t, int ) on_open_urlfrom_tab;
2679         int function( cef_request_handler_t*,cef_browser_t*,cef_frame_t*,cef_request_t* ) on_before_resource_load;
2680         cef_resource_handler_t* function( cef_request_handler_t*,cef_browser_t*,cef_frame_t*,cef_request_t* ) get_resource_handler;
2681         void function( cef_request_handler_t*,cef_browser_t*,cef_frame_t*,const( cef_string_t )*,cef_string_t* ) on_resource_redirect;
2682         int function( cef_request_handler_t*, cef_browser_t*, cef_frame_t*, cef_request_t*, cef_response_t* ) on_resource_response;
2683         cef_response_filter_t* function( cef_request_handler_t*, cef_browser_t*, cef_frame_t*, cef_request_t*, cef_response_t* ) get_resource_response_filter;
2684         void function( cef_request_handler_t*, cef_browser_t*, cef_frame_t*, cef_request_t*, cef_response_t*, cef_urlrequest_status_t, ulong ) on_resource_load_complete;
2685         int function( cef_request_handler_t*,cef_browser_t*,cef_frame_t*,int,const( cef_string_t )*,int,const( cef_string_t )*,const( cef_string_t )*,cef_auth_callback_t* ) get_auth_credentials;
2686         int function( cef_request_handler_t*, cef_browser_t*, cef_frame_t*, cef_request_t* ) can_get_cookies;
2687         int function( cef_request_handler_t*, cef_browser_t*, cef_frame_t*, cef_request_t*, const( cef_cookie_t )* ) can_set_cookie;
2688         int function( cef_request_handler_t*, cef_browser_t*, const( cef_string_t )*, ulong, cef_request_callback_t* ) on_quota_request;
2689         void function( cef_request_handler_t*, cef_browser_t*, const( cef_string_t )*, int* ) on_protocol_execution;
2690         int function( cef_request_handler_t*, cef_browser_t*, cef_errorcode_t, const( cef_string_t )*, cef_sslinfo_t*, cef_request_callback_t* ) on_certificate_error;
2691         int function( cef_request_handler_t*, cef_browser_t*, int, const( cef_string_t )*, int, size_t, const( cef_x509certificate_t*), cef_select_client_certificate_callback_t* ) on_select_client_certificate;
2692         void function( cef_request_handler_t*, cef_browser_t*, const( cef_string_t )* ) on_plugin_crashed;
2693         void function( cef_request_handler_t*, cef_browser_t* ) on_render_view_ready;
2694         void function( cef_request_handler_t*,cef_browser_t*,cef_termination_status_t ) on_render_process_terminated;
2695     }
2696 }
2697 
2698 // cef_resource_bundle_capi.h
2699 struct cef_resource_bundle_t {
2700     cef_base_t base;
2701     extern( System ) @nogc nothrow {
2702         cef_string_userfree_t function( cef_resource_bundle_t*, int ) get_localized_string;
2703         int function( cef_resource_bundle_t*, int, void**, size_t* ) get_data_resource;
2704         int function( cef_resource_bundle_t*, int, cef_scale_factor_t, void**, size_t* ) get_data_resource_for_scale;
2705     }
2706 }
2707 
2708 // cef_resource_bundle_handler_capi.h
2709 struct cef_resource_bundle_handler_t {
2710     cef_base_t base;
2711     extern( System ) @nogc nothrow {
2712         int function( cef_resource_bundle_handler_t*,int,cef_string_t* ) get_localized_string;
2713         int function( cef_resource_bundle_handler_t*,int,void**,size_t* ) get_data_resource;
2714         int function( cef_resource_bundle_handler_t*, int, cef_scale_factor_t, void**, size_t* ) get_data_resource_for_scale;
2715     }
2716 }
2717 
2718 // cef_resource_handler_capi.h
2719 struct cef_resource_handler_t {
2720     cef_base_t base;
2721     extern( System ) @nogc nothrow {
2722         int function( cef_resource_handler_t*,cef_request_t*,cef_callback_t* ) process_request;
2723         void function( cef_resource_handler_t*,cef_response_t*,int64*,cef_string_t* ) get_response_headers;
2724         int function( cef_resource_handler_t*,void*,int,int*,cef_callback_t* ) read_response;
2725         int function( cef_resource_handler_t*,const( cef_cookie_t )* ) can_get_cookie;
2726         int function( cef_resource_handler_t*,const( cef_cookie_t )* ) can_set_cookie;
2727         void function( cef_resource_handler_t* ) cancel;
2728     }
2729 }
2730 
2731 // cef_reponse_capi.h
2732 struct cef_response_t {
2733     cef_base_t base;
2734     extern( System ) @nogc nothrow {
2735         int function( cef_response_t* ) is_read_only;
2736         cef_errorcode_t function( cef_response_t* ) get_error;
2737         void function( cef_response_t*,cef_errorcode_t ) set_error;
2738         int function( cef_response_t* ) get_status;
2739         void function( cef_response_t*,int ) set_status;
2740         cef_string_userfree_t function( cef_response_t* ) get_status_text;
2741         void function( cef_response_t*,const( cef_string_t )* ) set_status_text;
2742         cef_string_userfree_t function( cef_response_t* ) get_mime_type;
2743         void function( cef_response_t*,const( cef_string_t )* ) set_mime_type;
2744         cef_string_userfree_t function( cef_response_t*,const( cef_string_t )* ) get_header;
2745         void function( cef_response_t*,cef_string_multimap_t ) get_header_map;
2746         void function( cef_response_t*,cef_string_multimap_t ) set_header_map;
2747         cef_string_userfree_t function( cef_response_t* ) get_url;
2748         void function( cef_response_t*, const( cef_string_t )* ) set_url;
2749     }
2750 }
2751 
2752 // cef_response_filter_capi.h
2753 struct cef_response_filter_t {
2754     cef_base_t base;
2755     extern( System ) @nogc nothrow {
2756         int function( cef_response_filter_t* ) init_filter;
2757         cef_response_filter_status_t function( cef_response_filter_t*, void*, size_t, size_t*, void*, size_t, size_t* ) filter;
2758     }
2759 }
2760 
2761 // cef_scheme_capi.h
2762 struct cef_scheme_registrar_t {
2763     cef_base_t base;
2764     extern( System ) @nogc nothrow int function( cef_scheme_registrar_t*,const( cef_string_t )*,int,int,int,int,int,int ) add_custom_scheme;
2765 }
2766 
2767 struct cef_scheme_handler_factory_t {
2768     cef_base_t base;
2769     extern( System ) @nogc nothrow cef_resource_handler_t* function( cef_scheme_handler_factory_t*,cef_browser_t*,cef_frame_t*,const( cef_string_t )*,cef_request_t* ) create;
2770 }
2771 
2772 // cef_server_capi.h
2773 struct cef_server_t {
2774     cef_base_t base;
2775     extern( System ) @nogc nothrow {
2776         cef_task_runner_t* function( cef_server_t* ) get_task_runner;
2777         void function( cef_server_t* ) shutdown;
2778         int function( cef_server_t* ) is_running;
2779         cef_string_userfree_t function( cef_server_t* ) get_address;
2780         int function( cef_server_t* ) has_connection;
2781         int function( cef_server_t*, int ) is_valid_connection;
2782         void function( cef_server_t*, int, const( cef_string_t )*, const( void )*, size_t ) send_http200response;
2783         void function( cef_server_t*, int ) send_http404response;
2784         void function( cef_server_t*, int, const( cef_string_t )* ) send_http500response;
2785         void function( cef_server_t*, int, int , const( cef_string_t )*, ulong, cef_string_multimap_t ) send_http_response;
2786         void function( cef_server_t*, int, const( void )*, size_t ) send_raw_data;
2787         void function( cef_server_t*, int ) close_connection;
2788         void function( cef_server_t*, int, const( void )*, size_t ) send_web_socket_message;
2789     }
2790 }
2791 
2792 struct cef_server_handler_t {
2793     cef_base_t base;
2794     extern( System ) @nogc nothrow {
2795         void function( cef_server_handler_t*, cef_server_t* ) on_server_created;
2796         void function( cef_server_handler_t*, cef_server_t* ) on_server_destroyed;
2797         void function( cef_server_handler_t*, cef_server_t*, int ) on_client_connected;
2798         void function( cef_server_handler_t*, cef_server_t*, int ) on_client_disconnected;
2799         void function( cef_server_handler_t*, cef_server_t*, int, const( cef_string_t )*, cef_request_t* ) on_http_request;
2800         void function( cef_server_handler_t*, cef_server_t*, int, const( cef_string_t )*, cef_request_t*, cef_callback_t* ) on_web_socket_request;
2801         void function( cef_server_handler_t*, cef_server_t* server, int ) on_web_socket_connected;
2802         void function( cef_server_handler_t*, cef_server_t*, int, const( void )*, size_t ) on_web_socket_message;
2803     }
2804 }
2805 
2806 // cef_ssl_info_capi.h
2807 struct cef_sslinfo_t {
2808     cef_base_t base;
2809     extern( System ) @nogc nothrow {
2810         cef_cert_status_t function( cef_sslinfo_t* ) get_cert_status;
2811         cef_x509certificate_t* function( cef_sslinfo_t* self) get_x509certificate;
2812     }
2813 }
2814 
2815 // cef_ssl_status_capi.h
2816 struct cef_sslstatus_t {
2817     cef_base_t base;
2818     extern( System ) @nogc nothrow {
2819         int function( cef_sslstatus_t* ) is_secure_connection;
2820         cef_cert_status_t function( cef_sslstatus_t* ) get_cert_status;
2821         cef_ssl_version_t function( cef_sslstatus_t* ) get_sslversion;
2822         cef_ssl_content_status_t function( cef_sslstatus_t* ) get_content_status;
2823         cef_x509certificate_t* function( cef_sslstatus_t* ) get_x509certificate;
2824     }
2825 }
2826 
2827 // cef_stream_capi.h
2828 struct cef_read_handler_t {
2829     cef_base_t base;
2830     extern( System ) @nogc nothrow {
2831         size_t function( cef_read_handler_t*, void*, size_t, size_t ) read;
2832         int function( cef_read_handler_t*, ulong, int ) seek;
2833         ulong function( cef_read_handler_t* ) tell;
2834         int function( cef_read_handler_t* ) eof;
2835         int function( cef_read_handler_t* ) may_block;
2836     }
2837 }
2838 
2839 struct cef_stream_reader_t {
2840     cef_base_t base;
2841     extern( System ) @nogc nothrow {
2842         size_t function( cef_stream_reader_t*, void*, size_t, size_t ) read;
2843         int function( cef_stream_reader_t*, ulong, int ) seek;
2844         ulong function( cef_stream_reader_t* ) tell;
2845         int function( cef_stream_reader_t* ) eof;
2846         int function( cef_stream_reader_t* ) may_block;
2847     }
2848 }
2849 
2850 struct cef_write_handler_t {
2851     cef_base_t base;
2852     extern( System ) @nogc nothrow {
2853         size_t function( cef_write_handler_t*, const( void )*, size_t, size_t ) write;
2854         int function( cef_write_handler_t*, ulong, int ) seek;
2855         ulong function( cef_write_handler_t* ) tell;
2856         int function( cef_write_handler_t* ) flush;
2857         int function( cef_write_handler_t* ) may_block;
2858     }
2859 }
2860 
2861 struct cef_stream_writer_t {
2862     cef_base_t base;
2863     extern( System ) @nogc nothrow {
2864         size_t function( cef_stream_writer_t*, const( void )*, size_t, size_t ) write;
2865         int function( cef_stream_writer_t*, ulong, int ) seek;
2866         ulong function( cef_stream_writer_t* ) tell;
2867         int function( cef_stream_writer_t* ) flush;
2868         int function( cef_stream_writer_t* ) may_block;
2869     }
2870 }
2871 
2872 // cef_string_visitor_capi.h
2873 struct cef_string_visitor_t {
2874     cef_base_t base;
2875     extern( System ) @nogc nothrow void function( cef_string_visitor_t*, const( cef_string_t )* ) visit;
2876 }
2877 
2878 // cef_task_capi.h
2879 struct cef_task_t {
2880     cef_base_t base;
2881     extern( System ) @nogc nothrow void function( cef_task_t* ) execute;
2882 } 
2883 
2884 struct cef_task_runner_t {
2885     cef_base_t base;
2886     extern( System ) @nogc nothrow {
2887         int function( cef_task_runner_t*, cef_task_runner_t* ) is_same;
2888         int function( cef_task_runner_t* ) belongs_to_current_thread;
2889         int function( cef_task_runner_t*, cef_thread_id_t ) belongs_to_thread;
2890         int function( cef_task_runner_t*, cef_task_t* ) post_task;
2891         int function( cef_task_runner_t*, cef_task_t*, ulong ) post_delayed_task;
2892     }
2893 }
2894 
2895 // cef_thread_capi.h
2896 struct cef_thread_t {
2897     cef_base_t base;
2898     extern( System ) @nogc nothrow {
2899         cef_task_runner_t* function( cef_thread_t* ) get_task_runner;
2900         cef_platform_thread_id_t function( cef_thread_t* ) get_platform_thread_id;
2901         void function( cef_thread_t* ) stop;
2902         int function( cef_thread_t* ) is_running;
2903     }
2904 }
2905 
2906 // cef_trace_capi.h
2907 struct cef_end_tracing_callback_t {
2908     cef_base_t base;
2909     extern( System ) @nogc nothrow void function( cef_end_tracing_callback_t*, const( cef_string_t )* ) on_end_tracing_complete;
2910 }
2911 
2912 // cef_urlrequest_capi.h
2913 struct cef_urlrequest_t {
2914     cef_base_t base;
2915     extern( System ) @nogc nothrow {
2916         cef_request_t* function( cef_urlrequest_t* ) get_request;
2917         cef_urlrequest_client_t* function( cef_urlrequest_t* ) get_client;
2918         cef_urlrequest_status_t function( cef_urlrequest_t* ) get_request_status;
2919         cef_errorcode_t function( cef_urlrequest_t* ) get_request_error;
2920         cef_response_t* function( cef_urlrequest_t* ) get_response;
2921         int function( cef_urlrequest_t* ) response_was_cached;
2922         void function( cef_urlrequest_t* ) cancel;
2923     }
2924 }
2925 
2926 struct cef_urlrequest_client_t {
2927     cef_base_t base;
2928     extern( System ) @nogc nothrow {
2929         void function( cef_urlrequest_client_t*, cef_urlrequest_t* ) on_request_complete;
2930         void function( cef_urlrequest_client_t*, cef_urlrequest_t*, ulong, ulong ) on_upload_progress;
2931         void function( cef_urlrequest_client_t*, cef_urlrequest_t*, ulong, ulong ) on_download_progress;
2932         void function( cef_urlrequest_client_t*, cef_urlrequest_t*, const( void )*, size_t) on_download_data;
2933         int function( cef_urlrequest_client_t*, int, const( cef_string_t )*, int, const( cef_string_t )*, const( cef_string_t )*, cef_auth_callback_t* ) get_auth_credentials;
2934     }
2935 }
2936 
2937 // cef_v8_capi.h
2938 struct cef_v8context_t {
2939     cef_base_t base;
2940     extern( System ) @nogc nothrow {
2941         cef_task_runner_t* function( cef_v8context_t* slf) get_task_runner;
2942         int function( cef_v8context_t* ) is_valid;
2943         cef_browser_t* function( cef_v8context_t* ) get_browser;
2944         cef_frame_t* function( cef_v8context_t* ) get_frame;
2945         cef_v8value_t* function( cef_v8context_t* ) get_global;
2946         int function( cef_v8context_t* ) enter;
2947         int function( cef_v8context_t* ) exit;
2948         int function( cef_v8context_t*, cef_v8context_t* ) is_same;
2949         int function( cef_v8context_t*, const( cef_string_t )*, const( cef_string_t )*, int, cef_v8value_t**, cef_v8exception_t** ) eval;
2950     }
2951 }
2952 
2953 struct cef_v8handler_t {
2954     cef_base_t base;
2955     extern( System ) @nogc nothrow int function( cef_v8handler_t*, const( cef_string_t )*, cef_v8value_t*, size_t, const( cef_v8value_t* ), cef_v8value_t**, cef_string_t* ) execute;
2956 }
2957 
2958 struct cef_v8accessor_t {
2959     cef_base_t base;
2960     extern( System ) @nogc nothrow {
2961         int function( cef_v8accessor_t*, const( cef_string_t )*, cef_v8value_t*, cef_v8value_t**, cef_string_t* ) get;
2962         int function( cef_v8accessor_t*, const( cef_string_t )*, cef_v8value_t*, cef_v8value_t*, cef_string_t* ) set;
2963     }
2964 }
2965 
2966 struct cef_v8interceptor_t {
2967     cef_base_t base;
2968     extern( System ) @nogc nothrow {
2969         int function( cef_v8interceptor_t*, const( cef_string_t )*, cef_v8value_t*, cef_v8value_t**, cef_string_t* ) get_byname;
2970         int function( cef_v8interceptor_t*, int, cef_v8value_t*, cef_v8value_t**, cef_string_t* ) get_byindex;
2971         int function( cef_v8interceptor_t*, const( cef_string_t )*, cef_v8value_t*, cef_v8value_t*, cef_string_t* ) set_byname;
2972         int function( cef_v8interceptor_t*, int, cef_v8value_t*, cef_v8value_t*, cef_string_t* ) set_byindex;
2973     }
2974 }
2975 
2976 struct cef_v8exception_t {
2977     cef_base_t base;
2978     extern( System ) @nogc nothrow {
2979         cef_string_userfree_t function( cef_v8exception_t* ) get_message;
2980         cef_string_userfree_t function( cef_v8exception_t* ) get_source_line;
2981         cef_string_userfree_t function( cef_v8exception_t* ) get_script_resource_name;
2982         int function( cef_v8exception_t* ) get_line_number;
2983         int function( cef_v8exception_t* ) get_start_position;
2984         int function( cef_v8exception_t* ) get_end_position;
2985         int function( cef_v8exception_t* ) get_start_column;
2986         int function( cef_v8exception_t* ) get_end_column;
2987     }
2988 }
2989 
2990 struct cef_v8array_buffer_release_callback_t {
2991     cef_base_t base;
2992     extern( System ) @nogc nothrow  void function( cef_v8array_buffer_release_callback_t*, void* ) release_buffer;
2993 }
2994 
2995 struct cef_v8value_t {
2996     cef_base_t base;
2997     extern( System ) @nogc nothrow {
2998         int function( cef_v8value_t* ) is_valid;
2999         int function( cef_v8value_t* ) is_undefined;
3000         int function( cef_v8value_t* ) is_null;
3001         int function( cef_v8value_t* ) is_bool;
3002         int function( cef_v8value_t* ) is_int;
3003         int function( cef_v8value_t* ) is_uint;
3004         int function( cef_v8value_t* ) is_double;
3005         int function( cef_v8value_t* ) is_date;
3006         int function( cef_v8value_t* ) is_string;
3007         int function( cef_v8value_t* ) is_object;
3008         int function( cef_v8value_t* ) is_array;
3009         int function( cef_v8value_t* ) is_array_buffer;
3010         int function( cef_v8value_t* ) is_function;
3011         int function( cef_v8value_t*, cef_v8value_t* ) is_same;
3012         int function( cef_v8value_t* ) get_bool_value;
3013         int32 function( cef_v8value_t* ) get_int_value;
3014         uint32 function( cef_v8value_t* ) get_uint_value;
3015         double function( cef_v8value_t* ) get_double_value;
3016         cef_time_t function( cef_v8value_t* ) get_date_value;
3017         cef_string_userfree_t function( cef_v8value_t* ) get_string_value;
3018         int function( cef_v8value_t* ) is_user_created;
3019         int function( cef_v8value_t* ) has_exception;
3020         cef_v8exception_t* function( cef_v8value_t* ) get_exception;
3021         int function( cef_v8value_t* ) clear_exception;
3022         int function( cef_v8value_t* ) will_rethrow_exceptions;
3023         int function( cef_v8value_t*, int ) set_rethrow_exceptions;
3024         int function( cef_v8value_t*, const( cef_string_t )* ) has_value_bykey;
3025         int function( cef_v8value_t*, int ) has_value_byindex;
3026         int function( cef_v8value_t*, const( cef_string_t )* ) delete_value_bykey;
3027         int function( cef_v8value_t*, int ) delete_value_byindex;
3028         cef_v8value_t* function( cef_v8value_t*, const( cef_string_t )* ) get_value_bykey;
3029         cef_v8value_t* function( cef_v8value_t*, int ) get_value_byindex;
3030         int function( cef_v8value_t*, const( cef_string_t )*, cef_v8value_t*, cef_v8_propertyattribute_t ) set_value_bykey;
3031         int function( cef_v8value_t*, int, cef_v8value_t* ) set_value_byindex;
3032         int function( cef_v8value_t*, const( cef_string_t )*, cef_v8_accesscontrol_t, cef_v8_propertyattribute_t ) set_value_byaccessor;
3033         int function( cef_v8value_t*, cef_string_list_t ) get_keys;
3034         int function( cef_v8value_t*, cef_base_t* ) set_user_data;
3035         cef_base_t* function( cef_v8value_t* ) get_user_data;
3036         int function( cef_v8value_t* ) get_externally_allocated_memory;
3037         int function( cef_v8value_t*, int ) adjust_externally_allocated_memory;
3038         int function( cef_v8value_t* ) get_array_length;
3039         cef_v8array_buffer_release_callback_t* function( cef_v8value_t* ) get_array_buffer_release_callback;
3040         int function( cef_v8value_t* ) neuter_array_buffer;
3041         cef_string_userfree_t function( cef_v8value_t* ) get_function_name;
3042         cef_v8handler_t* function( cef_v8value_t* ) get_function_handler;
3043         cef_v8value_t* function( cef_v8value_t*, cef_v8value_t*, size_t, const( cef_v8value_t* ) ) execute_function;
3044         cef_v8value_t* function( cef_v8value_t*, cef_v8context_t*, cef_v8value_t*, size_t, const( cef_v8value_t* )) execute_function_with_context;
3045     }
3046 }
3047 
3048 struct cef_v8stack_trace_t {
3049     cef_base_t base;
3050     extern( System ) @nogc nothrow {
3051         int function( cef_v8stack_trace_t* ) is_valid;
3052         int function( cef_v8stack_trace_t* ) get_frame_count;
3053         cef_v8stack_frame_t* function( cef_v8stack_trace_t*, int ) get_frame;
3054     }
3055 }
3056 
3057 struct cef_v8stack_frame_t {
3058     cef_base_t base;
3059     extern( System ) @nogc nothrow {
3060         int function( cef_v8stack_frame_t* ) is_valid;
3061         cef_string_userfree_t function( cef_v8stack_frame_t* ) get_script_name;
3062         cef_string_userfree_t function( cef_v8stack_frame_t* ) get_script_name_or_source_url;
3063         cef_string_userfree_t function( cef_v8stack_frame_t* ) get_function_name;
3064         int function( cef_v8stack_frame_t* ) get_line_number;
3065         int function( cef_v8stack_frame_t* ) get_column;
3066         int function( cef_v8stack_frame_t* ) is_eval;
3067         int function( cef_v8stack_frame_t* ) is_constructor;
3068     }
3069 }
3070 
3071 
3072 // cef_values_capi.h
3073 struct cef_value_t {
3074     cef_base_t base;
3075     extern( System ) @nogc nothrow {
3076         int function( cef_value_t* ) is_valid;
3077         int function( cef_value_t* ) is_owned;
3078         int function( cef_value_t* ) is_read_only;
3079         int function( cef_value_t*, cef_value_t* ) is_same;
3080         int function( cef_value_t*, cef_value_t* ) is_equal;
3081         cef_value_t* function( cef_value_t* ) copy;
3082         cef_value_type_t function( cef_value_t* ) get_type;
3083         int function( cef_value_t* ) get_bool;
3084         int function( cef_value_t* ) get_int;
3085         double function( cef_value_t* ) get_double;
3086         cef_string_userfree_t function( cef_value_t* ) get_string;
3087         cef_binary_value_t* function( cef_value_t* ) get_binary;
3088         cef_dictionary_value_t* function( cef_value_t* ) get_dictionary;
3089         cef_list_value_t* function( cef_value_t* ) get_list;
3090         int function( cef_value_t* ) set_null;
3091         int function( cef_value_t*, int ) set_bool;
3092         int function( cef_value_t*, int ) set_int;
3093         int function( cef_value_t*, double ) set_double;
3094         int function( cef_value_t*, const( cef_string_t )* ) set_string;
3095         int function( cef_value_t*, cef_binary_value_t* ) set_binary;
3096         int function( cef_value_t*, cef_dictionary_value_t* ) set_dictionary;
3097         int function( cef_value_t*, cef_list_value_t* ) set_list;
3098     }
3099 }
3100 
3101 struct cef_binary_value_t {
3102     cef_base_t base;
3103     extern( System ) @nogc nothrow {
3104         int function( cef_binary_value_t* ) is_valid;
3105         int function( cef_binary_value_t* ) is_owned;
3106         int function( cef_binary_value_t*, cef_binary_value_t* ) is_same;
3107         int function( cef_binary_value_t*, cef_binary_value_t* ) is_equal;
3108         cef_binary_value_t* function( cef_binary_value_t* ) copy;
3109         size_t function( cef_binary_value_t* ) get_size;
3110         size_t function( cef_binary_value_t*, void*, size_t, size_t ) get_data;
3111     }
3112 }
3113 
3114 struct cef_dictionary_value_t {
3115     cef_base_t base;
3116     extern( System ) @nogc nothrow {
3117         int function( cef_dictionary_value_t* ) is_valid;
3118         int function( cef_dictionary_value_t* ) is_owned;
3119         int function( cef_dictionary_value_t* ) is_read_only;
3120         int function( cef_dictionary_value_t*, cef_dictionary_value_t* ) is_same;
3121         int function( cef_dictionary_value_t*, cef_dictionary_value_t* ) is_equal;
3122         cef_dictionary_value_t* function( cef_dictionary_value_t*, int ) copy;
3123         size_t function( cef_dictionary_value_t* ) get_size;
3124         int function( cef_dictionary_value_t* ) clear;
3125         int function( cef_dictionary_value_t*, const( cef_string_t )* ) has_key;
3126         int function( cef_dictionary_value_t*, cef_string_list_t ) get_keys;
3127         int function( cef_dictionary_value_t*, const( cef_string_t )* ) remove;
3128         cef_value_type_t function( cef_dictionary_value_t*, const( cef_string_t )* ) get_type;
3129         cef_value_t* function( cef_dictionary_value_t*, const( cef_string_t )* ) get_value;
3130         int function( cef_dictionary_value_t*, const( cef_string_t )* ) get_bool;
3131         int function( cef_dictionary_value_t*, const( cef_string_t )* ) get_int;
3132         double function( cef_dictionary_value_t*, const( cef_string_t )* ) get_double;
3133         cef_string_userfree_t function( cef_dictionary_value_t*, const( cef_string_t )* ) get_string;
3134         cef_binary_value_t* function( cef_dictionary_value_t* self, const( cef_string_t )* key) get_binary;
3135         cef_dictionary_value_t* function( cef_dictionary_value_t* self, const( cef_string_t )* key) get_dictionary;
3136         cef_list_value_t* function( cef_dictionary_value_t*, const( cef_string_t )* ) get_list;
3137         int function( cef_dictionary_value_t*, const( cef_string_t )*, cef_value_t* ) set_value;
3138         int function( cef_dictionary_value_t*, const( cef_string_t )* ) set_null;
3139         int function( cef_dictionary_value_t*, const( cef_string_t )*, int ) set_bool;
3140         int function( cef_dictionary_value_t*, const( cef_string_t )*, int ) set_int;
3141         int function( cef_dictionary_value_t*, const( cef_string_t )*, double ) set_double;
3142         int function( cef_dictionary_value_t*, const( cef_string_t )*, const( cef_string_t )* ) set_string;
3143         int function( cef_dictionary_value_t*, const( cef_string_t )*, cef_binary_value_t* ) set_binary;
3144         int function( cef_dictionary_value_t*, const( cef_string_t )*, cef_dictionary_value_t* ) set_dictionary;
3145         int function( cef_dictionary_value_t*, const( cef_string_t )*, cef_list_value_t* ) set_list;
3146     }
3147 }
3148 
3149 struct cef_list_value_t {
3150     cef_base_t base;
3151     extern( System ) @nogc nothrow {
3152         int function( cef_list_value_t* ) is_valid;
3153         int function( cef_list_value_t* ) is_owned;
3154         int function( cef_list_value_t* ) is_read_only;
3155         int function( cef_list_value_t*, cef_list_value_t* ) is_same;
3156         int function( cef_list_value_t*, cef_list_value_t* ) is_equal;
3157         cef_list_value_t* function( cef_list_value_t* ) copy;
3158         int function( cef_list_value_t*, size_t ) set_size;
3159         size_t function( cef_list_value_t* ) get_size;
3160         int function( cef_list_value_t* ) clear;
3161         int function( cef_list_value_t*, size_t ) remove;
3162         cef_value_type_t function( cef_list_value_t*, size_t ) get_type;
3163         cef_value_t* function( cef_list_value_t*, size_t ) get_value;
3164         int function( cef_list_value_t*, size_t ) get_bool;
3165         int function( cef_list_value_t*, size_t ) get_int;
3166         double function( cef_list_value_t*, size_t ) get_double;
3167         cef_string_userfree_t function( cef_list_value_t*, size_t ) get_string;
3168         cef_binary_value_t* function( cef_list_value_t*, size_t ) get_binary;
3169         cef_dictionary_value_t* function( cef_list_value_t*, size_t ) get_dictionary;
3170         cef_list_value_t* function( cef_list_value_t*, size_t ) get_list;
3171         int function( cef_list_value_t*, size_t, cef_value_t* ) set_value;
3172         int function( cef_list_value_t*, size_t ) set_null;
3173         int function( cef_list_value_t*, size_t, int ) set_bool;
3174         int function( cef_list_value_t*, size_t, int ) set_int;
3175         int function( cef_list_value_t*, size_t, double ) set_double;
3176         int function( cef_list_value_t*, size_t, const( cef_string_t )* ) set_string;
3177         int function( cef_list_value_t*, size_t, cef_binary_value_t* ) set_binary;
3178         int function( cef_list_value_t*, size_t, cef_dictionary_value_t*value) set_dictionary;
3179         int function( cef_list_value_t*, size_t, cef_list_value_t* ) set_list;
3180     }
3181 }
3182 
3183 // cef_waitable_event_capi.h
3184 struct cef_waitable_event_t {
3185     cef_base_t base;
3186     extern( System ) @nogc nothrow {
3187         void function( cef_waitable_event_t* ) reset;
3188         void function( cef_waitable_event_t* ) signal;
3189         int function( cef_waitable_event_t* ) is_signaled;
3190         void function( cef_waitable_event_t* ) wait;
3191         int function( cef_waitable_event_t*, ulong ) timed_wait;
3192     }
3193 }
3194 
3195 // cef_web_plugin_capi.h
3196 struct cef_web_plugin_info_t {
3197     cef_base_t base;
3198     extern( System ) @nogc nothrow {
3199         cef_string_userfree_t function( cef_web_plugin_info_t* ) get_name;
3200         cef_string_userfree_t function( cef_web_plugin_info_t* ) get_path;
3201         cef_string_userfree_t function( cef_web_plugin_info_t* ) get_version;
3202         cef_string_userfree_t function( cef_web_plugin_info_t* ) get_description;
3203     }
3204 }
3205 
3206 struct cef_web_plugin_info_visitor_t {
3207     cef_base_t base;
3208     extern( System ) @nogc nothrow int function( cef_web_plugin_info_visitor_t*,cef_web_plugin_info_t*,int,int ) visit;
3209 }
3210 
3211 struct cef_web_plugin_unstable_callback_t {
3212     cef_base_t base;
3213     extern( System ) @nogc nothrow void function( cef_web_plugin_unstable_callback_t,const( cef_string_t )*,int ) is_unstable;
3214 }
3215 
3216 struct cef_register_cdm_callback_t {
3217     cef_base_t base;
3218     extern( System ) @nogc nothrow void function( cef_register_cdm_callback_t*, cef_cdm_registration_error_t, const ( cef_string_t )* ) on_cdm_registration_complete;
3219 }
3220 
3221 // cef_x509_certificate_capi.h
3222 struct cef_x509cert_principal_t {
3223     cef_base_t base;
3224     extern( System ) @nogc nothrow {
3225         cef_string_userfree_t function( cef_x509cert_principal_t* ) get_display_name;
3226         cef_string_userfree_t function( cef_x509cert_principal_t* ) get_common_name;
3227         cef_string_userfree_t function( cef_x509cert_principal_t* ) get_locality_name;
3228         cef_string_userfree_t function( cef_x509cert_principal_t* ) get_state_or_province_name;
3229         cef_string_userfree_t function( cef_x509cert_principal_t* ) get_country_name;
3230         void function( cef_x509cert_principal_t*, cef_string_list_t ) get_street_addresses;
3231         void function( cef_x509cert_principal_t*, cef_string_list_t ) get_organization_names;
3232         void function( cef_x509cert_principal_t*, cef_string_list_t ) get_organization_unit_names;
3233         void function( cef_x509cert_principal_t*, cef_string_list_t ) get_domain_components;
3234     }
3235 }
3236 
3237 struct cef_x509certificate_t {
3238     cef_base_t base;
3239     extern( System ) @nogc nothrow {
3240         cef_x509cert_principal_t* function( cef_x509certificate_t* ) get_subject;
3241         cef_x509cert_principal_t* function( cef_x509certificate_t* ) get_issuer;
3242         cef_binary_value_t* function( cef_x509certificate_t* ) get_serial_number;
3243         cef_time_t function( cef_x509certificate_t* ) get_valid_start;
3244         cef_time_t function( cef_x509certificate_t* ) get_valid_expiry;
3245         cef_binary_value_t* function( cef_x509certificate_t* ) get_derencoded;
3246         cef_binary_value_t* function( cef_x509certificate_t* ) get_pemencoded;
3247         size_t function( cef_x509certificate_t* ) get_issuer_chain_size;
3248         void function( cef_x509certificate_t*, size_t*, cef_binary_value_t** ) get_derencoded_issuer_chain;
3249         void function( cef_x509certificate_t*, size_t*, cef_binary_value_t** ) get_pemencoded_issuer_chain;
3250     }
3251 }
3252 
3253 // cef_xml_reader_capi.h
3254 struct cef_xml_reader_t {
3255     cef_base_t base;
3256     extern( System ) @nogc nothrow {
3257         int function( cef_xml_reader_t* ) move_to_next_node;
3258         int function( cef_xml_reader_t* ) close;
3259         int function( cef_xml_reader_t* ) has_error;
3260         cef_string_userfree_t function( cef_xml_reader_t* ) get_error;
3261         cef_xml_node_type_t function( cef_xml_reader_t* ) get_type;
3262         int function( cef_xml_reader_t* ) get_depth;
3263         cef_string_userfree_t function( cef_xml_reader_t* ) get_local_name;
3264         cef_string_userfree_t function( cef_xml_reader_t* ) get_prefix;
3265         cef_string_userfree_t function( cef_xml_reader_t* ) get_qualified_name;
3266         cef_string_userfree_t function( cef_xml_reader_t* ) get_namespace_uri;
3267         cef_string_userfree_t function( cef_xml_reader_t* ) get_base_uri;
3268         cef_string_userfree_t function( cef_xml_reader_t* ) get_xml_lang;
3269         int function( cef_xml_reader_t* ) is_empty_element;
3270         int function( cef_xml_reader_t* ) has_value;
3271         cef_string_userfree_t function( cef_xml_reader_t* ) get_value;
3272         int function( cef_xml_reader_t* ) has_attributes;
3273         size_t function( cef_xml_reader_t* ) get_attribute_count;
3274         cef_string_userfree_t function( cef_xml_reader_t*,int ) get_attribute_byindex;
3275         cef_string_userfree_t function( cef_xml_reader_t*,const( cef_string_t )* ) get_attribute_byqname;
3276         cef_string_userfree_t function( cef_xml_reader_t*,const( cef_string_t )*,const( cef_string_t )* ) get_attribute_bylname;
3277         cef_string_userfree_t function( cef_xml_reader_t* ) get_inner_xml;
3278         cef_string_userfree_t function( cef_xml_reader_t* ) get_outer_xml;
3279         int function( cef_xml_reader_t* ) get_line_number;
3280         int function( cef_xml_reader_t*,int ) move_to_attribute_by_index;
3281         int function( cef_xml_reader_t*,const( cef_string_t )* ) move_to_attribute_byqname;
3282         int function( cef_xml_reader_t*,const( cef_string_t )*,const( cef_string_t )* ) move_to_attribute_bylname;
3283         int function( cef_xml_reader_t* ) move_to_first_attribute;
3284         int function( cef_xml_reader_t* ) move_to_next_attribute;
3285         int function( cef_xml_reader_t* ) move_to_carrying_element;
3286     }
3287 }
3288 
3289 // cef_zip_reader_capi.h
3290 struct cef_zip_reader_t {
3291     import core.stdc.time : time_t;
3292 
3293     cef_base_t base;
3294     extern( System ) @nogc nothrow {
3295         int function( cef_zip_reader_t* ) move_to_first_file;
3296         int function( cef_zip_reader_t* ) move_to_next_file;
3297         int function( cef_zip_reader_t*,const( cef_string_t )*,int ) move_to_file;
3298         int function( cef_zip_reader_t* ) close;
3299         cef_string_userfree_t function( cef_zip_reader_t* ) get_file_name;
3300         int64 function( cef_zip_reader_t* ) get_file_size;
3301         time_t function( cef_zip_reader_t* ) get_file_last_modified;
3302         int function( cef_zip_reader_t*,const( cef_string_t )* ) open_file;
3303         int function( cef_zip_reader_t* ) close_file;
3304         int function( cef_zip_reader_t*,void*,size_t ) read_file;
3305         int64 function( cef_zip_reader_t* ) tell;
3306         int function( cef_zip_reader_t* ) eof;
3307     }
3308 }
3309 
3310 // test/cef_translator_test_capi.h
3311 struct cef_translator_test_t {
3312     cef_base_t base;
3313     extern( System ) @nogc nothrow {
3314         void function( cef_translator_test_t* ) get_void;
3315         int function( cef_translator_test_t* ) get_bool;
3316         int function( cef_translator_test_t* ) get_int;
3317         double function( cef_translator_test_t* ) get_double;
3318         long function( cef_translator_test_t* ) get_long;
3319         size_t function( cef_translator_test_t* ) get_sizet;
3320         int function( cef_translator_test_t* ) set_void;
3321         int function( cef_translator_test_t*, int ) set_bool;
3322         int function( cef_translator_test_t*, int ) set_int;
3323         int function( cef_translator_test_t*, double ) set_double;
3324         int function( cef_translator_test_t*, long ) set_long;
3325         int function( cef_translator_test_t*, size_t ) set_sizet;
3326         int function( cef_translator_test_t*, size_t, const( int* ) ) set_int_list;
3327         int function( cef_translator_test_t*, size_t*, int* ) get_int_list_by_ref;
3328         size_t function( cef_translator_test_t* ) get_int_list_size;
3329         cef_string_userfree_t function( cef_translator_test_t* ) get_string;
3330         int function( cef_translator_test_t*, const( cef_string_t )* ) set_string;
3331         void function( cef_translator_test_t*, cef_string_t* ) get_string_by_ref;
3332         int function( cef_translator_test_t*, cef_string_list_t ) set_string_list;
3333         int function( cef_translator_test_t*, cef_string_list_t ) get_string_list_by_ref;
3334         int function( cef_translator_test_t*, cef_string_map_t ) set_string_map;
3335         int function( cef_translator_test_t*, cef_string_map_t ) get_string_map_by_ref;
3336         int function( cef_translator_test_t*, cef_string_multimap_t ) set_string_multimap;
3337         int function( cef_translator_test_t*, cef_string_multimap_t ) get_string_multimap_by_ref;
3338         cef_point_t function( cef_translator_test_t* ) get_point;
3339         int function( cef_translator_test_t*, const( cef_point_t )* ) set_point;
3340         void function( cef_translator_test_t*, cef_point_t* ) get_point_by_ref;
3341         int function( cef_translator_test_t*, size_t, const( cef_point_t* ) val) set_point_list;
3342         int function( cef_translator_test_t*, size_t*, cef_point_t* ) get_point_list_by_ref;
3343         size_t function( cef_translator_test_t* ) get_point_list_size;
3344         cef_translator_test_ref_ptr_library_t* function( cef_translator_test_t*, int ) get_ref_ptr_library;
3345         int function( cef_translator_test_t*, cef_translator_test_ref_ptr_library_t* ) set_ref_ptr_library;
3346         cef_translator_test_ref_ptr_library_t* function( cef_translator_test_t*, cef_translator_test_ref_ptr_library_t* ) set_ref_ptr_library_and_return;
3347         int function( cef_translator_test_t*, cef_translator_test_ref_ptr_library_child_t* ) set_child_ref_ptr_library;
3348         cef_translator_test_ref_ptr_library_t* function( cef_translator_test_t*, cef_translator_test_ref_ptr_library_child_t* ) set_child_ref_ptr_library_and_return_parent;
3349         int function( cef_translator_test_t*, size_t, const( cef_translator_test_ref_ptr_library_t* ) val, int , int ) set_ref_ptr_library_list;
3350         int function( cef_translator_test_t*, size_t*, cef_translator_test_ref_ptr_library_t**, int, int ) get_ref_ptr_library_list_by_ref;
3351         size_t function( cef_translator_test_t* ) get_ref_ptr_library_list_size;
3352         int function( cef_translator_test_t*, cef_translator_test_ref_ptr_client_t* ) set_ref_ptr_client;
3353         cef_translator_test_ref_ptr_client_t* function( cef_translator_test_t* self, cef_translator_test_ref_ptr_client_t* ) set_ref_ptr_client_and_return;
3354         int function( cef_translator_test_t*, cef_translator_test_ref_ptr_client_child_t* ) set_child_ref_ptr_client;
3355         cef_translator_test_ref_ptr_client_t* function( cef_translator_test_t*, cef_translator_test_ref_ptr_client_child_t* ) set_child_ref_ptr_client_and_return_parent;
3356         int function( cef_translator_test_t*, size_t, const( cef_translator_test_ref_ptr_client_t* ) val, int, int ) set_ref_ptr_client_list;
3357         int function( cef_translator_test_t*, size_t*, cef_translator_test_ref_ptr_client_t**, cef_translator_test_ref_ptr_client_t*, cef_translator_test_ref_ptr_client_t* ) get_ref_ptr_client_list_by_ref;
3358         size_t function( cef_translator_test_t* ) get_ref_ptr_client_list_size;
3359         cef_translator_test_scoped_library_t* function( cef_translator_test_t*, int ) get_own_ptr_library;
3360         int function( cef_translator_test_t*, cef_translator_test_scoped_library_t* ) set_own_ptr_library;
3361         cef_translator_test_scoped_library_t* function( cef_translator_test_t*, cef_translator_test_scoped_library_t* ) set_own_ptr_library_and_return;
3362         int function( cef_translator_test_t*, cef_translator_test_scoped_library_child_t* ) set_child_own_ptr_library;
3363         cef_translator_test_scoped_library_t* function( cef_translator_test_t*, cef_translator_test_scoped_library_child_t* ) set_child_own_ptr_library_and_return_parent;
3364         int function( cef_translator_test_t*, cef_translator_test_scoped_client_t* ) set_own_ptr_client;
3365         cef_translator_test_scoped_client_t* function( cef_translator_test_t*, cef_translator_test_scoped_client_t* ) set_own_ptr_client_and_return;
3366         int function( cef_translator_test_t*, cef_translator_test_scoped_client_child_t* ) set_child_own_ptr_client;
3367         cef_translator_test_scoped_client_t* function( cef_translator_test_t*, cef_translator_test_scoped_client_child_t* ) set_child_own_ptr_client_and_return_parent;
3368         int function( cef_translator_test_t*, cef_translator_test_scoped_library_t* ) set_raw_ptr_library;
3369         int function( cef_translator_test_t*, cef_translator_test_scoped_library_child_t* ) set_child_raw_ptr_library;
3370         int function( cef_translator_test_t*, size_t, const( cef_translator_test_scoped_library_t* ), int, int ) set_raw_ptr_library_list;
3371         int function( cef_translator_test_t*, cef_translator_test_scoped_client_t* ) set_raw_ptr_client;
3372         int function( cef_translator_test_t*, cef_translator_test_scoped_client_child_t* ) set_child_raw_ptr_client;
3373         int function( cef_translator_test_t*, size_t, const( cef_translator_test_scoped_client_t* ), int, int ) set_raw_ptr_client_list;
3374     }
3375 }
3376 
3377 struct cef_translator_test_ref_ptr_library_t {
3378     cef_base_t base;
3379     extern( System ) @nogc nothrow {
3380         int function( cef_translator_test_ref_ptr_library_t* ) get_value;
3381         void function( cef_translator_test_ref_ptr_library_t*, int ) set_value;
3382     }
3383 }
3384 
3385 struct cef_translator_test_ref_ptr_library_child_t {
3386     cef_base_t base;
3387     extern( System ) @nogc nothrow {
3388         int function( cef_translator_test_ref_ptr_library_child_t* ) get_other_value;
3389         void function( cef_translator_test_ref_ptr_library_child_t*, int ) set_other_value;
3390     }
3391 }
3392 
3393 struct cef_translator_test_ref_ptr_library_child_child_t {
3394     cef_translator_test_ref_ptr_library_t base;
3395     extern( System ) @nogc nothrow {
3396         int function( cef_translator_test_ref_ptr_library_child_child_t* ) get_other_other_value;
3397         void function( cef_translator_test_ref_ptr_library_child_child_t*, int ) set_other_other_value;
3398     }
3399 }
3400 
3401 struct cef_translator_test_ref_ptr_client_t {
3402     cef_base_t base;
3403     extern( System ) @nogc nothrow int function( cef_translator_test_ref_ptr_client_t* ) get_value;
3404 }
3405 
3406 struct cef_translator_test_ref_ptr_client_child_t {
3407     cef_translator_test_ref_ptr_client_t base;
3408     extern( System ) @nogc nothrow int function( cef_translator_test_ref_ptr_client_child_t* ) get_other_value;
3409 }
3410 
3411 struct cef_translator_test_scoped_library_t {
3412     cef_base_scoped_t base;
3413     extern( System ) @nogc nothrow {
3414         int function( cef_translator_test_scoped_library_t* ) get_value;
3415         void function( cef_translator_test_scoped_library_t*, int ) set_value;
3416     }
3417 }
3418 
3419 struct cef_translator_test_scoped_library_child_t {
3420     cef_translator_test_scoped_library_t base;
3421     extern( System ) @nogc nothrow {
3422         int function( cef_translator_test_scoped_library_child_t* ) get_other_value;
3423         void function( cef_translator_test_scoped_library_child_t*, int ) set_other_value;
3424     }
3425 }
3426 
3427 struct cef_translator_test_scoped_library_child_child_t {
3428     cef_translator_test_scoped_library_child_t base;
3429     extern( System ) @nogc nothrow {
3430         int function( cef_translator_test_scoped_library_child_child_t* ) get_other_other_value;
3431         void function( cef_translator_test_scoped_library_child_child_t*, int ) set_other_other_value;
3432     }
3433 }
3434 
3435 struct cef_translator_test_scoped_client_t {
3436     cef_base_scoped_t base;
3437     extern( System ) @nogc nothrow int function( cef_translator_test_scoped_client_t* ) get_value;
3438 }
3439 
3440 struct cef_translator_test_scoped_client_child_t {
3441     cef_translator_test_scoped_client_t base;
3442     extern( System ) @nogc nothrow int function( cef_translator_test_scoped_client_child_t* ) get_other_value;
3443 }
3444 
3445 // views/cef_box_layout_capi.h
3446 struct cef_box_layout_t {
3447     cef_layout_t base;
3448     extern( System ) @nogc nothrow {
3449         void function( cef_box_layout_t*, cef_view_t*, int ) set_flex_for_view;
3450         void function( cef_box_layout_t*, cef_view_t* ) clear_flex_for_view;
3451     }
3452 }
3453 
3454 // views/cef_browser_view_capi.h
3455 struct cef_browser_view_t {
3456     cef_view_t base;
3457     extern( System ) @nogc nothrow {
3458         cef_browser_t* function( cef_browser_view_t* ) get_browser;
3459         void function( cef_browser_view_t* , int ) set_prefer_accelerators;
3460     }
3461 }
3462 
3463 // views/cef_browser_view_delegate_capi.h
3464 struct cef_browser_view_delegate_t {
3465     cef_view_delegate_t base;
3466     extern( System ) @nogc nothrow {
3467         void function( cef_browser_view_delegate_t*, cef_browser_view_t*, cef_browser_t* ) on_browser_created;
3468         void function( cef_browser_view_delegate_t*, cef_browser_view_t*, cef_browser_t* ) on_browser_destroyed;
3469         cef_browser_view_delegate_t* function( cef_browser_view_delegate_t*, cef_browser_view_t*, const( cef_browser_settings_t )*, cef_client_t*, int ) get_delegate_for_popup_browser_view;
3470         int function( cef_browser_view_delegate_t*, cef_browser_view_t*, cef_browser_view_t*, int is_devtools) on_popup_browser_view_created;
3471     }
3472 }
3473 
3474 // views/cef_button_capi.h
3475 struct cef_button_t {
3476     cef_view_t base;
3477     extern( System ) @nogc nothrow {
3478         cef_label_button_t* function( cef_button_t* ) as_label_button;
3479         void function( cef_button_t*, cef_button_state_t ) set_state;
3480         cef_button_state_t function( cef_button_t* ) get_state;
3481         void function( cef_button_t*, int ) set_ink_drop_enabled;
3482         void function( cef_button_t*, const( cef_string_t )* ) set_tooltip_text;
3483         void function( cef_button_t*, const( cef_string_t )* ) set_accessible_name;
3484     }
3485 }
3486 
3487 // views/cef_button_delegate_capi.h
3488 struct cef_button_delegate_t {
3489     cef_view_delegate_t base;
3490     extern( System ) @nogc nothrow {
3491         void function( cef_button_delegate_t*, cef_button_t* ) on_button_pressed;
3492         void function( cef_button_delegate_t*, cef_button_t* ) on_button_state_changed;
3493     }
3494 }
3495 
3496 // views/cef_display_capi.h
3497 struct cef_display_t {
3498     cef_base_t base;
3499     extern( System ) @nogc nothrow {
3500         long function( cef_display_t* )get_id;
3501         float function( cef_display_t* ) get_device_scale_factor;
3502         void function( cef_display_t*, cef_point_t* ) convert_point_to_pixels;
3503         void function( cef_display_t*, cef_point_t* ) convert_point_from_pixels;
3504         cef_rect_t function( cef_display_t* ) get_bounds;
3505         cef_rect_t function( cef_display_t* ) get_work_area;
3506         int function( cef_display_t* ) get_rotation;
3507     }
3508 }
3509 
3510 // views/cef_fill_layout_capi.h
3511 struct cef_fill_layout_t {
3512     cef_layout_t base;
3513 }
3514 
3515 // views/cef_label_button_capi.h
3516 struct cef_label_button_t {
3517     cef_button_t base;
3518     extern( System ) @nogc nothrow {
3519         cef_menu_button_t* function( cef_label_button_t* ) as_menu_button;
3520         void function( cef_label_button_t*, const( cef_string_t )* ) set_text;
3521         cef_string_userfree_t function( cef_label_button_t* ) get_text;
3522         void function( cef_label_button_t*, cef_button_state_t, cef_image_t* ) set_image;
3523         cef_image_t* function( cef_label_button_t*, cef_button_state_t ) get_image;
3524         void function( cef_label_button_t*, cef_button_state_t, cef_color_t ) set_text_color;
3525         void function( cef_label_button_t* , cef_color_t ) set_enabled_text_colors;
3526         void function( cef_label_button_t* , const( cef_string_t )* ) set_font_list;
3527         void function( cef_label_button_t*, cef_horizontal_alignment_t ) set_horizontal_alignment;
3528         void function( cef_label_button_t*, const( cef_size_t )* size) set_minimum_size;
3529         void function( cef_label_button_t*, const( cef_size_t )* ) set_maximum_size;
3530     }
3531 }
3532 
3533 // views/cef_layout_capi.h
3534 struct cef_layout_t {
3535     cef_base_t base;
3536     extern( System ) @nogc nothrow {
3537         cef_box_layout_t* function( cef_layout_t* ) as_box_layout;
3538         cef_fill_layout_t* function( cef_layout_t* ) as_fill_layout;
3539         int function( cef_layout_t* ) is_valid;
3540     }
3541 }
3542 
3543 // views/cef_menu_button_capi.h
3544 struct cef_menu_button_t {
3545     cef_label_button_t base;
3546     extern( System ) @nogc nothrow {
3547         void function( cef_menu_button_t*, cef_menu_model_t*, const( cef_point_t )* , cef_menu_anchor_position_t ) show_menu;
3548         void function( cef_menu_button_t* ) trigger_menu;
3549     }
3550 }
3551 
3552 // views/cef_menu_button_delegate_capi.h
3553 struct cef_menu_button_pressed_lock_t {
3554     cef_base_t base;
3555 }
3556 
3557 struct cef_menu_button_delegate_t {
3558     cef_button_delegate_t base;
3559     extern( System ) @nogc nothrow void function( cef_menu_button_delegate_t* self, cef_menu_button_t*, const( cef_point_t )*, cef_menu_button_pressed_lock_t* ) on_menu_button_pressed;
3560 }
3561 
3562 // views/cef_panel_capi.h
3563 struct cef_panel_t {
3564     cef_view_t base;
3565     extern( System ) @nogc nothrow {
3566         cef_window_t* function( cef_panel_t* ) as_window;
3567         cef_fill_layout_t* function( cef_panel_t* ) set_to_fill_layout;
3568         cef_box_layout_t* function( cef_panel_t*, const( cef_box_layout_settings_t )* ) set_to_box_layout;
3569         cef_layout_t* function( cef_panel_t* ) get_layout;
3570         void function( cef_panel_t* ) layout;
3571         void function( cef_panel_t*, cef_view_t* ) add_child_view;
3572         void function( cef_panel_t*, cef_view_t*, int ) add_child_view_at;
3573         void function( cef_panel_t*, cef_view_t*, int ) reorder_child_view;
3574         void function( cef_panel_t*, cef_view_t* ) remove_child_view;
3575         void function( cef_panel_t* ) remove_all_child_views;
3576         size_t function( cef_panel_t* ) get_child_view_count;
3577         cef_view_t* function( cef_panel_t*, int ) get_child_view_at;
3578     }
3579 }
3580 
3581 // views/cef_panel_delegate_capi.h
3582 struct cef_panel_delegate_t {
3583     cef_view_delegate_t base;
3584 }
3585 
3586 // views/cef_scroll_view_capi.h
3587 struct cef_scroll_view_t {
3588     cef_view_t base;
3589     extern( System ) @nogc nothrow {
3590         void function( cef_scroll_view_t*, cef_view_t* ) set_content_view;
3591         cef_view_t* function( cef_scroll_view_t* ) get_content_view;
3592         cef_rect_t function( cef_scroll_view_t* ) get_visible_content_rect;
3593         int function( cef_scroll_view_t* ) has_horizontal_scrollbar ;
3594         int function( cef_scroll_view_t* ) get_horizontal_scrollbar_height;
3595         int function( cef_scroll_view_t* ) has_vertical_scrollbar;
3596         int function( cef_scroll_view_t* ) get_vertical_scrollbar_width;
3597     }
3598 }
3599 
3600 // views/cef_scroll_view_capi.h
3601 struct cef_textfield_t {
3602     cef_view_t base;
3603     extern( System ) @nogc nothrow {
3604         void function( cef_textfield_t*, int ) set_password_input;
3605         int function( cef_textfield_t* ) is_password_input;
3606         void function( cef_textfield_t*, int ) set_read_only;
3607         int function( cef_textfield_t* ) is_read_only;
3608         cef_string_userfree_t function( cef_textfield_t* ) get_text;
3609         void function( cef_textfield_t* , const( cef_string_t )* ) set_text;
3610         void function( cef_textfield_t*, const( cef_string_t )* ) append_text;
3611         void function( cef_textfield_t*, const( cef_string_t )* ) insert_or_replace_text;
3612         int function( cef_textfield_t* ) has_selection;
3613         cef_string_userfree_t function( cef_textfield_t* ) get_selected_text;
3614         void function( cef_textfield_t*, int ) select_all;
3615         void function( cef_textfield_t*) clear_selection;
3616         cef_range_t function( cef_textfield_t* ) get_selected_range;
3617         void function( cef_textfield_t*, const( cef_range_t )* ) select_range;
3618         size_t function( cef_textfield_t* ) get_cursor_position;
3619         void function( cef_textfield_t*, cef_color_t ) set_text_color;
3620         cef_color_t function( cef_textfield_t* ) get_text_color;
3621         void function( cef_textfield_t*, cef_color_t ) set_selection_text_color;
3622         cef_color_t function( cef_textfield_t* ) get_selection_text_color; 
3623         void function( cef_textfield_t*, cef_color_t ) set_selection_background_color;
3624         cef_color_t function( cef_textfield_t* ) get_selection_background_color;
3625         void function( cef_textfield_t*, cef_string_t* ) set_font_list;
3626         void function( cef_textfield_t*, cef_color_t, const( cef_range_t )* ) apply_text_color;
3627         void function( cef_textfield_t*, cef_text_style_t, int, const( cef_range_t )* ) apply_text_style;
3628         int function( cef_textfield_t*, int ) is_command_enabled;
3629         void function( cef_textfield_t*, int ) execute_command;
3630         void function( cef_textfield_t* )clear_edit_history;
3631         void function( cef_textfield_t*, const( cef_string_t )* text) set_placeholder_text;
3632         cef_string_userfree_t function( cef_textfield_t* ) get_placeholder_text;
3633         void function( cef_textfield_t*, cef_color_t ) set_placeholder_text_color;
3634         void function( cef_textfield_t*, const( cef_string_t )* ) set_accessible_name;
3635     }
3636 }
3637 
3638 // views/cef_textfield_delegate_capi.h
3639 struct cef_textfield_delegate_t {
3640     cef_view_delegate_t base;
3641     extern( System ) @nogc nothrow {
3642         int function( cef_textfield_delegate_t*, cef_textfield_t*, const( cef_key_event_t )* ) on_key_event;
3643         void function( cef_textfield_delegate_t*, cef_textfield_t* ) on_after_user_action;
3644     }
3645 }
3646 
3647 // views/cef_view_capi.h
3648 struct cef_view_t {
3649     cef_base_t base;
3650     extern( System ) @nogc nothrow {
3651         cef_browser_view_t* function( cef_view_t* ) as_browser_view;
3652         cef_button_t* function( cef_view_t* ) as_button;
3653         cef_panel_t* function( cef_view_t* ) as_panel;
3654         cef_scroll_view_t* function( cef_view_t* ) as_scroll_view;
3655         cef_textfield_t* function( cef_view_t* ) as_textfield;
3656         cef_string_userfree_t function( cef_view_t* ) get_type_string;
3657         cef_string_userfree_t function( cef_view_t* , int ) to_string;
3658         int function( cef_view_t* ) is_valid;
3659         int function( cef_view_t* ) is_attached;
3660         int function( cef_view_t*, cef_view_t* ) is_same;
3661         cef_view_delegate_t* function( cef_view_t* ) get_delegate;
3662         cef_window_t* function( cef_view_t* ) get_window;
3663         int function( cef_view_t* ) get_id;
3664         void function( cef_view_t*, int ) set_id;
3665         int function( cef_view_t*) get_group_id;
3666         void function( cef_view_t*, int ) set_group_id;
3667         cef_view_t* function( cef_view_t* ) get_parent_view;
3668         cef_view_t* function( cef_view_t*, int ) get_view_for_id;
3669         void function( cef_view_t*, const( cef_rect_t )* ) set_bounds;
3670         cef_rect_t function( cef_view_t* ) get_bounds;
3671         cef_rect_t function( cef_view_t* ) get_bounds_in_screen;
3672         void function( cef_view_t*, const( cef_size_t )* ) set_size;
3673         cef_size_t function( cef_view_t* ) get_size;
3674         void function( cef_view_t*, const( cef_point_t )* ) set_position;
3675         cef_point_t function( cef_view_t* ) get_position;
3676         cef_size_t function( cef_view_t* ) get_preferred_size;
3677         void function( cef_view_t* ) size_to_preferred_size;
3678         cef_size_t function( cef_view_t* ) get_minimum_size;
3679         cef_size_t function( cef_view_t* ) get_maximum_size;
3680         int function( cef_view_t*, int) get_height_for_width;
3681         void function( cef_view_t* ) invalidate_layout;
3682         void function( cef_view_t*, int ) set_visible;
3683         int function( cef_view_t* ) is_visible;
3684         int function( cef_view_t* ) is_drawn;
3685         void function( cef_view_t* , int ) set_enabled;
3686         int function( cef_view_t* ) is_enabled;
3687         void function( cef_view_t* , int ) set_focusable;
3688         int function( cef_view_t* ) is_focusable;
3689         int function( cef_view_t* ) is_accessibility_focusable;
3690         void function( cef_view_t* ) request_focus;
3691         void function( cef_view_t*, cef_color_t ) set_background_color;
3692         cef_color_t function( cef_view_t* ) get_background_color;
3693         int function( cef_view_t*, cef_point_t* ) convert_point_to_screen;
3694         int function( cef_view_t*, cef_point_t* ) convert_point_from_screen;
3695         int function( cef_view_t*, cef_point_t* ) convert_point_to_window;
3696         int function( cef_view_t*, cef_point_t* ) convert_point_from_window;
3697         int function( cef_view_t* , cef_view_t*, cef_point_t* ) convert_point_to_view;
3698         int function( cef_view_t*, cef_view_t*, cef_point_t* ) convert_point_from_view;
3699     }
3700 }
3701 
3702 // views/cef_view_delegate_capi.h
3703 struct cef_view_delegate_t {
3704     cef_base_t base;
3705     extern( System ) @nogc nothrow {
3706         cef_size_t function( cef_view_delegate_t*, cef_view_t* ) get_preferred_size;
3707         cef_size_t function( cef_view_delegate_t*, cef_view_t* ) get_minimum_size;
3708         cef_size_t function( cef_view_delegate_t*, cef_view_t*) get_maximum_size;
3709         int function( cef_view_delegate_t*, cef_view_t*, int ) get_height_for_width;
3710         void function( cef_view_delegate_t*, cef_view_t*, int , cef_view_t* ) on_parent_view_changed;
3711         void function( cef_view_delegate_t*, cef_view_t*, int, cef_view_t* ) on_child_view_changed;
3712         void function( cef_view_delegate_t* , cef_view_t* ) on_focus;
3713         void function( cef_view_delegate_t*, cef_view_t* ) on_blur;
3714     }
3715 }
3716 
3717 // views/cef_window_capi.h
3718 struct  cef_window_t {
3719     cef_panel_t base;
3720     extern( System ) @nogc nothrow {
3721         void function( cef_window_t* ) show;
3722         void function( cef_window_t* ) hide;
3723         void function( cef_window_t*, const( cef_size_t )* ) center_window;
3724         void function( cef_window_t* ) close;
3725         int function( cef_window_t* ) is_closed;
3726         void function( cef_window_t* ) activate;
3727         void function( cef_window_t* ) deactivate;
3728         int function( cef_window_t* ) is_active;
3729         void function( cef_window_t* ) bring_to_top;
3730         void function( cef_window_t*, int ) set_always_on_top;
3731         int function( cef_window_t* ) is_always_on_top;
3732         void function( cef_window_t* ) maximize;
3733         void function( cef_window_t* ) minimize;
3734         void function( cef_window_t* ) restore;
3735         void function( cef_window_t*, int ) set_fullscreen;
3736         int function( cef_window_t*) is_maximized;
3737         int function( cef_window_t* ) is_minimized;
3738         int function( cef_window_t* ) is_fullscreen;
3739         void function( cef_window_t*, const( cef_string_t )* ) set_title;
3740         cef_string_userfree_t function( cef_window_t* ) get_title;
3741         void function( cef_window_t*, cef_image_t* ) set_window_icon;
3742         cef_image_t* function( cef_window_t* ) get_window_icon;
3743         void function( cef_window_t*, cef_image_t* ) set_window_app_icon;
3744         cef_image_t* function( cef_window_t* ) get_window_app_icon;
3745         void function( cef_window_t*, cef_menu_model_t*, const( cef_point_t )* , cef_menu_anchor_position_t ) show_menu;
3746         void function( cef_window_t* ) cancel_menu;
3747         cef_display_t* function( cef_window_t* ) get_display;
3748         cef_rect_t function( cef_window_t* ) get_client_area_bounds_in_screen;
3749         void function( cef_window_t* , size_t, const( cef_draggable_region_t* ) ) set_draggable_regions;
3750         cef_window_handle_t function( cef_window_t* ) get_window_handle;
3751         void function( cef_window_t*, int, uint ) send_key_press;
3752         void function( cef_window_t*, int, int ) send_mouse_move;
3753         void function( cef_window_t*, cef_mouse_button_type_t, int, int ) send_mouse_events;
3754         void function( cef_window_t*, int, int, int, int, int ) set_accelerator;
3755         void function( cef_window_t*, int ) remove_accelerator;
3756         void function( cef_window_t* ) remove_all_accelerators;
3757     }
3758 }
3759 
3760 // views/cef_window_delegate_capi.h
3761 struct cef_window_delegate_t {
3762     cef_panel_delegate_t base;
3763     extern( System ) @nogc nothrow {
3764         void function( cef_window_delegate_t*, cef_window_t* ) on_window_created;
3765         void function( cef_window_delegate_t*, cef_window_t* ) on_window_destroyed;
3766         cef_window_t* function( cef_window_delegate_t*, cef_window_t*, int*, int* ) get_parent_window;
3767         int function( cef_window_delegate_t*, cef_window_t* ) is_frameless;
3768         int function( cef_window_delegate_t*, cef_window_t* ) can_resize;
3769         int function( cef_window_delegate_t*, cef_window_t* ) can_maximize;
3770         int function( cef_window_delegate_t*, cef_window_t* ) can_minimize;
3771         int function( cef_window_delegate_t*, cef_window_t* ) can_close;
3772         int function( cef_window_delegate_t*, cef_window_t*, int ) on_accelerator;
3773         int function( cef_window_delegate_t*, cef_window_t*, const( cef_key_event_t )* ) on_key_event;
3774     }
3775 }
3776 }
3777 
3778 
3779 version(Windows):
3780 import arsd.simpledisplay;
3781 import arsd.com;
3782 import core.atomic;
3783 
3784 import std.stdio;
3785 
3786 T callback(T)(typeof(&T.init.Invoke) dg) {
3787 	return new class T {
3788 		extern(Windows):
3789 
3790 		static if(is(typeof(T.init.Invoke) R == return))
3791 		static if(is(typeof(T.init.Invoke) P == __parameters))
3792   		override R Invoke(P _args_) {
3793 			return dg(_args_);
3794 		}
3795 
3796 		override HRESULT QueryInterface(const (IID)*riid, LPVOID *ppv) {
3797 			if (IID_IUnknown == *riid) {
3798 				*ppv = cast(void*) cast(IUnknown) this;
3799 			}
3800 			else if (T.iid == *riid) {
3801 				*ppv = cast(void*) cast(T) this;
3802 			}
3803 			else {
3804 				*ppv = null;
3805 				return E_NOINTERFACE;
3806 			}
3807 
3808 			AddRef();
3809 			return NOERROR;
3810 		}
3811 
3812 		LONG count = 0;             // object reference count
3813 		ULONG AddRef() {
3814 			return atomicOp!"+="(*cast(shared)&count, 1);
3815 		}
3816 		ULONG Release() {
3817 			return atomicOp!"-="(*cast(shared)&count, 1);
3818 		}
3819 	};
3820 }
3821 
3822 version(Demo)
3823 void main() {
3824 	//CoInitializeEx(null, COINIT_APARTMENTTHREADED);
3825 
3826 	auto window = new SimpleWindow(500, 500, "Webview");//, OpenGlOptions.no, Resizability.allowResizing,;
3827 
3828 	auto lib = LoadLibraryW("WebView2Loader.dll"w.ptr);
3829 	typeof(&CreateCoreWebView2EnvironmentWithOptions) func;
3830 	assert(lib);
3831 	func = cast(typeof(func)) GetProcAddress(lib, CreateCoreWebView2EnvironmentWithOptions.mangleof);
3832 	assert(func);
3833 
3834 	ICoreWebView2 webview_window;
3835 	ICoreWebView2Environment webview_env;
3836 
3837 	auto result = func(null, null, null,
3838 		callback!(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler)(
3839 			delegate(error, env) {
3840 				if(error)
3841 					return error;
3842 
3843 				webview_env = env;
3844 				env.AddRef();
3845 
3846 				env.CreateCoreWebView2Controller(window.impl.hwnd,
3847 					callback!(ICoreWebView2CreateCoreWebView2ControllerCompletedHandler)(delegate(error, controller) {
3848 						if(error || controller is null)
3849 							return error;
3850 						controller.AddRef();
3851 						error = controller.get_CoreWebView2(&webview_window);
3852 						webview_window.AddRef();
3853 
3854 						ICoreWebView2Settings Settings;
3855 						webview_window.get_Settings(&Settings);
3856 						Settings.put_IsScriptEnabled(TRUE);
3857 						Settings.put_AreDefaultScriptDialogsEnabled(TRUE);
3858 						Settings.put_IsWebMessageEnabled(TRUE);
3859 
3860 
3861 		EventRegistrationToken ert = EventRegistrationToken(233);
3862 		webview_window.add_NavigationStarting(
3863 			callback!(
3864 				ICoreWebView2NavigationStartingEventHandler,
3865 			)(delegate (sender, args) {
3866 				wchar* t;
3867 				args.get_Uri(&t);
3868 				auto ot = t;
3869 
3870 				write("Nav: ");
3871 
3872 				while(*t) {
3873 					write(*t);
3874 					t++;
3875 				}
3876 
3877 				CoTaskMemFree(ot);
3878 
3879 				return S_OK;
3880 			})
3881 			, &ert);
3882 
3883 						RECT bounds;
3884 						GetClientRect(window.impl.hwnd, &bounds);
3885 						controller.put_Bounds(bounds);
3886 						error = webview_window.Navigate("https://bing.com/"w.ptr);
3887 						//error = webview_window.NavigateToString("<html><body>Hello</body></html>"w.ptr);
3888 						//error = webview_window.Navigate("http://192.168.1.10/"w.ptr);
3889 
3890 						controller.put_IsVisible(true);
3891 						writeln(error, " ", window.impl.hwnd, " window ", webview_window);//, "\n", GetParent(webview_window));
3892 
3893 						return S_OK;
3894 					}));
3895 
3896 
3897 				return S_OK;
3898 			}
3899 		)
3900 	);
3901 
3902 	if(result != S_OK) {
3903 		import std.stdio;
3904 		writeln("Failed: ", result);
3905 	}
3906 
3907 	window.eventLoop(0);
3908 }
3909 
3910 
3911 /* ************************************ */
3912 
3913 // File generated by idl2d from
3914 //   C:\Users\me\source\repos\webviewtest\packages\Microsoft.Web.WebView2.1.0.664.37\WebView2.idl
3915 //module webview2;
3916 
3917 public import core.sys.windows.windows;
3918 public import core.sys.windows.unknwn;
3919 public import core.sys.windows.oaidl;
3920 public import core.sys.windows.objidl;
3921 
3922 alias EventRegistrationToken = long;
3923 
3924 // Copyright (C) Microsoft Corporation. All rights reserved.
3925 // Use of this source code is governed by a BSD-style license that can be
3926 // found in the LICENSE file.
3927 
3928 /+
3929 Copyright (C) Microsoft Corporation. All rights reserved.
3930 
3931 Redistribution and use in source and binary forms, with or without
3932 modification, are permitted provided that the following conditions are
3933 met:
3934 
3935    * Redistributions of source code must retain the above copyright
3936 notice, this list of conditions and the following disclaimer.
3937    * Redistributions in binary form must reproduce the above
3938 copyright notice, this list of conditions and the following disclaimer
3939 in the documentation and/or other materials provided with the
3940 distribution.
3941    * The name of Microsoft Corporation, or the names of its contributors 
3942 may not be used to endorse or promote products derived from this
3943 software without specific prior written permission.
3944 
3945 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3946 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3947 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3948 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3949 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3950 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3951 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3952 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3953 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3954 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3955 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3956 +/
3957 
3958 // # API Review
3959 // All APIs need API review. List API review documents here with the URI to the
3960 // doc and the change ID of the IDL when the document was created.
3961 // API documents:
3962 //  * 916246ec [WebView2 API Specification](https://aka.ms/WebView2APISpecification)
3963 //
3964 // # Style
3965 // Follow the [Win32 API Design Guidelines](https://aka.ms/Win32APIDesignGuidelines)
3966 // while editing this file. For any style rules unspecified follow the Anaheim
3967 // style. Specifically, follow Anaheim indenting and line limit style rules in
3968 // this file.
3969 //
3970 // # Documentation
3971 // Please ensure that any new API includes complete documentation in its
3972 // JavaDoc comments in this file and sample usage in the Sample App.
3973 // Comments intended for public API documentation should start with 3 slashes.
3974 // The first sentence is the brief the brief description of the API and
3975 // shouldn't include the name of the API. Use markdown to style your public API
3976 // documentation.
3977 //
3978 // # WebView and JavaScript capitalization
3979 //    camel case  | webViewExample  | javaScriptExample
3980 //    Pascal case | WebViewExample  | JavaScriptExample
3981 //    Upper case  | WEBVIEW_EXAMPLE | JAVASCRIPT_EXAMPLE
3982 //
3983 // That said, in API names use the term 'script' rather than 'JavaScript'.
3984 // Script is shorter and there is only one supported scripting language on the
3985 // web so the specificity of JavaScript is unnecessary.
3986 //
3987 // # URI (not URL)
3988 // We use Uri in parameter names and type names
3989 // throughout. URIs identify resources while URLs (a subset of URIs) also
3990 // locates resources. This difference is not generally well understood. Because
3991 // all URLs are URIs we can ignore the conversation of trying to explain the
3992 // difference between the two and still be technically accurate by always using
3993 // the term URI. Additionally, whether a URI is locatable depends on the context
3994 // since end developers can at runtime specify custom URI scheme resolvers.
3995 //
3996 // # Event pattern
3997 // Events have a method to add and to remove event handlers:
3998 // ```
3999 // HRESULT add_{EventName}(
4000 //     ICoreWebView2{EventName}EventHandler* eventHandler,
4001 //     EventRegistrationToken* token);
4002 //
4003 // HRESULT remove_{EventName}(EventRegistrationToken token);
4004 // ```
4005 // Add takes an event handler delegate interface with a single Invoke method.
4006 // ```
4007 // ICoreWebView2{EventName}EventHandler::Invoke(
4008 //     {SenderType}* sender,
4009 //     ICoreWebView2{EventHandler}EventArgs* args);
4010 // ```
4011 // The Invoke method has two parameters. The first is the sender, the object
4012 // which is firing the event. The second is the EventArgs type. It doesn't take
4013 // the event arg parameters directly so we can version interfaces correctly.
4014 // If the event has no properties on its event args type, then the Invoke method
4015 // should take IUnknown* as its event args parameter so it is possible to add
4016 // event args interfaces in the future without requiring a new event. For events
4017 // with no sender (a static event), the Invoke method has only the event args
4018 // parameter.
4019 //
4020 // # Deferrable event pattern
4021 // Generally, events should be deferrable when their event args have settable
4022 // properties. In order for the caller to use asynchronous methods to produce
4023 // the value for those settable properties we must allow the caller to defer
4024 // the WebView reading those properties until asynchronously later. A deferrable
4025 // event should have the following method on its event args interface:
4026 //   `HRESULT GetDeferral([out, retval] ICoreWebView2Deferral** deferral);`
4027 // If called, the event is deferred and calling Complete on the
4028 // ICoreWebView2Deferral ends the deferral.
4029 //
4030 // # Asynchronous method pattern
4031 // Async methods take a final parameter that is the completed handler:
4032 //   `{MethodName}(..., ICoreWebView2{MethodName}CompletedHandler* handler)`
4033 // The handler has a single Invoke method:
4034 //   `ICoreWebView2{MethodName}CompletedHandler::Invoke(
4035 //       HRESULT errorCode, {AsyncReturnType});`
4036 //
4037 // # Property pattern
4038 // For properties with getters in IDL you have
4039 //   `[propget] HRESULT {PropertyName}([out, retval] {PropertyType}*)`
4040 // And for properties which also have setters in IDL you have
4041 //   `[propput] HRESULT {PropertyName}([in] {PropertyType});`
4042 //
4043 // # Versioning
4044 // The loader DLL may be older or newer than the client DLL. We have to deal
4045 // with compatibility across several dimensions:
4046 //  * There's the DLL export contract between the loader DLL and the client
4047 //    DLL as well as the interfaces defined in this IDL that are built into both
4048 //    the app code and the client DLL.
4049 //  * There are two kinds of versioned changes we need to be able to make:
4050 //    compatible changes and breaking changes. In both cases we need to make the
4051 //    change in a safe manner. For compatible that means everything continues to
4052 //    work unchanged despite the loader and client being different versions. For
4053 //    breaking changes this means the host app is unable to create a
4054 //    WebView using the different version browser and receives an associated
4055 //    error message (doesn't crash).
4056 //  * We also need to consider when the loader and host app is using a newer
4057 //    version than the browser and when the loader and host app is using an
4058 //    older version than the browser.
4059 //
4060 // ## Scenario 1: Older SDK in host app, Newer browser, Compatible change
4061 // In order to be compatible the newer client DLL must still support the older
4062 // client DLL exports. Similarly for the interfaces - they must all be exactly
4063 // the same with no modified IIDs, no reordered methods, no modified method
4064 // parameters and so on. The client DLL may have more DLL exports and more interfaces
4065 // but no changes to the older shipped DLL export or interfaces.
4066 // App code doesn't need to do anything special in this case.
4067 //
4068 // ## Scenario 2: Older SDK in host app, Newer browser, Breaking change
4069 // For breaking changes in the DLL export, the client DLL must change the DLL
4070 // export name. The old loader will attempt to use the old client DLL export.
4071 // When the loader finds the export missing it will fail.
4072 // For breaking changes in the interface, we must change the IID of the modified
4073 // interface. Additionally the loader DLL must validate that the returned object
4074 // supports the IID it expects and fail otherwise.
4075 // The app code must ensure that WebView objects succeed in their QueryInterface
4076 // calls. Basically the app code must have error handling for objects failing
4077 // QueryInterface and for the initial creation failing in order to handle
4078 // breaking changes gracefully.
4079 //
4080 // ## Scenario 3: Newer SDK in host app, Older browser, Compatible change
4081 // In order to be compatible, the newer loader DLL must fallback to calling the
4082 // older client DLL exports if the client DLL doesn't have the most recent DLL
4083 // exports.
4084 // For interface versioning the loader DLL shouldn't be impacted.
4085 // The app code must not assume an object supports all newer versioned
4086 // interfaces. Ideally it checks the success of QueryInterface for newer
4087 // interfaces and if not supported turns off associated app features or
4088 // otherwise fails gracefully.
4089 //
4090 // ## Scenario 4: Newer SDK in host app, Older browser, Breaking change
4091 // For breaking changes in the DLL export, a new export name will be used after
4092 // a breaking change and the loader DLL will just not check for pre-breaking
4093 // change exports from the client DLL. If the client DLL doesn't have the
4094 // correct exports, then the loader returns failure to the caller.
4095 // For breaking changes in the interface, the IIDs of broken interfaces will
4096 // have been modified. The loader will validate that the
4097 // object returned supports the correct base interface IID and return failure to
4098 // the caller otherwise.
4099 // The app code must allow for QueryInterface calls to fail if the object
4100 // doesn't support the newer IIDs.
4101 //
4102 // ## Actions
4103 //  * DLL export compatible changes: Create a new DLL export with a new name.
4104 //    Ideally implement the existing DLL export as a call into the new DLL
4105 //    export to reduce upkeep burden.
4106 //  * DLL export breaking changes: Give the modified DLL export a new name and
4107 //    remove all older DLL exports.
4108 //  * Interface compatible changes: Don't modify shipped interfaces. Add a new
4109 //    interface with an incremented version number suffix
4110 //    (ICoreWebView2_3) or feature group name suffix
4111 //    (ICoreWebView2WithNavigationHistory).
4112 //  * Interface breaking changes: After modifying a shipped interface, give it
4113 //    a new IID.
4114 //  * Loader: When finding the client DLL export it must check its known range
4115 //    of compatible exports in order from newest to oldest and use the newest
4116 //    one found. It must not attempt to use an older export from before a
4117 //    breaking change. Before returning objects to the caller, the loader must
4118 //    validate that the object actually implements the expected interface.
4119 //  * App code: Check for error from the DLL export methods as they can fail if
4120 //    the loader is used with an old browser from before a breaking change or
4121 //    with a newer browser that is after a breaking change.
4122 //    Check for errors when calling QueryInterface on a WebView object. The
4123 //    QueryInterface call may fail with E_NOINTERFACE if the object is from an
4124 //    older browser version that doesn't support the newer interface or if
4125 //    using a newer browser version that had a breaking change on that
4126 //    interface.
4127 
4128 /+[uuid(26d34152-879f-4065-bea2-3daa2cfadfb8), version(1.0)]+/
4129 version(all)
4130 { /+ library WebView2 +/
4131 
4132 // Interface forward declarations
4133 /+ interface ICoreWebView2AcceleratorKeyPressedEventArgs; +/
4134 /+ interface ICoreWebView2AcceleratorKeyPressedEventHandler; +/
4135 /+ interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler; +/
4136 /+ interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler; +/
4137 /+ interface ICoreWebView2CapturePreviewCompletedHandler; +/
4138 /+ interface ICoreWebView2; +/
4139 /+ interface ICoreWebView2Controller; +/
4140 /+ interface ICoreWebView2ContentLoadingEventArgs; +/
4141 /+ interface ICoreWebView2ContentLoadingEventHandler; +/
4142 /+ interface ICoreWebView2DocumentTitleChangedEventHandler; +/
4143 /+ interface ICoreWebView2ContainsFullScreenElementChangedEventHandler; +/
4144 /+ interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; +/
4145 /+ interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; +/
4146 /+ interface ICoreWebView2Deferral; +/
4147 /+ interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs; +/
4148 /+ interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler; +/
4149 /+ interface ICoreWebView2DevToolsProtocolEventReceiver; +/
4150 /+ interface ICoreWebView2Environment; +/
4151 /+ interface ICoreWebView2EnvironmentOptions; +/
4152 /+ interface ICoreWebView2ExecuteScriptCompletedHandler; +/
4153 /+ interface ICoreWebView2FocusChangedEventHandler; +/
4154 /+ interface ICoreWebView2HistoryChangedEventHandler; +/
4155 /+ interface ICoreWebView2HttpHeadersCollectionIterator; +/
4156 /+ interface ICoreWebView2HttpRequestHeaders; +/
4157 /+ interface ICoreWebView2HttpResponseHeaders; +/
4158 /+ interface ICoreWebView2MoveFocusRequestedEventArgs; +/
4159 /+ interface ICoreWebView2MoveFocusRequestedEventHandler; +/
4160 /+ interface ICoreWebView2NavigationCompletedEventArgs; +/
4161 /+ interface ICoreWebView2NavigationCompletedEventHandler; +/
4162 /+ interface ICoreWebView2NavigationStartingEventArgs; +/
4163 /+ interface ICoreWebView2NavigationStartingEventHandler; +/
4164 /+ interface ICoreWebView2NewBrowserVersionAvailableEventHandler; +/
4165 /+ interface ICoreWebView2NewWindowRequestedEventArgs; +/
4166 /+ interface ICoreWebView2NewWindowRequestedEventHandler; +/
4167 /+ interface ICoreWebView2PermissionRequestedEventArgs; +/
4168 /+ interface ICoreWebView2PermissionRequestedEventHandler; +/
4169 /+ interface ICoreWebView2ProcessFailedEventArgs; +/
4170 /+ interface ICoreWebView2ProcessFailedEventHandler; +/
4171 /+ interface ICoreWebView2ScriptDialogOpeningEventArgs; +/
4172 /+ interface ICoreWebView2ScriptDialogOpeningEventHandler; +/
4173 /+ interface ICoreWebView2Settings; +/
4174 /+ interface ICoreWebView2SourceChangedEventArgs; +/
4175 /+ interface ICoreWebView2SourceChangedEventHandler; +/
4176 /+ interface ICoreWebView2WebMessageReceivedEventArgs; +/
4177 /+ interface ICoreWebView2WebMessageReceivedEventHandler; +/
4178 /+ interface ICoreWebView2WebResourceRequest; +/
4179 /+ interface ICoreWebView2WebResourceRequestedEventArgs; +/
4180 /+ interface ICoreWebView2WebResourceRequestedEventHandler; +/
4181 /+ interface ICoreWebView2WebResourceResponse; +/
4182 /+ interface ICoreWebView2WindowCloseRequestedEventHandler; +/
4183 /+ interface ICoreWebView2WindowFeatures; +/
4184 /+ interface ICoreWebView2ZoomFactorChangedEventHandler; +/
4185 
4186 // Enums and structs
4187 /// Image format used by the ICoreWebView2::CapturePreview method.
4188 /+[v1_enum]+/
4189 enum /+ COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT+/
4190 {
4191   /// PNG image format.
4192   COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_PNG,
4193   /// JPEG image format.
4194   COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_JPEG,
4195 }
4196 alias int COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT;
4197 
4198 /// Kind of JavaScript dialog used in the
4199 /// ICoreWebView2ScriptDialogOpeningEventHandler interface.
4200 /+[v1_enum]+/
4201 enum /+ COREWEBVIEW2_SCRIPT_DIALOG_KIND+/
4202 {
4203   /// A dialog invoked via the window.alert JavaScript function.
4204   COREWEBVIEW2_SCRIPT_DIALOG_KIND_ALERT,
4205   /// A dialog invoked via the window.confirm JavaScript function.
4206   COREWEBVIEW2_SCRIPT_DIALOG_KIND_CONFIRM,
4207   /// A dialog invoked via the window.prompt JavaScript function.
4208   COREWEBVIEW2_SCRIPT_DIALOG_KIND_PROMPT,
4209   /// A dialog invoked via the beforeunload JavaScript event.
4210   COREWEBVIEW2_SCRIPT_DIALOG_KIND_BEFOREUNLOAD,
4211 }
4212 alias int COREWEBVIEW2_SCRIPT_DIALOG_KIND;
4213 
4214 /// Kind of process failure used in the ICoreWebView2ProcessFailedEventHandler
4215 /// interface.
4216 /+[v1_enum]+/
4217 enum /+ COREWEBVIEW2_PROCESS_FAILED_KIND+/
4218 {
4219   /// Indicates the browser process terminated unexpectedly.
4220   /// The WebView automatically goes into the Closed state.
4221   /// The app has to recreate a new WebView to recover from this failure.
4222   COREWEBVIEW2_PROCESS_FAILED_KIND_BROWSER_PROCESS_EXITED,
4223 
4224   /// Indicates the render process terminated unexpectedly.
4225   /// A new render process will be created automatically and navigated to an
4226   /// error page.
4227   /// The app can use Reload to try to recover from this failure.
4228   COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED,
4229 
4230   /// Indicates the render process becomes unresponsive.
4231   // Note that this does not seem to work right now.
4232   // Does not fire for simple long running script case, the only related test
4233   // SitePerProcessBrowserTest::NoCommitTimeoutForInvisibleWebContents is
4234   // disabled.
4235   COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE,
4236 }
4237 alias int COREWEBVIEW2_PROCESS_FAILED_KIND;
4238 
4239 /// The type of a permission request.
4240 /+[v1_enum]+/
4241 enum /+ COREWEBVIEW2_PERMISSION_KIND+/
4242 {
4243   /// Unknown permission.
4244   COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION,
4245 
4246   /// Permission to capture audio.
4247   COREWEBVIEW2_PERMISSION_KIND_MICROPHONE,
4248 
4249   /// Permission to capture video.
4250   COREWEBVIEW2_PERMISSION_KIND_CAMERA,
4251 
4252   /// Permission to access geolocation.
4253   COREWEBVIEW2_PERMISSION_KIND_GEOLOCATION,
4254 
4255   /// Permission to send web notifications.
4256   /// This permission request is currently auto rejected and
4257   /// no event is fired for it.
4258   COREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS,
4259 
4260   /// Permission to access generic sensor.
4261   /// Generic Sensor covering ambient-light-sensor, accelerometer, gyroscope
4262   /// and magnetometer.
4263   COREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS,
4264 
4265   /// Permission to read system clipboard without a user gesture.
4266   COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ,
4267 }
4268 alias int COREWEBVIEW2_PERMISSION_KIND;
4269 
4270 /// Response to a permission request.
4271 /+[v1_enum]+/
4272 enum /+ COREWEBVIEW2_PERMISSION_STATE+/
4273 {
4274   /// Use default browser behavior, which normally prompt users for decision.
4275   COREWEBVIEW2_PERMISSION_STATE_DEFAULT,
4276 
4277   /// Grant the permission request.
4278   COREWEBVIEW2_PERMISSION_STATE_ALLOW,
4279 
4280   /// Deny the permission request.
4281   COREWEBVIEW2_PERMISSION_STATE_DENY,
4282 }
4283 alias int COREWEBVIEW2_PERMISSION_STATE;
4284 
4285 /// Error status values for web navigations.
4286 /+[v1_enum]+/
4287 enum /+ COREWEBVIEW2_WEB_ERROR_STATUS+/
4288 {
4289   /// An unknown error occurred.
4290   COREWEBVIEW2_WEB_ERROR_STATUS_UNKNOWN,
4291 
4292   /// The SSL certificate common name does not match the web address.
4293   COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_COMMON_NAME_IS_INCORRECT,
4294 
4295   /// The SSL certificate has expired.
4296   COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_EXPIRED,
4297 
4298   /// The SSL client certificate contains errors.
4299   COREWEBVIEW2_WEB_ERROR_STATUS_CLIENT_CERTIFICATE_CONTAINS_ERRORS,
4300 
4301   /// The SSL certificate has been revoked.
4302   COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_REVOKED,
4303 
4304   /// The SSL certificate is invalid -- this could mean the certificate did not
4305   /// match the public key pins for the host name, the certificate is signed by
4306   /// an untrusted authority or using a weak sign algorithm, the certificate
4307   /// claimed DNS names violate name constraints, the certificate contains a
4308   /// weak key, the certificate's validity period is too long, lack of
4309   /// revocation information or revocation mechanism, non-unique host name, lack
4310   /// of certificate transparency information, or the certificate is chained to
4311   /// a [legacy Symantec
4312   /// root](https://security.googleblog.com/2018/03/distrust-of-symantec-pki-immediate.html).
4313   COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_IS_INVALID,
4314 
4315   /// The host is unreachable.
4316   COREWEBVIEW2_WEB_ERROR_STATUS_SERVER_UNREACHABLE,
4317 
4318   /// The connection has timed out.
4319   COREWEBVIEW2_WEB_ERROR_STATUS_TIMEOUT,
4320 
4321   /// The server returned an invalid or unrecognized response.
4322   COREWEBVIEW2_WEB_ERROR_STATUS_ERROR_HTTP_INVALID_SERVER_RESPONSE,
4323 
4324   /// The connection was aborted.
4325   COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED,
4326 
4327   /// The connection was reset.
4328   COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_RESET,
4329 
4330   /// The Internet connection has been lost.
4331   COREWEBVIEW2_WEB_ERROR_STATUS_DISCONNECTED,
4332 
4333   /// Cannot connect to destination.
4334   COREWEBVIEW2_WEB_ERROR_STATUS_CANNOT_CONNECT,
4335 
4336   /// Could not resolve provided host name.
4337   COREWEBVIEW2_WEB_ERROR_STATUS_HOST_NAME_NOT_RESOLVED,
4338 
4339   /// The operation was canceled.
4340   COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED,
4341 
4342   /// The request redirect failed.
4343   COREWEBVIEW2_WEB_ERROR_STATUS_REDIRECT_FAILED,
4344 
4345   /// An unexpected error occurred.
4346   COREWEBVIEW2_WEB_ERROR_STATUS_UNEXPECTED_ERROR,
4347 }
4348 alias int COREWEBVIEW2_WEB_ERROR_STATUS;
4349 
4350 /// Enum for web resource request contexts.
4351 /+[v1_enum]+/
4352 enum /+ COREWEBVIEW2_WEB_RESOURCE_CONTEXT+/
4353 {
4354   /// All resources
4355   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL,
4356   /// Document resources
4357   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT,
4358   /// CSS resources
4359   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_STYLESHEET,
4360   /// Image resources
4361   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE,
4362   /// Other media resources such as videos
4363   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MEDIA,
4364   /// Font resources
4365   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FONT,
4366   /// Script resources
4367   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SCRIPT,
4368   /// XML HTTP requests
4369   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST,
4370   /// Fetch API communication
4371   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FETCH,
4372   /// TextTrack resources
4373   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_TEXT_TRACK,
4374   /// EventSource API communication
4375   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_EVENT_SOURCE,
4376   /// WebSocket API communication
4377   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_WEBSOCKET,
4378   /// Web App Manifests
4379   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MANIFEST,
4380   /// Signed HTTP Exchanges
4381   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SIGNED_EXCHANGE,
4382   /// Ping requests
4383   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_PING,
4384   /// CSP Violation Reports
4385   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_CSP_VIOLATION_REPORT,
4386   /// Other resources
4387   COREWEBVIEW2_WEB_RESOURCE_CONTEXT_OTHER
4388 }
4389 alias int COREWEBVIEW2_WEB_RESOURCE_CONTEXT;
4390 
4391 /// Reason for moving focus.
4392 /+[v1_enum]+/
4393 enum /+ COREWEBVIEW2_MOVE_FOCUS_REASON+/
4394 {
4395   /// Code setting focus into WebView.
4396   COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC,
4397 
4398   /// Moving focus due to Tab traversal forward.
4399   COREWEBVIEW2_MOVE_FOCUS_REASON_NEXT,
4400 
4401   /// Moving focus due to Tab traversal backward.
4402   COREWEBVIEW2_MOVE_FOCUS_REASON_PREVIOUS,
4403 }
4404 alias int COREWEBVIEW2_MOVE_FOCUS_REASON;
4405 
4406 /// The type of key event that triggered an AcceleratorKeyPressed event.
4407 /+[v1_enum]+/
4408 enum /+ COREWEBVIEW2_KEY_EVENT_KIND+/
4409 {
4410   /// Correspond to window message WM_KEYDOWN.
4411   COREWEBVIEW2_KEY_EVENT_KIND_KEY_DOWN,
4412 
4413   /// Correspond to window message WM_KEYUP.
4414   COREWEBVIEW2_KEY_EVENT_KIND_KEY_UP,
4415 
4416   /// Correspond to window message WM_SYSKEYDOWN.
4417   COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_DOWN,
4418 
4419   /// Correspond to window message WM_SYSKEYUP.
4420   COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_UP,
4421 }
4422 alias int COREWEBVIEW2_KEY_EVENT_KIND;
4423 
4424 /// A structure representing the information packed into the LPARAM given
4425 /// to a Win32 key event.  See the documentation for WM_KEYDOWN for details
4426 /// at https://docs.microsoft.com/windows/win32/inputdev/wm-keydown
4427 struct COREWEBVIEW2_PHYSICAL_KEY_STATUS
4428 {
4429   /// The repeat count for the current message.
4430   UINT32 RepeatCount;
4431   /// The scan code.
4432   UINT32 ScanCode;
4433   /// Indicates whether the key is an extended key.
4434   BOOL IsExtendedKey;
4435   /// The context code.
4436   BOOL IsMenuKeyDown;
4437   /// The previous key state.
4438   BOOL WasKeyDown;
4439   /// The transition state.
4440   BOOL IsKeyReleased;
4441 }
4442 // End of enums and structs
4443 
4444 /// WebView2 enables you to host web content using the
4445 /// latest Edge web browser technology.
4446 ///
4447 /// ## Navigation events
4448 /// The normal sequence of navigation events is NavigationStarting,
4449 /// SourceChanged, ContentLoading and then NavigationCompleted.
4450 /// The following events describe the state of WebView during each navigation:
4451 /// NavigationStarting: WebView is starting to navigate and the navigation will
4452 /// result in a network request. The host can disallow the request at this time.
4453 /// SourceChanged: The source of WebView is changed to a new URL. This may also
4454 /// be due to a navigation that doesn't cause a network request such as a fragment
4455 /// navigation.
4456 /// HistoryChanged: WebView's history has been updated as a result of
4457 /// the navigation.
4458 /// ContentLoading: WebView has started loading new content.
4459 /// NavigationCompleted: WebView has completed loading content on the new page.
4460 /// Developers can track navigations to each new document by the navigation ID.
4461 /// WebView's navigation ID changes every time there is a successful navigation
4462 /// to a new document.
4463 ///
4464 ///
4465 /// \dot
4466 /// digraph NavigationEvents {
4467 ///    node [fontname=Roboto, shape=rectangle]
4468 ///    edge [fontname=Roboto]
4469 ///
4470 ///    NewDocument -> NavigationStarting;
4471 ///    NavigationStarting -> SourceChanged -> ContentLoading [label="New Document"];
4472 ///    ContentLoading -> HistoryChanged;
4473 ///    SameDocument -> SourceChanged;
4474 ///    SourceChanged -> HistoryChanged [label="Same Document"];
4475 ///    HistoryChanged -> NavigationCompleted;
4476 ///    NavigationStarting -> NavigationStarting [label="Redirect"];
4477 ///    NavigationStarting -> NavigationCompleted [label="Failure"];
4478 /// }
4479 /// \enddot
4480 ///
4481 /// Note that this is for navigation events with the same NavigationId event
4482 /// arg. Navigations events with different NavigationId event args may overlap.
4483 /// For instance, if you start a navigation wait for its NavigationStarting
4484 /// event and then start another navigation you'll see the NavigationStarting
4485 /// for the first navigate followed by the NavigationStarting of the second
4486 /// navigate, followed by the NavigationCompleted for the first navigation and
4487 /// then all the rest of the appropriate navigation events for the second
4488 /// navigation.
4489 /// In error cases there may or may not be a ContentLoading event depending
4490 /// on whether the navigation is continued to an error page.
4491 /// In case of an HTTP redirect, there will be multiple NavigationStarting
4492 /// events in a row, with ones following the first will have their IsRedirect
4493 /// flag set, however navigation ID remains the same. Same document navigations
4494 /// do not result in NavigationStarting event and also do not increment the
4495 /// navigation ID.
4496 ///
4497 /// To monitor or cancel navigations inside subframes in the WebView, use
4498 /// FrameNavigationStarting.
4499 ///
4500 /// ## Process model
4501 /// WebView2 uses the same process model as the Edge web
4502 /// browser. There is one Edge browser process per specified user data directory
4503 /// in a user session that will serve any WebView2 calling
4504 /// process that specifies that user data directory. This means one Edge browser
4505 /// process may be serving multiple calling processes and one calling
4506 /// process may be using multiple Edge browser processes.
4507 ///
4508 /// \dot
4509 /// digraph ProcessModelNClientsNServers {
4510 ///     node [fontname=Roboto, shape=rectangle];
4511 ///     edge [fontname=Roboto];
4512 ///
4513 ///     Host1 [label="Calling\nprocess 1"];
4514 ///     Host2 [label="Calling\nprocess 2"];
4515 ///     Browser1 [label="Edge processes\ngroup 1"];
4516 ///     Browser2 [label="Edge processes\ngroup 2"];
4517 ///
4518 ///     Host1 -> Browser1;
4519 ///     Host1 -> Browser2;
4520 ///     Host2 -> Browser2;
4521 /// }
4522 /// \enddot
4523 ///
4524 /// Associated with each browser process there will be some number of
4525 /// render processes.
4526 /// These are created as
4527 /// necessary to service potentially multiple frames in different WebViews. The
4528 /// number of render processes varies based on the site isolation browser
4529 /// feature and the number of distinct disconnected origins rendered in
4530 /// associated WebViews.
4531 ///
4532 /// \dot
4533 /// digraph ProcessModelClientServer {
4534 ///     node [fontname=Roboto, shape=rectangle];
4535 ///     edge [fontname=Roboto];
4536 ///     graph [fontname=Roboto];
4537 ///
4538 ///     Host [label="Calling process"];
4539 ///     subgraph cluster_0 {
4540 ///         labeljust = "l";
4541 ///         label = "Edge processes group";
4542 ///         Browser [label="Edge browser\nprocess"];
4543 ///         Render1 [label="Edge render\nprocess 1"];
4544 ///         Render2 [label="Edge render\nprocess 2"];
4545 ///         RenderN [label="Edge render\nprocess N"];
4546 ///         GPU [label="Edge GPU\nprocess"];
4547 ///     }
4548 ///
4549 ///     Host -> Browser;
4550 ///     Browser -> Render1;
4551 ///     Browser -> Render2;
4552 ///     Browser -> RenderN;
4553 ///     Browser -> GPU;
4554 /// }
4555 /// \enddot
4556 ///
4557 /// You can react to crashes and hangs in these browser and render processes
4558 /// using the ProcessFailure event.
4559 ///
4560 /// You can safely shutdown associated browser and render processes using the
4561 /// Close method.
4562 ///
4563 /// ## Threading model
4564 /// The WebView2 must be created on a UI thread. Specifically a
4565 /// thread with a message pump. All callbacks will occur on that thread and
4566 /// calls into the WebView must be done on that thread. It is not safe to use
4567 /// the WebView from another thread.
4568 ///
4569 /// Callbacks including event handlers and completion handlers execute serially.
4570 /// That is, if you have an event handler running and begin a message loop no
4571 /// other event handlers or completion callbacks will begin executing
4572 /// reentrantly.
4573 ///
4574 /// ## Security
4575 /// Always check the Source property of the WebView before using ExecuteScript,
4576 /// PostWebMessageAsJson, PostWebMessageAsString, or any other method to send
4577 /// information into the WebView. The WebView may have navigated to another page
4578 /// via the end user interacting with the page or script in the page causing
4579 /// navigation. Similarly, be very careful with
4580 /// AddScriptToExecuteOnDocumentCreated. All future navigations will run this
4581 /// script and if it provides access to information intended only for a certain
4582 /// origin, any HTML document may have access.
4583 ///
4584 /// When examining the result of an ExecuteScript method call, a
4585 /// WebMessageReceived event, always check the Source of the sender, or any
4586 /// other mechanism of receiving information from an HTML document in a WebView
4587 /// validate the URI of the HTML document is what you expect.
4588 ///
4589 /// When constructing a message to send into a WebView, prefer using
4590 /// PostWebMessageAsJson and construct the JSON string parameter using a JSON
4591 /// library. This will prevent accidentally encoding information into a JSON string
4592 /// or script, and ensure no attacker controlled input can
4593 /// modify the rest of the JSON message or run arbitrary script.
4594 ///
4595 /// ## String types
4596 /// String out parameters are LPWSTR null terminated strings. The callee
4597 /// allocates the string using CoTaskMemAlloc. Ownership is transferred to the
4598 /// caller and it is up to the caller to free the memory using CoTaskMemFree.
4599 ///
4600 /// String in parameters are LPCWSTR null terminated strings. The caller ensures
4601 /// the string is valid for the duration of the synchronous function call.
4602 /// If the callee needs to retain that value to some point after the function
4603 /// call completes, the callee must allocate its own copy of the string value.
4604 ///
4605 /// ## URI and JSON parsing
4606 /// Various methods provide or accept URIs and JSON as strings. Please use your
4607 /// own preferred library for parsing and generating these strings.
4608 ///
4609 /// If WinRT is available for your app you can use `Windows.Data.Json.JsonObject`
4610 /// and `IJsonObjectStatics` to parse or produce JSON strings or `Windows.Foundation.Uri`
4611 /// and `IUriRuntimeClassFactory` to parse and produce URIs. Both of these work
4612 /// in Win32 apps.
4613 ///
4614 /// If you use IUri and CreateUri to parse URIs you may want to use the
4615 /// following URI creation flags to have CreateUri behavior more closely match
4616 /// the URI parsing in the WebView:
4617 /// `Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME | Uri_CREATE_NO_DECODE_EXTRA_INFO`
4618 ///
4619 /// ## Debugging
4620 /// Open DevTools with the normal shortcuts: `F12` or `Ctrl+Shift+I`.
4621 /// You can use the `--auto-open-devtools-for-tabs` command argument switch to
4622 /// have the DevTools window open immediately when first creating a WebView. See
4623 /// CreateCoreWebView2Controller documentation for how to provide additional command
4624 /// line arguments to the browser process.
4625 /// Check out the LoaderOverride registry key in the CreateCoreWebView2Controller
4626 /// documentation.
4627 ///
4628 /// ## Versioning
4629 /// After you've used a particular version of the SDK to build your app, your
4630 /// app may end up running with an older or newer version of installed browser
4631 /// binaries. Until version 1.0.0.0 of WebView2 there may be breaking changes
4632 /// during updates that will prevent your SDK from working with different
4633 /// versions of installed browser binaries. After version 1.0.0.0 different
4634 /// versions of the SDK can work with different versions of the installed
4635 /// browser by following these best practices:
4636 ///
4637 /// To account for breaking changes to the API be sure to check for failure when
4638 /// calling the DLL export CreateCoreWebView2Environment and when
4639 /// calling QueryInterface on any CoreWebView2 object. A return value of
4640 /// E_NOINTERFACE can indicate the SDK is not compatible with the Edge
4641 /// browser binaries.
4642 ///
4643 /// Checking for failure from QueryInterface will also account for cases where
4644 /// the SDK is newer than the version of the Edge browser and your app attempts
4645 /// to use an interface of which the Edge browser is unaware.
4646 ///
4647 /// When an interface is unavailable, you can consider disabling the associated
4648 /// feature if possible, or otherwise informing the end user they need to update
4649 /// their browser.
4650 const GUID IID_ICoreWebView2 = ICoreWebView2.iid;
4651 
4652 interface ICoreWebView2 : IUnknown
4653 {
4654     static const GUID iid = { 0x76eceacb,0x0462,0x4d94,[ 0xac,0x83,0x42,0x3a,0x67,0x93,0x77,0x5e ] };
4655     extern(Windows):
4656   /// The ICoreWebView2Settings object contains various modifiable settings for
4657   /// the running WebView.
4658   /+[ propget]+/
4659 	HRESULT get_Settings(/+[out, retval]+/ ICoreWebView2Settings * settings);
4660 
4661   /// The URI of the current top level document. This value potentially
4662   /// changes as a part of the SourceChanged event firing for some cases
4663   /// such as navigating to a different site or fragment navigations. It will
4664   /// remain the same for other types of navigations such as page reloads or
4665   /// history.pushState with the same URL as the current page.
4666   ///
4667   /// \snippet ControlComponent.cpp SourceChanged
4668   /+[ propget]+/
4669 	HRESULT get_Source(/+[out, retval]+/ LPWSTR* uri);
4670 
4671   /// Cause a navigation of the top level document to the specified URI. See
4672   /// the navigation events for more information. Note that this starts a
4673   /// navigation and the corresponding NavigationStarting event will fire
4674   /// sometime after this Navigate call completes.
4675   ///
4676   /// \snippet ControlComponent.cpp Navigate
4677   HRESULT Navigate(in LPCWSTR uri);
4678 
4679   /// Initiates a navigation to htmlContent as source HTML of a new
4680   /// document. The htmlContent parameter may not be larger than 2 MB
4681   /// in total size. The origin of the new page will be about:blank.
4682   ///
4683   /// \snippet SettingsComponent.cpp NavigateToString
4684   HRESULT NavigateToString(in LPCWSTR htmlContent);
4685 
4686   /// Add an event handler for the NavigationStarting event.
4687   /// NavigationStarting fires when the WebView main frame is
4688   /// requesting permission to navigate to a different URI. This will fire for
4689   /// redirects as well.
4690   ///
4691   /// Corresponding navigations can be blocked until the event handler returns.
4692   ///
4693   /// \snippet SettingsComponent.cpp NavigationStarting
4694   HRESULT add_NavigationStarting(
4695       /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler,
4696       /+[out]+/ EventRegistrationToken* token);
4697   /// Remove an event handler previously added with add_NavigationStarting.
4698   HRESULT remove_NavigationStarting(
4699       in EventRegistrationToken token);
4700 
4701   /// Add an event handler for the ContentLoading event.
4702   /// ContentLoading fires before any content is loaded, including scripts added
4703   /// with AddScriptToExecuteOnDocumentCreated.
4704   /// ContentLoading will not fire if a same page navigation occurs
4705   /// (such as through fragment navigations or history.pushState navigations).
4706   /// This follows the NavigationStarting and SourceChanged events and
4707   /// precedes the HistoryChanged and NavigationCompleted events.
4708   HRESULT add_ContentLoading(
4709       /+[in]+/ ICoreWebView2ContentLoadingEventHandler eventHandler,
4710       /+[out]+/ EventRegistrationToken* token);
4711   /// Remove an event handler previously added with add_ContentLoading.
4712   HRESULT remove_ContentLoading(
4713       in EventRegistrationToken token);
4714 
4715   /// Add an event handler for the SourceChanged event.
4716   /// SourceChanged fires when the Source property changes.
4717   /// SourceChanged fires for navigating to a different site or fragment
4718   /// navigations.
4719   /// It will not fire for other types of navigations such as page reloads or
4720   /// history.pushState with the same URL as the current page.
4721   /// SourceChanged fires before ContentLoading for navigation to a new document.
4722   ///
4723   /// \snippet ControlComponent.cpp SourceChanged
4724   HRESULT add_SourceChanged(
4725       /+[in]+/ ICoreWebView2SourceChangedEventHandler eventHandler,
4726       /+[out]+/ EventRegistrationToken* token);
4727   /// Remove an event handler previously added with add_SourceChanged.
4728   HRESULT remove_SourceChanged(
4729       in EventRegistrationToken token);
4730 
4731   /// Add an event handler for the HistoryChanged event.
4732   /// HistoryChanged listens to the change of navigation history for the top
4733   /// level document. Use HistoryChanged to check if CanGoBack/CanGoForward
4734   /// value has changed. HistoryChanged also fires for using GoBack/GoForward.
4735   /// HistoryChanged fires after SourceChanged and ContentLoading.
4736   ///
4737   /// \snippet ControlComponent.cpp HistoryChanged
4738   HRESULT add_HistoryChanged(
4739       /+[in]+/ ICoreWebView2HistoryChangedEventHandler eventHandler,
4740       /+[out]+/ EventRegistrationToken* token);
4741   /// Remove an event handler previously added with add_HistoryChanged.
4742   HRESULT remove_HistoryChanged(
4743       in EventRegistrationToken token);
4744 
4745   /// Add an event handler for the NavigationCompleted event.
4746   /// NavigationCompleted fires when the WebView has completely loaded
4747   /// (body.onload has fired) or loading stopped with error.
4748   ///
4749   /// \snippet ControlComponent.cpp NavigationCompleted
4750   HRESULT add_NavigationCompleted(
4751       /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler,
4752       /+[out]+/ EventRegistrationToken* token);
4753   /// Remove an event handler previously added with add_NavigationCompleted.
4754   HRESULT remove_NavigationCompleted(
4755       in EventRegistrationToken token);
4756 
4757   /// Add an event handler for the FrameNavigationStarting event.
4758   /// FrameNavigationStarting fires when a child frame in the WebView
4759   /// requests permission to navigate to a different URI. This will fire for
4760   /// redirects as well.
4761   ///
4762   /// Corresponding navigations can be blocked until the event handler returns.
4763   ///
4764   /// \snippet SettingsComponent.cpp FrameNavigationStarting
4765   HRESULT add_FrameNavigationStarting(
4766       /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler,
4767       /+[out]+/ EventRegistrationToken* token);
4768   /// Remove an event handler previously added with add_FrameNavigationStarting.
4769   HRESULT remove_FrameNavigationStarting(
4770       in EventRegistrationToken token);
4771 
4772   /// Add an event handler for the FrameNavigationCompleted event.
4773   /// FrameNavigationCompleted fires when a child frame has completely
4774   /// loaded (body.onload has fired) or loading stopped with error.
4775   ///
4776   /// \snippet ControlComponent.cpp FrameNavigationCompleted
4777   HRESULT add_FrameNavigationCompleted(
4778       /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler,
4779       /+[out]+/ EventRegistrationToken* token);
4780   /// Remove an event handler previously added with add_FrameNavigationCompleted.
4781   HRESULT remove_FrameNavigationCompleted(
4782       in EventRegistrationToken token);
4783 
4784   /// Add an event handler for the ScriptDialogOpening event.
4785   /// ScriptDialogOpening fires when a JavaScript dialog (alert, confirm,
4786   /// prompt, or beforeunload) will show for the webview. This event only fires
4787   /// if the ICoreWebView2Settings::AreDefaultScriptDialogsEnabled property is
4788   /// set to false. The ScriptDialogOpening event can be used to suppress
4789   /// dialogs or replace default dialogs with custom dialogs.
4790   ///
4791   /// If a deferral is not taken on the event args, the subsequent scripts can be
4792   /// blocked until the event handler returns. If a deferral is taken, then the
4793   /// scripts are blocked until the deferral is completed.
4794   ///
4795   /// \snippet SettingsComponent.cpp ScriptDialogOpening
4796   HRESULT add_ScriptDialogOpening(
4797       /+[in]+/ ICoreWebView2ScriptDialogOpeningEventHandler eventHandler,
4798       /+[out]+/ EventRegistrationToken* token);
4799   /// Remove an event handler previously added with add_ScriptDialogOpening.
4800   HRESULT remove_ScriptDialogOpening(
4801       in EventRegistrationToken token);
4802 
4803   /// Add an event handler for the PermissionRequested event.
4804   /// PermissionRequested fires when content in a WebView requests permission to
4805   /// access some privileged resources.
4806   ///
4807   /// If a deferral is not taken on the event args, the subsequent scripts can
4808   /// be blocked until the event handler returns. If a deferral is taken, then
4809   /// the scripts are blocked until the deferral is completed.
4810   ///
4811   /// \snippet SettingsComponent.cpp PermissionRequested
4812   HRESULT add_PermissionRequested(
4813       /+[in]+/ ICoreWebView2PermissionRequestedEventHandler eventHandler,
4814       /+[out]+/ EventRegistrationToken* token);
4815   /// Remove an event handler previously added with add_PermissionRequested.
4816   HRESULT remove_PermissionRequested(
4817       in EventRegistrationToken token);
4818 
4819   /// Add an event handler for the ProcessFailed event.
4820   /// ProcessFailed fires when a WebView process is terminated unexpectedly or
4821   /// becomes unresponsive.
4822   ///
4823   /// \snippet ProcessComponent.cpp ProcessFailed
4824   HRESULT add_ProcessFailed(
4825       /+[in]+/ ICoreWebView2ProcessFailedEventHandler eventHandler,
4826       /+[out]+/ EventRegistrationToken* token);
4827   /// Remove an event handler previously added with add_ProcessFailed.
4828   HRESULT remove_ProcessFailed(
4829       in EventRegistrationToken token);
4830 
4831   /// Add the provided JavaScript to a list of scripts that should be executed
4832   /// after the global object has been created, but before the HTML document has
4833   /// been parsed and before any other script included by the HTML document is
4834   /// executed. This method injects a script that runs on all top-level document
4835   /// and child frame page navigations.
4836   /// This method runs asynchronously, and you must wait for the completion
4837   /// handler to finish before the injected script is ready to run. When this
4838   /// method completes, the handler's `Invoke` method is called with the `id` of
4839   /// the injected script. `id` is a string. To remove the injected script, use
4840   /// `RemoveScriptToExecuteOnDocumentCreated`.
4841   ///
4842   /// Note that if an HTML document has sandboxing of some kind via
4843   /// [sandbox](https://developer.mozilla.org/docs/Web/HTML/Element/iframe#attr-sandbox)
4844   /// properties or the [Content-Security-Policy HTTP
4845   /// header](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy)
4846   /// this will affect the script run here. So, for example, if the
4847   /// 'allow-modals' keyword is not set then calls to the `alert` function will
4848   /// be ignored.
4849   ///
4850   /// \snippet ScriptComponent.cpp AddScriptToExecuteOnDocumentCreated
4851   HRESULT AddScriptToExecuteOnDocumentCreated(
4852       in LPCWSTR javaScript,
4853       /+[in]+/ ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler handler);
4854 
4855   /// Remove the corresponding JavaScript added using `AddScriptToExecuteOnDocumentCreated`
4856   /// with the specified script id.
4857   HRESULT RemoveScriptToExecuteOnDocumentCreated(in LPCWSTR id);
4858 
4859   /// Execute JavaScript code from the javascript parameter in the
4860   /// current top level document rendered in the WebView. This will execute
4861   /// asynchronously and when complete, if a handler is provided in the
4862   /// ExecuteScriptCompletedHandler parameter, its Invoke method will be
4863   /// called with the result of evaluating the provided JavaScript. The result
4864   /// value is a JSON encoded string.
4865   /// If the result is undefined, contains a reference cycle, or otherwise
4866   /// cannot be encoded into JSON, the JSON null value will be returned as the
4867   /// string 'null'. Note that a function that has no explicit return value
4868   /// returns undefined.
4869   /// If the executed script throws an unhandled exception, then the result is
4870   /// also 'null'.
4871   /// This method is applied asynchronously. If the method is called after
4872   /// NavigationStarting event during a navigation, the script will be executed
4873   /// in the new document when loading it, around the time ContentLoading is
4874   /// fired. ExecuteScript will work even if
4875   /// ICoreWebView2Settings::IsScriptEnabled is set to FALSE.
4876   ///
4877   /// \snippet ScriptComponent.cpp ExecuteScript
4878   HRESULT ExecuteScript(
4879       in LPCWSTR javaScript,
4880       /+[in]+/ ICoreWebView2ExecuteScriptCompletedHandler handler);
4881 
4882   /// Capture an image of what WebView is displaying. Specify the
4883   /// format of the image with the imageFormat parameter.
4884   /// The resulting image binary data is written to the provided imageStream
4885   /// parameter. When CapturePreview finishes writing to the stream, the Invoke
4886   /// method on the provided handler parameter is called.
4887   ///
4888   /// \snippet FileComponent.cpp CapturePreview
4889   HRESULT CapturePreview(
4890       in COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT imageFormat,
4891       in IStream* imageStream,
4892       /+[in]+/ ICoreWebView2CapturePreviewCompletedHandler handler);
4893 
4894   /// Reload the current page. This is similar to navigating to the URI of
4895   /// current top level document including all navigation events firing and
4896   /// respecting any entries in the HTTP cache. But, the back/forward history
4897   /// will not be modified.
4898   HRESULT Reload();
4899 
4900   /// Post the specified webMessage to the top level document in this WebView.
4901   /// The top level document's window.chrome.webview's message event fires.
4902   /// JavaScript in that document may subscribe and unsubscribe to the event
4903   /// via the following:
4904   ///
4905   /// ```
4906   ///    window.chrome.webview.addEventListener('message', handler)
4907   ///    window.chrome.webview.removeEventListener('message', handler)
4908   /// ```
4909   ///
4910   /// The event args is an instance of `MessageEvent`.
4911   /// The ICoreWebView2Settings::IsWebMessageEnabled setting must be true or
4912   /// this method will fail with E_INVALIDARG.
4913   /// The event arg's data property is the webMessage string parameter parsed
4914   /// as a JSON string into a JavaScript object.
4915   /// The event arg's source property is a reference to the
4916   /// `window.chrome.webview` object.
4917   /// See add_WebMessageReceived for information on sending messages from the
4918   /// HTML document in the WebView to the host.
4919   /// This message is sent asynchronously. If a navigation occurs before the
4920   /// message is posted to the page, then the message will not be sent.
4921   ///
4922   /// \snippet ScenarioWebMessage.cpp WebMessageReceived
4923   HRESULT PostWebMessageAsJson(in LPCWSTR webMessageAsJson);
4924 
4925   /// This is a helper for posting a message that is a simple string
4926   /// rather than a JSON string representation of a JavaScript object. This
4927   /// behaves in exactly the same manner as PostWebMessageAsJson but the
4928   /// `window.chrome.webview` message event arg's data property will be a string
4929   /// with the same value as webMessageAsString. Use this instead of
4930   /// PostWebMessageAsJson if you want to communicate via simple strings rather
4931   /// than JSON objects.
4932   HRESULT PostWebMessageAsString(in LPCWSTR webMessageAsString);
4933 
4934   /// Add an event handler for the WebMessageReceived event.
4935   /// WebMessageReceived fires when the
4936   /// ICoreWebView2Settings::IsWebMessageEnabled setting is set and the top
4937   /// level document of the WebView calls `window.chrome.webview.postMessage`.
4938   /// The postMessage function is `void postMessage(object)` where
4939   /// object is any object supported by JSON conversion.
4940   ///
4941   /// \snippet ScenarioWebMessage.html chromeWebView
4942   ///
4943   /// When postMessage is called, the handler's Invoke method will be called
4944   /// with the postMessage's object parameter converted to a JSON string.
4945   ///
4946   /// \snippet ScenarioWebMessage.cpp WebMessageReceived
4947   HRESULT add_WebMessageReceived(
4948       /+[in]+/ ICoreWebView2WebMessageReceivedEventHandler handler,
4949       /+[out]+/ EventRegistrationToken* token);
4950   /// Remove an event handler previously added with add_WebMessageReceived.
4951   HRESULT remove_WebMessageReceived(
4952       in EventRegistrationToken token);
4953 
4954   /// Call an asynchronous DevToolsProtocol method. See the
4955   /// [DevTools Protocol Viewer](https://aka.ms/DevToolsProtocolDocs)
4956   /// for a list and description of available methods.
4957   /// The methodName parameter is the full name of the method in the format
4958   /// `{domain}.{method}`.
4959   /// The parametersAsJson parameter is a JSON formatted string containing
4960   /// the parameters for the corresponding method.
4961   /// The handler's Invoke method will be called when the method asynchronously
4962   /// completes. Invoke will be called with the method's return object as a
4963   /// JSON string.
4964   ///
4965   /// \snippet ScriptComponent.cpp CallDevToolsProtocolMethod
4966   HRESULT CallDevToolsProtocolMethod(
4967       in LPCWSTR methodName,
4968       in LPCWSTR parametersAsJson,
4969       /+[in]+/ ICoreWebView2CallDevToolsProtocolMethodCompletedHandler handler);
4970 
4971   /// The process id of the browser process that hosts the WebView.
4972   /+[ propget]+/
4973 	HRESULT get_BrowserProcessId(/+[out, retval]+/ UINT32* value);
4974 
4975   /// Returns true if the WebView can navigate to a previous page in the
4976   /// navigation history.
4977   /// The HistoryChanged event will fire if CanGoBack changes value.
4978   /+[ propget]+/
4979 	HRESULT get_CanGoBack(/+[out, retval]+/ BOOL* canGoBack);
4980   /// Returns true if the WebView can navigate to a next page in the navigation
4981   /// history.
4982   /// The HistoryChanged event will fire if CanGoForward changes value.
4983   /+[ propget]+/
4984 	HRESULT get_CanGoForward(/+[out, retval]+/ BOOL* canGoForward);
4985   /// Navigates the WebView to the previous page in the navigation history.
4986   HRESULT GoBack();
4987   /// Navigates the WebView to the next page in the navigation history.
4988   HRESULT GoForward();
4989 
4990   /// Get a DevTools Protocol event receiver that allows you to subscribe to
4991   /// a DevTools Protocol event.
4992   /// The eventName parameter is the full name of the event in the format
4993   /// `{domain}.{event}`.
4994   /// See the [DevTools Protocol Viewer](https://aka.ms/DevToolsProtocolDocs)
4995   /// for a list of DevTools Protocol events description, and event args.
4996   ///
4997   /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived
4998   HRESULT GetDevToolsProtocolEventReceiver(
4999       in LPCWSTR eventName,
5000       /+[out, retval]+/ ICoreWebView2DevToolsProtocolEventReceiver * receiver);
5001 
5002   /// Stop all navigations and pending resource fetches. Does not stop
5003   /// scripts.
5004   HRESULT Stop();
5005 
5006   /// Add an event handler for the NewWindowRequested event.
5007   /// NewWindowRequested fires when content inside the WebView requests to open
5008   /// a new window, such as through window.open. The app can pass a target
5009   /// WebView that will be considered the opened window.
5010   ///
5011   /// Scripts resulted in the new window requested can be blocked until the
5012   /// event handler returns if a deferral is not taken on the event args. If a
5013   /// deferral is taken, then scripts are blocked until the deferral is
5014   /// completed.
5015   ///
5016   /// \snippet AppWindow.cpp NewWindowRequested
5017   HRESULT add_NewWindowRequested(
5018       /+[in]+/ ICoreWebView2NewWindowRequestedEventHandler eventHandler,
5019       /+[out]+/ EventRegistrationToken* token);
5020   /// Remove an event handler previously added with add_NewWindowRequested.
5021   HRESULT remove_NewWindowRequested(
5022       in EventRegistrationToken token);
5023 
5024   /// Add an event handler for the DocumentTitleChanged event.
5025   /// DocumentTitleChanged fires when the DocumentTitle property of the WebView
5026   /// changes and may fire before or after the NavigationCompleted event.
5027   ///
5028   /// \snippet FileComponent.cpp DocumentTitleChanged
5029   HRESULT add_DocumentTitleChanged(
5030       /+[in]+/ ICoreWebView2DocumentTitleChangedEventHandler eventHandler,
5031       /+[out]+/ EventRegistrationToken* token);
5032   /// Remove an event handler previously added with add_DocumentTitleChanged.
5033   HRESULT remove_DocumentTitleChanged(
5034       in EventRegistrationToken token);
5035 
5036   /// The title for the current top level document.
5037   /// If the document has no explicit title or is otherwise empty,
5038   /// a default that may or may not match the URI of the document will be used.
5039   /+[ propget]+/
5040 	HRESULT get_DocumentTitle(/+[out, retval]+/ LPWSTR* title);
5041 
5042   /// Add the provided host object to script running in the WebView with the
5043   /// specified name.
5044   /// Host objects are exposed as host object proxies via
5045   /// `window.chrome.webview.hostObjects.<name>`.
5046   /// Host object proxies are promises and will resolve to an object
5047   /// representing the host object.
5048   /// The promise is rejected if the app has not added an object with the name.
5049   /// When JavaScript code access a property or method of the object, a promise
5050   /// is return, which will resolve to the value returned from the host for the
5051   /// property or method, or rejected in case of error such as there is no such
5052   /// property or method on the object or parameters are invalid.
5053   /// For example, when the application code does the following:
5054   ///
5055   /// ```
5056   ///    VARIANT object;
5057   ///    object.vt = VT_DISPATCH;
5058   ///    object.pdispVal = appObject;
5059   ///    webview->AddHostObjectToScript(L"host_object", &host);
5060   /// ```
5061   ///
5062   /// JavaScript code in the WebView will be able to access appObject as
5063   /// following and then access attributes and methods of appObject:
5064   ///
5065   /// ```
5066   ///    let app_object = await window.chrome.webview.hostObjects.host_object;
5067   ///    let attr1 = await app_object.attr1;
5068   ///    let result = await app_object.method1(parameters);
5069   /// ```
5070   ///
5071   /// Note that while simple types, IDispatch and array are supported, generic
5072   /// IUnknown, VT_DECIMAL, or VT_RECORD variant is not supported.
5073   /// Remote JavaScript objects like callback functions are represented as
5074   /// an VT_DISPATCH VARIANT with the object implementing IDispatch. The
5075   /// JavaScript callback method may be invoked using DISPID_VALUE for the
5076   /// DISPID.
5077   /// Nested arrays are supported up to a depth of 3.
5078   /// Arrays of by reference types are not supported.
5079   /// VT_EMPTY and VT_NULL are mapped into JavaScript as null. In JavaScript
5080   /// null and undefined are mapped to VT_EMPTY.
5081   ///
5082   /// Additionally, all host objects are exposed as
5083   /// `window.chrome.webview.hostObjects.sync.<name>`. Here the host
5084   /// objects are exposed as synchronous host object proxies. These are not
5085   /// promises and calls to functions or property access synchronously block
5086   /// running script waiting to communicate cross process for the host code to
5087   /// run. Accordingly this can result in reliability issues and it is
5088   /// recommended that you use the promise based asynchronous
5089   /// `window.chrome.webview.hostObjects.<name>` API described above.
5090   ///
5091   /// Synchronous host object proxies and asynchronous host object proxies
5092   /// can both proxy the same host object. Remote changes made by one proxy
5093   /// will be reflected in any other proxy of that same host object whether
5094   /// the other proxies and synchronous or asynchronous.
5095   ///
5096   /// While JavaScript is blocked on a synchronous call to native code, that
5097   /// native code is unable to call back to JavaScript. Attempts to do so will
5098   /// fail with HRESULT_FROM_WIN32(ERROR_POSSIBLE_DEADLOCK).
5099   ///
5100   /// Host object proxies are JavaScript Proxy objects that intercept all
5101   /// property get, property set, and method invocations. Properties or methods
5102   /// that are a part of the Function or Object prototype are run locally.
5103   /// Additionally any property or method in the array
5104   /// `chrome.webview.hostObjects.options.forceLocalProperties` will also be
5105   /// run locally. This defaults to including optional methods that have
5106   /// meaning in JavaScript like `toJSON` and `Symbol.toPrimitive`. You can add
5107   /// more to this array as required.
5108   ///
5109   /// There's a method `chrome.webview.hostObjects.cleanupSome` that will best
5110   /// effort garbage collect host object proxies.
5111   ///
5112   /// Host object proxies additionally have the following methods which run
5113   /// locally:
5114   ///  * applyHostFunction, getHostProperty, setHostProperty: Perform a
5115   ///    method invocation, property get, or property set on the host object.
5116   ///    You can use these to explicitly force a method or property to run
5117   ///    remotely if there is a conflicting local method or property. For
5118   ///    instance, `proxy.toString()` will run the local toString method on the
5119   ///    proxy object. But ``proxy.applyHostFunction('toString')`` runs
5120   ///    `toString` on the host proxied object instead.
5121   ///  * getLocalProperty, setLocalProperty: Perform property get, or property
5122   ///    set locally. You can use these methods to force getting or setting a
5123   ///    property on the host object proxy itself rather than on the host
5124   ///    object it represents. For instance, `proxy.unknownProperty` will get the
5125   ///    property named `unknownProperty` from the host proxied object. But
5126   ///    ``proxy.getLocalProperty('unknownProperty')`` will get the value of the property
5127   ///    `unknownProperty` on the proxy object itself.
5128   ///  * sync: Asynchronous host object proxies expose a sync method which
5129   ///    returns a promise for a synchronous host object proxy for the same
5130   ///    host object. For example,
5131   ///    `chrome.webview.hostObjects.sample.methodCall()` returns an
5132   ///    asynchronous host object proxy. You can use the `sync` method to
5133   ///    obtain a synchronous host object proxy instead:
5134   ///    `const syncProxy = await chrome.webview.hostObjects.sample.methodCall().sync()`
5135   ///  * async: Synchronous host object proxies expose an async method which
5136   ///    blocks and returns an asynchronous host object proxy for the same
5137   ///    host object. For example, `chrome.webview.hostObjects.sync.sample.methodCall()` returns a
5138   ///    synchronous host object proxy. Calling the `async` method on this blocks
5139   ///    and then returns an asynchronous host object proxy for the same host object:
5140   ///    `const asyncProxy = chrome.webview.hostObjects.sync.sample.methodCall().async()`
5141   ///  * then: Asynchronous host object proxies have a then method. This
5142   ///    allows them to be awaitable. `then` will return a promise that resolves
5143   ///    with a representation of the host object. If the proxy represents a
5144   ///    JavaScript literal then a copy of that is returned locally. If
5145   ///    the proxy represents a function then a non-awaitable proxy is returned.
5146   ///    If the proxy represents a JavaScript object with a mix of literal
5147   ///    properties and function properties, then the a copy of the object is
5148   ///    returned with some properties as host object proxies.
5149   ///
5150   /// All other property and method invocations (other than the above Remote
5151   /// object proxy methods, forceLocalProperties list, and properties on
5152   /// Function and Object prototypes) are run remotely. Asynchronous host
5153   /// object proxies return a promise representing asynchronous completion of
5154   /// remotely invoking the method, or getting the property.
5155   /// The promise resolves after the remote operations complete and
5156   /// the promises resolve to the resulting value of the operation.
5157   /// Synchronous host object proxies work similarly but block JavaScript
5158   /// execution and wait for the remote operation to complete.
5159   ///
5160   /// Setting a property on an asynchronous host object proxy works slightly
5161   /// differently. The set returns immediately and the return value is the value
5162   /// that will be set. This is a requirement of the JavaScript Proxy object.
5163   /// If you need to asynchronously wait for the property set to complete, use
5164   /// the setHostProperty method which returns a promise as described above.
5165   /// Synchronous object property set property synchronously blocks until the
5166   /// property is set.
5167   ///
5168   /// For example, suppose you have a COM object with the following interface
5169   ///
5170   /// \snippet HostObjectSample.idl AddHostObjectInterface
5171   ///
5172   /// We can add an instance of this interface into our JavaScript with
5173   /// `AddHostObjectToScript`. In this case we name it `sample`:
5174   ///
5175   /// \snippet ScenarioAddHostObject.cpp AddHostObjectToScript
5176   ///
5177   /// Then in the HTML document we can use this COM object via `chrome.webview.hostObjects.sample`:
5178   ///
5179   /// \snippet ScenarioAddHostObject.html HostObjectUsage
5180   /// Exposing host objects to script has security risk. Please follow
5181   /// [best practices](https://docs.microsoft.com/microsoft-edge/webview2/concepts/security).
5182   HRESULT AddHostObjectToScript(in LPCWSTR name, in VARIANT* object);
5183 
5184   /// Remove the host object specified by the name so that it is no longer
5185   /// accessible from JavaScript code in the WebView.
5186   /// While new access attempts will be denied, if the object is already
5187   /// obtained by JavaScript code in the WebView, the JavaScript code will
5188   /// continue to have access to that object.
5189   /// Calling this method for a name that is already removed or never added will
5190   /// fail.
5191   HRESULT RemoveHostObjectFromScript(in LPCWSTR name);
5192 
5193   /// Opens the DevTools window for the current document in the WebView.
5194   /// Does nothing if called when the DevTools window is already open.
5195   HRESULT OpenDevToolsWindow();
5196 
5197   /// Add an event handler for the ContainsFullScreenElementChanged event.
5198   /// ContainsFullScreenElementChanged fires when the ContainsFullScreenElement
5199   /// property changes. This means that an HTML element inside the WebView is
5200   /// entering fullscreen to the size of the WebView or leaving fullscreen. This
5201   /// event is useful when, for example, a video element requests to go
5202   /// fullscreen. The listener of ContainsFullScreenElementChanged can then
5203   /// resize the WebView in response.
5204   ///
5205   /// \snippet AppWindow.cpp ContainsFullScreenElementChanged
5206   HRESULT add_ContainsFullScreenElementChanged(
5207       /+[in]+/ ICoreWebView2ContainsFullScreenElementChangedEventHandler eventHandler,
5208       /+[out]+/ EventRegistrationToken* token);
5209   /// Remove an event handler previously added with
5210   /// add_ContainsFullScreenElementChanged.
5211   HRESULT remove_ContainsFullScreenElementChanged(
5212       in EventRegistrationToken token);
5213 
5214   /// Indicates if the WebView contains a fullscreen HTML element.
5215   /+[ propget]+/
5216 	HRESULT get_ContainsFullScreenElement(
5217       /+[out, retval]+/ BOOL* containsFullScreenElement);
5218 
5219   /// Add an event handler for the WebResourceRequested event.
5220   /// WebResourceRequested fires when the WebView is performing a URL request to
5221   /// a matching URL and resource context filter that was added with
5222   /// AddWebResourceRequestedFilter. At least one filter must be added for the
5223   /// event to fire.
5224   ///
5225   /// The web resource requested can be blocked until the event handler returns
5226   /// if a deferral is not taken on the event args. If a deferral is taken, then
5227   /// the web resource requested is blocked until the deferral is completed.
5228   ///
5229   /// \snippet SettingsComponent.cpp WebResourceRequested
5230   HRESULT add_WebResourceRequested(
5231     /+[in]+/ ICoreWebView2WebResourceRequestedEventHandler eventHandler,
5232     /+[out]+/ EventRegistrationToken* token);
5233   /// Remove an event handler previously added with add_WebResourceRequested.
5234   HRESULT remove_WebResourceRequested(
5235       in EventRegistrationToken token);
5236 
5237   /// Adds a URI and resource context filter to the WebResourceRequested event.
5238   /// The URI parameter can be a wildcard string ('*': zero or more, '?':
5239   /// exactly one). nullptr is equivalent to L"".
5240   /// See COREWEBVIEW2_WEB_RESOURCE_CONTEXT enum for description of resource
5241   /// context filters.
5242   HRESULT AddWebResourceRequestedFilter(
5243     in LPCWSTR uri,
5244     in COREWEBVIEW2_WEB_RESOURCE_CONTEXT resourceContext);
5245   /// Removes a matching WebResource filter that was previously added for the
5246   /// WebResourceRequested event. If the same filter was added multiple times,
5247   /// then it will need to be removed as many times as it was added for the
5248   /// removal to be effective. Returns E_INVALIDARG for a filter that was never
5249   /// added.
5250   HRESULT RemoveWebResourceRequestedFilter(
5251     in LPCWSTR uri,
5252     in COREWEBVIEW2_WEB_RESOURCE_CONTEXT resourceContext);
5253 
5254   /// Add an event handler for the WindowCloseRequested event.
5255   /// WindowCloseRequested fires when content inside the WebView requested to
5256   /// close the window, such as after window.close is called. The app should
5257   /// close the WebView and related app window if that makes sense to the app.
5258   ///
5259   /// \snippet AppWindow.cpp WindowCloseRequested
5260   HRESULT add_WindowCloseRequested(
5261       /+[in]+/ ICoreWebView2WindowCloseRequestedEventHandler eventHandler,
5262       /+[out]+/ EventRegistrationToken* token);
5263   /// Remove an event handler previously added with add_WindowCloseRequested.
5264   HRESULT remove_WindowCloseRequested(
5265       in EventRegistrationToken token);
5266 }
5267 
5268 /// This interface is the owner of the CoreWebView2 object, and provides support
5269 /// for resizing, showing and hiding, focusing, and other functionality related
5270 /// to windowing and composition. The CoreWebView2Controller owns the CoreWebView2,
5271 /// and if all references to the CoreWebView2Controller go away, the WebView will
5272 /// be closed.
5273 const GUID IID_ICoreWebView2Controller = ICoreWebView2Controller.iid;
5274 
5275 interface ICoreWebView2Controller : IUnknown
5276 {
5277     static const GUID iid = { 0x4d00c0d1,0x9434,0x4eb6,[ 0x80,0x78,0x86,0x97,0xa5,0x60,0x33,0x4f ] };
5278     extern(Windows):
5279   /// The IsVisible property determines whether to show or hide the WebView.
5280   /// If IsVisible is set to false, the WebView will be transparent and will
5281   /// not be rendered.  However, this will not affect the window containing
5282   /// the WebView (the HWND parameter that was passed to CreateCoreWebView2Controller).
5283   /// If you want that window to disappear too, call ShowWindow on it directly
5284   /// in addition to modifying the IsVisible property.
5285   /// WebView as a child window won't get window messages when the top window
5286   /// is minimized or restored. For performance reason, developer should set
5287   /// IsVisible property of the WebView to false when the app window is
5288   /// minimized and back to true when app window is restored. App window can do
5289   /// this by handling SC_MINIMIZE and SC_RESTORE command upon receiving
5290   /// WM_SYSCOMMAND message.
5291   ///
5292   /// \snippet ViewComponent.cpp ToggleIsVisible
5293   /+[ propget]+/
5294 	HRESULT get_IsVisible(/+[out, retval]+/ BOOL* isVisible);
5295   /// Set the IsVisible property.
5296   ///
5297   /// \snippet ViewComponent.cpp ToggleIsVisibleOnMinimize
5298   /+[ propput]+/
5299 	HRESULT put_IsVisible(in BOOL isVisible);
5300 
5301   /// The WebView bounds.
5302   /// Bounds are relative to the parent HWND. The app has two ways it can
5303   /// position a WebView:
5304   /// 1. Create a child HWND that is the WebView parent HWND. Position this
5305   ///    window where the WebView should be. In this case, use (0, 0) for the
5306   ///    WebView's Bound's top left corner (the offset).
5307   /// 2. Use the app's top most window as the WebView parent HWND. Set the
5308   ///    WebView's Bound's top left corner so that the WebView is positioned
5309   ///    correctly in the app.
5310   /// The Bound's values are in the host's coordinate space.
5311   /+[ propget]+/
5312 	HRESULT get_Bounds(/+[out, retval]+/ RECT* bounds);
5313   /// Set the Bounds property.
5314   ///
5315   /// \snippet ViewComponent.cpp ResizeWebView
5316   /+[ propput]+/
5317 	HRESULT put_Bounds(in RECT bounds);
5318 
5319   /// The zoom factor for the WebView.
5320   /// Note that changing zoom factor could cause `window.innerWidth/innerHeight`
5321   /// and page layout to change.
5322   /// A zoom factor that is applied by the host by calling ZoomFactor
5323   /// becomes the new default zoom for the WebView. This zoom factor applies
5324   /// across navigations and is the zoom factor WebView is returned to when the
5325   /// user presses ctrl+0. When the zoom factor is changed by the user
5326   /// (resulting in the app receiving ZoomFactorChanged), that zoom applies
5327   /// only for the current page. Any user applied zoom is only for the current
5328   /// page and is reset on a navigation.
5329   /// Specifying a zoomFactor less than or equal to 0 is not allowed.
5330   /// WebView also has an internal supported zoom factor range. When a specified
5331   /// zoom factor is out of that range, it will be normalized to be within the
5332   /// range, and a ZoomFactorChanged event will be fired for the real
5333   /// applied zoom factor. When this range normalization happens, the
5334   /// ZoomFactor property will report the zoom factor specified during the
5335   /// previous modification of the ZoomFactor property until the
5336   /// ZoomFactorChanged event is received after WebView applies the normalized
5337   /// zoom factor.
5338   /+[ propget]+/
5339 	HRESULT get_ZoomFactor(/+[out, retval]+/ double* zoomFactor);
5340   /// Set the ZoomFactor property.
5341   /+[ propput]+/
5342 	HRESULT put_ZoomFactor(in double zoomFactor);
5343 
5344   /// Add an event handler for the ZoomFactorChanged event.
5345   /// ZoomFactorChanged fires when the ZoomFactor property of the WebView changes.
5346   /// The event could fire because the caller modified the ZoomFactor property,
5347   /// or due to the user manually modifying the zoom. When it is modified by the
5348   /// caller via the ZoomFactor property, the internal zoom factor is updated
5349   /// immediately and there will be no ZoomFactorChanged event.
5350   /// WebView associates the last used zoom factor for each site. Therefore, it
5351   /// is possible for the zoom factor to change when navigating to a different
5352   /// page. When the zoom factor changes due to this, the ZoomFactorChanged
5353   /// event fires right after the ContentLoading event.
5354   ///
5355   /// \snippet ViewComponent.cpp ZoomFactorChanged
5356   HRESULT add_ZoomFactorChanged(
5357       /+[in]+/ ICoreWebView2ZoomFactorChangedEventHandler eventHandler,
5358       /+[out]+/ EventRegistrationToken* token);
5359   /// Remove an event handler previously added with add_ZoomFactorChanged.
5360   HRESULT remove_ZoomFactorChanged(
5361       in EventRegistrationToken token);
5362 
5363   /// Update Bounds and ZoomFactor properties at the same time. This operation
5364   /// is atomic from the host's perspective. After returning from this function,
5365   /// the Bounds and ZoomFactor properties will have both been updated if the
5366   /// function is successful, or neither will be updated if the function fails.
5367   /// If Bounds and ZoomFactor are both updated by the same scale (i.e. Bounds
5368   /// and ZoomFactor are both doubled), then the page will not see a change in
5369   /// window.innerWidth/innerHeight and the WebView will render the content at
5370   /// the new size and zoom without intermediate renderings.
5371   /// This function can also be used to update just one of ZoomFactor or Bounds
5372   /// by passing in the new value for one and the current value for the other.
5373   ///
5374   /// \snippet ViewComponent.cpp SetBoundsAndZoomFactor
5375   HRESULT SetBoundsAndZoomFactor(in RECT bounds, in double zoomFactor);
5376 
5377   /// Move focus into WebView. WebView will get focus and focus will be set to
5378   /// correspondent element in the page hosted in the WebView.
5379   /// For Programmatic reason, focus is set to previously focused element or
5380   /// the default element if there is no previously focused element.
5381   /// For Next reason, focus is set to the first element.
5382   /// For Previous reason, focus is set to the last element.
5383   /// WebView can also got focus through user interaction like clicking into
5384   /// WebView or Tab into it.
5385   /// For tabbing, the app can call MoveFocus with Next or Previous to align
5386   /// with tab and shift+tab respectively when it decides the WebView is the
5387   /// next tabbable element. Or, the app can call IsDialogMessage as part of
5388   /// its message loop to allow the platform to auto handle tabbing. The
5389   /// platform will rotate through all windows with WS_TABSTOP. When the
5390   /// WebView gets focus from IsDialogMessage, it will internally put the focus
5391   /// on the first or last element for tab and shift+tab respectively.
5392   ///
5393   /// \snippet App.cpp MoveFocus0
5394   ///
5395   /// \snippet ControlComponent.cpp MoveFocus1
5396   ///
5397   /// \snippet ControlComponent.cpp MoveFocus2
5398   HRESULT MoveFocus(in COREWEBVIEW2_MOVE_FOCUS_REASON reason);
5399 
5400   /// Add an event handler for the MoveFocusRequested event.
5401   /// MoveFocusRequested fires when user tries to tab out of the WebView.
5402   /// The WebView's focus has not changed when this event is fired.
5403   ///
5404   /// \snippet ControlComponent.cpp MoveFocusRequested
5405   HRESULT add_MoveFocusRequested(
5406       /+[in]+/ ICoreWebView2MoveFocusRequestedEventHandler eventHandler,
5407       /+[out]+/ EventRegistrationToken* token);
5408   /// Remove an event handler previously added with add_MoveFocusRequested.
5409   HRESULT remove_MoveFocusRequested(
5410       in EventRegistrationToken token);
5411 
5412   /// Add an event handler for the GotFocus event.
5413   /// GotFocus fires when WebView got focus.
5414   HRESULT add_GotFocus(
5415       /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler,
5416       /+[out]+/ EventRegistrationToken* token);
5417   /// Remove an event handler previously added with add_GotFocus.
5418   HRESULT remove_GotFocus(
5419       in EventRegistrationToken token);
5420 
5421   /// Add an event handler for the LostFocus event.
5422   /// LostFocus fires when WebView lost focus.
5423   /// In the case where MoveFocusRequested event is fired, the focus is still
5424   /// on WebView when MoveFocusRequested event fires. LostFocus only fires
5425   /// afterwards when app's code or default action of MoveFocusRequested event
5426   /// set focus away from WebView.
5427   HRESULT add_LostFocus(
5428       /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler,
5429       /+[out]+/ EventRegistrationToken* token);
5430   /// Remove an event handler previously added with add_LostFocus.
5431   HRESULT remove_LostFocus(
5432       in EventRegistrationToken token);
5433 
5434   /// Add an event handler for the AcceleratorKeyPressed event.
5435   /// AcceleratorKeyPressed fires when an accelerator key or key combo is
5436   /// pressed or released while the WebView is focused. A key is considered an
5437   /// accelerator if either:
5438   ///   1. Ctrl or Alt is currently being held, or
5439   ///   2. the pressed key does not map to a character.
5440   /// A few specific keys are never considered accelerators, such as Shift.
5441   /// The Escape key is always considered an accelerator.
5442   ///
5443   /// Autorepeated key events caused by holding the key down will also fire this
5444   /// event.  You can filter these out by checking the event args'
5445   /// KeyEventLParam or PhysicalKeyStatus.
5446   ///
5447   /// In windowed mode, this event handler is called synchronously. Until you
5448   /// call Handled() on the event args or the event handler returns, the browser
5449   /// process will be blocked and outgoing cross-process COM calls will fail
5450   /// with RPC_E_CANTCALLOUT_ININPUTSYNCCALL. All CoreWebView2 API methods will
5451   /// work, however.
5452   ///
5453   /// In windowless mode, the event handler is called asynchronously.  Further
5454   /// input will not reach the browser until the event handler returns or
5455   /// Handled() is called, but the browser process itself will not be blocked,
5456   /// and outgoing COM calls will work normally.
5457   ///
5458   /// It is recommended to call Handled(TRUE) as early as you can know that you want
5459   /// to handle the accelerator key.
5460   ///
5461   /// \snippet ControlComponent.cpp AcceleratorKeyPressed
5462   HRESULT add_AcceleratorKeyPressed(
5463     /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventHandler eventHandler,
5464     /+[out]+/ EventRegistrationToken* token);
5465   /// Remove an event handler previously added with add_AcceleratorKeyPressed.
5466   HRESULT remove_AcceleratorKeyPressed(
5467     in EventRegistrationToken token);
5468 
5469   /// The parent window provided by the app that this WebView is using to
5470   /// render content. This API initially returns the window passed into
5471   /// CreateCoreWebView2Controller.
5472   /+[ propget]+/
5473 	HRESULT get_ParentWindow(/+[out, retval]+/ HWND* parentWindow);
5474 
5475   /// Set the parent window for the WebView. This will cause the WebView to
5476   /// reparent its window to the newly provided window.
5477   /+[ propput]+/
5478 	HRESULT put_ParentWindow(in HWND parentWindow);
5479 
5480   /// This is a notification separate from Bounds that tells WebView its
5481   /// parent (or any ancestor) HWND moved. This is needed for accessibility and
5482   /// certain dialogs in WebView to work correctly.
5483   /// \snippet ViewComponent.cpp NotifyParentWindowPositionChanged
5484   HRESULT NotifyParentWindowPositionChanged();
5485 
5486   /// Closes the WebView and cleans up the underlying browser instance.
5487   /// Cleaning up the browser instance will release the resources powering the WebView.
5488   /// The browser instance will be shut down if there are no other WebViews using it.
5489   ///
5490   /// After calling Close, all method calls will fail and event handlers
5491   /// will stop firing. Specifically, the WebView will release its references
5492   /// to its event handlers when Close is called.
5493   ///
5494   /// Close is implicitly called when the CoreWebView2Controller loses its final
5495   /// reference and is destructed. But it is best practice to explicitly call
5496   /// Close to avoid any accidental cycle of references between the WebView
5497   /// and the app code. Specifically, if you capture a reference to the WebView
5498   /// in an event handler you will create a reference cycle between the WebView
5499   /// and the event handler. Calling Close will break this cycle by releasing
5500   /// all event handlers. But to avoid this situation it is best practice both
5501   /// to explicitly call Close on the WebView and to not capture a reference to
5502   /// the WebView to ensure the WebView can be cleaned up correctly.
5503   ///
5504   /// \snippet AppWindow.cpp Close
5505   HRESULT Close();
5506 
5507   /// Gets the CoreWebView2 associated with this CoreWebView2Controller.
5508   /+[ propget]+/
5509 	HRESULT get_CoreWebView2(/+[out, retval]+/ ICoreWebView2 * coreWebView2);
5510 }
5511 
5512 /// This interface is used to complete deferrals on event args that
5513 /// support getting deferrals via their GetDeferral method.
5514 const GUID IID_ICoreWebView2Deferral = ICoreWebView2Deferral.iid;
5515 
5516 interface ICoreWebView2Deferral : IUnknown
5517 {
5518     static const GUID iid = { 0xc10e7f7b,0xb585,0x46f0,[ 0xa6,0x23,0x8b,0xef,0xbf,0x3e,0x4e,0xe0 ] };
5519     extern(Windows):
5520   /// Completes the associated deferred event. Complete should only be
5521   /// called once for each deferral taken.
5522   HRESULT Complete();
5523 }
5524 
5525 /// Defines properties that enable, disable, or modify WebView
5526 /// features. Setting changes made after NavigationStarting event will not
5527 /// apply until the next top level navigation.
5528 const GUID IID_ICoreWebView2Settings = ICoreWebView2Settings.iid;
5529 
5530 interface ICoreWebView2Settings : IUnknown
5531 {
5532     static const GUID iid = { 0xe562e4f0,0xd7fa,0x43ac,[ 0x8d,0x71,0xc0,0x51,0x50,0x49,0x9f,0x00 ] };
5533     extern(Windows):
5534   /// Controls if JavaScript execution is enabled in all future
5535   /// navigations in the WebView.  This only affects scripts in the document;
5536   /// scripts injected with ExecuteScript will run even if script is disabled.
5537   /// It is true by default.
5538   ///
5539   /// \snippet SettingsComponent.cpp IsScriptEnabled
5540   /+[ propget]+/
5541 	HRESULT get_IsScriptEnabled(
5542       /+[out, retval]+/ BOOL* isScriptEnabled);
5543   /// Set the IsScriptEnabled property.
5544   /+[ propput]+/
5545 	HRESULT put_IsScriptEnabled(in BOOL isScriptEnabled);
5546 
5547   /// The IsWebMessageEnabled property is used when loading a new
5548   /// HTML document. If set to true, communication from the host to the
5549   /// WebView's top level HTML document is allowed via PostWebMessageAsJson,
5550   /// PostWebMessageAsString, and window.chrome.webview's message event
5551   /// (see PostWebMessageAsJson documentation for details).
5552   /// Communication from the WebView's top level HTML document to the host is
5553   /// allowed via window.chrome.webview's postMessage function and
5554   /// add_WebMessageReceived method (see add_WebMessageReceived documentation
5555   /// for details).
5556   /// If set to false, then communication is disallowed.
5557   /// PostWebMessageAsJson and PostWebMessageAsString will
5558   /// fail with E_ACCESSDENIED and window.chrome.webview.postMessage will fail
5559   /// by throwing an instance of an Error object.
5560   /// It is true by default.
5561   ///
5562   /// \snippet ScenarioWebMessage.cpp IsWebMessageEnabled
5563   /+[ propget]+/
5564 	HRESULT get_IsWebMessageEnabled(
5565       /+[out, retval]+/ BOOL* isWebMessageEnabled);
5566   /// Set the IsWebMessageEnabled property.
5567   /+[ propput]+/
5568 	HRESULT put_IsWebMessageEnabled(in BOOL isWebMessageEnabled);
5569 
5570   /// AreDefaultScriptDialogsEnabled is used when loading a new HTML document.
5571   /// If set to false, then WebView won't render the default JavaScript dialog
5572   /// box (Specifically those shown by the JavaScript alert, confirm, prompt
5573   /// functions and beforeunload event). Instead, if an event handler is set via
5574   /// add_ScriptDialogOpening, WebView will send an event that will contain all
5575   /// of the information for the dialog and allow the host app to show its own
5576   /// custom UI. It is true by default.
5577   /+[ propget]+/
5578 	HRESULT get_AreDefaultScriptDialogsEnabled(
5579       /+[out, retval]+/ BOOL* areDefaultScriptDialogsEnabled);
5580   /// Set the AreDefaultScriptDialogsEnabled property.
5581   /+[ propput]+/
5582 	HRESULT put_AreDefaultScriptDialogsEnabled(
5583       in BOOL areDefaultScriptDialogsEnabled);
5584 
5585   /// IsStatusBarEnabled controls whether the status bar will be displayed. The
5586   /// status bar is usually displayed in the lower left of the WebView and shows
5587   /// things such as the URI of a link when the user hovers over it and other
5588   /// information. It is true by default.
5589   /+[ propget]+/
5590 	HRESULT get_IsStatusBarEnabled(/+[out, retval]+/ BOOL* isStatusBarEnabled);
5591   /// Set the IsStatusBarEnabled property.
5592   /+[ propput]+/
5593 	HRESULT put_IsStatusBarEnabled(in BOOL isStatusBarEnabled);
5594 
5595   /// AreDevToolsEnabled controls whether the user is able to use the context
5596   /// menu or keyboard shortcuts to open the DevTools window.
5597   /// It is true by default.
5598   /+[ propget]+/
5599 	HRESULT get_AreDevToolsEnabled(/+[out, retval]+/ BOOL* areDevToolsEnabled);
5600   /// Set the AreDevToolsEnabled property.
5601   /+[ propput]+/
5602 	HRESULT put_AreDevToolsEnabled(in BOOL areDevToolsEnabled);
5603 
5604   /// The AreDefaultContextMenusEnabled property is used to prevent
5605   /// default context menus from being shown to user in WebView.
5606   /// It is true by default.
5607   ///
5608   /// \snippet SettingsComponent.cpp DisableContextMenu
5609   /+[ propget]+/
5610 	HRESULT get_AreDefaultContextMenusEnabled(/+[out, retval]+/ BOOL* enabled);
5611   /// Set the AreDefaultContextMenusEnabled property.
5612   /+[ propput]+/
5613 	HRESULT put_AreDefaultContextMenusEnabled(in BOOL enabled);
5614 
5615   /// The AreHostObjectsAllowed property is used to control whether
5616   /// host objects are accessible from the page in WebView.
5617   /// It is true by default.
5618   ///
5619   /// \snippet SettingsComponent.cpp HostObjectsAccess
5620   /+[ propget]+/
5621 	HRESULT get_AreHostObjectsAllowed(/+[out, retval]+/ BOOL* allowed);
5622   /// Set the AreHostObjectsAllowed property.
5623   /+[ propput]+/
5624 	HRESULT put_AreHostObjectsAllowed(in BOOL allowed);
5625 
5626   /// The IsZoomControlEnabled property is used to prevent the user from
5627   /// impacting the zoom of the WebView. It is true by default.
5628   /// When disabled, user will not be able to zoom using ctrl+/- or
5629   /// ctrl+mouse wheel, but the zoom can be set via ZoomFactor API.
5630   ///
5631   /// \snippet SettingsComponent.cpp DisableZoomControl
5632   /+[ propget]+/
5633 	HRESULT get_IsZoomControlEnabled(/+[out, retval]+/ BOOL* enabled);
5634   /// Set the IsZoomControlEnabled property.
5635   /+[ propput]+/
5636 	HRESULT put_IsZoomControlEnabled(in BOOL enabled);
5637 
5638   /// The IsBuiltInErrorPageEnabled property is used to disable built in error
5639   /// page for navigation failure and render process failure. It is true by
5640   /// default.
5641   /// When disabled, blank page will be shown when related error happens.
5642   ///
5643   /// \snippet SettingsComponent.cpp BuiltInErrorPageEnabled
5644   /+[ propget]+/
5645 	HRESULT get_IsBuiltInErrorPageEnabled(/+[out, retval]+/ BOOL* enabled);
5646   /// Set the IsBuiltInErrorPageEnabled property.
5647   /+[ propput]+/
5648 	HRESULT put_IsBuiltInErrorPageEnabled(in BOOL enabled);
5649 }
5650 
5651 /// Event args for the ProcessFailed event.
5652 const GUID IID_ICoreWebView2ProcessFailedEventArgs = ICoreWebView2ProcessFailedEventArgs.iid;
5653 
5654 interface ICoreWebView2ProcessFailedEventArgs : IUnknown
5655 {
5656     static const GUID iid = { 0x8155a9a4,0x1474,0x4a86,[ 0x8c,0xae,0x15,0x1b,0x0f,0xa6,0xb8,0xca ] };
5657     extern(Windows):
5658   /// The kind of process failure that has occurred.
5659   /+[ propget]+/
5660 	HRESULT get_ProcessFailedKind(
5661       /+[out, retval]+/ COREWEBVIEW2_PROCESS_FAILED_KIND* processFailedKind);
5662 }
5663 
5664 /// The caller implements this interface to receive ProcessFailed events.
5665 const GUID IID_ICoreWebView2ProcessFailedEventHandler = ICoreWebView2ProcessFailedEventHandler.iid;
5666 
5667 interface ICoreWebView2ProcessFailedEventHandler : IUnknown
5668 {
5669     static const GUID iid = { 0x79e0aea4,0x990b,0x42d9,[ 0xaa,0x1d,0x0f,0xcc,0x2e,0x5b,0xc7,0xf1 ] };
5670     extern(Windows):
5671   /// Called to provide the implementer with the event args for the
5672   /// corresponding event.
5673   HRESULT Invoke(
5674       /+[in]+/ ICoreWebView2 sender,
5675       /+[in]+/ ICoreWebView2ProcessFailedEventArgs args);
5676 }
5677 
5678 /// The caller implements this interface to receive ZoomFactorChanged
5679 /// events. Use the ICoreWebView2Controller.ZoomFactor property to get the
5680 /// modified zoom factor.
5681 const GUID IID_ICoreWebView2ZoomFactorChangedEventHandler = ICoreWebView2ZoomFactorChangedEventHandler.iid;
5682 
5683 interface ICoreWebView2ZoomFactorChangedEventHandler : IUnknown
5684 {
5685     static const GUID iid = { 0xb52d71d6,0xc4df,0x4543,[ 0xa9,0x0c,0x64,0xa3,0xe6,0x0f,0x38,0xcb ] };
5686     extern(Windows):
5687   /// Called to provide the implementer with the event args for the
5688   /// corresponding event. There are no event args and the args
5689   /// parameter will be null.
5690   HRESULT Invoke(/+[in]+/ ICoreWebView2Controller sender, /+[in]+/ IUnknown args);
5691 }
5692 
5693 /// Iterator for a collection of HTTP headers. See ICoreWebView2HttpRequestHeaders
5694 /// and ICoreWebView2HttpResponseHeaders.
5695 ///
5696 /// \snippet ScenarioWebViewEventMonitor.cpp HttpRequestHeaderIterator
5697 const GUID IID_ICoreWebView2HttpHeadersCollectionIterator = ICoreWebView2HttpHeadersCollectionIterator.iid;
5698 
5699 interface ICoreWebView2HttpHeadersCollectionIterator : IUnknown
5700 {
5701     static const GUID iid = { 0x0702fc30,0xf43b,0x47bb,[ 0xab,0x52,0xa4,0x2c,0xb5,0x52,0xad,0x9f ] };
5702     extern(Windows):
5703   /// Get the name and value of the current HTTP header of the iterator. This
5704   /// method will fail if the last call to MoveNext set hasNext to FALSE.
5705   HRESULT GetCurrentHeader(/+[out]+/ LPWSTR* name, 
5706 		/+[out]+/ LPWSTR* value);
5707 
5708   /// True when the iterator hasn't run out of headers. If the collection over
5709   /// which the iterator is iterating is empty or if the iterator has gone past
5710   /// the end of the collection then this is false.
5711   /+[ propget]+/
5712 	HRESULT get_HasCurrentHeader(/+[out, retval]+/ BOOL* hasCurrent);
5713 
5714   /// Move the iterator to the next HTTP header in the collection. The hasNext
5715   /// parameter will be set to FALSE if there are no more HTTP headers. After
5716   /// this occurs the GetCurrentHeader method will fail if called.
5717   HRESULT MoveNext(/+[out, retval]+/ BOOL* hasNext);
5718 }
5719 
5720 /// HTTP request headers. Used to inspect the HTTP request on
5721 /// WebResourceRequested event and NavigationStarting event.
5722 /// Note, you can modify the HTTP request headers from a WebResourceRequested event,
5723 /// but not from a NavigationStarting event.
5724 const GUID IID_ICoreWebView2HttpRequestHeaders = ICoreWebView2HttpRequestHeaders.iid;
5725 
5726 interface ICoreWebView2HttpRequestHeaders : IUnknown
5727 {
5728     static const GUID iid = { 0xe86cac0e,0x5523,0x465c,[ 0xb5,0x36,0x8f,0xb9,0xfc,0x8c,0x8c,0x60 ] };
5729     extern(Windows):
5730   /// Gets the header value matching the name.
5731   HRESULT GetHeader(in LPCWSTR name, 
5732 		/+[out, retval]+/ LPWSTR* value);
5733   /// Gets the header value matching the name via an iterator.
5734   HRESULT GetHeaders(in LPCWSTR name, 
5735 		/+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator);
5736   /// Checks whether the headers contain an entry matching the header name.
5737   HRESULT Contains(in LPCWSTR name, 
5738 		/+[out, retval]+/ BOOL* contains);
5739   /// Adds or updates header that matches the name.
5740   HRESULT SetHeader(in LPCWSTR name, in LPCWSTR value);
5741   /// Removes header that matches the name.
5742   HRESULT RemoveHeader(in LPCWSTR name);
5743   /// Gets an iterator over the collection of request headers.
5744   HRESULT GetIterator(
5745       /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator);
5746 }
5747 
5748 /// HTTP response headers. Used to construct a WebResourceResponse for the
5749 /// WebResourceRequested event.
5750 const GUID IID_ICoreWebView2HttpResponseHeaders = ICoreWebView2HttpResponseHeaders.iid;
5751 
5752 interface ICoreWebView2HttpResponseHeaders : IUnknown
5753 {
5754     static const GUID iid = { 0x03c5ff5a,0x9b45,0x4a88,[ 0x88,0x1c,0x89,0xa9,0xf3,0x28,0x61,0x9c ] };
5755     extern(Windows):
5756   /// Appends header line with name and value.
5757   HRESULT AppendHeader(in LPCWSTR name, in LPCWSTR value);
5758   /// Checks whether the headers contain entries matching the header name.
5759   HRESULT Contains(in LPCWSTR name, 
5760 		/+[out, retval]+/ BOOL* contains);
5761   /// Gets the first header value in the collection matching the name.
5762   HRESULT GetHeader(in LPCWSTR name, 
5763 		/+[out, retval]+/ LPWSTR* value);
5764   /// Gets the header values matching the name.
5765   HRESULT GetHeaders(in LPCWSTR name, 
5766 		/+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator);
5767   /// Gets an iterator over the collection of entire response headers.
5768   HRESULT GetIterator(
5769   /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator);
5770 }
5771 
5772 /// An HTTP request used with the WebResourceRequested event.
5773 const GUID IID_ICoreWebView2WebResourceRequest = ICoreWebView2WebResourceRequest.iid;
5774 
5775 interface ICoreWebView2WebResourceRequest : IUnknown
5776 {
5777     static const GUID iid = { 0x97055cd4,0x512c,0x4264,[ 0x8b,0x5f,0xe3,0xf4,0x46,0xce,0xa6,0xa5 ] };
5778     extern(Windows):
5779   /// The request URI.
5780   /+[ propget]+/
5781 	HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri);
5782   /// Set the Uri property.
5783   /+[ propput]+/
5784 	HRESULT put_Uri(in LPCWSTR uri);
5785 
5786   /// The HTTP request method.
5787   /+[ propget]+/
5788 	HRESULT get_Method(/+[out, retval]+/ LPWSTR* method);
5789   /// Set the Method property.
5790   /+[ propput]+/
5791 	HRESULT put_Method(in LPCWSTR method);
5792 
5793   /// The HTTP request message body as stream. POST data would be here.
5794   /// If a stream is set, which will override the message body, the stream must
5795   /// have all the content data available by the time this
5796   /// response's WebResourceRequested event deferral is completed. Stream
5797   /// should be agile or be created from a background STA to prevent performance
5798   /// impact to the UI thread. Null means no content data. IStream semantics
5799   /// apply (return S_OK to Read calls until all data is exhausted).
5800   /+[ propget]+/
5801 	HRESULT get_Content(/+[out, retval]+/ IStream** content);
5802   /// Set the Content property.
5803   /+[ propput]+/
5804 	HRESULT put_Content(in IStream* content);
5805 
5806   /// The mutable HTTP request headers
5807   /+[ propget]+/
5808 	HRESULT get_Headers(/+[out, retval]+/ ICoreWebView2HttpRequestHeaders * headers);
5809 }
5810 
5811 /// An HTTP response used with the WebResourceRequested event.
5812 const GUID IID_ICoreWebView2WebResourceResponse = ICoreWebView2WebResourceResponse.iid;
5813 
5814 interface ICoreWebView2WebResourceResponse : IUnknown
5815 {
5816     static const GUID iid = { 0xaafcc94f,0xfa27,0x48fd,[ 0x97,0xdf,0x83,0x0e,0xf7,0x5a,0xae,0xc9 ] };
5817     extern(Windows):
5818   /// HTTP response content as stream. Stream must have all the
5819   /// content data available by the time this response's WebResourceRequested
5820   /// event deferral is completed. Stream should be agile or be created from
5821   /// a background thread to prevent performance impact to the UI thread.
5822   /// Null means no content data. IStream semantics
5823   /// apply (return S_OK to Read calls until all data is exhausted).
5824   /+[ propget]+/
5825 	HRESULT get_Content(/+[out, retval]+/ IStream** content);
5826   /// Set the Content property.
5827   /+[ propput]+/
5828 	HRESULT put_Content(in IStream* content);
5829 
5830   /// Overridden HTTP response headers.
5831   /+[ propget]+/
5832 	HRESULT get_Headers(/+[out, retval]+/ ICoreWebView2HttpResponseHeaders * headers);
5833 
5834   /// The HTTP response status code.
5835   /+[ propget]+/
5836 	HRESULT get_StatusCode(/+[out, retval]+/ int* statusCode);
5837   /// Set the StatusCode property.
5838   /+[ propput]+/
5839 	HRESULT put_StatusCode(in int statusCode);
5840 
5841   /// The HTTP response reason phrase.
5842   /+[ propget]+/
5843 	HRESULT get_ReasonPhrase(/+[out, retval]+/ LPWSTR* reasonPhrase);
5844   /// Set the ReasonPhrase property.
5845   /+[ propput]+/
5846 	HRESULT put_ReasonPhrase(in LPCWSTR reasonPhrase);
5847 }
5848 
5849 /// Event args for the NavigationStarting event.
5850 const GUID IID_ICoreWebView2NavigationStartingEventArgs = ICoreWebView2NavigationStartingEventArgs.iid;
5851 
5852 interface ICoreWebView2NavigationStartingEventArgs : IUnknown
5853 {
5854     static const GUID iid = { 0x5b495469,0xe119,0x438a,[ 0x9b,0x18,0x76,0x04,0xf2,0x5f,0x2e,0x49 ] };
5855     extern(Windows):
5856   /// The uri of the requested navigation.
5857   /+[ propget]+/
5858 	HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri);
5859 
5860   /// True when the navigation was initiated through a user gesture as opposed
5861   /// to programmatic navigation.
5862   /+[ propget]+/
5863 	HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated);
5864 
5865   /// True when the navigation is redirected.
5866   /+[ propget]+/
5867 	HRESULT get_IsRedirected(/+[out, retval]+/ BOOL* isRedirected);
5868 
5869   /// The HTTP request headers for the navigation.
5870   /// Note, you cannot modify the HTTP request headers in a NavigationStarting event.
5871   /+[ propget]+/
5872 	HRESULT get_RequestHeaders(/+[out, retval]+/ ICoreWebView2HttpRequestHeaders * requestHeaders);
5873 
5874   /// The host may set this flag to cancel the navigation.
5875   /// If set, it will be as if the navigation never happened and the current
5876   /// page's content will be intact. For performance reasons, GET HTTP requests
5877   /// may happen, while the host is responding. This means cookies can be set
5878   /// and used part of a request for the navigation.
5879   /// Cancellation for navigation to about:blank or frame navigation to srcdoc
5880   /// is not supported. Such attempts will be ignored.
5881   /+[ propget]+/
5882 	HRESULT get_Cancel(/+[out, retval]+/ BOOL* cancel);
5883   /// Set the Cancel property.
5884   /+[ propput]+/
5885 	HRESULT put_Cancel(in BOOL cancel);
5886 
5887   /// The ID of the navigation.
5888   /+[ propget]+/
5889 	HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId);
5890 }
5891 
5892 /// The caller implements this interface to receive the NavigationStarting
5893 /// event.
5894 const GUID IID_ICoreWebView2NavigationStartingEventHandler = ICoreWebView2NavigationStartingEventHandler.iid;
5895 
5896 interface ICoreWebView2NavigationStartingEventHandler : IUnknown
5897 {
5898     static const GUID iid = { 0x9adbe429,0xf36d,0x432b,[ 0x9d,0xdc,0xf8,0x88,0x1f,0xbd,0x76,0xe3 ] };
5899     extern(Windows):
5900   /// Called to provide the implementer with the event args for the
5901   /// corresponding event.
5902   HRESULT Invoke(
5903       /+[in]+/ ICoreWebView2 sender,
5904       /+[in]+/ ICoreWebView2NavigationStartingEventArgs args);
5905 }
5906 
5907 /// Event args for the ContentLoading event.
5908 const GUID IID_ICoreWebView2ContentLoadingEventArgs = ICoreWebView2ContentLoadingEventArgs.iid;
5909 
5910 interface ICoreWebView2ContentLoadingEventArgs : IUnknown
5911 {
5912     static const GUID iid = { 0x0c8a1275,0x9b6b,0x4901,[ 0x87,0xad,0x70,0xdf,0x25,0xba,0xfa,0x6e ] };
5913     extern(Windows):
5914   /// True if the loaded content is an error page.
5915   /+[ propget]+/
5916 	HRESULT get_IsErrorPage(/+[out, retval]+/ BOOL* isErrorPage);
5917 
5918   /// The ID of the navigation.
5919   /+[ propget]+/
5920 	HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId);
5921 }
5922 
5923 /// The caller implements this interface to receive the ContentLoading event.
5924 const GUID IID_ICoreWebView2ContentLoadingEventHandler = ICoreWebView2ContentLoadingEventHandler.iid;
5925 
5926 interface ICoreWebView2ContentLoadingEventHandler : IUnknown
5927 {
5928     static const GUID iid = { 0x364471e7,0xf2be,0x4910,[ 0xbd,0xba,0xd7,0x20,0x77,0xd5,0x1c,0x4b ] };
5929     extern(Windows):
5930   /// Called to provide the implementer with the event args for the
5931   /// corresponding event.
5932   HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2ContentLoadingEventArgs args);
5933 }
5934 
5935 /// Event args for the SourceChanged event.
5936 const GUID IID_ICoreWebView2SourceChangedEventArgs = ICoreWebView2SourceChangedEventArgs.iid;
5937 
5938 interface ICoreWebView2SourceChangedEventArgs : IUnknown
5939 {
5940     static const GUID iid = { 0x31e0e545,0x1dba,0x4266,[ 0x89,0x14,0xf6,0x38,0x48,0xa1,0xf7,0xd7 ] };
5941     extern(Windows):
5942   /// True if the page being navigated to is a new document.
5943   /+[ propget]+/
5944 	HRESULT get_IsNewDocument(/+[out, retval]+/ BOOL* isNewDocument);
5945 }
5946 
5947 /// The caller implements this interface to receive the SourceChanged event.
5948 const GUID IID_ICoreWebView2SourceChangedEventHandler = ICoreWebView2SourceChangedEventHandler.iid;
5949 
5950 interface ICoreWebView2SourceChangedEventHandler : IUnknown
5951 {
5952     static const GUID iid = { 0x3c067f9f,0x5388,0x4772,[ 0x8b,0x48,0x79,0xf7,0xef,0x1a,0xb3,0x7c ] };
5953     extern(Windows):
5954   /// Called to provide the implementer with the event args for the
5955   /// corresponding event.
5956   HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2SourceChangedEventArgs args);
5957 }
5958 
5959 /// The caller implements this interface to receive the HistoryChanged event.
5960 const GUID IID_ICoreWebView2HistoryChangedEventHandler = ICoreWebView2HistoryChangedEventHandler.iid;
5961 
5962 interface ICoreWebView2HistoryChangedEventHandler : IUnknown
5963 {
5964     static const GUID iid = { 0xc79a420c,0xefd9,0x4058,[ 0x92,0x95,0x3e,0x8b,0x4b,0xca,0xb6,0x45 ] };
5965     extern(Windows):
5966   /// There are no event args and the args parameter will be null.
5967   HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
5968 }
5969 
5970 /// Event args for the ScriptDialogOpening event.
5971 const GUID IID_ICoreWebView2ScriptDialogOpeningEventArgs = ICoreWebView2ScriptDialogOpeningEventArgs.iid;
5972 
5973 interface ICoreWebView2ScriptDialogOpeningEventArgs : IUnknown
5974 {
5975     static const GUID iid = { 0x7390bb70,0xabe0,0x4843,[ 0x95,0x29,0xf1,0x43,0xb3,0x1b,0x03,0xd6 ] };
5976     extern(Windows):
5977   /// The URI of the page that requested the dialog box.
5978   /+[ propget]+/
5979 	HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri);
5980 
5981   /// The kind of JavaScript dialog box. Accept, confirm, prompt, or
5982   /// beforeunload.
5983   /+[ propget]+/
5984 	HRESULT get_Kind(/+[out, retval]+/ COREWEBVIEW2_SCRIPT_DIALOG_KIND* kind);
5985 
5986   /// The message of the dialog box. From JavaScript this is the first parameter
5987   /// passed to alert, confirm, and prompt and is empty for beforeunload.
5988   /+[ propget]+/
5989 	HRESULT get_Message(/+[out, retval]+/ LPWSTR* message);
5990 
5991   /// The host may call this to respond with OK to confirm, prompt, and
5992   /// beforeunload dialogs or not call this method to indicate cancel. From
5993   /// JavaScript, this means that the confirm and beforeunload function returns
5994   /// true if Accept is called. And for the prompt function it returns the value
5995   /// of ResultText if Accept is called and returns false otherwise.
5996   HRESULT Accept();
5997 
5998   /// The second parameter passed to the JavaScript prompt dialog. This is the
5999   /// default value to use for the result of the prompt JavaScript function.
6000   /+[ propget]+/
6001 	HRESULT get_DefaultText(/+[out, retval]+/ LPWSTR* defaultText);
6002 
6003   /// The return value from the JavaScript prompt function if Accept is called.
6004   /// This is ignored for dialog kinds other than prompt. If Accept is not
6005   /// called this value is ignored and false is returned from prompt.
6006   /+[ propget]+/
6007 	HRESULT get_ResultText(/+[out, retval]+/ LPWSTR* resultText);
6008   /// Set the ResultText property.
6009   /+[ propput]+/
6010 	HRESULT put_ResultText(in LPCWSTR resultText);
6011 
6012   /// GetDeferral can be called to return an ICoreWebView2Deferral object.
6013   /// You can use this to complete the event at a later time.
6014   HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral);
6015 }
6016 
6017 /// The caller implements this interface to receive the ScriptDialogOpening
6018 /// event.
6019 const GUID IID_ICoreWebView2ScriptDialogOpeningEventHandler = ICoreWebView2ScriptDialogOpeningEventHandler.iid;
6020 
6021 interface ICoreWebView2ScriptDialogOpeningEventHandler : IUnknown
6022 {
6023     static const GUID iid = { 0xef381bf9,0xafa8,0x4e37,[ 0x91,0xc4,0x8a,0xc4,0x85,0x24,0xbd,0xfb ] };
6024     extern(Windows):
6025   /// Called to provide the implementer with the event args for the
6026   /// corresponding event.
6027   HRESULT Invoke(
6028       /+[in]+/ ICoreWebView2 sender,
6029       /+[in]+/ ICoreWebView2ScriptDialogOpeningEventArgs args);
6030 }
6031 
6032 /// Event args for the NavigationCompleted event.
6033 const GUID IID_ICoreWebView2NavigationCompletedEventArgs = ICoreWebView2NavigationCompletedEventArgs.iid;
6034 
6035 interface ICoreWebView2NavigationCompletedEventArgs : IUnknown
6036 {
6037     static const GUID iid = { 0x30d68b7d,0x20d9,0x4752,[ 0xa9,0xca,0xec,0x84,0x48,0xfb,0xb5,0xc1 ] };
6038     extern(Windows):
6039   /// True when the navigation is successful. This
6040   /// is false for a navigation that ended up in an error page (failures due to
6041   /// no network, DNS lookup failure, HTTP server responds with 4xx), but could
6042   /// also be false for additional scenarios such as window.stop() called on
6043   /// navigated page.
6044   /+[ propget]+/
6045 	HRESULT get_IsSuccess(/+[out, retval]+/ BOOL* isSuccess);
6046 
6047   /// The error code if the navigation failed.
6048   /+[ propget]+/
6049 	HRESULT get_WebErrorStatus(/+[out, retval]+/ COREWEBVIEW2_WEB_ERROR_STATUS*
6050       webErrorStatus);
6051 
6052   /// The ID of the navigation.
6053   /+[ propget]+/
6054 	HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId);
6055 }
6056 
6057 /// The caller implements this interface to receive the NavigationCompleted
6058 /// event.
6059 const GUID IID_ICoreWebView2NavigationCompletedEventHandler = ICoreWebView2NavigationCompletedEventHandler.iid;
6060 
6061 interface ICoreWebView2NavigationCompletedEventHandler : IUnknown
6062 {
6063     static const GUID iid = { 0xd33a35bf,0x1c49,0x4f98,[ 0x93,0xab,0x00,0x6e,0x05,0x33,0xfe,0x1c ] };
6064     extern(Windows):
6065   /// Called to provide the implementer with the event args for the
6066   /// corresponding event.
6067   HRESULT Invoke(
6068       /+[in]+/ ICoreWebView2 sender,
6069       /+[in]+/ ICoreWebView2NavigationCompletedEventArgs args);
6070 }
6071 
6072 /// Event args for the PermissionRequested event.
6073 const GUID IID_ICoreWebView2PermissionRequestedEventArgs = ICoreWebView2PermissionRequestedEventArgs.iid;
6074 
6075 interface ICoreWebView2PermissionRequestedEventArgs : IUnknown
6076 {
6077     static const GUID iid = { 0x973ae2ef,0xff18,0x4894,[ 0x8f,0xb2,0x3c,0x75,0x8f,0x04,0x68,0x10 ] };
6078     extern(Windows):
6079   /// The origin of the web content that requests the permission.
6080   /+[ propget]+/
6081 	HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri);
6082 
6083   /// The type of the permission that is requested.
6084   /+[ propget]+/
6085 	HRESULT get_PermissionKind(/+[out, retval]+/ COREWEBVIEW2_PERMISSION_KIND* permissionKind);
6086 
6087   /// True when the permission request was initiated through a user gesture.
6088   /// Note that being initiated through a user gesture doesn't mean that user
6089   /// intended to access the associated resource.
6090   /+[ propget]+/
6091 	HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated);
6092 
6093   /// The status of a permission request, i.e. whether the request is granted.
6094   /// Default value is COREWEBVIEW2_PERMISSION_STATE_DEFAULT.
6095   /+[ propget]+/
6096 	HRESULT get_State(/+[out, retval]+/ COREWEBVIEW2_PERMISSION_STATE* state);
6097   /// Set the State property.
6098   /+[ propput]+/
6099 	HRESULT put_State(in COREWEBVIEW2_PERMISSION_STATE state);
6100 
6101   /// GetDeferral can be called to return an ICoreWebView2Deferral object.
6102   /// Developer can use the deferral object to make the permission decision
6103   /// at a later time.
6104   HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral);
6105 }
6106 
6107 /// The caller implements this interface to receive the PermissionRequested
6108 /// event.
6109 const GUID IID_ICoreWebView2PermissionRequestedEventHandler = ICoreWebView2PermissionRequestedEventHandler.iid;
6110 
6111 interface ICoreWebView2PermissionRequestedEventHandler : IUnknown
6112 {
6113     static const GUID iid = { 0x15e1c6a3,0xc72a,0x4df3,[ 0x91,0xd7,0xd0,0x97,0xfb,0xec,0x6b,0xfd ] };
6114     extern(Windows):
6115   /// Called to provide the implementer with the event args for the
6116   /// corresponding event.
6117   HRESULT Invoke(
6118       /+[in]+/ ICoreWebView2 sender,
6119       /+[in]+/ ICoreWebView2PermissionRequestedEventArgs args);
6120 }
6121 
6122 /// The caller implements this interface to receive the result of the
6123 /// AddScriptToExecuteOnDocumentCreated method.
6124 const GUID IID_ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler = ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler.iid;
6125 
6126 interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler : IUnknown
6127 {
6128     static const GUID iid = { 0xb99369f3,0x9b11,0x47b5,[ 0xbc,0x6f,0x8e,0x78,0x95,0xfc,0xea,0x17 ] };
6129     extern(Windows):
6130   /// Called to provide the implementer with the completion status and result
6131   /// of the corresponding asynchronous method call.
6132   HRESULT Invoke(in HRESULT errorCode, in LPCWSTR id);
6133 }
6134 
6135 /// The caller implements this interface to receive the result of the
6136 /// ExecuteScript method.
6137 const GUID IID_ICoreWebView2ExecuteScriptCompletedHandler = ICoreWebView2ExecuteScriptCompletedHandler.iid;
6138 
6139 interface ICoreWebView2ExecuteScriptCompletedHandler : IUnknown
6140 {
6141     static const GUID iid = { 0x49511172,0xcc67,0x4bca,[ 0x99,0x23,0x13,0x71,0x12,0xf4,0xc4,0xcc ] };
6142     extern(Windows):
6143   /// Called to provide the implementer with the completion status and result
6144   /// of the corresponding asynchronous method call.
6145   HRESULT Invoke(in HRESULT errorCode, in LPCWSTR resultObjectAsJson);
6146 }
6147 
6148 /// Event args for the WebResourceRequested event.
6149 const GUID IID_ICoreWebView2WebResourceRequestedEventArgs = ICoreWebView2WebResourceRequestedEventArgs.iid;
6150 
6151 interface ICoreWebView2WebResourceRequestedEventArgs : IUnknown
6152 {
6153     static const GUID iid = { 0x453e667f,0x12c7,0x49d4,[ 0xbe,0x6d,0xdd,0xbe,0x79,0x56,0xf5,0x7a ] };
6154     extern(Windows):
6155   /// The Web resource request. The request object may be missing some headers
6156   /// that are added by network stack later on.
6157   /+[ propget]+/
6158 	HRESULT get_Request(/+[out, retval]+/ ICoreWebView2WebResourceRequest * request);
6159 
6160   /// A placeholder for the web resource response object. If this object is set, the
6161   /// web resource request will be completed with this response.
6162   /+[ propget]+/
6163 	HRESULT get_Response(/+[out, retval]+/ ICoreWebView2WebResourceResponse * response);
6164   /// Set the Response property. An empty Web resource response object can be
6165   /// created with CreateWebResourceResponse and then modified to construct the response.
6166   /+[ propput]+/
6167 	HRESULT put_Response(/+[in]+/ ICoreWebView2WebResourceResponse response);
6168 
6169   /// Obtain an ICoreWebView2Deferral object and put the event into a deferred state.
6170   /// You can use the ICoreWebView2Deferral object to complete the request at a
6171   /// later time.
6172   HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral);
6173 
6174   /// The web resource request context.
6175   /+[ propget]+/
6176 	HRESULT get_ResourceContext(/+[out, retval]+/ COREWEBVIEW2_WEB_RESOURCE_CONTEXT* context);
6177 }
6178 
6179 /// Fires when a URL request (through network, file etc.) is made in the webview
6180 /// for a Web resource matching resource context filter and URL specified in
6181 /// AddWebResourceRequestedFilter.
6182 /// The host can view and modify the request or provide a response in a similar
6183 /// pattern to HTTP, in which case the request immediately completed.
6184 /// This may not contain any request headers that are added by the network
6185 /// stack, such as Authorization headers.
6186 const GUID IID_ICoreWebView2WebResourceRequestedEventHandler = ICoreWebView2WebResourceRequestedEventHandler.iid;
6187 
6188 interface ICoreWebView2WebResourceRequestedEventHandler : IUnknown
6189 {
6190     static const GUID iid = { 0xab00b74c,0x15f1,0x4646,[ 0x80,0xe8,0xe7,0x63,0x41,0xd2,0x5d,0x71 ] };
6191     extern(Windows):
6192   /// Called to provide the implementer with the event args for the
6193   /// corresponding event.
6194   HRESULT Invoke(
6195       /+[in]+/ ICoreWebView2 sender,
6196       /+[in]+/ ICoreWebView2WebResourceRequestedEventArgs args);
6197 }
6198 
6199 /// The caller implements this method to receive the result of the
6200 /// CapturePreview method. The result is written to the stream provided in
6201 /// the CapturePreview method call.
6202 const GUID IID_ICoreWebView2CapturePreviewCompletedHandler = ICoreWebView2CapturePreviewCompletedHandler.iid;
6203 
6204 interface ICoreWebView2CapturePreviewCompletedHandler : IUnknown
6205 {
6206     static const GUID iid = { 0x697e05e9,0x3d8f,0x45fa,[ 0x96,0xf4,0x8f,0xfe,0x1e,0xde,0xda,0xf5 ] };
6207     extern(Windows):
6208   /// Called to provide the implementer with the completion status
6209   /// of the corresponding asynchronous method call.
6210   HRESULT Invoke(in HRESULT errorCode);
6211 }
6212 
6213 /// The caller implements this method to receive the GotFocus and LostFocus
6214 /// events. There are no event args for this event.
6215 const GUID IID_ICoreWebView2FocusChangedEventHandler = ICoreWebView2FocusChangedEventHandler.iid;
6216 
6217 interface ICoreWebView2FocusChangedEventHandler : IUnknown
6218 {
6219     static const GUID iid = { 0x05ea24bd,0x6452,0x4926,[ 0x90,0x14,0x4b,0x82,0xb4,0x98,0x13,0x5d ] };
6220     extern(Windows):
6221   /// Called to provide the implementer with the event args for the
6222   /// corresponding event. There are no event args and the args
6223   /// parameter will be null.
6224   HRESULT Invoke(
6225       /+[in]+/ ICoreWebView2Controller sender,
6226       /+[in]+/ IUnknown args);
6227 }
6228 
6229 /// Event args for the MoveFocusRequested event.
6230 const GUID IID_ICoreWebView2MoveFocusRequestedEventArgs = ICoreWebView2MoveFocusRequestedEventArgs.iid;
6231 
6232 interface ICoreWebView2MoveFocusRequestedEventArgs : IUnknown
6233 {
6234     static const GUID iid = { 0x2d6aa13b,0x3839,0x4a15,[ 0x92,0xfc,0xd8,0x8b,0x3c,0x0d,0x9c,0x9d ] };
6235     extern(Windows):
6236   /// The reason for WebView to fire the MoveFocus Requested event.
6237   /+[ propget]+/
6238 	HRESULT get_Reason(/+[out, retval]+/ COREWEBVIEW2_MOVE_FOCUS_REASON* reason);
6239 
6240   /// Indicate whether the event has been handled by the app.
6241   /// If the app has moved the focus to its desired location, it should set
6242   /// Handled property to TRUE.
6243   /// When Handled property is false after the event handler returns, default
6244   /// action will be taken. The default action is to try to find the next tab
6245   /// stop child window in the app and try to move focus to that window. If
6246   /// there is no other such window to move focus to, focus will be cycled
6247   /// within the WebView's web content.
6248   /+[ propget]+/
6249 	HRESULT get_Handled(/+[out, retval]+/ BOOL* value);
6250   /// Set the Handled property.
6251   /+[ propput]+/
6252 	HRESULT put_Handled(in BOOL value);
6253 }
6254 
6255 /// The caller implements this method to receive the MoveFocusRequested event.
6256 const GUID IID_ICoreWebView2MoveFocusRequestedEventHandler = ICoreWebView2MoveFocusRequestedEventHandler.iid;
6257 
6258 interface ICoreWebView2MoveFocusRequestedEventHandler : IUnknown
6259 {
6260     static const GUID iid = { 0x69035451,0x6dc7,0x4cb8,[ 0x9b,0xce,0xb2,0xbd,0x70,0xad,0x28,0x9f ] };
6261     extern(Windows):
6262   /// Called to provide the implementer with the event args for the
6263   /// corresponding event.
6264   HRESULT Invoke(
6265       /+[in]+/ ICoreWebView2Controller sender,
6266       /+[in]+/ ICoreWebView2MoveFocusRequestedEventArgs args);
6267 }
6268 
6269 /// Event args for the WebMessageReceived event.
6270 const GUID IID_ICoreWebView2WebMessageReceivedEventArgs = ICoreWebView2WebMessageReceivedEventArgs.iid;
6271 
6272 interface ICoreWebView2WebMessageReceivedEventArgs : IUnknown
6273 {
6274     static const GUID iid = { 0x0f99a40c,0xe962,0x4207,[ 0x9e,0x92,0xe3,0xd5,0x42,0xef,0xf8,0x49 ] };
6275     extern(Windows):
6276   /// The URI of the document that sent this web message.
6277   /+[ propget]+/
6278 	HRESULT get_Source(/+[out, retval]+/ LPWSTR* source);
6279 
6280   /// The message posted from the WebView content to the host converted to a
6281   /// JSON string. Use this to communicate via JavaScript objects.
6282   ///
6283   /// For example the following postMessage calls result in the
6284   /// following WebMessageAsJson values:
6285   ///
6286   /// ```
6287   ///    postMessage({'a': 'b'})      L"{\"a\": \"b\"}"
6288   ///    postMessage(1.2)             L"1.2"
6289   ///    postMessage('example')       L"\"example\""
6290   /// ```
6291   /+[ propget]+/
6292 	HRESULT get_WebMessageAsJson(/+[out, retval]+/ LPWSTR* webMessageAsJson);
6293 
6294   /// If the message posted from the WebView content to the host is a
6295   /// string type, this method will return the value of that string. If the
6296   /// message posted is some other kind of JavaScript type this method will fail
6297   /// with E_INVALIDARG. Use this to communicate via simple strings.
6298   ///
6299   /// For example the following postMessage calls result in the
6300   /// following WebMessageAsString values:
6301   ///
6302   /// ```
6303   ///    postMessage({'a': 'b'})      E_INVALIDARG
6304   ///    postMessage(1.2)             E_INVALIDARG
6305   ///    postMessage('example')       L"example"
6306   /// ```
6307   HRESULT TryGetWebMessageAsString(/+[out, retval]+/ LPWSTR* webMessageAsString);
6308 }
6309 
6310 /// The caller implements this interface to receive the WebMessageReceived
6311 /// event.
6312 const GUID IID_ICoreWebView2WebMessageReceivedEventHandler = ICoreWebView2WebMessageReceivedEventHandler.iid;
6313 
6314 interface ICoreWebView2WebMessageReceivedEventHandler : IUnknown
6315 {
6316     static const GUID iid = { 0x57213f19,0x00e6,0x49fa,[ 0x8e,0x07,0x89,0x8e,0xa0,0x1e,0xcb,0xd2 ] };
6317     extern(Windows):
6318   /// Called to provide the implementer with the event args for the
6319   /// corresponding event.
6320   HRESULT Invoke(
6321       /+[in]+/ ICoreWebView2 sender,
6322       /+[in]+/ ICoreWebView2WebMessageReceivedEventArgs args);
6323 }
6324 
6325 /// Event args for the DevToolsProtocolEventReceived event.
6326 const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventArgs = ICoreWebView2DevToolsProtocolEventReceivedEventArgs.iid;
6327 
6328 interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs : IUnknown
6329 {
6330     static const GUID iid = { 0x653c2959,0xbb3a,0x4377,[ 0x86,0x32,0xb5,0x8a,0xda,0x4e,0x66,0xc4 ] };
6331     extern(Windows):
6332   /// The parameter object of the corresponding DevToolsProtocol event
6333   /// represented as a JSON string.
6334   /+[ propget]+/
6335 	HRESULT get_ParameterObjectAsJson(/+[out, retval]+/ LPWSTR*
6336                                     parameterObjectAsJson);
6337 }
6338 
6339 /// The caller implements this interface to receive
6340 /// DevToolsProtocolEventReceived events from the WebView.
6341 const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventHandler = ICoreWebView2DevToolsProtocolEventReceivedEventHandler.iid;
6342 
6343 interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler : IUnknown
6344 {
6345     static const GUID iid = { 0xe2fda4be,0x5456,0x406c,[ 0xa2,0x61,0x3d,0x45,0x21,0x38,0x36,0x2c ] };
6346     extern(Windows):
6347   /// Called to provide the implementer with the event args for the
6348   /// corresponding event.
6349   HRESULT Invoke(
6350       /+[in]+/ ICoreWebView2 sender,
6351       /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventArgs args);
6352 }
6353 
6354 /// The caller implements this interface to receive CallDevToolsProtocolMethod
6355 /// completion results.
6356 const GUID IID_ICoreWebView2CallDevToolsProtocolMethodCompletedHandler = ICoreWebView2CallDevToolsProtocolMethodCompletedHandler.iid;
6357 
6358 interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler : IUnknown
6359 {
6360     static const GUID iid = { 0x5c4889f0,0x5ef6,0x4c5a,[ 0x95,0x2c,0xd8,0xf1,0xb9,0x2d,0x05,0x74 ] };
6361     extern(Windows):
6362   /// Called to provide the implementer with the completion status and result
6363   /// of the corresponding asynchronous method call.
6364   HRESULT Invoke(in HRESULT errorCode, in LPCWSTR returnObjectAsJson);
6365 }
6366 
6367 /// The caller implements this interface to receive the CoreWebView2Controller created
6368 /// via CreateCoreWebView2Controller.
6369 const GUID IID_ICoreWebView2CreateCoreWebView2ControllerCompletedHandler = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.iid;
6370 
6371 interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler : IUnknown
6372 {
6373     static const GUID iid = { 0x6c4819f3,0xc9b7,0x4260,[ 0x81,0x27,0xc9,0xf5,0xbd,0xe7,0xf6,0x8c ] };
6374     extern(Windows):
6375   /// Called to provide the implementer with the completion status and result
6376   /// of the corresponding asynchronous method call.
6377   HRESULT Invoke(HRESULT errorCode, ICoreWebView2Controller createdController);
6378 }
6379 
6380 /// Event args for the NewWindowRequested event. The event is fired when content
6381 /// inside webview requested to a open a new window (through window.open() and so on.)
6382 const GUID IID_ICoreWebView2NewWindowRequestedEventArgs = ICoreWebView2NewWindowRequestedEventArgs.iid;
6383 
6384 interface ICoreWebView2NewWindowRequestedEventArgs : IUnknown
6385 {
6386     static const GUID iid = { 0x34acb11c,0xfc37,0x4418,[ 0x91,0x32,0xf9,0xc2,0x1d,0x1e,0xaf,0xb9 ] };
6387     extern(Windows):
6388   /// The target uri of the NewWindowRequest.
6389   /+[ propget]+/
6390 	HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri);
6391 
6392   /// Sets a WebView as a result of the NewWindowRequest. The target
6393   /// WebView should not be navigated. If the NewWindow is set, its top level
6394   /// window will return as the opened WindowProxy.
6395   /+[ propput]+/
6396 	HRESULT put_NewWindow(/+[in]+/ ICoreWebView2 newWindow);
6397   /// Gets the new window.
6398   /+[ propget]+/
6399 	HRESULT get_NewWindow(/+[out, retval]+/ ICoreWebView2 * newWindow);
6400 
6401   /// Sets whether the NewWindowRequestedEvent is handled by host. If this is false
6402   /// and no NewWindow is set, the WebView will open a popup
6403   /// window and it will be returned as opened WindowProxy.
6404   /// If set to true and no NewWindow is set for a window.open call, the opened
6405   /// WindowProxy will be for an dummy window object and no window will load.
6406   /// Default is false.
6407   /+[ propput]+/
6408 	HRESULT put_Handled(in BOOL handled);
6409   /// Gets whether the NewWindowRequestedEvent is handled by host.
6410   /+[ propget]+/
6411 	HRESULT get_Handled(/+[out, retval]+/ BOOL* handled);
6412 
6413   /// IsUserInitiated is true when the new window request was initiated through
6414   /// a user gesture such as clicking an anchor tag with target. The Edge
6415   /// popup blocker is disabled for WebView so the app can use this flag to
6416   /// block non-user initiated popups.
6417   /+[ propget]+/
6418 	HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated);
6419 
6420   /// Obtain an ICoreWebView2Deferral object and put the event into a deferred state.
6421   /// You can use the ICoreWebView2Deferral object to complete the window open
6422   /// request at a later time.
6423   /// While this event is deferred the opener window will be returned a WindowProxy
6424   /// to an unnavigated window, which will navigate when the deferral is complete.
6425   HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral);
6426 
6427   /// Window features specified by the window.open call.
6428   /// These features can be considered for positioning and sizing of
6429   /// new webview windows.
6430   /+[ propget]+/
6431 	HRESULT get_WindowFeatures(/+[out, retval]+/ ICoreWebView2WindowFeatures * value);
6432 }
6433 
6434 /// Window features for a WebView popup window. These fields match the
6435 /// 'windowFeatures' passed to window.open as specified in
6436 /// https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Window_features
6437 /// There is no requirement for you to respect these values. If your app doesn't
6438 /// have corresponding UI features, for example no toolbar, or if all webviews
6439 /// are opened in tabs and so cannot have distinct size or positions, then your
6440 /// app cannot respect these values. You may want to respect values but perhaps
6441 /// only some can apply to your app's UI. Accordingly, it is fine to respect
6442 /// all, some, or none of these properties as appropriate based on your app.
6443 /// For all numeric properties, if the value when passed to window.open is
6444 /// outside the range of an unsigned 32bit int, the value will be mod of the max
6445 /// of unsigned 32bit integer. If the value cannot be parsed as an integer it
6446 /// will be considered 0. If the value is a floating point value, it will be
6447 /// rounded down to an integer.
6448 const GUID IID_ICoreWebView2WindowFeatures = ICoreWebView2WindowFeatures.iid;
6449 
6450 interface ICoreWebView2WindowFeatures : IUnknown
6451 {
6452     static const GUID iid = { 0x5eaf559f,0xb46e,0x4397,[ 0x88,0x60,0xe4,0x22,0xf2,0x87,0xff,0x1e ] };
6453     extern(Windows):
6454   /// True if the Left and Top properties were specified. False if at least one
6455   /// was not specified.
6456   /+[ propget]+/
6457 	HRESULT get_HasPosition(/+[out, retval]+/ BOOL* value);
6458   /// True if the Width and Height properties were specified. False if at least
6459   /// one was not specified.
6460   /+[ propget]+/
6461 	HRESULT get_HasSize(/+[out, retval]+/ BOOL* value);
6462   /// The left position of the window. This will fail if HasPosition is false.
6463   /+[ propget]+/
6464 	HRESULT get_Left(/+[out, retval]+/ UINT32* value);
6465   /// The top position of the window. This will fail if HasPosition is false.
6466   /+[ propget]+/
6467 	HRESULT get_Top(/+[out, retval]+/ UINT32* value);
6468   /// The height of the window. This will fail if HasSize is false.
6469   /+[ propget]+/
6470 	HRESULT get_Height(/+[out, retval]+/ UINT32* value);
6471   /// The width of the window. This will fail if HasSize is false.
6472   /+[ propget]+/
6473 	HRESULT get_Width(/+[out, retval]+/ UINT32* value);
6474   /// Whether or not to display the menu bar.
6475   /+[ propget]+/
6476 	HRESULT get_ShouldDisplayMenuBar(/+[out, retval]+/ BOOL* value);
6477   /// Whether or not to display a status bar.
6478   /+[ propget]+/
6479 	HRESULT get_ShouldDisplayStatus(/+[out, retval]+/ BOOL* value);
6480   /// Whether or not to display a toolbar.
6481   /+[ propget]+/
6482 	HRESULT get_ShouldDisplayToolbar(/+[out, retval]+/ BOOL* value);
6483   /// Whether or not to display scroll bars.
6484   /+[ propget]+/
6485 	HRESULT get_ShouldDisplayScrollBars(/+[out, retval]+/ BOOL* value);
6486 }
6487 
6488 /// The caller implements this interface to receive NewWindowRequested
6489 /// events.
6490 const GUID IID_ICoreWebView2NewWindowRequestedEventHandler = ICoreWebView2NewWindowRequestedEventHandler.iid;
6491 
6492 interface ICoreWebView2NewWindowRequestedEventHandler : IUnknown
6493 {
6494     static const GUID iid = { 0xd4c185fe,0xc81c,0x4989,[ 0x97,0xaf,0x2d,0x3f,0xa7,0xab,0x56,0x51 ] };
6495     extern(Windows):
6496   /// Called to provide the implementer with the event args for the
6497   /// corresponding event.
6498   HRESULT Invoke(
6499       /+[in]+/ ICoreWebView2 sender,
6500       /+[in]+/ ICoreWebView2NewWindowRequestedEventArgs args);
6501 }
6502 
6503 /// The caller implements this interface to receive DocumentTitleChanged
6504 /// events. Use the DocumentTitle property to get the modified
6505 /// title.
6506 const GUID IID_ICoreWebView2DocumentTitleChangedEventHandler = ICoreWebView2DocumentTitleChangedEventHandler.iid;
6507 
6508 interface ICoreWebView2DocumentTitleChangedEventHandler : IUnknown
6509 {
6510     static const GUID iid = { 0xf5f2b923,0x953e,0x4042,[ 0x9f,0x95,0xf3,0xa1,0x18,0xe1,0xaf,0xd4 ] };
6511     extern(Windows):
6512   /// Called to provide the implementer with the event args for the
6513   /// corresponding event. There are no event args and the args
6514   /// parameter will be null.
6515   HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
6516 }
6517 
6518 /// Event args for the AcceleratorKeyPressed event.
6519 const GUID IID_ICoreWebView2AcceleratorKeyPressedEventArgs = ICoreWebView2AcceleratorKeyPressedEventArgs.iid;
6520 
6521 interface ICoreWebView2AcceleratorKeyPressedEventArgs : IUnknown
6522 {
6523     static const GUID iid = { 0x9f760f8a,0xfb79,0x42be,[ 0x99,0x90,0x7b,0x56,0x90,0x0f,0xa9,0xc7 ] };
6524     extern(Windows):
6525   /// The key event type that caused the event to be fired.
6526   /+[ propget]+/
6527 	HRESULT get_KeyEventKind(/+[out, retval]+/ COREWEBVIEW2_KEY_EVENT_KIND* keyEventKind);
6528   /// The Win32 virtual key code of the key that was pressed or released.
6529   /// This will be one of the Win32 virtual key constants such as VK_RETURN or
6530   /// an (uppercase) ASCII value such as 'A'. You can check whether Ctrl or Alt
6531   /// are pressed by calling GetKeyState(VK_CONTROL) or GetKeyState(VK_MENU).
6532   /+[ propget]+/
6533 	HRESULT get_VirtualKey(/+[out, retval]+/ UINT* virtualKey);
6534   /// The LPARAM value that accompanied the window message. See the
6535   /// documentation for the WM_KEYDOWN and WM_KEYUP messages.
6536   /+[ propget]+/
6537 	HRESULT get_KeyEventLParam(/+[out, retval]+/ INT* lParam);
6538   /// A structure representing the information passed in the LPARAM of the
6539   /// window message.
6540   /+[ propget]+/
6541 	HRESULT get_PhysicalKeyStatus(
6542       /+[out, retval]+/ COREWEBVIEW2_PHYSICAL_KEY_STATUS* physicalKeyStatus);
6543   /// During AcceleratorKeyPressedEvent handler invocation the WebView is blocked
6544   /// waiting for the decision of if the accelerator will be handled by the host
6545   /// or not. If the Handled property is set to TRUE then this will
6546   /// prevent the WebView from performing the default action for this
6547   /// accelerator key. Otherwise the WebView will perform the default action for
6548   /// the accelerator key.
6549   /+[ propget]+/
6550 	HRESULT get_Handled(/+[out, retval]+/ BOOL* handled);
6551   /// Sets the Handled property.
6552   /+[ propput]+/
6553 	HRESULT put_Handled(in BOOL handled);
6554 }
6555 
6556 /// The caller implements this interface to receive the AcceleratorKeyPressed
6557 /// event.
6558 const GUID IID_ICoreWebView2AcceleratorKeyPressedEventHandler = ICoreWebView2AcceleratorKeyPressedEventHandler.iid;
6559 
6560 interface ICoreWebView2AcceleratorKeyPressedEventHandler : IUnknown
6561 {
6562     static const GUID iid = { 0xb29c7e28,0xfa79,0x41a8,[ 0x8e,0x44,0x65,0x81,0x1c,0x76,0xdc,0xb2 ] };
6563     extern(Windows):
6564   /// Called to provide the implementer with the event args for the
6565   /// corresponding event.
6566   HRESULT Invoke(
6567       /+[in]+/ ICoreWebView2Controller sender,
6568       /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventArgs args);
6569 }
6570 
6571 /// The caller implements this interface to receive NewBrowserVersionAvailable events.
6572 const GUID IID_ICoreWebView2NewBrowserVersionAvailableEventHandler = ICoreWebView2NewBrowserVersionAvailableEventHandler.iid;
6573 
6574 interface ICoreWebView2NewBrowserVersionAvailableEventHandler : IUnknown
6575 {
6576     static const GUID iid = { 0xf9a2976e,0xd34e,0x44fc,[ 0xad,0xee,0x81,0xb6,0xb5,0x7c,0xa9,0x14 ] };
6577     extern(Windows):
6578   /// Called to provide the implementer with the event args for the
6579   /// corresponding event.
6580   HRESULT Invoke(/+[in]+/ ICoreWebView2Environment webviewEnvironment,
6581                  /+[in]+/ IUnknown args);
6582 }
6583 
6584 /// The caller implements this method to receive the
6585 /// ContainsFullScreenElementChanged events. There are no event args for this
6586 /// event.
6587 const GUID IID_ICoreWebView2ContainsFullScreenElementChangedEventHandler = ICoreWebView2ContainsFullScreenElementChangedEventHandler.iid;
6588 
6589 interface ICoreWebView2ContainsFullScreenElementChangedEventHandler : IUnknown
6590 {
6591     static const GUID iid = { 0xe45d98b1,0xafef,0x45be,[ 0x8b,0xaf,0x6c,0x77,0x28,0x86,0x7f,0x73 ] };
6592     extern(Windows):
6593   /// Called to provide the implementer with the event args for the
6594   /// corresponding event. There are no event args and the args
6595   /// parameter will be null.
6596   HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
6597 }
6598 
6599 /// The caller implements this interface to receive NewWindowRequested
6600 /// events.
6601 const GUID IID_ICoreWebView2WindowCloseRequestedEventHandler = ICoreWebView2WindowCloseRequestedEventHandler.iid;
6602 
6603 interface ICoreWebView2WindowCloseRequestedEventHandler : IUnknown
6604 {
6605     static const GUID iid = { 0x5c19e9e0,0x092f,0x486b,[ 0xaf,0xfa,0xca,0x82,0x31,0x91,0x30,0x39 ] };
6606     extern(Windows):
6607   /// Called to provide the implementer with the event args for the
6608   /// corresponding event. There are no event args and the args
6609   /// parameter will be null.
6610   HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args);
6611 }
6612 
6613 /// This represents the WebView2 Environment. WebViews created from an
6614 /// environment run on the browser process specified with environment parameters
6615 /// and objects created from an environment should be used in the same environment.
6616 /// Using it in different environments are not guaranteed to be compatible and may fail.
6617 const GUID IID_ICoreWebView2Environment = ICoreWebView2Environment.iid;
6618 
6619 interface ICoreWebView2Environment : IUnknown
6620 {
6621     static const GUID iid = { 0xb96d755e,0x0319,0x4e92,[ 0xa2,0x96,0x23,0x43,0x6f,0x46,0xa1,0xfc ] };
6622     extern(Windows):
6623   /// Asynchronously create a new WebView.
6624   ///
6625   /// parentWindow is the HWND in which the WebView should be displayed and
6626   /// from which receive input. The WebView will add a child window to the
6627   /// provided window during WebView creation. Z-order and other things impacted
6628   /// by sibling window order will be affected accordingly.
6629   ///
6630   /// It is recommended that the application set Application User Model ID for
6631   /// the process or the application window. If none is set, during WebView
6632   /// creation a generated Application User Model ID is set to root window of
6633   /// parentWindow.
6634   /// \snippet AppWindow.cpp CreateCoreWebView2Controller
6635   ///
6636   /// It is recommended that the application handles restart manager messages
6637   /// so that it can be restarted gracefully in the case when the app is using
6638   /// Edge for WebView from a certain installation and that installation is being
6639   /// uninstalled. For example, if a user installs Edge from Dev channel and
6640   /// opts to use Edge from that channel for testing the app, and then uninstalls
6641   /// Edge from that channel without closing the app, the app will be restarted
6642   /// to allow uninstallation of the dev channel to succeed.
6643   /// \snippet AppWindow.cpp RestartManager
6644   ///
6645   /// When the application retries CreateCoreWebView2Controller upon failure, it is
6646   /// recommended that the application restarts from creating a new WebView2
6647   /// Environment. If an Edge update happens, the version associated with a WebView2
6648   /// Environment could have been removed and causing the object to no longer work.
6649   /// Creating a new WebView2 Environment will work as it uses the latest version.
6650   ///
6651   /// WebView creation will fail if there is already a running instance using the same
6652   /// user data folder, and the Environment objects have different EnvironmentOptions.
6653   /// For example, if there is already a WebView created with one language, trying to
6654   /// create a WebView with a different language using the same user data folder will
6655   /// fail.
6656   HRESULT CreateCoreWebView2Controller(
6657     HWND parentWindow,
6658     ICoreWebView2CreateCoreWebView2ControllerCompletedHandler handler);
6659 
6660   /// Create a new web resource response object. The headers is the
6661   /// raw response header string delimited by newline. It's also possible to
6662   /// create this object with null headers string and then use the
6663   /// ICoreWebView2HttpResponseHeaders to construct the headers line by line.
6664   /// For information on other parameters see ICoreWebView2WebResourceResponse.
6665   ///
6666   /// \snippet SettingsComponent.cpp WebResourceRequested
6667   HRESULT CreateWebResourceResponse(
6668     in IStream* content,
6669     in int statusCode,
6670     in LPCWSTR reasonPhrase,
6671     in LPCWSTR headers,
6672     /+[out, retval]+/ ICoreWebView2WebResourceResponse * response);
6673 
6674   /// The browser version info of the current ICoreWebView2Environment,
6675   /// including channel name if it is not the stable channel.
6676   /// This matches the format of the
6677   /// GetAvailableCoreWebView2BrowserVersionString API.
6678   /// Channel names are 'beta', 'dev', and 'canary'.
6679   ///
6680   /// \snippet AppWindow.cpp GetBrowserVersionString
6681   /+[ propget]+/
6682 	HRESULT get_BrowserVersionString(/+[out, retval]+/ LPWSTR* versionInfo);
6683 
6684   /// Add an event handler for the NewBrowserVersionAvailable event.
6685   /// NewBrowserVersionAvailable fires when a newer version of the
6686   /// Edge browser is installed and available for use via WebView2.
6687   /// To use the newer version of the browser you must create a new
6688   /// environment and WebView.
6689   /// This event will only be fired for new version from the same Edge channel
6690   /// that the code is running from. When not running with installed Edge,
6691   /// no event will be fired.
6692   ///
6693   /// Because a user data folder can only be used by one browser process at
6694   /// a time, if you want to use the same user data folder in the WebViews
6695   /// using the new version of the browser,
6696   /// you must close the environment and WebViews that are using the older
6697   /// version of the browser first. Or simply prompt the user to restart the
6698   /// app.
6699   ///
6700   /// \snippet AppWindow.cpp NewBrowserVersionAvailable
6701   ///
6702   HRESULT add_NewBrowserVersionAvailable(
6703       /+[in]+/ ICoreWebView2NewBrowserVersionAvailableEventHandler eventHandler,
6704       /+[out]+/ EventRegistrationToken* token);
6705 
6706   /// Remove an event handler previously added with add_NewBrowserVersionAvailable.
6707   HRESULT remove_NewBrowserVersionAvailable(
6708       in EventRegistrationToken token);
6709 }
6710 
6711 /// Options used to create WebView2 Environment.
6712 ///
6713 /// \snippet AppWindow.cpp CreateCoreWebView2EnvironmentWithOptions
6714 ///
6715 const GUID IID_ICoreWebView2EnvironmentOptions = ICoreWebView2EnvironmentOptions.iid;
6716 
6717 interface ICoreWebView2EnvironmentOptions : IUnknown
6718 {
6719     static const GUID iid = { 0x2fde08a8,0x1e9a,0x4766,[ 0x8c,0x05,0x95,0xa9,0xce,0xb9,0xd1,0xc5 ] };
6720     extern(Windows):
6721   /// AdditionalBrowserArguments can be specified to change the behavior of the
6722   /// WebView. These will be passed to the browser process as part of
6723   /// the command line. See
6724   /// [Run Chromium with Flags](https://aka.ms/RunChromiumWithFlags)
6725   /// for more information about command line switches to browser
6726   /// process. If the app is launched with a command line switch
6727   /// `--edge-webview-switches=xxx` the value of that switch (xxx in
6728   /// the above example) will also be appended to the browser
6729   /// process command line. Certain switches like `--user-data-dir` are
6730   /// internal and important to WebView. Those switches will be
6731   /// ignored even if specified. If the same switches are specified
6732   /// multiple times, the last one wins. There is no attempt to
6733   /// merge the different values of the same switch, except for disabled
6734   /// and enabled features.  The features specified by `--enable-features`
6735   /// and `--disable-features` will be merged with simple logic: the features
6736   /// will be the union of the specified features and built-in features, and if
6737   /// a feature is disabled, it will be removed from the enabled features list.
6738   /// App process's command line `--edge-webview-switches` value are processed
6739   /// after the additionalBrowserArguments parameter is processed. Certain
6740   /// features are disabled internally and can't be enabled.
6741   /// If parsing failed for the specified switches, they will be
6742   /// ignored. Default is to run browser process with no extra flags.
6743   /+[ propget]+/
6744 	HRESULT get_AdditionalBrowserArguments(/+[out, retval]+/ LPWSTR* value);
6745   /// Set the AdditionalBrowserArguments property.
6746   /+[ propput]+/
6747 	HRESULT put_AdditionalBrowserArguments(in LPCWSTR value);
6748 
6749   /// The default language that WebView will run with. It applies to browser UIs
6750   /// like context menu and dialogs. It also applies to the accept-languages
6751   /// HTTP header that WebView sends to web sites.
6752   /// It is in the format of `language[-country]` where `language` is the 2 letter
6753   /// code from ISO 639 and `country` is the 2 letter code from ISO 3166.
6754   /+[ propget]+/
6755 	HRESULT get_Language(/+[out, retval]+/ LPWSTR* value);
6756   /// Set the Language property.
6757   /+[ propput]+/
6758 	HRESULT put_Language(in LPCWSTR value);
6759 
6760   /// The version of the Edge WebView2 Runtime binaries required to be
6761   /// compatible with the calling application. This defaults to the Edge
6762   /// WebView2 Runtime version
6763   /// that corresponds with the version of the SDK the application is using.
6764   /// The format of this value is the same as the format of the
6765   /// BrowserVersionString property and other BrowserVersion values.
6766   /// Only the version part of the BrowserVersion value is respected. The
6767   /// channel suffix, if it exists, is ignored.
6768   /// The version of the Edge WebView2 Runtime binaries actually used may be
6769   /// different from the specified TargetCompatibleBrowserVersion. They are only
6770   /// guaranteed to be compatible. You can check the actual version on the
6771   /// BrowserVersionString property on the ICoreWebView2Environment.
6772   /+[ propget]+/
6773 	HRESULT get_TargetCompatibleBrowserVersion(/+[out, retval]+/ LPWSTR* value);
6774   /// Set the TargetCompatibleBrowserVersion property.
6775   /+[ propput]+/
6776 	HRESULT put_TargetCompatibleBrowserVersion(in LPCWSTR value);
6777 
6778   /// The AllowSingleSignOnUsingOSPrimaryAccount property is used to enable
6779   /// single sign on with Azure Active Directory (AAD) resources inside WebView
6780   /// using the logged in Windows account and single sign on with web sites using
6781   /// Microsoft account associated with the login in Windows account.
6782   /// Default is disabled.
6783   /// Universal Windows Platform apps must also declare enterpriseCloudSSO
6784   /// [restricted capability](https://docs.microsoft.com/windows/uwp/packaging/app-capability-declarations#restricted-capabilities)
6785   /// for the single sign on to work.
6786   /+[ propget]+/
6787 	HRESULT get_AllowSingleSignOnUsingOSPrimaryAccount(/+[out, retval]+/ BOOL* allow);
6788   /// Set the AllowSingleSignOnUsingOSPrimaryAccount property.
6789   /+[ propput]+/
6790 	HRESULT put_AllowSingleSignOnUsingOSPrimaryAccount(in BOOL allow);
6791 }
6792 
6793 /// The caller implements this interface to receive the WebView2Environment created
6794 /// via CreateCoreWebView2Environment.
6795 const GUID IID_ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler.iid;
6796 
6797 interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler : IUnknown
6798 {
6799     static const GUID iid = { 0x4e8a3389,0xc9d8,0x4bd2,[ 0xb6,0xb5,0x12,0x4f,0xee,0x6c,0xc1,0x4d ] };
6800     extern(Windows):
6801   /// Called to provide the implementer with the completion status and result
6802   /// of the corresponding asynchronous method call.
6803   HRESULT Invoke(HRESULT errorCode, ICoreWebView2Environment createdEnvironment);
6804 }
6805 
6806 /// A Receiver is created for a particular DevTools Protocol event and allows
6807 /// you to subscribe and unsubscribe from that event.
6808 /// Obtained from the WebView object via GetDevToolsProtocolEventReceiver.
6809 const GUID IID_ICoreWebView2DevToolsProtocolEventReceiver = ICoreWebView2DevToolsProtocolEventReceiver.iid;
6810 
6811 interface ICoreWebView2DevToolsProtocolEventReceiver : IUnknown
6812 {
6813     static const GUID iid = { 0xb32ca51a,0x8371,0x45e9,[ 0x93,0x17,0xaf,0x02,0x1d,0x08,0x03,0x67 ] };
6814     extern(Windows):
6815   /// Subscribe to a DevToolsProtocol event.
6816   /// The handler's Invoke method will be called whenever the corresponding
6817   /// DevToolsProtocol event fires. Invoke will be called with
6818   /// an event args object containing the DevTools Protocol event's parameter
6819   /// object as a JSON string.
6820   ///
6821   /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived
6822   HRESULT add_DevToolsProtocolEventReceived(
6823       /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventHandler handler,
6824       /+[out]+/ EventRegistrationToken* token);
6825   /// Remove an event handler previously added with
6826   /// add_DevToolsProtocolEventReceived.
6827   HRESULT remove_DevToolsProtocolEventReceived(
6828       in EventRegistrationToken token);
6829 }
6830 
6831 /// DLL export to create a WebView2 environment with a custom version of Edge,
6832 /// user data directory and/or additional options.
6833 ///
6834 /// The WebView2 environment and all other WebView2 objects are single threaded
6835 /// and have dependencies on Windows components that require COM to be
6836 /// initialized for a single-threaded apartment. The application is expected to
6837 /// call CoInitializeEx before calling CreateCoreWebView2EnvironmentWithOptions.
6838 ///
6839 /// ```
6840 /// CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
6841 /// ```
6842 ///
6843 /// If CoInitializeEx was not called or has been previously called with
6844 /// COINIT_MULTITHREADED, CreateCoreWebView2EnvironmentWithOptions will fail
6845 /// with one of the following errors.
6846 ///
6847 /// ```
6848 /// CO_E_NOTINITIALIZED (if CoInitializeEx was not called)
6849 /// RPC_E_CHANGED_MODE  (if CoInitializeEx was previously called with
6850 ///                      COINIT_MULTITHREADED)
6851 /// ```
6852 ///
6853 /// Use `browserExecutableFolder` to specify whether WebView2 controls use a
6854 /// fixed or installed version of the WebView2 Runtime that exists on a client
6855 /// machine. To use a fixed version of the WebView2 Runtime, pass the relative
6856 /// path of the folder that contains the fixed version of the WebView2 Runtime
6857 /// to `browserExecutableFolder`. To create WebView2 controls that use the
6858 /// installed version of the WebView2 Runtime that exists on client machines,
6859 /// pass a null or empty string to `browserExecutableFolder`. In this scenario,
6860 /// the API tries to find a compatible version of the WebView2 Runtime that is
6861 /// installed on the client machine (first at the machine level, and then per
6862 /// user) using the selected channel preference. The path of fixed version of
6863 /// the WebView2 Runtime should not contain `\Edge\Application\`. When such a
6864 /// path is used, the API will fail with ERROR_NOT_SUPPORTED.
6865 ///
6866 /// The default channel search order is the WebView2 Runtime, Beta, Dev, and
6867 /// Canary.
6868 /// When there is an override WEBVIEW2_RELEASE_CHANNEL_PREFERENCE environment
6869 /// variable or applicable releaseChannelPreference registry value
6870 /// with the value of 1, the channel search order is reversed.
6871 ///
6872 /// userDataFolder can be
6873 /// specified to change the default user data folder location for
6874 /// WebView2. The path can be an absolute file path or a relative file path
6875 /// that is interpreted as relative to the current process's executable.
6876 /// Otherwise, for UWP apps, the default user data folder will be
6877 /// the app data folder for the package; for non-UWP apps,
6878 /// the default user data folder `{Executable File Name}.WebView2`
6879 /// will be created in the same directory next to the app executable.
6880 /// WebView2 creation can fail if the executable is running in a directory
6881 /// that the process doesn't have permission to create a new folder in.
6882 /// The app is responsible to clean up its user data folder
6883 /// when it is done.
6884 ///
6885 /// Note that as a browser process might be shared among WebViews,
6886 /// WebView creation will fail with HRESULT_FROM_WIN32(ERROR_INVALID_STATE) if
6887 /// the specified options does not match the options of the WebViews that are
6888 /// currently running in the shared browser process.
6889 ///
6890 /// environmentCreatedHandler is the handler result to the async operation
6891 /// which will contain the WebView2Environment that got created.
6892 ///
6893 /// The browserExecutableFolder, userDataFolder and additionalBrowserArguments
6894 /// of the environmentOptions may be overridden by
6895 /// values either specified in environment variables or in the registry.
6896 ///
6897 /// When creating a WebView2Environment the following environment variables
6898 /// are checked:
6899 ///
6900 /// ```
6901 /// WEBVIEW2_BROWSER_EXECUTABLE_FOLDER
6902 /// WEBVIEW2_USER_DATA_FOLDER
6903 /// WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS
6904 /// WEBVIEW2_RELEASE_CHANNEL_PREFERENCE
6905 /// ```
6906 ///
6907 /// If an override environment variable is found then we use the
6908 /// browserExecutableFolder and userDataFolder values as replacements for the
6909 /// corresponding values in CreateCoreWebView2EnvironmentWithOptions parameters.
6910 /// If additionalBrowserArguments specified in environment variable or in the
6911 /// registry, it will be appended to the correspinding values in
6912 /// CreateCoreWebView2EnvironmentWithOptions parameters.
6913 ///
6914 /// While not strictly overrides, there exists additional environment variables
6915 /// that can be set:
6916 ///
6917 /// ```
6918 /// WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER
6919 /// ```
6920 ///
6921 /// When found with a non-empty value, this indicates that the WebView is being
6922 /// launched under a script debugger. In this case, the WebView will issue a
6923 /// `Page.waitForDebugger` CDP command that will cause script execution inside the
6924 /// WebView to pause on launch, until a debugger issues a corresponding
6925 /// `Runtime.runIfWaitingForDebugger` CDP command to resume execution.
6926 /// Note: There is no registry key equivalent of this environment variable.
6927 ///
6928 /// ```
6929 /// WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER
6930 /// ```
6931 ///
6932 /// When found with a non-empty value, this indicates that the WebView is being
6933 /// launched under a script debugger that also supports host applications that
6934 /// use multiple WebViews. The value is used as the identifier for a named pipe
6935 /// that will be opened and written to when a new WebView is created by the host
6936 /// application. The payload will match that of the remote-debugging-port JSON
6937 /// target and can be used by the external debugger to attach to a specific
6938 /// WebView instance.
6939 /// The format of the pipe created by the debugger should be:
6940 /// `\\.\pipe\WebView2\Debugger\{app_name}\{pipe_name}`
6941 /// where:
6942 ///
6943 /// - `{app_name}` is the host application exe filename, e.g. WebView2Example.exe
6944 /// - `{pipe_name}` is the value set for WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER.
6945 ///
6946 /// To enable debugging of the targets identified by the JSON you will also need
6947 /// to set the WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variable to
6948 /// send `--remote-debugging-port={port_num}`
6949 /// where:
6950 ///
6951 /// - `{port_num}` is the port on which the CDP server will bind.
6952 ///
6953 /// Be aware that setting both the WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER and
6954 /// WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variables will cause the
6955 /// WebViews hosted in your application and their contents to be exposed to
6956 /// 3rd party applications such as debuggers.
6957 ///
6958 /// Note: There is no registry key equivalent of this environment variable.
6959 ///
6960 /// If none of those environment variables exist, then the registry is examined next.
6961 /// The following registry values are checked:
6962 ///
6963 /// ```
6964 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder
6965 /// "{AppId}"=""
6966 ///
6967 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannelPreference
6968 /// "{AppId}"=""
6969 ///
6970 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments
6971 /// "{AppId}"=""
6972 ///
6973 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\UserDataFolder
6974 /// "{AppId}"=""
6975 /// ```
6976 ///
6977 /// browserExecutableFolder and releaseChannelPreference can be configured using
6978 /// group policy under Administrative Templates > Microsoft Edge WebView2.
6979 /// The old registry location will be deprecated soon:
6980 ///
6981 /// ```
6982 /// [{Root}\Software\Policies\Microsoft\EmbeddedBrowserWebView\LoaderOverride\{AppId}]
6983 /// "ReleaseChannelPreference"=dword:00000000
6984 /// "BrowserExecutableFolder"=""
6985 /// "UserDataFolder"=""
6986 /// "AdditionalBrowserArguments"=""
6987 /// ```
6988 ///
6989 /// In the unlikely scenario where some instances of WebView are open during
6990 /// a browser update we could end up blocking the deletion of old Edge browsers.
6991 /// To avoid running out of disk space a new WebView creation will fail
6992 /// with the next error if it detects that there are many old versions present.
6993 ///
6994 /// ```
6995 /// ERROR_DISK_FULL
6996 /// ```
6997 ///
6998 /// The default maximum number of Edge versions allowed is 20.
6999 ///
7000 /// The maximum number of old Edge versions allowed can be overwritten with the value
7001 /// of the following environment variable.
7002 ///
7003 /// ```
7004 /// WEBVIEW2_MAX_INSTANCES
7005 /// ```
7006 ///
7007 /// If the Webview depends on an installed Edge and it is uninstalled
7008 /// any subsequent creation will fail with the next error
7009 ///
7010 /// ```
7011 /// ERROR_PRODUCT_UNINSTALLED
7012 /// ```
7013 ///
7014 /// First we check with Root as HKLM and then HKCU.
7015 /// AppId is first set to the Application User Model ID of the caller's process,
7016 /// then if there's no corresponding registry key the AppId is set to the
7017 /// executable name of the caller's process, or if that isn't a registry key
7018 /// then '*'. If an override registry key is found, then we use the
7019 /// browserExecutableFolder and userDataFolder registry values as replacements
7020 /// and append additionalBrowserArguments registry values for the corresponding
7021 /// values in CreateCoreWebView2EnvironmentWithOptions parameters.
7022 extern(Windows) HRESULT CreateCoreWebView2EnvironmentWithOptions(PCWSTR browserExecutableFolder, PCWSTR userDataFolder, ICoreWebView2EnvironmentOptions environmentOptions, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler);
7023 
7024 /// Creates an evergreen WebView2 Environment using the installed Edge version.
7025 /// This is equivalent to calling CreateCoreWebView2EnvironmentWithOptions with
7026 /// nullptr for browserExecutableFolder, userDataFolder,
7027 /// additionalBrowserArguments. See CreateCoreWebView2EnvironmentWithOptions for
7028 /// more details.
7029 extern(Windows) HRESULT CreateCoreWebView2Environment(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler);
7030 
7031 /// Get the browser version info including channel name if it is not the stable channel
7032 /// or the Embedded Edge.
7033 /// Channel names are beta, dev, and canary.
7034 /// If an override exists for the browserExecutableFolder or the channel preference,
7035 /// the override will be used.
7036 /// If there isn't an override, then the parameter passed to
7037 /// GetAvailableCoreWebView2BrowserVersionString is used.
7038 extern(Windows) HRESULT GetAvailableCoreWebView2BrowserVersionString(PCWSTR browserExecutableFolder, LPWSTR* versionInfo);
7039 
7040 /// This method is for anyone want to compare version correctly to determine
7041 /// which version is newer, older or same. It can be used to determine whether
7042 /// to use webview2 or certain feature base on version.
7043 /// Sets the value of result to -1, 0 or 1 if version1 is less than, equal or
7044 /// greater than version2 respectively.
7045 /// Returns E_INVALIDARG if it fails to parse any of the version strings or any
7046 /// input parameter is null.
7047 /// Input can directly use the versionInfo obtained from
7048 /// GetAvailableCoreWebView2BrowserVersionString, channel info will be ignored.
7049 extern(Windows) HRESULT CompareBrowserVersions(PCWSTR version1, PCWSTR version2, int* result);
7050 
7051 }
Suggestion Box / Bug Report